Section 1
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "2.0.1.0";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 2
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "2.0.1.0";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 3
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 4
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function set height(_arg1:Number):void;
function get scaleY():Number;
function move(_arg1:Number, _arg2:Number):void;
function get scaleX():Number;
function set mask(_arg1:DisplayObject):void;
function set scaleX(_arg1:Number):void;
function set name(_arg1:String):void;
function set scaleY(_arg1:Number):void;
function get visible():Boolean;
function get measuredWidth():Number;
function set visible(_arg1:Boolean):void;
function get alpha():Number;
function get height():Number;
function get width():Number;
function get parent():DisplayObjectContainer;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set y(_arg1:Number):void;
function get x():Number;
function get y():Number;
function set alpha(_arg1:Number):void;
}
}//package mx.core
Section 5
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function get repeaters():Array;
function get instanceIndices():Array;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 6
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 7
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "2.0.1.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local3:DisplayObject;
var _local4:String;
var _local5:Array;
_local3 = _arg1;
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
if ((_local3 is IRepeaterClient)){
_local5 = IRepeaterClient(_local3).instanceIndices;
if (_local5){
_local4 = (_local4 + (("[" + _local5.join("][")) + "]"));
};
};
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
return (_local2);
}
public static function createUniqueName(_arg1:Object):String{
var _local2:String;
var _local3:int;
var _local4:int;
if (!_arg1){
return (null);
};
_local2 = getQualifiedClassName(_arg1);
_local3 = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
_local4 = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 8
//Armies (Risk.Armies)
package Risk {
import flash.display.*;
import flash.text.*;
public class Armies extends Sprite {
public var cannon_text_format:TextFormat;
public var cannon_text:TextField;
public var cannon_sprite:DisplayObject;
public var how_many:int;
public function Armies(_arg1:int):void{
cannon_text = new TextField();
cannon_text_format = new TextFormat();
super();
how_many = _arg1;
create_display_list();
}
public function update_army_count(_arg1:int):void{
cannon_text.text = ("" + _arg1);
cannon_text.setTextFormat(cannon_text_format);
}
public function create_display_list():void{
var _local1:Class;
this.graphics.lineStyle(3, 0);
this.graphics.beginFill(0xFFFFFF);
this.graphics.drawRoundRect(0, 0, 150, 80, 2, 2);
this.graphics.endFill();
cannon_text.text = ("" + how_many);
cannon_text.x = ((this.width / 2) - 8);
cannon_text.y = 5;
cannon_text.width = (this.width / 2);
cannon_text_format.color = 0;
cannon_text_format.size = 62;
cannon_text_format.align = TextFormatAlign.CENTER;
cannon_text.setTextFormat(cannon_text_format);
this.addChild(cannon_text);
_local1 = Armies_cannon;
cannon_sprite = new (_local1);
cannon_sprite.x = 5;
cannon_sprite.y = 5;
addChild(cannon_sprite);
this.scaleX = 0.8;
this.scaleY = 0.8;
}
}
}//package Risk
Section 9
//Armies_cannon (Risk.Armies_cannon)
package Risk {
import mx.core.*;
public class Armies_cannon extends BitmapAsset {
}
}//package Risk
Section 10
//Battle (Risk.Battle)
package Risk {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.text.*;
public class Battle extends Sprite {
public var withdraw:Button;
public var defend_place:Point;
public var old_defend_y:int;
public var attack_place:Point;
public var old_defend_x:int;
public var old_attack_y:int;
public var old_attack_x:int;
public var attacker_wins_text:TextField;
public var dice:Dice_table;
public var defend_armies:Armies;
public var win_format:TextFormat;
public var title_format:TextFormat;
public var defending_country:Country;
public var attack_armies:Armies;
public var attack_text:TextField;
public var board:Risk_Board;
public var attacking_country:Country;
public var defender_wins_text:TextField;
public function Battle(_arg1:Country, _arg2:Country, _arg3:Risk_Board){
attack_text = new TextField();
title_format = new TextFormat();
attacker_wins_text = new TextField();
defender_wins_text = new TextField();
win_format = new TextFormat();
super();
attacking_country = _arg1;
old_attack_x = attacking_country.x;
old_attack_y = attacking_country.y;
attack_place = new Point(old_attack_x, old_attack_y);
defending_country = _arg2;
old_defend_x = defending_country.x;
old_defend_y = defending_country.y;
defend_place = new Point(old_defend_x, old_defend_y);
attacking_country.x = 20;
attacking_country.y = -15;
defending_country.x = 380;
defending_country.y = -15;
board = _arg3;
attack_text.text = ((attacking_country.country_name + " vs. ") + defending_country.country_name);
attack_text.width = 700;
attack_text.x = 10;
attack_text.y = 5;
title_format.font = "Arial";
title_format.color = 0;
title_format.align = TextFormatAlign.CENTER;
title_format.size = 26;
attack_text.setTextFormat(title_format);
this.addChild(attack_text);
attacker_wins_text.text = (attacking_country.country_name + " Wins!");
attacker_wins_text.width = 500;
attacker_wins_text.x = 100;
attacker_wins_text.y = 225;
defender_wins_text.text = (defending_country.country_name + " Wins!");
defender_wins_text.width = 500;
defender_wins_text.x = 100;
defender_wins_text.y = 225;
win_format.font = "Arial";
win_format.color = 0;
win_format.align = TextFormatAlign.CENTER;
win_format.size = 36;
attacker_wins_text.setTextFormat(win_format);
defender_wins_text.setTextFormat(win_format);
attack_armies = new Armies((attacking_country.armies - 1));
this.addChild(attack_armies);
attack_armies.x = 100;
attack_armies.y = 298;
defend_armies = new Armies(defending_country.armies);
this.addChild(defend_armies);
defend_armies.x = 480;
defend_armies.y = 298;
withdraw = new Button("Withdraw", 100, 40, end_battle);
this.addChild(withdraw);
withdraw.x = ((this.width / 2) - 54);
withdraw.y = 350;
dice = new Dice_table(3, 2, this);
dice.y = 450;
create_display_list();
}
public function update_armies():void{
if (attacking_country.armies < 0){
attacking_country.armies = 0;
};
if (defending_country.armies < 0){
defending_country.armies = 0;
};
attack_armies.update_army_count((attacking_country.armies - 1));
defend_armies.update_army_count(defending_country.armies);
}
public function create_display_list():void{
board.addChild(this);
this.graphics.lineStyle(3, 0);
this.graphics.drawRect(0, 0, 700, 500);
this.graphics.beginFill(0xFFFFFF);
this.graphics.drawRect(0, 0, 700, 500);
this.graphics.endFill();
this.addChild(attacking_country);
this.addChild(defending_country);
this.x = ((this.stage.stageWidth / 2) - 350);
this.y = ((this.stage.stageHeight / 2) - 250);
}
public function end_battle(_arg1:Event):void{
board.end_battle(this, attack_place, defend_place);
}
public function win(_arg1:String):void{
var _local2:Button;
this.removeChild(withdraw);
this.graphics.lineStyle(3, 0);
this.graphics.beginFill(0xFFFFFF);
this.graphics.drawRect(100, 225, 500, 50);
this.graphics.endFill();
if (_arg1 == "Attacker"){
this.addChild(attacker_wins_text);
defending_country.change_owner(attacking_country.owner);
board.took_over_country = true;
defending_country.armies = (attacking_country.armies - 1);
defending_country.update_armies();
attacking_country.armies = 1;
attacking_country.update_armies();
};
if (_arg1 == "Defender"){
this.addChild(defender_wins_text);
};
_local2 = new Button("End Battle", 100, 40, end_battle);
_local2.x = ((this.width / 2) - 55);
_local2.y = 300;
this.addChild(_local2);
}
}
}//package Risk
Section 11
//Button (Risk.Button)
package Risk {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Button extends Sprite {
private var title:String;
private var value:int;// = 0
public function Button(_arg1:String, _arg2:int, _arg3:int, _arg4:Function){
value = 0;
super();
this.title = _arg1;
this.addEventListener(MouseEvent.MOUSE_DOWN, create_mouse_down_display_list);
this.addEventListener(MouseEvent.MOUSE_UP, create_mouse_over_display_list);
this.addEventListener(MouseEvent.ROLL_OVER, create_mouse_over_display_list);
this.addEventListener(MouseEvent.ROLL_OUT, create_default_display_list);
this.addEventListener(MouseEvent.CLICK, _arg4);
this.create_default_display_list(null);
this.create_title_display_list();
this.scaleX = (_arg2 / 100);
this.scaleY = (_arg3 / 50);
}
private function create_mouse_down_display_list(_arg1:MouseEvent):void{
this.graphics.clear();
this.graphics.lineStyle(2, 0xCCCCCC);
this.graphics.beginFill(0x330000);
this.graphics.drawRoundRect(0, 0, 100, 50, 40);
this.graphics.endFill();
}
private function create_mouse_over_display_list(_arg1:MouseEvent):void{
this.graphics.clear();
this.graphics.lineStyle(3, 0);
this.graphics.beginFill(0x660000);
this.graphics.drawRoundRect(0, 0, 100, 50, 40);
this.graphics.endFill();
}
public function get_value():int{
return (this.value);
}
public function set_value(_arg1:int):void{
this.value = _arg1;
}
private function create_title_display_list():void{
var _local1:TextField;
var _local2:TextFormat;
_local1 = new TextField();
_local2 = new TextFormat();
_local1.width = this.width;
_local1.height = this.height;
_local2.align = "center";
_local2.font = "Tahmoa";
_local2.size = 24;
_local2.color = 0xFFFFFF;
_local1.text = this.title;
_local1.selectable = false;
_local1.antiAliasType = "advanced";
_local1.setTextFormat(_local2);
_local1.y = 10;
this.addChild(_local1);
}
private function create_default_display_list(_arg1:MouseEvent):void{
this.graphics.clear();
this.graphics.lineStyle(2, 0xCCCCCC);
this.graphics.beginFill(16737894);
this.graphics.drawRoundRect(0, 0, 100, 50, 40);
this.graphics.endFill();
}
}
}//package Risk
Section 12
//Card (Risk.Card)
package Risk {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Card extends Sprite {
public var owner_format:TextFormat;
public var cavalry_sprite:DisplayObject;
public var id:String;
public var dest_y:int;// = 430
public var soldier_sprite:DisplayObject;
public var cannon_sprite:DisplayObject;
public var highlighted:Boolean;// = false
public var num:Number;
public var owner:TextField;
public var board:Risk_Board;
public var start_y:int;// = 570
public function Card(_arg1:Risk_Board):void{
num = Math.random();
highlighted = false;
dest_y = 430;
start_y = 570;
owner = new TextField();
owner_format = new TextFormat();
super();
board = _arg1;
create_display_list();
owner.text = board.whos_turn;
owner.x = 0;
owner.y = 130;
owner.width = 110;
owner_format.color = 0;
owner_format.size = 12;
owner_format.align = TextFormatAlign.CENTER;
owner.setTextFormat(owner_format);
this.addChild(owner);
this.addEventListener(MouseEvent.MOUSE_OVER, mouse_over);
this.addEventListener(MouseEvent.MOUSE_OUT, mouse_out);
}
public function mouse_over(_arg1:Event):void{
this.addEventListener(Event.ENTER_FRAME, go_up);
}
public function go_up(_arg1:Event):void{
this.removeEventListener(Event.ENTER_FRAME, go_down);
if (this.y > (dest_y - 1)){
this.y = (this.y - 5);
} else {
this.y = dest_y;
this.removeEventListener(Event.ENTER_FRAME, go_up);
};
}
public function create_display_list():void{
var _local1:Class;
var _local2:Class;
var _local3:Class;
this.graphics.lineStyle(3, 0);
this.graphics.beginFill(0xFFFFFF);
this.graphics.drawRect(0, 0, 110, 180);
this.graphics.endFill();
if (num < 0.3){
_local1 = Card_cannon;
cannon_sprite = new (_local1);
cannon_sprite.x = 17;
cannon_sprite.y = 50;
addChild(cannon_sprite);
id = "Cannon";
} else {
if (num > 0.6){
_local2 = Card_cavalry;
cavalry_sprite = new (_local2);
cavalry_sprite.x = 17;
cavalry_sprite.y = 50;
addChild(cavalry_sprite);
id = "Cavalry";
} else {
_local3 = Card_soldier;
soldier_sprite = new (_local3);
soldier_sprite.x = 17;
soldier_sprite.y = 50;
addChild(soldier_sprite);
id = "Soldier";
};
};
board.addChild(this);
}
public function remove_highlight_click():void{
this.removeEventListener(MouseEvent.CLICK, highlight);
}
public function go_down(_arg1:Event):void{
this.removeEventListener(Event.ENTER_FRAME, go_up);
if (this.y < (start_y - 1)){
this.y = (this.y + 5);
} else {
this.y = start_y;
this.removeEventListener(Event.ENTER_FRAME, go_down);
};
}
public function add_highlight_click():void{
this.addEventListener(MouseEvent.CLICK, highlight);
}
public function highlight(_arg1:Event):void{
if (highlighted){
highlighted = false;
this.graphics.clear();
this.graphics.lineStyle(3, 0);
this.graphics.beginFill(0xFFFFFF);
this.graphics.drawRect(0, 0, 110, 200);
this.graphics.endFill();
board.cards_selected--;
} else {
highlighted = true;
this.graphics.clear();
this.graphics.lineStyle(3, 0);
this.graphics.beginFill(board.get_player_color());
this.graphics.drawRect(0, 0, 110, 200);
this.graphics.endFill();
board.check_for_match();
};
}
public function mouse_out(_arg1:Event):void{
this.addEventListener(Event.ENTER_FRAME, go_down);
}
public function remove_go_down():void{
this.removeEventListener(Event.ENTER_FRAME, go_down);
}
}
}//package Risk
Section 13
//Card_cannon (Risk.Card_cannon)
package Risk {
import mx.core.*;
public class Card_cannon extends BitmapAsset {
}
}//package Risk
Section 14
//Card_cavalry (Risk.Card_cavalry)
package Risk {
import mx.core.*;
public class Card_cavalry extends BitmapAsset {
}
}//package Risk
Section 15
//Card_soldier (Risk.Card_soldier)
package Risk {
import mx.core.*;
public class Card_soldier extends BitmapAsset {
}
}//package Risk
Section 16
//Circle (Risk.Circle)
package Risk {
import flash.display.*;
public class Circle extends Sprite {
public var color:int;
public var dice:Dice;
public function Circle(_arg1:int, _arg2:Dice){
dice = _arg2;
color = _arg1;
create_display_list(color);
}
public function create_display_list(_arg1:int):void{
this.graphics.beginFill(_arg1);
this.graphics.drawCircle(0, 0, 3);
this.graphics.endFill();
dice.addChild(this);
}
}
}//package Risk
Section 17
//Country (Risk.Country)
package Risk {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.text.*;
public class Country extends Sprite {
public var gray_highlight:Boolean;// = false
public var picture:DisplayObject;
public var place:Point;
public var mouse_over_color:int;// = 0xFFFFFF
public var armies:int;// = 0
public var highlighted:Boolean;// = false
public var border_countries:Array;
public var risk_board:Risk_Board;
public var how_many_armies:TextField;
public var country_name:String;
public var owner:String;
public var armies_format:TextFormat;
public var army_count:Armies;
public function Country(_arg1:DisplayObject, _arg2:Risk_Board, _arg3:Point, _arg4:String, _arg5:Array, _arg6:String){
var _local7:Sprite;
mouse_over_color = 0xFFFFFF;
how_many_armies = new TextField();
armies = 0;
armies_format = new TextFormat();
highlighted = false;
gray_highlight = false;
super();
picture = _arg1;
risk_board = _arg2;
place = _arg3;
owner = _arg4;
border_countries = _arg5;
country_name = _arg6;
create_display_list();
change_color(owner);
this.x = place.x;
this.y = place.y;
army_count = new Armies(armies);
army_count.x = (this.x + 100);
if (this.x > 950){
army_count.x = this.x;
};
army_count.y = this.y;
if (this.y < 0){
army_count.y = (this.y + 200);
};
this.addEventListener(MouseEvent.MOUSE_OVER, mouse_over);
this.addEventListener(MouseEvent.MOUSE_OUT, mouse_out);
_local7 = new Sprite();
_local7.graphics.beginFill(0xFFCC00);
_local7.graphics.drawCircle((this.width / 2), (this.height / 2), 40);
_local7.visible = false;
this.addChild(_local7);
this.hitArea = _local7;
_local7.mouseEnabled = true;
}
public function change_color(_arg1:String):void{
if (gray_highlight == true){
gray_highlight_on();
} else {
if (_arg1 == "Player 1"){
picture.transform.colorTransform = new ColorTransform(0.5, 0.5, 0.5, 1, 0, 0, 0xFF, 0);
};
if (_arg1 == "Player 2"){
picture.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 0xFF, 15, 15, 0);
};
if (_arg1 == "Player 3"){
picture.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 0, 200, 0, 0);
};
if (_arg1 == "Player 4"){
picture.transform.colorTransform = new ColorTransform(0.5, 0.5, 0.5, 1, 47, 79, 79, 0);
};
if (_arg1 == "Player 5"){
picture.transform.colorTransform = new ColorTransform(0.4, 0.4, 0.4, 1, 176, 48, 96, 0);
};
if (_arg1 == "Player 6"){
picture.transform.colorTransform = new ColorTransform(0.5, 0.5, 0.5, 1, 184, 134, 11, 0);
};
};
}
public function remove_battle_click():void{
this.removeEventListener(MouseEvent.CLICK, initiate_battle);
}
public function initiate_battle(_arg1:Event):void{
risk_board.initiate_battle(this, _arg1);
}
public function mouse_over(_arg1:Event):void{
picture.transform.colorTransform = new ColorTransform(0.5, 0.5, 0.5, 1, 0xFF, 0xFF, 0xFF, 0);
risk_board.addChild(army_count);
}
public function update_armies():void{
army_count.update_army_count(armies);
}
public function remove_move_click():void{
var _local1:int;
this.removeEventListener(MouseEvent.CLICK, move_armies_next_door);
_local1 = 0;
while (_local1 < border_countries.length) {
border_countries[_local1].gray_no_battle_off();
_local1++;
};
}
public function add_event_listeners():void{
this.addEventListener(MouseEvent.MOUSE_OVER, mouse_over);
this.addEventListener(MouseEvent.MOUSE_OUT, mouse_out);
}
public function remove_event_listeners():void{
this.removeEventListener(MouseEvent.MOUSE_OVER, mouse_over);
this.removeEventListener(MouseEvent.MOUSE_OUT, mouse_out);
}
public function add_battle_click():void{
this.addEventListener(MouseEvent.CLICK, initiate_battle);
}
public function clone():Country{
return (new Country(picture, risk_board, place, owner, border_countries, country_name));
}
public function gray_no_battle_on():void{
gray_highlight = true;
picture.transform.colorTransform = new ColorTransform(0.5, 0.5, 0.5, 1, 125, 125, 125, 0);
}
public function change_owner(_arg1:String):void{
owner = _arg1;
change_color(owner);
}
public function mouse_click(_arg1:Event):void{
var _local2:int;
var _local3:int;
if (highlighted){
add_event_listeners();
highlighted = false;
_local2 = 0;
while (_local2 < border_countries.length) {
border_countries[_local2].gray_highlight_off();
_local2++;
};
risk_board.add_click_events();
} else {
remove_event_listeners();
mouse_over(_arg1);
highlighted = true;
_local3 = 0;
while (_local3 < border_countries.length) {
if (border_countries[_local3].owner != owner){
border_countries[_local3].gray_highlight_on();
};
_local3++;
};
risk_board.remove_click_events();
};
}
public function add_armies(_arg1:Event):void{
armies++;
update_armies();
if (risk_board.placing_initial_armies == true){
risk_board.check_starting_armies(_arg1);
} else {
risk_board.check_armies();
};
}
public function remove_mouse_click():void{
this.removeEventListener(MouseEvent.CLICK, mouse_click);
}
public function create_display_list():void{
this.addChild(picture);
risk_board.addChild(this);
}
public function gray_highlight_on():void{
add_battle_click();
gray_highlight = true;
picture.transform.colorTransform = new ColorTransform(0.5, 0.5, 0.5, 1, 125, 125, 125, 0);
}
public function gray_highlight_off():void{
remove_battle_click();
gray_highlight = false;
change_color(owner);
}
public function remove_armies_listener():void{
this.removeEventListener(MouseEvent.CLICK, add_armies);
}
public function mouse_out(_arg1:Event):void{
change_color(owner);
risk_board.removeChild(army_count);
}
public function gray_no_battle_off():void{
gray_highlight = false;
change_color(owner);
}
public function add_mouse_click():void{
this.addEventListener(MouseEvent.CLICK, mouse_click);
}
public function add_armies_listener():void{
this.addEventListener(MouseEvent.CLICK, add_armies);
}
public function move_armies_next_door(_arg1:Event):void{
var _local2:int;
_local2 = 0;
while (_local2 < border_countries.length) {
if (border_countries[_local2].owner == owner){
border_countries[_local2].gray_no_battle_on();
};
_local2++;
};
risk_board.move_armies(_arg1);
}
public function add_move_click():void{
this.addEventListener(MouseEvent.CLICK, move_armies_next_door);
}
}
}//package Risk
Section 18
//Dice (Risk.Dice)
package Risk {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Dice extends Sprite {
public var rolled:Boolean;// = false
public var circle_color:int;
public var dice_table:Dice_table;
public var up_side:int;
private var owner:String;
public var circles:Array;
public var my_timer:Timer;
public function Dice(_arg1:String, _arg2:Dice_table):void{
var _local3:int;
var _local4:int;
circles = new Array();
my_timer = new Timer((Math.random() * 3000), 1);
rolled = false;
super();
owner = _arg1;
dice_table = _arg2;
if (owner == "Attacker"){
circle_color = 0xFFFFFF;
} else {
circle_color = 0;
};
_local3 = 0;
while (_local3 < 7) {
circles[_local3] = new Circle(circle_color, this);
_local3++;
};
if (owner == "Attacker"){
this.graphics.beginFill(11674146);
this.graphics.drawRoundRect(0, 0, 40, 40, 8);
this.graphics.endFill();
} else {
this.graphics.lineStyle(2, 0);
this.graphics.drawRoundRect(0, 0, 40, 40, 8);
};
circles[0].x = (this.width / 2);
circles[0].y = (this.height / 2);
circles[1].x = (this.width / 4);
circles[1].y = (this.height / 4);
circles[2].x = ((this.width / 4) * 3);
circles[2].y = (this.height / 4);
circles[3].x = (this.width / 4);
circles[3].y = ((this.height / 4) * 3);
circles[4].x = ((this.width / 4) * 3);
circles[4].y = ((this.height / 4) * 3);
circles[5].x = (this.width / 4);
circles[5].y = (this.height / 2);
circles[6].x = ((this.width / 4) * 3);
circles[6].y = (this.height / 2);
_local4 = 0;
while (_local4 < circles.length) {
circles[_local4].visible = false;
_local4++;
};
create_display_list(6);
dice_table.addChild(this);
}
public function display_dice(_arg1:TimerEvent):void{
up_side = (Math.floor((Math.random() * 6)) + 1);
create_display_list(up_side);
rolled = true;
dice_table.check_if_rolled();
}
public function create_display_list(_arg1:int):void{
var _local2:int;
_local2 = 0;
while (_local2 < circles.length) {
circles[_local2].visible = false;
_local2++;
};
if (_arg1 == 1){
circles[0].visible = true;
} else {
if (_arg1 == 2){
circles[1].visible = true;
circles[4].visible = true;
} else {
if (_arg1 == 3){
circles[0].visible = true;
circles[1].visible = true;
circles[4].visible = true;
} else {
if (_arg1 == 4){
circles[1].visible = true;
circles[2].visible = true;
circles[3].visible = true;
circles[4].visible = true;
} else {
if (_arg1 == 5){
circles[0].visible = true;
circles[1].visible = true;
circles[2].visible = true;
circles[3].visible = true;
circles[4].visible = true;
} else {
if (_arg1 == 6){
circles[1].visible = true;
circles[2].visible = true;
circles[3].visible = true;
circles[4].visible = true;
circles[5].visible = true;
circles[6].visible = true;
};
};
};
};
};
};
}
public function get_owner():String{
return (this.owner);
}
public function roll():void{
rolled = false;
create_display_list(0);
my_timer.addEventListener(TimerEvent.TIMER, display_dice);
my_timer.start();
}
public function look_at():int{
return (this.up_side);
}
public function black():void{
var _local1:int;
this.graphics.beginFill(0);
this.graphics.drawRoundRect(0, 0, 40, 40, 8);
this.graphics.endFill();
rolled = false;
_local1 = 0;
while (_local1 < circles.length) {
circles[_local1].visible = false;
_local1++;
};
}
}
}//package Risk
Section 19
//Dice_table (Risk.Dice_table)
package Risk {
import flash.events.*;
import flash.display.*;
public class Dice_table extends Sprite {
public var biggest_defender_dice:int;
public var how_many_defend:int;
public var biggest_attacker_dice:int;
public var roll_button:Button;
public var whos_smaller:int;
public var smallest_defender_dice:int;
public var how_many_rolled:int;
public var whos_bigger:int;
private var defender_dice:Array;
public var middle_attacker_dice:int;
private var attacker_dice:Array;
public var how_many_attack:int;
public var total_dice:int;
public var battle:Battle;
public var defend_values:Array;
public var rolled:int;
public var attack_values:Array;
public function Dice_table(_arg1:int, _arg2:int, _arg3:Battle){
attack_values = new Array();
defend_values = new Array();
super();
how_many_attack = _arg1;
how_many_defend = _arg2;
battle = _arg3;
this.attacker_dice = new Array(how_many_attack);
this.defender_dice = new Array(how_many_defend);
create_dice();
battle.addChild(this);
rolled = 0;
total_dice = (how_many_attack + how_many_defend);
roll_button = new Button("Roll", 100, 40, roll_dice);
battle.addChild(roll_button);
roll_button.x = ((this.width / 2) + 50);
roll_button.y = 300;
if (how_many_attack > how_many_defend){
whos_bigger = how_many_attack;
} else {
whos_bigger = how_many_defend;
};
}
public function create_dice():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < how_many_attack) {
attacker_dice[_local1] = new Dice("Attacker", this);
attacker_dice[_local1].x = (70 + (_local1 * 80));
_local1++;
};
_local2 = 0;
while (_local2 < how_many_defend) {
defender_dice[_local2] = new Dice("Defender", this);
defender_dice[_local2].x = (450 + (_local2 * 80));
_local2++;
};
}
public function roll_dice(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
if ((battle.attacking_country.armies - 1) < 3){
how_many_attack = (battle.attacking_country.armies - 1);
_local4 = how_many_attack;
while (_local4 < attacker_dice.length) {
attacker_dice[_local4].black();
attacker_dice[_local4].up_side = 0;
_local4++;
};
};
if (battle.defending_country.armies < 2){
how_many_defend = battle.defending_country.armies;
_local5 = how_many_defend;
while (_local5 < defender_dice.length) {
defender_dice[_local5].black();
defender_dice[_local5].up_side = 0;
_local5++;
};
};
total_dice = (how_many_attack + how_many_defend);
_local2 = 0;
while (_local2 < how_many_attack) {
attacker_dice[_local2].roll();
_local2++;
};
_local3 = 0;
while (_local3 < how_many_defend) {
defender_dice[_local3].roll();
_local3++;
};
}
public function check_for_win():void{
if ((battle.attacking_country.armies - 1) <= 0){
battle.win("Defender");
};
if (battle.defending_country.armies <= 0){
battle.win("Attacker");
};
}
public function get_dice_values():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < how_many_attack) {
attack_values[_local1] = attacker_dice[_local1].up_side;
_local1++;
};
_local2 = 0;
while (_local2 < how_many_defend) {
defend_values[_local2] = defender_dice[_local2].up_side;
_local2++;
};
order_dice();
compare_the_dice();
check_for_win();
}
public function check_if_rolled():void{
how_many_rolled++;
if (how_many_rolled == total_dice){
how_many_rolled = 0;
get_dice_values();
};
}
public function compare_the_dice():void{
var _local1:int;
if (how_many_attack < how_many_defend){
whos_smaller = how_many_attack;
} else {
whos_smaller = how_many_defend;
};
_local1 = 0;
while (_local1 < whos_smaller) {
if (defend_values[_local1] >= attack_values[_local1]){
battle.attacking_country.armies--;
battle.attacking_country.update_armies();
} else {
battle.defending_country.armies--;
battle.defending_country.update_armies();
};
battle.update_armies();
_local1++;
};
}
public function order_dice():void{
attack_values.sort(Array.DESCENDING);
defend_values.sort(Array.DESCENDING);
}
}
}//package Risk
Section 20
//Risk_Board (Risk.Risk_Board)
package Risk {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.text.*;
public class Risk_Board extends Sprite {
public var first_move:Country;
public var whos_turn:String;// = "Player 1"
public var init_country_count:Array;
public var player_id_text:TextFormat;
public var ask_match:TextField;
public var max_init_countries:Array;
public var player_color:Array;
public var player_colors:Array;
public var armies_to_add:int;
public var no_match_button:Button;
public var owner:String;
public var countries:Array;
public var second_move:Country;
public var risk:Risk;
public var took_over_country:Boolean;// = false
public var card_points:Array;
public var text_box_place:Point;
public var player_format:TextFormat;
public var country_count:Array;
public var whos_turn_value:int;// = 1
public var text_box_format:TextFormat;
public var continents:Array;
public var yes_match_button:Button;
public var cards_armies:Array;
public var adding_armies:Boolean;// = true
public var how_many_turn_ins:int;// = 0
public var cards:Array;
public var how_many_players:int;
public var move_button:Button;
public var index1:int;
public var index2:int;
public var win_text:TextField;
public var end_turn_button:Button;
public var move:Boolean;// = false
public var player_text:TextField;
public var starting_armies:Array;
public var armies_text:TextField;
public var cards_selected:int;// = 0
public var placing_initial_armies:Boolean;// = true
public var end_move_button:Button;
public function Risk_Board(_arg1:int, _arg2:Risk):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Class;
var _local8:DisplayObject;
var _local9:Array;
var _local10:Class;
var _local11:DisplayObject;
var _local12:Array;
var _local13:Class;
var _local14:DisplayObject;
var _local15:Array;
var _local16:Class;
var _local17:DisplayObject;
var _local18:Array;
var _local19:Class;
var _local20:DisplayObject;
var _local21:Array;
var _local22:Class;
var _local23:DisplayObject;
var _local24:Array;
var _local25:Class;
var _local26:DisplayObject;
var _local27:Array;
var _local28:Class;
var _local29:DisplayObject;
var _local30:Array;
var _local31:Class;
var _local32:DisplayObject;
var _local33:Array;
var _local34:Class;
var _local35:DisplayObject;
var _local36:Array;
var _local37:Class;
var _local38:DisplayObject;
var _local39:Array;
var _local40:Class;
var _local41:DisplayObject;
var _local42:Array;
var _local43:Class;
var _local44:DisplayObject;
var _local45:Array;
var _local46:Class;
var _local47:DisplayObject;
var _local48:Array;
var _local49:Class;
var _local50:DisplayObject;
var _local51:Array;
var _local52:Class;
var _local53:DisplayObject;
var _local54:Array;
var _local55:Class;
var _local56:DisplayObject;
var _local57:Array;
var _local58:Class;
var _local59:DisplayObject;
var _local60:Array;
var _local61:Class;
var _local62:DisplayObject;
var _local63:Array;
var _local64:Class;
var _local65:DisplayObject;
var _local66:Array;
var _local67:Class;
var _local68:DisplayObject;
var _local69:Array;
var _local70:Class;
var _local71:DisplayObject;
var _local72:Array;
var _local73:Class;
var _local74:DisplayObject;
var _local75:Array;
var _local76:Class;
var _local77:DisplayObject;
var _local78:Array;
var _local79:Class;
var _local80:DisplayObject;
var _local81:Array;
var _local82:Class;
var _local83:DisplayObject;
var _local84:Array;
var _local85:Class;
var _local86:DisplayObject;
var _local87:Array;
var _local88:Class;
var _local89:DisplayObject;
var _local90:Array;
var _local91:Class;
var _local92:DisplayObject;
var _local93:Array;
var _local94:Class;
var _local95:DisplayObject;
var _local96:Array;
var _local97:Class;
var _local98:DisplayObject;
var _local99:Array;
var _local100:Class;
var _local101:DisplayObject;
var _local102:Array;
var _local103:Class;
var _local104:DisplayObject;
var _local105:Array;
var _local106:Class;
var _local107:DisplayObject;
var _local108:Array;
var _local109:Class;
var _local110:DisplayObject;
var _local111:Array;
var _local112:Class;
var _local113:DisplayObject;
var _local114:Array;
var _local115:Class;
var _local116:DisplayObject;
var _local117:Array;
var _local118:Class;
var _local119:DisplayObject;
var _local120:Array;
var _local121:Class;
var _local122:DisplayObject;
var _local123:Array;
var _local124:Class;
var _local125:DisplayObject;
var _local126:Array;
var _local127:Class;
var _local128:DisplayObject;
var _local129:Array;
var _local130:Class;
var _local131:DisplayObject;
var _local132:Array;
var _local133:int;
var _local134:int;
var _local135:int;
var _local136:int;
var _local137:int;
var _local138:TextField;
starting_armies = new Array();
countries = new Array();
player_colors = new Array();
max_init_countries = new Array();
init_country_count = new Array();
whos_turn = "Player 1";
whos_turn_value = 1;
adding_armies = true;
player_text = new TextField();
player_format = new TextFormat();
text_box_format = new TextFormat();
move = false;
cards = new Array();
player_color = new Array();
cards_selected = 0;
cards_armies = new Array();
how_many_turn_ins = 0;
continents = new Array(6);
placing_initial_armies = true;
country_count = new Array();
took_over_country = false;
armies_text = new TextField();
card_points = new Array();
win_text = new TextField();
player_id_text = new TextFormat();
ask_match = new TextField();
super();
how_many_players = _arg1;
risk = _arg2;
risk.addChild(this);
_local3 = 0;
while (_local3 < how_many_players) {
cards[_local3] = new Array();
_local3++;
};
max_init_countries[0] = 0;
max_init_countries[1] = 0;
max_init_countries[2] = 21;
max_init_countries[3] = 14;
max_init_countries[4] = 11;
max_init_countries[5] = 9;
max_init_countries[6] = 7;
player_color[0] = 0;
player_color[1] = 0xFF;
player_color[2] = 16715535;
player_color[3] = 0xC800;
player_color[4] = 3100495;
player_color[5] = 11546720;
player_color[6] = 12092939;
starting_armies[0] = 0;
starting_armies[1] = 0;
starting_armies[2] = 45;
starting_armies[3] = 40;
starting_armies[4] = 35;
starting_armies[5] = 30;
starting_armies[6] = 25;
cards_armies[0] = 4;
cards_armies[1] = 6;
cards_armies[2] = 8;
cards_armies[3] = 10;
cards_armies[4] = 12;
cards_armies[5] = 15;
card_points[0] = new Point(10, 570);
card_points[1] = new Point(130, 570);
card_points[2] = new Point(250, 570);
card_points[3] = new Point(370, 570);
card_points[4] = new Point(490, 570);
card_points[5] = new Point(610, 570);
_local4 = 0;
while (_local4 < how_many_players) {
country_count[_local4] = 0;
_local4++;
};
_local5 = 0;
while (_local5 < 7) {
init_country_count[_local5] = 0;
_local5++;
};
armies_to_add = starting_armies[how_many_players];
_local6 = 0;
while (_local6 < continents.length) {
continents[_local6] = new Array();
_local6++;
};
_local7 = Risk_Board_north_texas;
_local8 = new (_local7);
_local9 = new Array();
countries[0] = new Country(_local8, this, new Point(-74, -75), random_owner(), _local9, "North Texas");
_local10 = Risk_Board_west_siberia;
_local11 = new (_local10);
_local12 = new Array();
countries[1] = new Country(_local11, this, new Point(17, -63), random_owner(), _local12, "West Siberia");
_local13 = Risk_Board_toronto;
_local14 = new (_local13);
_local15 = new Array();
countries[2] = new Country(_local14, this, new Point(129, -64), random_owner(), _local15, "Toronto");
_local16 = Risk_Board_left_america;
_local17 = new (_local16);
_local18 = new Array();
countries[3] = new Country(_local17, this, new Point(-49, 6), random_owner(), _local18, "Left America");
_local19 = Risk_Board_quebekistan;
_local20 = new (_local19);
_local21 = new Array();
countries[4] = new Country(_local20, this, new Point(156, -46), random_owner(), _local21, "Quebekistan");
_local22 = Risk_Board_right_america;
_local23 = new (_local22);
_local24 = new Array();
countries[5] = new Country(_local23, this, new Point(14, 23), random_owner(), _local24, "Right America");
_local25 = Risk_Board_union;
_local26 = new (_local25);
_local27 = new Array();
countries[6] = new Country(_local26, this, new Point(102, 2), random_owner(), _local27, "Union");
_local28 = Risk_Board_cabo_san_lucas;
_local29 = new (_local28);
_local30 = new Array();
countries[7] = new Country(_local29, this, new Point(17, 88), random_owner(), _local30, "Cabo San Lucas");
_local31 = Risk_Board_cooperstown;
_local32 = new (_local31);
_local33 = new Array();
countries[8] = new Country(_local32, this, new Point(107, 84), random_owner(), _local33, "Cooperstown");
_local34 = Risk_Board_northern_south_america;
_local35 = new (_local34);
_local36 = new Array();
countries[9] = new Country(_local35, this, new Point(133, 158), random_owner(), _local36, "Northern South America");
_local37 = Risk_Board_zil;
_local38 = new (_local37);
_local39 = new Array();
countries[10] = new Country(_local38, this, new Point(184, 231), random_owner(), _local39, "Zil");
_local40 = Risk_Board_argenchile;
_local41 = new (_local40);
_local42 = new Array();
countries[11] = new Country(_local41, this, new Point(138, 288), random_owner(), _local42, "Argenchile");
_local43 = Risk_Board_iceland;
_local44 = new (_local43);
_local45 = new Array();
countries[12] = new Country(_local44, this, new Point(300, -100), random_owner(), _local45, "Iceland");
_local46 = Risk_Board_good_europe;
_local47 = new (_local46);
_local48 = new Array();
countries[13] = new Country(_local47, this, new Point(402, -54), random_owner(), _local48, "Good Europe");
_local49 = Risk_Board_old_europe;
_local50 = new (_local49);
_local51 = new Array();
countries[14] = new Country(_local50, this, new Point(422, -24), random_owner(), _local51, "Old Europe");
_local52 = Risk_Board_new_europe;
_local53 = new (_local52);
_local54 = new Array();
countries[15] = new Country(_local53, this, new Point(491, -45), random_owner(), _local54, "New Europe");
_local55 = Risk_Board_messy_europe;
_local56 = new (_local55);
_local57 = new Array();
countries[16] = new Country(_local56, this, new Point(478, 0), random_owner(), _local57, "Messy Europe");
_local58 = Risk_Board_moscow_and_suburbs;
_local59 = new (_local58);
_local60 = new Array();
countries[17] = new Country(_local59, this, new Point(550, -70), random_owner(), _local60, "Moscow and Suburbs");
_local61 = Risk_Board_european_wisconsin;
_local62 = new (_local61);
_local63 = new Array();
countries[18] = new Country(_local62, this, new Point(458, -92), random_owner(), _local63, "European Wisconsin");
_local64 = Risk_Board_earmarked_for_annexation;
_local65 = new (_local64);
_local66 = new Array();
countries[19] = new Country(_local65, this, new Point(627, -22), random_owner(), _local66, "Earmarked for Annexation");
_local67 = Risk_Board_irafghakistan;
_local68 = new (_local67);
_local69 = new Array();
countries[20] = new Country(_local68, this, new Point(620, 38), random_owner(), _local69, "Irafghakistan");
_local70 = Risk_Board_almost_europe;
_local71 = new (_local70);
_local72 = new Array();
countries[21] = new Country(_local71, this, new Point(526, 5), random_owner(), _local72, "Almost Europe");
_local73 = Risk_Board_controversia;
_local74 = new (_local73);
_local75 = new Array();
countries[22] = new Country(_local74, this, new Point(548, 20), random_owner(), _local75, "Controversia");
_local76 = Risk_Board_petrolia;
_local77 = new (_local76);
_local78 = new Array();
countries[23] = new Country(_local77, this, new Point(574, 85), random_owner(), _local78, "Petrolia");
_local79 = Risk_Board_denial;
_local80 = new (_local79);
_local81 = new Array();
countries[24] = new Country(_local80, this, new Point(511, 62), random_owner(), _local81, "Denial");
_local82 = Risk_Board_carthage;
_local83 = new (_local82);
_local84 = new Array();
countries[25] = new Country(_local83, this, new Point(425, 59), random_owner(), _local84, "Carthage");
_local85 = Risk_Board_west_side;
_local86 = new (_local85);
_local87 = new Array();
countries[26] = new Country(_local86, this, new Point(412, 113), random_owner(), _local87, "West Side");
_local88 = Risk_Board_east_side;
_local89 = new (_local88);
_local90 = new Array();
countries[27] = new Country(_local89, this, new Point(535, 131), random_owner(), _local90, "East Side");
_local91 = Risk_Board_congo_and_friends;
_local92 = new (_local91);
_local93 = new Array();
countries[28] = new Country(_local92, this, new Point(492, 213), random_owner(), _local93, "Congo and Friends");
_local94 = Risk_Board_africa_lite;
_local95 = new (_local94);
_local96 = new Array();
countries[29] = new Country(_local95, this, new Point(497, 295), random_owner(), _local96, "Africa Lite");
_local97 = Risk_Board_madagascar;
_local98 = new (_local97);
_local99 = new Array();
countries[30] = new Country(_local98, this, new Point(584, 0xFF), random_owner(), _local99, "Mad, Mad, Mad, Madagascar");
_local100 = Risk_Board_siberia;
_local101 = new (_local100);
_local102 = new Array();
countries[31] = new Country(_local101, this, new Point(657, -90), random_owner(), _local102, "Siberia");
_local103 = Risk_Board_more_siberia;
_local104 = new (_local103);
_local105 = new Array();
countries[32] = new Country(_local104, this, new Point(822, -77), random_owner(), _local105, "More Siberia");
_local106 = Risk_Board_greater_chinatown;
_local107 = new (_local106);
_local108 = new Array();
countries[33] = new Country(_local107, this, new Point(770, 7), random_owner(), _local108, "Greater Chinatown");
_local109 = Risk_Board_indiana;
_local110 = new (_local109);
_local111 = new Array();
countries[34] = new Country(_local110, this, new Point(705, 81), random_owner(), _local111, "Indiana");
_local112 = Risk_Board_new_siam;
_local113 = new (_local112);
_local114 = new Array();
countries[35] = new Country(_local113, this, new Point(791, 106), random_owner(), _local114, "New Siam");
_local115 = Risk_Board_toyota;
_local116 = new (_local115);
_local117 = new Array();
countries[36] = new Country(_local116, this, new Point(905, 13), random_owner(), _local117, "Toyota");
_local118 = Risk_Board_american_asia;
_local119 = new (_local118);
_local120 = new Array();
countries[37] = new Country(_local119, this, new Point(875, 110), random_owner(), _local120, "American Asia");
_local121 = Risk_Board_indonesia_ish;
_local122 = new (_local121);
_local123 = new Array();
countries[38] = new Country(_local122, this, new Point(844, 183), random_owner(), _local123, "Indonesia-ish");
_local124 = Risk_Board_can_you;
_local125 = new (_local124);
_local126 = new Array();
countries[39] = new Country(_local125, this, new Point(960, 200), random_owner(), _local126, "Can you name this island?");
_local127 = Risk_Board_outback_steakhouse;
_local128 = new (_local127);
_local129 = new Array();
countries[40] = new Country(_local128, this, new Point(910, 290), random_owner(), _local129, "Outback Steakhouse");
_local130 = Risk_Board_middle_earth;
_local131 = new (_local130);
_local132 = new Array();
countries[41] = new Country(_local131, this, new Point(1023, 362), random_owner(), _local132, "Middle Earth");
this.graphics.lineStyle(3, 0);
this.graphics.moveTo(360, 95);
this.graphics.lineTo(390, 80);
this.graphics.moveTo(360, 45);
this.graphics.lineTo(380, 37);
this.graphics.moveTo(234, 219);
this.graphics.lineTo(238, 229);
this.graphics.moveTo(204, 243);
this.graphics.lineTo(222, 241);
this.graphics.moveTo(0x0101, 0x0101);
this.graphics.lineTo(0x0101, 271);
this.graphics.moveTo(409, 361);
this.graphics.lineTo(494, 312);
this.graphics.moveTo(472, 63);
this.graphics.lineTo(516, 94);
this.graphics.moveTo(546, 93);
this.graphics.lineTo(563, 80);
this.graphics.moveTo(698, 405);
this.graphics.lineTo(709, 407);
this.graphics.moveTo(662, 463);
this.graphics.lineTo(708, 440);
this.graphics.moveTo(965, 280);
this.graphics.lineTo(980, 310);
this.graphics.moveTo(972, 270);
this.graphics.lineTo(995, 265);
this.graphics.moveTo(1030, 311);
this.graphics.lineTo(1030, 317);
this.graphics.moveTo(1030, 380);
this.graphics.lineTo(1040, 390);
this.graphics.moveTo(1085, 371);
this.graphics.lineTo(1077, 381);
this.graphics.moveTo(1130, 472);
this.graphics.lineTo(1155, 490);
this.graphics.moveTo(1065, 352);
this.graphics.lineTo(1045, 360);
this.graphics.moveTo(1056, 329);
this.graphics.lineTo(1045, 307);
this.graphics.moveTo(996, 239);
this.graphics.lineTo(989, 232);
this.graphics.moveTo(1014, 215);
this.graphics.lineTo(1027, 193);
this.graphics.moveTo(1004, 195);
this.graphics.lineTo(1026, 180);
this.graphics.moveTo(1036, 131);
this.graphics.lineTo(1041, 135);
this.graphics.moveTo(1120, 50);
this.graphics.lineTo(1200, 50);
this.graphics.moveTo(0, 50);
this.graphics.lineTo(35, 50);
countries[0].border_countries[0] = countries[1];
countries[0].border_countries[1] = countries[32];
countries[1].border_countries[0] = countries[0];
countries[1].border_countries[1] = countries[2];
countries[1].border_countries[2] = countries[3];
countries[1].border_countries[3] = countries[5];
countries[2].border_countries[0] = countries[1];
countries[2].border_countries[1] = countries[5];
countries[2].border_countries[2] = countries[6];
countries[2].border_countries[3] = countries[4];
countries[2].border_countries[4] = countries[12];
countries[3].border_countries[0] = countries[1];
countries[3].border_countries[1] = countries[5];
countries[3].border_countries[2] = countries[7];
countries[4].border_countries[0] = countries[2];
countries[4].border_countries[1] = countries[6];
countries[4].border_countries[2] = countries[12];
countries[5].border_countries[0] = countries[1];
countries[5].border_countries[1] = countries[2];
countries[5].border_countries[2] = countries[3];
countries[5].border_countries[3] = countries[6];
countries[5].border_countries[4] = countries[7];
countries[5].border_countries[5] = countries[8];
countries[6].border_countries[0] = countries[2];
countries[6].border_countries[1] = countries[4];
countries[6].border_countries[2] = countries[5];
countries[7].border_countries[0] = countries[3];
countries[7].border_countries[1] = countries[5];
countries[7].border_countries[2] = countries[8];
countries[7].border_countries[3] = countries[9];
countries[8].border_countries[0] = countries[5];
countries[8].border_countries[1] = countries[7];
countries[8].border_countries[2] = countries[9];
countries[9].border_countries[0] = countries[7];
countries[9].border_countries[1] = countries[8];
countries[9].border_countries[2] = countries[10];
countries[9].border_countries[3] = countries[11];
countries[10].border_countries[0] = countries[9];
countries[10].border_countries[1] = countries[11];
countries[10].border_countries[2] = countries[26];
countries[11].border_countries[0] = countries[9];
countries[11].border_countries[1] = countries[10];
countries[12].border_countries[0] = countries[2];
countries[12].border_countries[1] = countries[4];
countries[12].border_countries[2] = countries[13];
countries[13].border_countries[0] = countries[12];
countries[13].border_countries[1] = countries[14];
countries[13].border_countries[2] = countries[18];
countries[14].border_countries[0] = countries[13];
countries[14].border_countries[1] = countries[15];
countries[14].border_countries[2] = countries[16];
countries[14].border_countries[3] = countries[18];
countries[14].border_countries[4] = countries[25];
countries[15].border_countries[0] = countries[14];
countries[15].border_countries[1] = countries[16];
countries[15].border_countries[2] = countries[17];
countries[15].border_countries[3] = countries[18];
countries[16].border_countries[0] = countries[14];
countries[16].border_countries[1] = countries[15];
countries[16].border_countries[2] = countries[21];
countries[16].border_countries[3] = countries[25];
countries[17].border_countries[0] = countries[18];
countries[17].border_countries[1] = countries[19];
countries[17].border_countries[2] = countries[15];
countries[17].border_countries[3] = countries[31];
countries[18].border_countries[0] = countries[17];
countries[18].border_countries[1] = countries[15];
countries[18].border_countries[2] = countries[13];
countries[18].border_countries[3] = countries[14];
countries[19].border_countries[0] = countries[17];
countries[19].border_countries[1] = countries[20];
countries[19].border_countries[2] = countries[21];
countries[19].border_countries[3] = countries[31];
countries[19].border_countries[4] = countries[33];
countries[20].border_countries[0] = countries[19];
countries[20].border_countries[1] = countries[21];
countries[20].border_countries[2] = countries[22];
countries[20].border_countries[3] = countries[23];
countries[20].border_countries[4] = countries[33];
countries[20].border_countries[5] = countries[34];
countries[21].border_countries[0] = countries[16];
countries[21].border_countries[1] = countries[19];
countries[21].border_countries[2] = countries[22];
countries[21].border_countries[3] = countries[20];
countries[21].border_countries[4] = countries[25];
countries[22].border_countries[0] = countries[21];
countries[22].border_countries[1] = countries[20];
countries[22].border_countries[2] = countries[23];
countries[22].border_countries[3] = countries[24];
countries[23].border_countries[0] = countries[22];
countries[23].border_countries[1] = countries[24];
countries[23].border_countries[2] = countries[20];
countries[23].border_countries[3] = countries[27];
countries[24].border_countries[0] = countries[22];
countries[24].border_countries[1] = countries[23];
countries[24].border_countries[2] = countries[25];
countries[24].border_countries[3] = countries[27];
countries[25].border_countries[0] = countries[14];
countries[25].border_countries[1] = countries[16];
countries[25].border_countries[2] = countries[21];
countries[25].border_countries[3] = countries[24];
countries[25].border_countries[4] = countries[26];
countries[25].border_countries[5] = countries[27];
countries[26].border_countries[0] = countries[25];
countries[26].border_countries[1] = countries[27];
countries[26].border_countries[2] = countries[10];
countries[26].border_countries[3] = countries[28];
countries[27].border_countries[0] = countries[23];
countries[27].border_countries[1] = countries[24];
countries[27].border_countries[2] = countries[25];
countries[27].border_countries[3] = countries[26];
countries[27].border_countries[4] = countries[28];
countries[28].border_countries[0] = countries[26];
countries[28].border_countries[1] = countries[27];
countries[28].border_countries[2] = countries[29];
countries[28].border_countries[3] = countries[30];
countries[29].border_countries[0] = countries[28];
countries[29].border_countries[1] = countries[30];
countries[30].border_countries[0] = countries[28];
countries[30].border_countries[1] = countries[29];
countries[31].border_countries[0] = countries[17];
countries[31].border_countries[1] = countries[19];
countries[31].border_countries[2] = countries[32];
countries[31].border_countries[3] = countries[33];
countries[32].border_countries[0] = countries[31];
countries[32].border_countries[1] = countries[33];
countries[32].border_countries[2] = countries[36];
countries[32].border_countries[3] = countries[0];
countries[33].border_countries[0] = countries[32];
countries[33].border_countries[1] = countries[31];
countries[33].border_countries[2] = countries[19];
countries[33].border_countries[3] = countries[20];
countries[33].border_countries[4] = countries[34];
countries[33].border_countries[5] = countries[35];
countries[33].border_countries[6] = countries[36];
countries[33].border_countries[7] = countries[37];
countries[34].border_countries[0] = countries[33];
countries[34].border_countries[1] = countries[20];
countries[34].border_countries[2] = countries[35];
countries[35].border_countries[0] = countries[33];
countries[35].border_countries[1] = countries[34];
countries[35].border_countries[2] = countries[37];
countries[35].border_countries[3] = countries[38];
countries[36].border_countries[0] = countries[32];
countries[36].border_countries[1] = countries[33];
countries[36].border_countries[2] = countries[37];
countries[37].border_countries[0] = countries[33];
countries[37].border_countries[1] = countries[35];
countries[37].border_countries[2] = countries[36];
countries[37].border_countries[3] = countries[38];
countries[37].border_countries[4] = countries[39];
countries[38].border_countries[0] = countries[35];
countries[38].border_countries[1] = countries[37];
countries[38].border_countries[2] = countries[39];
countries[38].border_countries[3] = countries[40];
countries[39].border_countries[0] = countries[37];
countries[39].border_countries[1] = countries[38];
countries[39].border_countries[2] = countries[40];
countries[40].border_countries[0] = countries[38];
countries[40].border_countries[1] = countries[39];
countries[40].border_countries[2] = countries[41];
countries[41].border_countries[0] = countries[40];
continents[0][0] = countries[0];
continents[0][1] = countries[1];
continents[0][2] = countries[2];
continents[0][3] = countries[3];
continents[0][4] = countries[4];
continents[0][5] = countries[5];
continents[0][6] = countries[6];
continents[0][7] = countries[12];
continents[1][0] = countries[7];
continents[1][1] = countries[8];
continents[1][2] = countries[9];
continents[1][3] = countries[10];
continents[1][4] = countries[11];
continents[2][0] = countries[24];
continents[2][1] = countries[25];
continents[2][2] = countries[26];
continents[2][3] = countries[27];
continents[2][4] = countries[28];
continents[2][5] = countries[29];
continents[2][6] = countries[30];
continents[3][0] = countries[13];
continents[3][1] = countries[14];
continents[3][2] = countries[15];
continents[3][3] = countries[16];
continents[3][4] = countries[17];
continents[3][5] = countries[18];
continents[3][6] = countries[21];
continents[4][0] = countries[19];
continents[4][1] = countries[20];
continents[4][2] = countries[22];
continents[4][3] = countries[23];
continents[4][4] = countries[31];
continents[4][5] = countries[32];
continents[4][6] = countries[33];
continents[4][7] = countries[34];
continents[4][8] = countries[35];
continents[4][9] = countries[36];
continents[4][10] = countries[37];
continents[5][0] = countries[38];
continents[5][1] = countries[39];
continents[5][2] = countries[40];
continents[5][3] = countries[41];
_local133 = 1;
while (_local133 < how_many_players) {
_local137 = 0;
while (_local137 < countries.length) {
if (countries[_local137].owner == ("Player " + _local133)){
var _local139 = country_count;
var _local140 = (_local133 - 1);
var _local141 = (_local139[_local140] + 1);
_local139[_local140] = _local141;
};
_local137++;
};
_local133++;
};
text_box_place = new Point(450, 505);
this.graphics.lineStyle(3, 0);
this.graphics.beginFill(0xFFFFFF);
this.graphics.drawRect(text_box_place.x, text_box_place.y, 400, 40);
this.graphics.beginFill(player_color[whos_turn_value]);
this.graphics.drawRect((text_box_place.x + 150), (text_box_place.y + 50), 100, 25);
this.graphics.endFill();
_local134 = 0;
while (_local134 < countries.length) {
if (countries[_local134].owner == "Player 1"){
countries[_local134].add_armies_listener();
};
_local134++;
};
ask_match.text = "Turn in a match?";
ask_match.x = text_box_place.x;
ask_match.y = (text_box_place.y - 3);
ask_match.width = 400;
player_text.text = whos_turn;
player_text.width = 100;
player_text.x = (text_box_place.x + 150);
player_text.y = (text_box_place.y + 51);
player_format.color = 0xFFFFFF;
player_format.bold = true;
player_format.align = TextFormatAlign.CENTER;
player_format.size = 18;
player_text.setTextFormat(player_format);
this.addChild(player_text);
armies_text.text = ("Armies to add: " + armies_to_add);
armies_text.x = text_box_place.x;
armies_text.y = (text_box_place.y - 3);
armies_text.width = 400;
win_text.text = (whos_turn + " Won!!");
win_text.x = text_box_place.x;
win_text.y = (text_box_place.y - 3);
win_text.width = 400;
text_box_format.color = 0;
text_box_format.align = TextFormatAlign.CENTER;
text_box_format.size = 36;
armies_text.setTextFormat(text_box_format);
this.addChild(armies_text);
win_text.setTextFormat(text_box_format);
ask_match.setTextFormat(text_box_format);
player_id_text.color = 0xFFFFFF;
player_id_text.size = 10;
player_id_text.align = TextFormatAlign.CENTER;
this.graphics.lineStyle(1, 0);
_local135 = 0;
while (_local135 < how_many_players) {
this.graphics.beginFill(player_color[(_local135 + 1)]);
this.graphics.drawRect(1, (200 + (_local135 * 24)), 60, 20);
this.graphics.endFill();
_local135++;
};
_local136 = 0;
while (_local136 < how_many_players) {
_local138 = new TextField();
_local138.text = ("Player " + (_local136 + 1));
_local138.x = 4;
_local138.y = (201 + (_local136 * 24));
_local138.width = 60;
_local138.setTextFormat(player_id_text);
this.addChild(_local138);
_local136++;
};
end_move_button = new Button("End Moves", 150, 40, move_listeners_off);
yes_match_button = new Button("Yes", 100, 40, yes_match);
no_match_button = new Button("No", 100, 40, no_match);
}
public function check_armies():void{
var _local1:int;
armies_to_add--;
update_armies_text();
if (armies_to_add == 0){
this.removeChild(armies_text);
_local1 = 0;
while (_local1 < countries.length) {
countries[_local1].remove_armies_listener();
_local1++;
};
add_click_events();
end_turn_button = new Button("End Turn", 150, 40, end_turn);
this.addChild(end_turn_button);
end_turn_button.x = 10;
end_turn_button.y = 400;
move_button = new Button("Move Armies", 150, 40, move_listeners_on);
this.addChild(move_button);
move_button.x = 10;
move_button.y = 450;
};
}
public function change_cards():void{
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = (whos_turn_value - 2);
if (whos_turn_value == 1){
_local1 = (how_many_players - 1);
};
_local2 = 0;
while (_local2 < cards[_local1].length) {
this.removeChild(cards[_local1][_local2]);
_local2++;
};
_local3 = 0;
while (_local3 < cards[(whos_turn_value - 1)].length) {
this.addChild(cards[(whos_turn_value - 1)][_local3]);
cards[(whos_turn_value - 1)][_local3].x = card_points[_local3].x;
cards[(whos_turn_value - 1)][_local3].y = card_points[_local3].y;
_local3++;
};
}
public function random_owner():String{
generate_player_number();
return (owner);
}
public function start_turn():void{
add_new_armies();
place_new_armies();
}
public function check_continent_armies():int{
var _local1:int;
_local1 = 0;
if (((check_continent_array(continents[0])) && ((continents[0][0].owner == whos_turn)))){
_local1 = (_local1 + 5);
};
if (((check_continent_array(continents[1])) && ((continents[1][0].owner == whos_turn)))){
_local1 = (_local1 + 3);
};
if (((check_continent_array(continents[2])) && ((continents[2][0].owner == whos_turn)))){
_local1 = (_local1 + 4);
};
if (((check_continent_array(continents[3])) && ((continents[3][0].owner == whos_turn)))){
_local1 = (_local1 + 4);
};
if (((check_continent_array(continents[4])) && ((continents[4][0].owner == whos_turn)))){
_local1 = (_local1 + 7);
};
if (((check_continent_array(continents[5])) && ((continents[5][0].owner == whos_turn)))){
_local1 = (_local1 + 2);
};
return (_local1);
}
public function change_player():void{
if (whos_turn == "Player 6"){
whos_turn = "Player 1";
whos_turn_value = 1;
} else {
if ((((whos_turn == "Player 5")) && ((whos_turn_value < how_many_players)))){
whos_turn = "Player 6";
whos_turn_value = 6;
} else {
if ((((whos_turn == "Player 4")) && ((whos_turn_value < how_many_players)))){
whos_turn = "Player 5";
whos_turn_value = 5;
} else {
if ((((whos_turn == "Player 3")) && ((whos_turn_value < how_many_players)))){
whos_turn = "Player 4";
whos_turn_value = 4;
} else {
if ((((whos_turn == "Player 2")) && ((whos_turn_value < how_many_players)))){
whos_turn = "Player 3";
whos_turn_value = 3;
} else {
if (whos_turn == "Player 1"){
whos_turn = "Player 2";
whos_turn_value = 2;
} else {
whos_turn = "Player 1";
whos_turn_value = 1;
};
};
};
};
};
};
update_player_text();
update_player_box();
}
public function check_for_match():void{
var _local1:Array;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
cards_selected++;
if (cards_selected == 3){
cards_selected = 0;
_local1 = new Array();
_local2 = 0;
while (_local2 < cards[(whos_turn_value - 1)].length) {
if (cards[(whos_turn_value - 1)][_local2].highlighted == true){
_local1.push(cards[(whos_turn_value - 1)][_local2].id);
};
_local2++;
};
if ((((((_local1[0] == _local1[1])) && ((_local1[0] == _local1[2])))) || (((((!((_local1[0] == _local1[1]))) && (!((_local1[0] == _local1[2]))))) && (!((_local1[1] == _local1[2]))))))){
_local3 = 100;
_local4 = 100;
_local5 = 100;
_local6 = 0;
while (_local6 < cards[(whos_turn_value - 1)].length) {
cards[(whos_turn_value - 1)][_local6].remove_highlight_click();
if (cards[(whos_turn_value - 1)][_local6].highlighted == true){
this.removeChild(cards[(whos_turn_value - 1)][_local6]);
if (_local3 == 100){
_local3 = _local6;
} else {
if (_local4 == 100){
_local4 = _local6;
} else {
_local5 = _local6;
};
};
};
_local6++;
};
cards[(whos_turn_value - 1)].splice(_local5, 1);
cards[(whos_turn_value - 1)].splice(_local4, 1);
cards[(whos_turn_value - 1)].splice(_local3, 1);
armies_to_add = check_cards_armies();
check_cards();
} else {
_local7 = 0;
while (_local7 < cards[(whos_turn_value - 1)].length) {
cards[(whos_turn_value - 1)][_local7].highlight();
_local7++;
};
};
};
}
public function yes_match(_arg1:Event):void{
var _local2:int;
this.removeChild(ask_match);
this.removeChild(yes_match_button);
this.removeChild(no_match_button);
_local2 = 0;
while (_local2 < cards[(whos_turn_value - 1)].length) {
cards[(whos_turn_value - 1)][_local2].mouse_over(_arg1);
cards[(whos_turn_value - 1)][_local2].remove_go_down();
cards[(whos_turn_value - 1)][_local2].add_highlight_click();
_local2++;
};
}
public function ask_for_match():void{
this.addChild(ask_match);
this.addChild(yes_match_button);
yes_match_button.x = (text_box_place.x + 80);
yes_match_button.y = (text_box_place.y - 50);
if (cards[(whos_turn_value - 1)].length < 6){
this.addChild(no_match_button);
no_match_button.x = (text_box_place.x + 220);
no_match_button.y = (text_box_place.y - 50);
};
}
public function add_click_events():void{
var _local1:int;
_local1 = 0;
while (_local1 < countries.length) {
if (countries[_local1].owner == whos_turn){
countries[_local1].add_mouse_click();
};
_local1++;
};
}
public function update_player_box():void{
this.graphics.beginFill(player_color[whos_turn_value]);
this.graphics.drawRect((text_box_place.x + 150), (text_box_place.y + 50), 100, 25);
}
public function end_battle(_arg1:Battle, _arg2:Point, _arg3:Point):void{
var _local4:int;
this.removeChild(_arg1);
check_for_win();
this.addChild(countries[index1]);
this.addChild(countries[index2]);
countries[index1].x = _arg2.x;
countries[index1].y = _arg2.y;
countries[index2].x = _arg3.x;
countries[index2].y = _arg3.y;
_local4 = 0;
while (_local4 < countries.length) {
countries[_local4].add_mouse_click();
countries[_local4].update_armies();
_local4++;
};
}
public function place_new_armies():void{
var _local1:int;
this.addChild(armies_text);
_local1 = 0;
while (_local1 < countries.length) {
if (countries[_local1].owner == whos_turn){
countries[_local1].add_armies_listener();
};
_local1++;
};
}
public function check_starting_armies(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:int;
armies_to_add--;
update_armies_text();
if (armies_to_add == 0){
_local2 = 0;
while (_local2 < countries.length) {
countries[_local2].remove_armies_listener();
_local2++;
};
change_player();
if (whos_turn != "Player 1"){
armies_to_add = starting_armies[how_many_players];
update_armies_text();
_local3 = 0;
while (_local3 < countries.length) {
if (countries[_local3].owner == whos_turn){
countries[_local3].add_armies_listener();
};
_local3++;
};
} else {
placing_initial_armies = false;
this.removeChild(armies_text);
_local4 = 0;
while (_local4 < countries.length) {
countries[_local4].remove_mouse_click();
_local4++;
};
start_turn();
};
};
}
public function get_player_color():int{
return (player_color[whos_turn_value]);
}
public function check_continent_array(_arg1:Array):Boolean{
var _local2:String;
var _local3:int;
var _local4:int;
_local2 = _arg1[0].owner;
_local3 = 1;
_local4 = 1;
while (_local4 < _arg1.length) {
if (_local2 == _arg1[_local4].owner){
_local3++;
};
_local4++;
};
if (_local3 == _arg1.length){
return (true);
};
return (false);
}
public function add_new_armies():void{
var _local1:int;
_local1 = calculate_new_armies();
armies_to_add = (armies_to_add + _local1);
update_armies_text();
}
public function calculate_new_armies():int{
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = 0;
_local2 = 0;
_local3 = 0;
while (_local3 < countries.length) {
if (countries[_local3].owner == whos_turn){
_local1++;
};
_local3++;
};
_local1 = (_local1 / 3);
if (_local1 < 3){
_local1 = 3;
};
_local2 = check_continent_armies();
_local1 = (_local1 + _local2);
return (_local1);
}
public function deal_card():void{
cards[(whos_turn_value - 1)].push(new Card(this));
}
public function initiate_battle(_arg1:Country, _arg2:Event):void{
var _local3:int;
_local3 = 0;
while (_local3 < countries.length) {
countries[_local3].remove_battle_click();
countries[_local3].remove_mouse_click();
if (countries[_local3].highlighted == true){
countries[_local3].mouse_click(_arg2);
countries[_local3].mouse_out(_arg2);
countries[_local3].change_color(countries[_local3].owner);
create_battle(countries[_local3], _arg1);
};
_local3++;
};
}
public function move_armies(_arg1:Event):void{
var _local2:Country;
var _local3:Country;
var _local4:int;
var _local5:int;
this.stage.focus = stage;
if (move == false){
_local2 = (_arg1.currentTarget as Country);
first_move = _local2;
move = true;
} else {
_local3 = (_arg1.currentTarget as Country);
second_move = _local3;
move = false;
if (first_move.armies > 1){
_local5 = 0;
while (_local5 < first_move.border_countries.length) {
if (first_move.border_countries[_local5] == second_move){
first_move.armies--;
first_move.update_armies();
second_move.armies++;
second_move.update_armies();
};
_local5++;
};
};
_local4 = 0;
while (_local4 < countries.length) {
if (countries[_local4].gray_highlight){
countries[_local4].gray_no_battle_off();
};
_local4++;
};
};
}
public function generate_player_number():void{
var _local1:Number;
_local1 = Math.floor(((Math.random() * how_many_players) + 1));
if (init_country_count[_local1] < max_init_countries[how_many_players]){
var _local2 = init_country_count;
var _local3 = _local1;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
owner = ("Player " + _local1);
} else {
generate_player_number();
};
}
public function check_cards_armies():int{
if (how_many_turn_ins < 7){
return (cards_armies[how_many_turn_ins]);
};
return ((5 * (how_many_turn_ins - 3)));
}
public function check_for_win():void{
var _local1:String;
var _local2:int;
var _local3:int;
_local1 = countries[0].owner;
_local2 = 1;
_local3 = 1;
while (_local3 < countries.length) {
if (countries[_local3].owner == _local1){
_local2++;
};
_local3++;
};
if (_local2 == countries.length){
this.addChild(win_text);
remove_click_events();
};
}
public function update_player_text():void{
player_text.text = whos_turn;
player_text.setTextFormat(player_format);
}
public function create_battle(_arg1:Country, _arg2:Country):void{
var _local3:int;
var _local4:Battle;
_local3 = 0;
while (_local3 < countries.length) {
if (countries[_local3] == _arg1){
index1 = _local3;
};
if (countries[_local3] == _arg2){
index2 = _local3;
};
_local3++;
};
_local4 = new Battle(_arg1, _arg2, this);
}
public function check_cards():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = 0;
_local2 = 0;
_local3 = 0;
if (cards[(whos_turn_value - 1)].length > 2){
_local4 = 0;
while (_local4 < cards[(whos_turn_value - 1)].length) {
if (cards[(whos_turn_value - 1)][_local4].id == "Soldier"){
_local1++;
} else {
if (cards[(whos_turn_value - 1)][_local4].id == "Cannon"){
_local3++;
} else {
_local2++;
};
};
_local4++;
};
if ((((((((_local1 >= 3)) || ((_local3 >= 3)))) || ((_local2 >= 3)))) || ((((((_local1 > 0)) && ((_local3 > 0)))) && ((_local2 > 0)))))){
ask_for_match();
} else {
start_turn();
};
} else {
start_turn();
};
}
public function end_turn(_arg1:Event):void{
var _local2:int;
this.stage.focus = stage;
this.removeChild(end_turn_button);
this.removeChild(move_button);
_local2 = 0;
while (_local2 < countries.length) {
countries[_local2].gray_highlight_off();
countries[_local2].remove_mouse_click();
_local2++;
};
if (took_over_country == true){
deal_card();
};
took_over_country = false;
armies_to_add = 0;
change_player();
change_cards();
check_cards();
}
public function update_armies_text():void{
armies_text.text = ("Armies to add: " + armies_to_add);
armies_text.setTextFormat(text_box_format);
}
public function move_listeners_off(_arg1:Event):void{
var _local2:int;
this.stage.focus = stage;
this.removeChild(end_move_button);
_local2 = 0;
while (_local2 < countries.length) {
countries[_local2].remove_move_click();
if (countries[_local2].owner == whos_turn){
countries[_local2].add_mouse_click();
};
_local2++;
};
this.addChild(move_button);
this.addChild(end_turn_button);
}
public function remove_click_events():void{
var _local1:int;
_local1 = 0;
while (_local1 < countries.length) {
if (countries[_local1].highlighted == false){
countries[_local1].remove_mouse_click();
};
_local1++;
};
}
public function move_listeners_on(_arg1:Event):void{
var _local2:int;
this.stage.focus = stage;
this.removeChild(end_turn_button);
_local2 = 0;
while (_local2 < countries.length) {
if (countries[_local2].owner == whos_turn){
countries[_local2].remove_mouse_click();
countries[_local2].add_move_click();
};
_local2++;
};
this.removeChild(move_button);
this.addChild(end_move_button);
end_move_button.x = 10;
end_move_button.y = 450;
}
public function no_match(_arg1:Event):void{
this.removeChild(ask_match);
this.removeChild(yes_match_button);
this.removeChild(no_match_button);
start_turn();
}
}
}//package Risk
Section 21
//Risk_Board_africa_lite (Risk.Risk_Board_africa_lite)
package Risk {
import mx.core.*;
public class Risk_Board_africa_lite extends BitmapAsset {
}
}//package Risk
Section 22
//Risk_Board_almost_europe (Risk.Risk_Board_almost_europe)
package Risk {
import mx.core.*;
public class Risk_Board_almost_europe extends BitmapAsset {
}
}//package Risk
Section 23
//Risk_Board_american_asia (Risk.Risk_Board_american_asia)
package Risk {
import mx.core.*;
public class Risk_Board_american_asia extends BitmapAsset {
}
}//package Risk
Section 24
//Risk_Board_argenchile (Risk.Risk_Board_argenchile)
package Risk {
import mx.core.*;
public class Risk_Board_argenchile extends BitmapAsset {
}
}//package Risk
Section 25
//Risk_Board_cabo_san_lucas (Risk.Risk_Board_cabo_san_lucas)
package Risk {
import mx.core.*;
public class Risk_Board_cabo_san_lucas extends BitmapAsset {
}
}//package Risk
Section 26
//Risk_Board_can_you (Risk.Risk_Board_can_you)
package Risk {
import mx.core.*;
public class Risk_Board_can_you extends BitmapAsset {
}
}//package Risk
Section 27
//Risk_Board_carthage (Risk.Risk_Board_carthage)
package Risk {
import mx.core.*;
public class Risk_Board_carthage extends BitmapAsset {
}
}//package Risk
Section 28
//Risk_Board_congo_and_friends (Risk.Risk_Board_congo_and_friends)
package Risk {
import mx.core.*;
public class Risk_Board_congo_and_friends extends BitmapAsset {
}
}//package Risk
Section 29
//Risk_Board_controversia (Risk.Risk_Board_controversia)
package Risk {
import mx.core.*;
public class Risk_Board_controversia extends BitmapAsset {
}
}//package Risk
Section 30
//Risk_Board_cooperstown (Risk.Risk_Board_cooperstown)
package Risk {
import mx.core.*;
public class Risk_Board_cooperstown extends BitmapAsset {
}
}//package Risk
Section 31
//Risk_Board_denial (Risk.Risk_Board_denial)
package Risk {
import mx.core.*;
public class Risk_Board_denial extends BitmapAsset {
}
}//package Risk
Section 32
//Risk_Board_earmarked_for_annexation (Risk.Risk_Board_earmarked_for_annexation)
package Risk {
import mx.core.*;
public class Risk_Board_earmarked_for_annexation extends BitmapAsset {
}
}//package Risk
Section 33
//Risk_Board_east_side (Risk.Risk_Board_east_side)
package Risk {
import mx.core.*;
public class Risk_Board_east_side extends BitmapAsset {
}
}//package Risk
Section 34
//Risk_Board_european_wisconsin (Risk.Risk_Board_european_wisconsin)
package Risk {
import mx.core.*;
public class Risk_Board_european_wisconsin extends BitmapAsset {
}
}//package Risk
Section 35
//Risk_Board_good_europe (Risk.Risk_Board_good_europe)
package Risk {
import mx.core.*;
public class Risk_Board_good_europe extends BitmapAsset {
}
}//package Risk
Section 36
//Risk_Board_greater_chinatown (Risk.Risk_Board_greater_chinatown)
package Risk {
import mx.core.*;
public class Risk_Board_greater_chinatown extends BitmapAsset {
}
}//package Risk
Section 37
//Risk_Board_iceland (Risk.Risk_Board_iceland)
package Risk {
import mx.core.*;
public class Risk_Board_iceland extends BitmapAsset {
}
}//package Risk
Section 38
//Risk_Board_indiana (Risk.Risk_Board_indiana)
package Risk {
import mx.core.*;
public class Risk_Board_indiana extends BitmapAsset {
}
}//package Risk
Section 39
//Risk_Board_indonesia_ish (Risk.Risk_Board_indonesia_ish)
package Risk {
import mx.core.*;
public class Risk_Board_indonesia_ish extends BitmapAsset {
}
}//package Risk
Section 40
//Risk_Board_irafghakistan (Risk.Risk_Board_irafghakistan)
package Risk {
import mx.core.*;
public class Risk_Board_irafghakistan extends BitmapAsset {
}
}//package Risk
Section 41
//Risk_Board_left_america (Risk.Risk_Board_left_america)
package Risk {
import mx.core.*;
public class Risk_Board_left_america extends BitmapAsset {
}
}//package Risk
Section 42
//Risk_Board_madagascar (Risk.Risk_Board_madagascar)
package Risk {
import mx.core.*;
public class Risk_Board_madagascar extends BitmapAsset {
}
}//package Risk
Section 43
//Risk_Board_messy_europe (Risk.Risk_Board_messy_europe)
package Risk {
import mx.core.*;
public class Risk_Board_messy_europe extends BitmapAsset {
}
}//package Risk
Section 44
//Risk_Board_middle_earth (Risk.Risk_Board_middle_earth)
package Risk {
import mx.core.*;
public class Risk_Board_middle_earth extends BitmapAsset {
}
}//package Risk
Section 45
//Risk_Board_more_siberia (Risk.Risk_Board_more_siberia)
package Risk {
import mx.core.*;
public class Risk_Board_more_siberia extends BitmapAsset {
}
}//package Risk
Section 46
//Risk_Board_moscow_and_suburbs (Risk.Risk_Board_moscow_and_suburbs)
package Risk {
import mx.core.*;
public class Risk_Board_moscow_and_suburbs extends BitmapAsset {
}
}//package Risk
Section 47
//Risk_Board_new_europe (Risk.Risk_Board_new_europe)
package Risk {
import mx.core.*;
public class Risk_Board_new_europe extends BitmapAsset {
}
}//package Risk
Section 48
//Risk_Board_new_siam (Risk.Risk_Board_new_siam)
package Risk {
import mx.core.*;
public class Risk_Board_new_siam extends BitmapAsset {
}
}//package Risk
Section 49
//Risk_Board_north_texas (Risk.Risk_Board_north_texas)
package Risk {
import mx.core.*;
public class Risk_Board_north_texas extends BitmapAsset {
}
}//package Risk
Section 50
//Risk_Board_northern_south_america (Risk.Risk_Board_northern_south_america)
package Risk {
import mx.core.*;
public class Risk_Board_northern_south_america extends BitmapAsset {
}
}//package Risk
Section 51
//Risk_Board_old_europe (Risk.Risk_Board_old_europe)
package Risk {
import mx.core.*;
public class Risk_Board_old_europe extends BitmapAsset {
}
}//package Risk
Section 52
//Risk_Board_outback_steakhouse (Risk.Risk_Board_outback_steakhouse)
package Risk {
import mx.core.*;
public class Risk_Board_outback_steakhouse extends BitmapAsset {
}
}//package Risk
Section 53
//Risk_Board_petrolia (Risk.Risk_Board_petrolia)
package Risk {
import mx.core.*;
public class Risk_Board_petrolia extends BitmapAsset {
}
}//package Risk
Section 54
//Risk_Board_quebekistan (Risk.Risk_Board_quebekistan)
package Risk {
import mx.core.*;
public class Risk_Board_quebekistan extends BitmapAsset {
}
}//package Risk
Section 55
//Risk_Board_right_america (Risk.Risk_Board_right_america)
package Risk {
import mx.core.*;
public class Risk_Board_right_america extends BitmapAsset {
}
}//package Risk
Section 56
//Risk_Board_siberia (Risk.Risk_Board_siberia)
package Risk {
import mx.core.*;
public class Risk_Board_siberia extends BitmapAsset {
}
}//package Risk
Section 57
//Risk_Board_toronto (Risk.Risk_Board_toronto)
package Risk {
import mx.core.*;
public class Risk_Board_toronto extends BitmapAsset {
}
}//package Risk
Section 58
//Risk_Board_toyota (Risk.Risk_Board_toyota)
package Risk {
import mx.core.*;
public class Risk_Board_toyota extends BitmapAsset {
}
}//package Risk
Section 59
//Risk_Board_union (Risk.Risk_Board_union)
package Risk {
import mx.core.*;
public class Risk_Board_union extends BitmapAsset {
}
}//package Risk
Section 60
//Risk_Board_west_siberia (Risk.Risk_Board_west_siberia)
package Risk {
import mx.core.*;
public class Risk_Board_west_siberia extends BitmapAsset {
}
}//package Risk
Section 61
//Risk_Board_west_side (Risk.Risk_Board_west_side)
package Risk {
import mx.core.*;
public class Risk_Board_west_side extends BitmapAsset {
}
}//package Risk
Section 62
//Risk_Board_zil (Risk.Risk_Board_zil)
package Risk {
import mx.core.*;
public class Risk_Board_zil extends BitmapAsset {
}
}//package Risk
Section 63
//Risk (Risk)
package {
import flash.events.*;
import Risk.*;
import flash.display.*;
import flash.text.*;
public class Risk extends Sprite {
public var four:Button;
public var two:Button;
public var how_many_format:TextFormat;
public var three:Button;
public var five:Button;
public var board:Risk_Board;
public var six:Button;
public var how_many:TextField;
public function Risk(){
how_many = new TextField();
how_many_format = new TextFormat();
super();
how_many.text = "How Many Players?";
how_many.x = ((this.stage.stageWidth / 2) - 400);
how_many.y = 100;
how_many.width = 800;
how_many_format.color = 0;
how_many_format.size = 56;
how_many_format.align = TextFormatAlign.CENTER;
how_many.setTextFormat(how_many_format);
this.addChild(how_many);
two = new Button("Two", 150, 50, two_players);
this.addChild(two);
two.x = 125;
two.y = 300;
three = new Button("Three", 150, 50, three_players);
this.addChild(three);
three.x = 325;
three.y = 300;
four = new Button("Four", 150, 50, four_players);
this.addChild(four);
four.x = 525;
four.y = 300;
five = new Button("Five", 150, 50, five_players);
this.addChild(five);
five.x = 725;
five.y = 300;
six = new Button("Six", 150, 50, six_players);
this.addChild(six);
six.x = 925;
six.y = 300;
}
public function three_players(_arg1:Event):void{
remove_children();
board = new Risk_Board(3, this);
}
public function five_players(_arg1:Event):void{
remove_children();
board = new Risk_Board(5, this);
}
public function remove_children():void{
this.removeChild(how_many);
this.removeChild(two);
this.removeChild(three);
this.removeChild(four);
this.removeChild(five);
this.removeChild(six);
}
public function six_players(_arg1:Event):void{
remove_children();
board = new Risk_Board(6, this);
}
public function four_players(_arg1:Event):void{
remove_children();
board = new Risk_Board(4, this);
}
public function two_players(_arg1:Event):void{
remove_children();
board = new Risk_Board(2, this);
}
}
}//package