Section 1
//AimAnim (com.midasplayer.africanrainmaker.anim.AimAnim)
package com.midasplayer.africanrainmaker.anim {
import com.midasplayer.africanrainmaker.*;
import flash.display.*;
import com.midasplayer.math.*;
import com.midasplayer.util.*;
public class AimAnim extends Anim {
private var board_:Board;// = null
private var layer_:Sprite;// = null
private var random_:MtRandom;// = null
private var tick_:Number;
private var startY_:Number;
private var ticksToNextRelease_:int;
private var unusedAimClips_:ArrayList;
private var usedAimClips_:ArrayList;
public function AimAnim(_arg1:Sprite, _arg2:Board, _arg3:Number, _arg4:int){
board_ = _arg2;
layer_ = _arg1;
startY_ = _arg3;
random_ = new MtRandom(_arg4);
unusedAimClips_ = new ArrayList();
usedAimClips_ = new ArrayList();
ticksToNextRelease_ = 0;
super();
}
override public function end():void{
}
public function newAimClip():void{
var _local1:Aim;
if (unusedAimClips_.size() == 0){
_local1 = new Aim(startY_);
_local1.x = 34;
layer_.addChild(_local1);
} else {
_local1 = Aim(unusedAimClips_.removeI(0));
};
_local1.reset();
usedAimClips_.add(_local1);
}
override public function tick(_arg1:Number):Boolean{
var _local2:int;
var _local3:int;
var _local4:Aim;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
tick_ = _arg1;
var _local5:int = board_.xToCol((layer_.x - board_.x));
_local5 = ((_local5 < 0)) ? 0 : _local5;
_local5 = ((_local5 >= board_.getMaxCols())) ? (board_.getMaxCols() - 1) : _local5;
var _local6:int = board_.getNumRowsInCol(_local5);
var _local7:Number = ((_local6 * Ball.HEIGHT) + board_.y);
if (ticksToNextRelease_ <= 0){
newAimClip();
ticksToNextRelease_ = (15 + random_.nextInt(5));
};
_local3 = usedAimClips_.size();
_local2 = (_local3 - 1);
while (_local2 >= 0) {
_local4 = Aim(usedAimClips_.get(_local2));
Aim(usedAimClips_.get(_local2)).y0 = _local4.y1;
_local4.y1 = (_local4.y1 + _local4.v);
_local4.v = (_local4.v + (_local4.v * 0.008));
_local4.x0 = _local4.x1;
_local8 = board_.xToCol((layer_.x - board_.x));
_local9 = ((_local8 * Ball.WIDTH) + board_.x);
_local10 = ((_local4.s1 / 0.45) * (_local9 - layer_.x));
_local4.x1 = (_local4.x1 + (0.8 * (_local10 - _local4.x1)));
_local4.targetAlpha = 0.6;
_local11 = (_local4.y0 + layer_.y);
if ((_local11 - 100) < _local7){
_local4.targetAlpha = 0;
};
_local4.alpha = (_local4.alpha + ((_local4.targetAlpha - _local4.alpha) * 0.1));
_local4.s0 = _local4.s1;
if (_local4.s1 < 0.45){
_local4.s1 = (_local4.s1 + 0.006);
};
if ((startY_ - _local4.y0) > 500){
_local4.visible = false;
usedAimClips_.removeI(_local2);
unusedAimClips_.add(_local4);
};
_local2--;
};
ticksToNextRelease_--;
return (false);
}
override public function render(_arg1:Number):void{
var _local2:int;
var _local3:int;
var _local4:Aim;
_local3 = usedAimClips_.size();
_local2 = (_local3 - 1);
while (_local2 >= 0) {
_local4 = Aim(usedAimClips_.get(_local2));
Aim(usedAimClips_.get(_local2)).y = (_local4.y0 + (_arg1 * (_local4.y1 - _local4.y0)));
_local4.x = ((_local4.x0 + (_arg1 * (_local4.x1 - _local4.x0))) + 34);
_local4.scaleX = (_local4.scaleY = (_local4.s0 + (_arg1 * (_local4.s1 - _local4.s0))));
_local2--;
};
}
}
}//package com.midasplayer.africanrainmaker.anim
Section 2
//BallExplosionAnim (com.midasplayer.africanrainmaker.anim.BallExplosionAnim)
package com.midasplayer.africanrainmaker.anim {
import flash.display.*;
import com.midasplayer.util.*;
public class BallExplosionAnim extends Anim {
private var layer_:Sprite;// = null
private var explosionsClip_:MovieClip;// = null
private var isBig_:Boolean;// = false
private var tick_:Number;// = 0
private var maxFrames_:int;
private var startTime_:Number;
private var animSpeed_:Number;// = 1.1
public function BallExplosionAnim(_arg1:Sprite, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Number=0){
layer_ = _arg1;
isBig_ = _arg4;
startTime_ = _arg5;
if (isBig_){
explosionsClip_ = new cloud_expl_big();
maxFrames_ = 29;
} else {
explosionsClip_ = new cloud_expl();
maxFrames_ = 16;
};
explosionsClip_.x = _arg2;
explosionsClip_.y = _arg3;
explosionsClip_.gotoAndStop(1);
explosionsClip_.visible = false;
layer_.addChild(explosionsClip_);
super();
}
override public function end():void{
layer_.removeChild(explosionsClip_);
}
override public function tick(_arg1:Number):Boolean{
var _local2:int;
tick_ = _arg1;
_local2 = Math.floor(((tick_ * animSpeed_) - startTime_));
_local2++;
if (_local2 > maxFrames_){
return (true);
};
return (false);
}
override public function render(_arg1:Number):void{
var _local2:int;
_local2 = Math.floor((((tick_ + _arg1) * animSpeed_) - startTime_));
_local2++;
if (_local2 < 1){
} else {
if (_local2 <= maxFrames_){
explosionsClip_.visible = true;
explosionsClip_.gotoAndStop(_local2);
_local2 = (_local2 + 1);
} else {
explosionsClip_.visible = false;
};
};
}
}
}//package com.midasplayer.africanrainmaker.anim
Section 3
//BengalAnim (com.midasplayer.africanrainmaker.anim.BengalAnim)
package com.midasplayer.africanrainmaker.anim {
import flash.display.*;
import com.midasplayer.util.*;
public class BengalAnim extends Anim {
private var layer_:Sprite;// = null
private var bengalClip_:MovieClip;// = null
private var bengalSmokeClip_:MovieClip;// = null
private var tick_:Number;// = 0
private var y0:Number;
private var y1:Number;
private var v:Number;
public function BengalAnim(_arg1:Sprite, _arg2:Number, _arg3:Number){
layer_ = _arg1;
bengalClip_ = new bengal();
bengalSmokeClip_ = new bengal_smoke();
bengalClip_.x = _arg2;
bengalClip_.y = _arg3;
bengalSmokeClip_.x = _arg2;
bengalSmokeClip_.y = (_arg3 + 70);
y0 = (y1 = _arg3);
v = -35;
bengalClip_.gotoAndStop(1);
bengalSmokeClip_.gotoAndStop(1);
layer_.addChild(bengalClip_);
layer_.addChild(bengalSmokeClip_);
super();
}
override public function end():void{
layer_.removeChild(bengalClip_);
layer_.removeChild(bengalSmokeClip_);
}
public function getY():Number{
return (y0);
}
public function isDone():Boolean{
return ((y0 < -250));
}
override public function tick(_arg1:Number):Boolean{
tick_ = _arg1;
y0 = y1;
y1 = (y1 + (v * AnimPlayer.tickToPercent(_arg1, 0, 10)));
v = (v - 1);
return (isDone());
}
override public function render(_arg1:Number):void{
var _local2:int;
_local2 = Math.floor(((tick_ + _arg1) * 1));
if (_local2 <= 11){
_local2 = (_local2 + 1);
} else {
_local2 = ((_local2 - 12) % 18);
_local2 = (_local2 + 13);
};
bengalClip_.gotoAndStop(_local2);
bengalClip_.y = (y0 + ((y1 - y0) * _arg1));
_local2 = Math.floor(((tick_ + _arg1) * 0.8));
_local2 = (_local2 + 1);
if (_local2 <= 23){
bengalSmokeClip_.gotoAndStop(_local2);
} else {
bengalSmokeClip_.visible = false;
};
}
}
}//package com.midasplayer.africanrainmaker.anim
Section 4
//BoardIntroAnim (com.midasplayer.africanrainmaker.anim.BoardIntroAnim)
package com.midasplayer.africanrainmaker.anim {
import com.midasplayer.africanrainmaker.*;
import com.midasplayer.math.*;
import com.midasplayer.util.*;
public class BoardIntroAnim extends Anim {
private var game_:Game;
private var board_:Board;
private var random_:MtRandom;
private var balls_:Array;
private var cols_:int;
private var rows_:int;
private var centerX_:Number;
private var centerY_:Number;
private var rcenterX_:Number;
private var rcenterY_:Number;
private var tick_:Number;// = 0
private var numTicks_:Number;
private var angle_:Number;
private var allDone_:Boolean;// = false
public function BoardIntroAnim(_arg1:Game, _arg2:Board, _arg3:int){
game_ = _arg1;
board_ = _arg2;
random_ = new MtRandom(_arg3);
balls_ = board_.getBalls();
cols_ = board_.getMaxCols();
rows_ = board_.getNumInitialRows();
centerX_ = random_.nextInt(500);
centerY_ = random_.nextInt(500);
rcenterX_ = random_.nextInt(500);
rcenterY_ = random_.nextInt(200);
numTicks_ = 40;
angle_ = -1;
}
override public function end():void{
}
public function isDone():Boolean{
return (allDone_);
}
override public function tick(_arg1:Number):Boolean{
var _local2:int;
var _local3:int;
var _local4:Ball;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local11:Number;
var _local12:Number;
var _local10:Boolean;
_local3 = 0;
while (_local3 < rows_) {
_local2 = 0;
while (_local2 < cols_) {
_local4 = balls_[_local3][_local2];
if (_local4 != null){
_local4.x0 = _local4.x1;
_local4.y0 = _local4.y1;
_local5 = (_local4.col * Ball.WIDTH);
_local6 = (_local4.row * Ball.HEIGHT);
_local5 = (_local5 - rcenterX_);
_local6 = (_local6 - rcenterY_);
_local9 = ((tick_ - ((0.0002 * Math.abs(_local5)) * Math.abs(_local6))) / numTicks_);
if (_local9 < 0){
_local9 = 0;
};
if (_local9 > 1){
_local9 = 1;
};
if (_local9 < 1){
_local10 = false;
};
_local9 = AnimPlayer.easeOutBack(_local9, 0, 1, 1);
_local5 = (_local5 + rcenterX_);
_local6 = (_local6 + rcenterY_);
_local5 = (_local5 - centerX_);
_local6 = (_local6 - centerY_);
_local11 = ((angle_ + ((_local2 / cols_) - 0.5)) - ((_local3 / rows_) - 0.5));
_local12 = (((angle_ + ((_local2 / cols_) - 0.5)) - ((_local3 / rows_) - 0.5)) - (_local11 * _local9));
_local7 = ((Math.cos(_local12) * _local5) - (Math.sin(_local12) * _local6));
_local8 = ((Math.cos(_local12) * _local6) + (Math.sin(_local12) * _local5));
_local7 = (_local7 * (1 - (0.3 * (1 - (_local9 * 1)))));
_local8 = (_local8 * (1 - (0.3 * (1 - (_local9 * 1)))));
_local5 = (_local7 + centerX_);
_local6 = (_local8 + centerY_);
_local4.x1 = _local5;
_local4.y1 = _local6;
_local4.scaleX = (1 - (1 - (_local9 * 1)));
_local4.scaleY = (1 - (1 - (_local9 * 1)));
};
_local2++;
};
_local3++;
};
tick_++;
allDone_ = _local10;
if (allDone_){
game_.endBoardIntro();
};
return (allDone_);
}
override public function render(_arg1:Number):void{
var _local2:int;
var _local3:int;
var _local4:Ball;
_local3 = 0;
while (_local3 < rows_) {
_local2 = 0;
while (_local2 < cols_) {
_local4 = balls_[_local3][_local2];
if (_local4 != null){
_local4.x = (_local4.x0 + ((_local4.x1 - _local4.x0) * _arg1));
_local4.y = (_local4.y0 + ((_local4.y1 - _local4.y0) * _arg1));
_local4.clip.color.gotoAndStop((((_local4.fb + 12) + 20) - Math.ceil((20 * (_local4.f0 + ((_local4.f1 - _local4.f0) * _arg1))))));
if (tick_ > 2){
_local4.visible = true;
};
};
_local2++;
};
_local3++;
};
}
}
}//package com.midasplayer.africanrainmaker.anim
Section 5
//DrumBeatAnim (com.midasplayer.africanrainmaker.anim.DrumBeatAnim)
package com.midasplayer.africanrainmaker.anim {
import flash.display.*;
import com.midasplayer.util.*;
public class DrumBeatAnim extends Anim {
private var layer_:Sprite;// = null
private var clip_:MovieClip;// = null
private var tick_:Number;// = 0
private var maxFrames_:int;
public function DrumBeatAnim(_arg1:Sprite, _arg2:Number, _arg3:Number){
clip_ = new drum_beat();
clip_.x = _arg2;
clip_.y = _arg3;
layer_ = _arg1;
layer_.addChild(clip_);
maxFrames_ = 13;
clip_.gotoAndStop(1);
super();
}
override public function end():void{
layer_.removeChild(clip_);
}
override public function tick(_arg1:Number):Boolean{
tick_ = _arg1;
var _local2:int;
_local2 = Math.floor(((tick_ + 0) * 1));
_local2++;
if (_local2 >= (maxFrames_ + 2)){
return (true);
};
return (false);
}
override public function render(_arg1:Number):void{
var _local2:int;
_local2 = Math.floor(((tick_ + _arg1) * 1));
_local2++;
if (_local2 > maxFrames_){
_local2 = maxFrames_;
};
clip_.gotoAndStop(_local2);
}
}
}//package com.midasplayer.africanrainmaker.anim
Section 6
//DrumBrokenAnim (com.midasplayer.africanrainmaker.anim.DrumBrokenAnim)
package com.midasplayer.africanrainmaker.anim {
import flash.display.*;
import com.midasplayer.util.*;
public class DrumBrokenAnim extends Anim {
private var layer_:Sprite;// = null
private var explosionsClip_:MovieClip;// = null
private var tick_:Number;// = 0
private var maxFrames_:int;
private var startTime_:Number;// = 0
public function DrumBrokenAnim(_arg1:Sprite, _arg2:Number, _arg3:Number){
layer_ = _arg1;
explosionsClip_ = new drum_broken();
maxFrames_ = 28;
explosionsClip_.x = _arg2;
explosionsClip_.y = _arg3;
explosionsClip_.gotoAndStop(1);
explosionsClip_.visible = false;
layer_.addChild(explosionsClip_);
super();
}
override public function end():void{
layer_.removeChild(explosionsClip_);
}
override public function tick(_arg1:Number):Boolean{
var _local2:int;
tick_ = _arg1;
_local2 = Math.floor(((tick_ * 1) - startTime_));
_local2++;
if (_local2 > maxFrames_){
return (true);
};
return (false);
}
override public function render(_arg1:Number):void{
var _local2:int;
_local2 = Math.floor((((tick_ + _arg1) * 1) - startTime_));
_local2++;
if (_local2 < 1){
} else {
if (_local2 <= maxFrames_){
explosionsClip_.visible = true;
explosionsClip_.gotoAndStop(_local2);
_local2 = (_local2 + 1);
} else {
explosionsClip_.visible = false;
};
};
}
}
}//package com.midasplayer.africanrainmaker.anim
Section 7
//HideScorePanelAnim (com.midasplayer.africanrainmaker.anim.HideScorePanelAnim)
package com.midasplayer.africanrainmaker.anim {
import flash.display.*;
import com.midasplayer.util.*;
public class HideScorePanelAnim extends Anim {
private var layer_:Sprite;// = null
private var tick_:Number;// = 0
private var y0_:Number;
private var y1_:Number;
public function HideScorePanelAnim(_arg1:Sprite){
layer_ = _arg1;
y0_ = (y1_ = 0);
super();
}
override public function end():void{
}
override public function tick(_arg1:Number):Boolean{
var _local2:Number;
tick_ = _arg1;
y0_ = y1_;
_local2 = AnimPlayer.tickToPercent(tick_, 0, 20);
y1_ = (0 - (50 * AnimPlayer.easeInQuad(_local2, 0, 1, 1)));
return ((_local2 == 1));
}
override public function render(_arg1:Number):void{
layer_.y = (y0_ + (_arg1 * (y1_ - y0_)));
}
}
}//package com.midasplayer.africanrainmaker.anim
Section 8
//IntroAnim (com.midasplayer.africanrainmaker.anim.IntroAnim)
package com.midasplayer.africanrainmaker.anim {
import flash.events.*;
import com.midasplayer.africanrainmaker.*;
import flash.display.*;
import com.midasplayer.util.*;
public class IntroAnim extends Anim implements CannonListener, BoardListener {
private var game_:Game;// = null
private var layer_:Sprite;// = null
private var bgClip_:Sprite;// = null
private var logoClip_:Sprite;// = null
private var frameClip_:MovieClip;// = null
private var logoY0_:Number;
private var logoY1_:Number;
private var frameX0_:Number;
private var frameX1_:Number;
private var tick_:Number;// = 0
private var stopped_:Boolean;// = false
private var stoppedTick_:Number;// = 0
private var cannon_:Cannon;
private var board_:Board;
private var ball_:Ball;
private var bengalClip_:MovieClip;
public function IntroAnim(_arg1:Game, _arg2:Sprite){
game_ = _arg1;
layer_ = _arg2;
bgClip_ = new intro();
layer_.addChild(bgClip_);
logoClip_ = new logo();
logoClip_.y = (0 - 300);
logoY0_ = logoClip_.y;
logoY1_ = logoClip_.y;
bgClip_.addChild(logoClip_);
frameClip_ = new introframe();
frameClip_.y = 8;
frameClip_.x = (375 + 400);
frameX0_ = frameClip_.x;
frameX1_ = frameClip_.x;
bgClip_.addChild(frameClip_);
bgClip_.buttonMode = true;
bgClip_.mouseChildren = false;
bgClip_.addEventListener(MouseEvent.CLICK, onClicked);
board_ = new Board(this, 10, 3, 5, 4, 2, 280, true);
board_.y = 240;
board_.x = 34;
frameClip_.addChild(board_);
cannon_ = new Cannon(this);
cannon_.y = (cannon_.y0 = (cannon_.y1 = 420));
cannon_.x = (cannon_.x0 = (cannon_.x1 = 80));
cannon_.moveTo(80);
frameClip_.addChild(cannon_);
frameClip_.header_txt.text = game_.getGameData().getText("instructions");
frameClip_.starts_in_txt.text = game_.getGameData().getText("game_starts", 40);
frameClip_.main_txt.text = game_.getGameData().getText("instructions1");
frameClip_.side_1_txt.text = "";
frameClip_.side_2_txt.text = "";
ball_ = new Ball(1);
ball_.x = 60;
ball_.y = 240;
ball_.setIsLineBlast();
ball_.alpha = 0;
frameClip_.addChild(ball_);
bengalClip_ = new bengal();
bengalClip_.gotoAndStop(13);
bengalClip_.scaleX = (bengalClip_.scaleY = 0.5);
bengalClip_.x = 90;
bengalClip_.y = 320;
bengalClip_.alpha = 0;
frameClip_.addChild(bengalClip_);
super();
}
override public function end():void{
layer_.removeChild(bgClip_);
}
public function onClicked(_arg1:MouseEvent):void{
_arg1.stopPropagation();
stop();
}
public function stop():void{
stopped_ = true;
}
public function cannonReleasedBall(_arg1:Ball, _arg2:Number):void{
board_.releaseBall(_arg1, (cannon_.x0 - board_.x), (cannon_.y0 - board_.y), (_arg2 - board_.x));
}
public function drumCreated():void{
}
public function activateDrumMode():void{
}
public function generateLineBlast():void{
}
public function ripple(_arg1:Number, _arg2:Number):void{
}
public function drumHit():void{
}
public function drumActivated(_arg1:Drum):void{
}
public function drumWrecked(_arg1:Drum):void{
}
public function addScore(_arg1:int, _arg2:Number, _arg3:Number, _arg4:int=0, _arg5:int=0, _arg6:int=0, _arg7:int=0):void{
}
public function boardFull():void{
}
public function endGame():void{
}
public function combo(_arg1:int):void{
}
public function ballRemoved(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Number):void{
}
public function bengalFire(_arg1:Number, _arg2:Number):BengalAnim{
return (null);
}
public function lineBlast(_arg1:Number, _arg2:Number):LineBlastAnim{
return (null);
}
override public function tick(_arg1:Number):Boolean{
var _local2:Number;
var _local4:Number;
var _local3:Boolean;
tick_ = _arg1;
logoY0_ = logoY1_;
frameX0_ = frameX1_;
if (stoppedTick_ == 0){
_local2 = AnimPlayer.tickToPercent(_arg1, 0, 25);
logoY1_ = ((0 - 300) + (300 * AnimPlayer.easeOutQuad(_local2, 0, 1, 1)));
_local2 = AnimPlayer.tickToPercent(_arg1, 10, 25);
frameX1_ = ((375 + 400) - (400 * AnimPlayer.easeOutQuad(_local2, 0, 1, 1)));
};
if (((((stopped_) && ((tick_ > 35)))) && ((stoppedTick_ == 0)))){
stoppedTick_ = tick_;
game_.endIntro();
};
if (stoppedTick_ > 0){
_local2 = AnimPlayer.tickToPercent(_arg1, (stoppedTick_ + 5), 15);
bgClip_.alpha = (1 - _local2);
_local2 = AnimPlayer.tickToPercent(_arg1, stoppedTick_, 25);
logoY1_ = (0 - (300 * AnimPlayer.easeInQuad(_local2, 0, 1, 1)));
_local2 = AnimPlayer.tickToPercent(_arg1, stoppedTick_, 15);
frameX1_ = (375 + (400 * AnimPlayer.easeInQuad(_local2, 0, 1, 1)));
if (tick_ >= (stoppedTick_ + 30)){
_local3 = true;
};
};
while (!(cannon_.isFull())) {
cannon_.addBall(board_.getNextCannonBall());
};
cannon_.x0 = cannon_.x1;
cannon_.y0 = cannon_.y1;
board_.tick();
cannon_.tick(tick_);
if (_arg1 == 2){
board_.showBalls();
};
_local4 = AnimPlayer.tickToPercent(_arg1, 60, 30);
if ((((_local4 > 0)) && ((_local4 <= 1)))){
cannon_.moveTo((80 + (_local4 * 80)));
};
if (_arg1 == 100){
cannon_.releaseBall();
};
if (_arg1 == 150){
cannon_.releaseBall();
};
_local4 = AnimPlayer.tickToPercent(_arg1, 180, 20);
if ((((_local4 > 0)) && ((_local4 <= 1)))){
cannon_.moveTo((160 + (_local4 * 100)));
};
if (_arg1 == 250){
cannon_.releaseBall();
};
_local4 = AnimPlayer.tickToPercent(_arg1, 260, 50);
if ((((_local4 > 0)) && ((_local4 <= 1)))){
cannon_.moveTo((260 - (_local4 * 160)));
};
if (_arg1 == 320){
cannon_.releaseBall();
};
_local4 = AnimPlayer.tickToPercent(_arg1, 330, 30);
if ((((_local4 > 0)) && ((_local4 <= 1)))){
cannon_.moveTo((100 + (_local4 * 160)));
};
if (_arg1 == 380){
cannon_.releaseBall();
};
if (_arg1 == 380){
frameClip_.main_txt.text = game_.getGameData().getText("instructions2");
};
_local4 = AnimPlayer.tickToPercent(_arg1, 390, 20);
if ((((_local4 > 0)) && ((_local4 <= 1)))){
cannon_.moveTo((260 - (_local4 * 50)));
};
if (_arg1 == 420){
cannon_.releaseBall();
};
_local4 = AnimPlayer.tickToPercent(_arg1, 430, 25);
if ((((_local4 > 0)) && ((_local4 <= 1)))){
cannon_.moveTo((210 - (_local4 * 110)));
};
if (_arg1 == 450){
cannon_.releaseBall();
};
_local4 = AnimPlayer.tickToPercent(_arg1, 450, 25);
if ((((_local4 > 0)) && ((_local4 <= 1)))){
cannon_.moveTo((100 + (_local4 * 80)));
};
if (_arg1 >= 620){
frameClip_.main_txt.text = game_.getGameData().getText("instructions3");
frameClip_.side_1_txt.text = game_.getGameData().getText("instructions3_1");
frameClip_.side_2_txt.text = game_.getGameData().getText("instructions3_2");
};
if (_arg1 >= 600){
_local4 = AnimPlayer.tickToPercent(_arg1, 600, 20);
board_.alpha = (1 - _local4);
cannon_.alpha = (1 - _local4);
ball_.alpha = _local4;
bengalClip_.alpha = _local4;
};
ball_.lineblastClip.gotoAndStop(((tick_ % 15) + 1));
var _local5:int = Math.floor((tick_ * 1));
if (_local5 <= 11){
_local5 = (_local5 + 1);
} else {
_local5 = ((_local5 - 12) % 18);
_local5 = (_local5 + 13);
};
bengalClip_.gotoAndStop(_local5);
var _local6:int = (41 - (tick_ / 30));
if (_local6 <= 0){
stop();
};
if (_local6 > 40){
_local6 = 40;
};
if (_local6 <= 1){
frameClip_.starts_in_txt.text = game_.getGameData().getText("game_starts_1sec", _local6);
} else {
frameClip_.starts_in_txt.text = game_.getGameData().getText("game_starts", _local6);
};
return (_local3);
}
override public function render(_arg1:Number):void{
logoClip_.y = (logoY0_ + (_arg1 * (logoY1_ - logoY0_)));
frameClip_.x = (frameX0_ + (_arg1 * (frameX1_ - frameX0_)));
cannon_.x = (cannon_.x0 + (_arg1 * (cannon_.x1 - cannon_.x0)));
board_.render(tick_, _arg1);
cannon_.render(tick_, _arg1);
}
}
}//package com.midasplayer.africanrainmaker.anim
Section 9
//LineBlastAnim (com.midasplayer.africanrainmaker.anim.LineBlastAnim)
package com.midasplayer.africanrainmaker.anim {
import flash.display.*;
import com.midasplayer.util.*;
public class LineBlastAnim extends Anim {
private var layer_:Sprite;// = null
private var blastClip_:MovieClip;// = null
private var tick_:Number;// = 0
private var x0:Number;
private var x1:Number;
private var sx:Number;
private var v:Number;
public function LineBlastAnim(_arg1:Sprite, _arg2:Number, _arg3:Number, _arg4:Boolean){
layer_ = _arg1;
blastClip_ = new lineblast();
blastClip_.x = _arg2;
blastClip_.y = _arg3;
x0 = (x1 = _arg2);
sx = _arg2;
v = (_arg4) ? -15 : 15;
blastClip_.gotoAndStop(1);
layer_.addChild(blastClip_);
if (!_arg4){
blastClip_.rotation = 180;
};
super();
}
override public function end():void{
layer_.removeChild(blastClip_);
}
public function getX():Number{
return (x0);
}
public function getDX():Number{
return (Math.abs((x0 - sx)));
}
public function isDone():Boolean{
return ((getDX() > 800));
}
override public function tick(_arg1:Number):Boolean{
tick_ = _arg1;
x0 = x1;
x1 = (x1 + (v * AnimPlayer.tickToPercent(_arg1, 0, 10)));
v = (v + ((v < 0)) ? -2 : 2);
return (isDone());
}
override public function render(_arg1:Number):void{
var _local2:int;
_local2 = Math.floor(((tick_ + _arg1) * 1));
if (_local2 <= 14){
_local2 = (_local2 + 1);
} else {
_local2 = ((_local2 - 14) % 30);
_local2 = (_local2 + 15);
};
blastClip_.gotoAndStop(_local2);
blastClip_.x = (x0 + ((x1 - x0) * _arg1));
}
}
}//package com.midasplayer.africanrainmaker.anim
Section 10
//OutroGoodAnim (com.midasplayer.africanrainmaker.anim.OutroGoodAnim)
package com.midasplayer.africanrainmaker.anim {
import com.midasplayer.africanrainmaker.*;
import flash.display.*;
import com.midasplayer.util.*;
public class OutroGoodAnim extends Anim {
private var game_:Game;
private var layer_:Sprite;// = null
private var bg_:Sprite;// = null
private var fg1_:Sprite;// = null
private var fg2_:Sprite;// = null
private var gameOverClip_:Sprite;// = null
private var trophies_:Array;
private var gameOverClipX1_:Number;
private var gameOverClipX2_:Number;
private var gameOverClipY1_:Number;
private var gameOverClipY2_:Number;
private var textClip_:MovieClip;
private var animPlayer_:AnimPlayer;
private var tick_:Number;// = 0
public function OutroGoodAnim(_arg1:Game, _arg2:Sprite, _arg3:Sprite, _arg4:Sprite){
trophies_ = new Array();
game_ = _arg1;
layer_ = _arg3;
gameOverClip_ = _arg4;
animPlayer_ = new AnimPlayer();
bg_ = new outro_good_bg();
fg1_ = new outro_good_fg1();
fg2_ = new outro_good_fg2();
bg_.alpha = 0;
fg1_.alpha = 0;
fg2_.alpha = 0;
gameOverClipX1_ = gameOverClip_.x;
gameOverClipX2_ = 120;
gameOverClipY1_ = gameOverClip_.y;
gameOverClipY2_ = 9;
initTrophies();
_arg2.addChild(bg_);
layer_.addChild(fg1_);
layer_.addChild(fg2_);
super();
}
public function initTrophies():void{
var _local1:Trophy;
var _local2:int = (30 * 4);
_local1 = new Trophy(fg1_, Trophy.TYPE_ELEPHANT, 462, 314, 440, 346, game_.getGameData().getText("trophy_elephant"), fg2_);
_local1.show = ((game_.hasElephantTrophy) || (game_.gotElephantTrophy));
_local1.isNew = ((game_.gotElephantTrophy) && (!(game_.hasElephantTrophy)));
_local1.showStart = (_local1.isNew) ? _local2 : 0;
_local1.x2 = 427;
_local1.y2 = 348;
_local1.isAnim = true;
trophies_.push(_local1);
_local2 = (_local2 + (_local1.isNew) ? 30 : 0);
_local1 = new Trophy(fg2_, Trophy.TYPE_GIRAFFE, 350, 319, 380, 470, game_.getGameData().getText("trophy_giraffe"), fg2_);
_local1.show = ((game_.hasGiraffeTrophy) || (game_.gotGiraffeTrophy));
_local1.isNew = ((game_.gotGiraffeTrophy) && (!(game_.hasGiraffeTrophy)));
_local1.showStart = (_local1.isNew) ? _local2 : 0;
trophies_.push(_local1);
_local2 = (_local2 + (_local1.isNew) ? 30 : 0);
_local1 = new Trophy(fg1_, Trophy.TYPE_LEOPARD, 541, 160, 560, 180, game_.getGameData().getText("trophy_leopard"), fg2_);
_local1.show = ((game_.hasLeopardTrophy) || (game_.gotLeopardTrophy));
_local1.isNew = ((game_.gotLeopardTrophy) && (!(game_.hasLeopardTrophy)));
_local1.showStart = (_local1.isNew) ? _local2 : 0;
trophies_.push(_local1);
_local2 = (_local2 + (_local1.isNew) ? 30 : 0);
_local1 = new Trophy(fg2_, Trophy.TYPE_RHINO, 0, 441, 27, 471, game_.getGameData().getText("trophy_rhino"), fg2_);
_local1.show = ((game_.hasRhinoTrophy) || (game_.gotRhinoTrophy));
_local1.isNew = ((game_.gotRhinoTrophy) && (!(game_.hasRhinoTrophy)));
_local1.showStart = (_local1.isNew) ? _local2 : 0;
trophies_.push(_local1);
_local2 = (_local2 + (_local1.isNew) ? 30 : 0);
_local1 = new Trophy(fg2_, Trophy.TYPE_LION, 181, 425, 210, 452, game_.getGameData().getText("trophy_lion"), fg2_);
_local1.show = ((game_.hasLionTrophy) || (game_.gotLionTrophy));
_local1.isNew = ((game_.gotLionTrophy) && (!(game_.hasLionTrophy)));
_local1.showStart = (_local1.isNew) ? _local2 : 0;
trophies_.push(_local1);
_local2 = (_local2 + (_local1.isNew) ? 30 : 0);
_local1 = new Trophy(fg2_, Trophy.TYPE_MONKEY, 522, 454, 540, 454, game_.getGameData().getText("trophy_monkey"), fg2_);
_local1.show = ((game_.hasMonkeyTrophy) || (game_.gotMonkeyTrophy));
_local1.isNew = ((game_.gotMonkeyTrophy) && (!(game_.hasMonkeyTrophy)));
_local1.showStart = (_local1.isNew) ? _local2 : 0;
trophies_.push(_local1);
_local2 = (_local2 + (_local1.isNew) ? 30 : 0);
}
override public function end():void{
}
override public function tick(_arg1:Number):Boolean{
var _local2:QuestionCloudAnim;
var _local3:Trophy;
tick_ = _arg1;
animPlayer_.tick(_arg1);
bg_.alpha = AnimPlayer.tickToPercent(_arg1, 0, (30 * 2));
fg1_.alpha = AnimPlayer.tickToPercent(_arg1, 0, (30 * 2));
fg2_.alpha = AnimPlayer.tickToPercent(_arg1, 0, (30 * 2));
var _local4:int;
while (_local4 < trophies_.length) {
_local3 = trophies_[_local4];
if (_local3.show){
if (((_local3.isNew) && ((_arg1 == 0)))){
_local2 = new QuestionCloudAnim(game_, _local3);
_local2.explode(_local3.showStart);
animPlayer_.addAnim(_local2);
};
if (_local3.clip2.overMask.hitTestPoint(layer_.mouseX, layer_.mouseY, true)){
_local3.onMouseOver(null);
} else {
_local3.onMouseOut(null);
};
} else {
if (_arg1 == 0){
_local2 = new QuestionCloudAnim(game_, _local3);
animPlayer_.addAnim(_local2);
};
};
if (((_local3.textOver) && ((_local3.textOverTick < 10)))){
_local3.textOverTick = (_local3.textOverTick + 1);
};
if (((!(_local3.textOver)) && ((_local3.textOverTick > 0)))){
_local3.textOverTick--;
};
if (_local3.textOverTick > 0){
_local3.textClip.visible = true;
_local3.textClip.alpha = (_local3.textOverTick / 10);
} else {
_local3.textClip.visible = false;
};
_local4++;
};
return (false);
}
override public function render(_arg1:Number):void{
var _local2:Number;
var _local3:Trophy;
animPlayer_.render(tick_, _arg1);
var _local4:int;
while (_local4 < trophies_.length) {
_local3 = trophies_[_local4];
if (_local3.show){
_local2 = AnimPlayer.tickToPercent((tick_ + _arg1), _local3.showStart, 20);
_local3.clip.alpha = _local2;
if (_local3.isAnim){
_local2 = AnimPlayer.tickToPercent((tick_ + _arg1), (_local3.showStart + 40), 90);
_local3.clip.x = ((_local2 * (_local3.x2 - _local3.x1)) + _local3.x1);
_local3.clip.y = ((_local2 * (_local3.y2 - _local3.y1)) + _local3.y1);
_local3.clip2.x = _local3.clip.x;
_local3.clip2.y = _local3.clip.y;
if (_local2 <= 0){
_local3.clip.gotoAndStop(1);
} else {
if (_local2 >= 1){
_local3.clip.gotoAndStop(37);
} else {
if (_local2 >= 0.9){
_local2 = ((_local2 - 0.9) * 10);
_local3.clip.gotoAndStop((Math.round((_local2 * 5)) + 32));
} else {
_local2 = (_local2 / 0.9);
_local2 = ((Math.round((62 * _local2)) % 31) + 1);
_local3.clip.gotoAndStop(_local2);
};
};
};
};
};
_local4++;
};
_local2 = AnimPlayer.tickToPercent((tick_ + _arg1), 0, 40);
_local2 = AnimPlayer.easeInOutQuad(_local2, 0, 1, 1);
gameOverClip_.x = (gameOverClipX1_ + (_local2 * (gameOverClipX2_ - gameOverClipX1_)));
gameOverClip_.y = (gameOverClipY1_ + (_local2 * (gameOverClipY2_ - gameOverClipY1_)));
}
public function renderTrophies():void{
}
}
}//package com.midasplayer.africanrainmaker.anim
Section 11
//QuestionCloudAnim (com.midasplayer.africanrainmaker.anim.QuestionCloudAnim)
package com.midasplayer.africanrainmaker.anim {
import flash.events.*;
import com.midasplayer.africanrainmaker.*;
import flash.display.*;
import com.midasplayer.util.*;
import flash.filters.*;
public class QuestionCloudAnim extends Anim {
private var game_:Game;
private var trophy_:Trophy;
private var layer_:Sprite;
private var clip_:MovieClip;
private var tick_:int;
private var frames_:int;// = 16
private var yS:Number;
private var y0:Number;
private var y1:Number;
private var rot1p:Number;// = 0
private var rot1v:Number;// = 0
private var rot2p:Number;// = 0
private var rot2v:Number;// = 0
private var textOverTick_:int;// = 0
private var textOver_:Boolean;// = false
private var explode_:Boolean;// = false
private var explodeStart_:int;// = 0
private var animPlayer_:AnimPlayer;// = null
private var filter_:GlowFilter;// = null
public function QuestionCloudAnim(_arg1:Game, _arg2:Trophy){
game_ = _arg1;
trophy_ = _arg2;
layer_ = _arg2.layer;
clip_ = _arg2.questionClip;
clip_.visible = false;
yS = (y0 = (y1 = _arg2.questionClip.y));
animPlayer_ = new AnimPlayer();
rot1p = (Math.random() * 100);
rot2p = (Math.random() * 100);
rot1v = ((Math.random() * 0.01) + 0.005);
rot2v = ((Math.random() * 0.01) + 0.005);
filter_ = new GlowFilter(0xFFFFFF, 1, 18, 18, 1.5, 2, false, false);
}
override public function end():void{
}
public function explode(_arg1:int):void{
explode_ = true;
explodeStart_ = _arg1;
animPlayer_.addAnim(new BallExplosionAnim(layer_, (clip_.x + (clip_.width / 2)), (clip_.y + (clip_.height / 2)), true, explodeStart_));
}
public function onMouseOver(_arg1:MouseEvent):void{
clip_.filters = [filter_];
trophy_.onMouseOver(_arg1);
}
public function onMouseOut(_arg1:MouseEvent):void{
trophy_.onMouseOut(_arg1);
clip_.filters = [];
}
override public function tick(_arg1:Number):Boolean{
var _local3:Number;
tick_ = _arg1;
animPlayer_.tick(tick_);
if (clip_.hitTestPoint(layer_.mouseX, layer_.mouseY)){
onMouseOver(null);
} else {
onMouseOut(null);
};
rot2p = (rot2p + (0.1 * Math.sin(rot1p)));
rot1p = (rot1p + (0.2 * rot1v));
rot2p = (rot2p + (0.2 * rot2v));
var _local2:Number = Math.sin((rot2p * 0.5));
_local2 = (_local2 * _local2);
_local2 = Math.round(((15 * _local2) + 1));
y0 = y1;
y1 = (yS - (((10 * Math.sin((rot1p * 0.5))) * Math.sin((rot2p * 0.5))) * Math.sin((rot2p * 0.5))));
clip_.gotoAndStop(_local2);
if (_arg1 == 0){
clip_.visible = true;
};
if (explode_){
_local3 = AnimPlayer.tickToPercent(_arg1, explodeStart_, 10);
clip_.alpha = (1 - _local3);
if (tick_ == (explodeStart_ - 15)){
game_.trophyUnlocked();
};
if ((((tick_ >= (explodeStart_ - 30))) && ((tick_ <= ((explodeStart_ - 30) + 121))))){
_local3 = AnimPlayer.tickToPercent(_arg1, (explodeStart_ - 30), 120);
_local3 = AnimPlayer.easeInCubic(_local3, 0, 1, 1);
trophy_.textOver = true;
trophy_.textOverTick = (10 - (_local3 * 11));
};
};
return (false);
}
override public function render(_arg1:Number):void{
animPlayer_.render(tick_, _arg1);
clip_.y = (y0 + (_arg1 * (y1 - y0)));
}
}
}//package com.midasplayer.africanrainmaker.anim
Section 12
//ScorePopAnim (com.midasplayer.africanrainmaker.anim.ScorePopAnim)
package com.midasplayer.africanrainmaker.anim {
import flash.display.*;
import com.midasplayer.util.*;
public class ScorePopAnim extends Anim {
private var tick_:Number;// = 0
private var layer_:Sprite;// = null
private var clip_:Sprite;// = null
private var clips_:Array;// = null
private var score_:int;
private var x_:Number;
private var y_:Number;
private var y0_:Number;
private var y1_:Number;
private var dy_:Number;
private var numTicks_:Number;
private static var numbersWidth:Array = [[19, 13, 21, 18, 19, 17, 17, 16, 18, 20, 21, 21], [22, 15, 25, 21, 23, 20, 20, 18, 21, 23, 25, 25], [28, 19, 31, 27, 29, 26, 26, 23, 28, 30, 33, 33], [35, 24, 39, 34, 35, 32, 32, 29, 34, 37, 18, 38]];
public function ScorePopAnim(_arg1:Sprite, _arg2:int, _arg3:Number, _arg4:Number){
layer_ = _arg1;
score_ = _arg2;
x_ = _arg3;
y_ = (_arg4 + 10);
y0_ = (y1_ = y_);
var _local5:Number = (40 + ((_arg3 * _arg4) % 20));
dy_ = ((y_ < _local5)) ? y_ : _local5;
numTicks_ = (25 + (((_arg3 * _arg4) + _arg2) % 5));
init();
layer_.addChild(clip_);
super();
}
public function init():void{
var _local3:int;
var _local4:MovieClip;
var _local7:int;
clip_ = new Sprite();
clips_ = new Array();
var _local1:int = score_;
var _local2:int;
if (score_ <= 0){
return;
};
var _local5:int = (Math.floor((Math.log(score_) * Math.LOG10E)) + 1);
var _local6:int;
if (_local5 <= 3){
_local6 = 0;
} else {
if (_local5 <= 4){
_local6 = 1;
} else {
if (_local5 <= 5){
_local6 = 2;
} else {
_local6 = 3;
};
};
};
_local3 = 0;
while (_local3 < _local5) {
_local7 = (_local1 % 10);
if (_local6 == 0){
_local4 = new numbers50();
};
if (_local6 == 1){
_local4 = new numbers60();
};
if (_local6 == 2){
_local4 = new numbers80();
};
if (_local6 == 3){
_local4 = new numbers();
};
_local4.gotoAndStop((_local7 + 1));
_local2 = (_local2 - numbersWidth[_local6][_local7]);
_local4.x = _local2;
_local4.y = 0;
_local1 = (_local1 / 10);
clips_.push(_local4);
clip_.addChild(_local4);
_local3++;
};
_local3 = 0;
while (_local3 < clips_.length) {
_local4 = MovieClip(clips_[_local3]);
MovieClip(clips_[_local3]).x = (_local4.x + (-(_local2) / 2));
_local3++;
};
clip_.x = x_;
clip_.y = y_;
numTicks_ = (numTicks_ + (_local6 * 2));
}
override public function end():void{
layer_.removeChild(clip_);
}
override public function tick(_arg1:Number):Boolean{
var _local2:Number;
var _local3:Number;
tick_ = _arg1;
y0_ = y1_;
_local2 = AnimPlayer.tickToPercent(tick_, 0, numTicks_);
y1_ = (y_ - (dy_ * AnimPlayer.easeOutQuad(_local2, 0, 1, 1)));
_local3 = (1 - AnimPlayer.tickToPercent(tick_, (numTicks_ - 4), 4));
if (_local3 < 1){
clip_.alpha = _local3;
};
return ((_local2 == 1));
}
override public function render(_arg1:Number):void{
clip_.y = (y0_ + (_arg1 * (y1_ - y0_)));
}
}
}//package com.midasplayer.africanrainmaker.anim
Section 13
//ShowScorePanelAnim (com.midasplayer.africanrainmaker.anim.ShowScorePanelAnim)
package com.midasplayer.africanrainmaker.anim {
import flash.display.*;
import com.midasplayer.util.*;
public class ShowScorePanelAnim extends Anim {
private var layer_:Sprite;// = null
private var tick_:Number;// = 0
private var y0_:Number;
private var y1_:Number;
public function ShowScorePanelAnim(_arg1:Sprite){
layer_ = _arg1;
y0_ = (y1_ = -50);
layer_.y = y0_;
layer_.visible = true;
super();
}
override public function end():void{
}
override public function tick(_arg1:Number):Boolean{
var _local2:Number;
tick_ = _arg1;
y0_ = y1_;
_local2 = AnimPlayer.tickToPercent(tick_, 0, 20);
y1_ = (-50 + (50 * AnimPlayer.easeOutQuad(_local2, 0, 1, 1)));
return ((_local2 == 1));
}
override public function render(_arg1:Number):void{
layer_.y = (y0_ + (_arg1 * (y1_ - y0_)));
}
}
}//package com.midasplayer.africanrainmaker.anim
Section 14
//UpdateScorePanelAnim (com.midasplayer.africanrainmaker.anim.UpdateScorePanelAnim)
package com.midasplayer.africanrainmaker.anim {
import com.midasplayer.africanrainmaker.*;
import flash.display.*;
import com.midasplayer.util.*;
public class UpdateScorePanelAnim extends Anim {
private var game_:Game;// = null
private var layer_:Sprite;// = null
private var tick_:Number;// = 0
private var y0_:Number;
private var y1_:Number;
private var scoreNumbers_:Array;
private var timeNumbers_:Array;
private var multiplierNumbers_:Array;
private static var guiNumbersWidth:Array = [23, 16, 25, 22, 22, 20, 21, 19, 22, 24, 12, 24];
public function UpdateScorePanelAnim(_arg1:Game, _arg2:Sprite){
var _local3:int;
var _local4:MovieClip;
game_ = _arg1;
layer_ = _arg2;
scoreNumbers_ = new Array();
_local3 = 0;
while (_local3 < 10) {
_local4 = new gui_numbers();
_local4.y = -50;
scoreNumbers_.push(_local4);
layer_.addChild(_local4);
_local3++;
};
timeNumbers_ = new Array();
_local3 = 0;
while (_local3 < 5) {
_local4 = new gui_numbers();
_local4.y = -50;
timeNumbers_.push(_local4);
layer_.addChild(_local4);
_local3++;
};
multiplierNumbers_ = new Array();
_local3 = 0;
while (_local3 < 4) {
_local4 = new gui_numbers();
_local4.y = -50;
multiplierNumbers_.push(_local4);
layer_.addChild(_local4);
_local3++;
};
super();
}
override public function end():void{
}
override public function tick(_arg1:Number):Boolean{
var _local2:Number;
tick_ = _arg1;
y0_ = y1_;
return ((_local2 == 1));
}
override public function render(_arg1:Number):void{
renderScore();
renderTime();
renderMultiplier();
}
public function renderScore():void{
var _local3:int;
var _local4:MovieClip;
var _local5:int;
var _local1:int = game_.getScore();
var _local2:int;
_local3 = 0;
while (_local3 < 10) {
_local5 = (_local1 % 10);
_local4 = MovieClip(scoreNumbers_[_local3]);
_local4.gotoAndStop((_local5 + 1));
if ((((_local3 > 0)) && ((_local1 == 0)))){
_local4.y = -50;
} else {
_local2 = (_local2 - guiNumbersWidth[_local5]);
_local4.x = _local2;
_local4.y = 0;
_local1 = (_local1 / 10);
};
_local3++;
};
_local3 = 0;
while (_local3 < 10) {
_local4 = MovieClip(scoreNumbers_[_local3]);
MovieClip(scoreNumbers_[_local3]).x = (_local4.x + (-(_local2) + 20));
_local3++;
};
}
public function renderTime():void{
var _local1:int;
var _local2:MovieClip;
var _local7:int;
var _local3:Number = 640;
var _local4:Number = game_.getClock().getTimeLeft();
_local4 = Math.ceil((_local4 / 30));
var _local5:int = (_local4 % 60);
var _local6:int = Math.floor((_local4 / 60));
_local7 = ((_local6 <= 9)) ? 0 : (_local6 / 10);
_local2 = MovieClip(timeNumbers_[0]);
_local2.gotoAndStop((_local7 + 1));
_local2.x = _local3;
_local2.y = 0;
_local3 = (_local3 + guiNumbersWidth[_local7]);
_local7 = (_local6 % 10);
_local2 = MovieClip(timeNumbers_[1]);
_local2.gotoAndStop((_local7 + 1));
_local2.x = _local3;
_local2.y = 0;
_local3 = (_local3 + guiNumbersWidth[_local7]);
_local7 = 10;
_local2 = MovieClip(timeNumbers_[2]);
_local2.gotoAndStop((_local7 + 1));
_local2.x = _local3;
_local2.y = 0;
_local3 = (_local3 + guiNumbersWidth[_local7]);
_local7 = ((_local5 <= 9)) ? 0 : (_local5 / 10);
_local2 = MovieClip(timeNumbers_[3]);
_local2.gotoAndStop((_local7 + 1));
_local2.x = _local3;
_local2.y = 0;
_local3 = (_local3 + guiNumbersWidth[_local7]);
_local7 = (_local5 % 10);
_local2 = MovieClip(timeNumbers_[4]);
_local2.gotoAndStop((_local7 + 1));
_local2.x = _local3;
_local2.y = 0;
_local3 = (_local3 + guiNumbersWidth[_local7]);
}
public function renderMultiplier():void{
var _local3:int;
var _local4:MovieClip;
var _local5:int;
var _local1:int = game_.getMultiplier();
var _local2:int;
_local3 = 0;
while (_local3 < 3) {
_local5 = (_local1 % 10);
_local4 = MovieClip(multiplierNumbers_[_local3]);
_local4.gotoAndStop((_local5 + 1));
if ((((_local3 > 0)) && ((_local1 == 0)))){
_local4.y = -50;
} else {
_local2 = (_local2 - guiNumbersWidth[_local5]);
_local4.x = _local2;
_local4.y = 0;
_local1 = (_local1 / 10);
};
_local3++;
};
_local3 = 0;
while (_local3 < 3) {
_local4 = MovieClip(multiplierNumbers_[_local3]);
MovieClip(multiplierNumbers_[_local3]).x = (_local4.x + (-(_local2) + (755 / 2)));
_local3++;
};
_local4 = MovieClip(multiplierNumbers_[3]);
_local4.gotoAndStop(12);
_local4.x = ((0 - guiNumbersWidth[11]) + (755 / 2));
_local4.y = 0;
}
}
}//package com.midasplayer.africanrainmaker.anim
Section 15
//Aim (com.midasplayer.africanrainmaker.Aim)
package com.midasplayer.africanrainmaker {
import flash.display.*;
public class Aim extends Sprite {
private var startY_:Number;
public var y0:Number;
public var y1:Number;
public var x0:Number;
public var x1:Number;
public var v:Number;
public var clip:Sprite;
public var targetAlpha:Number;
public var s0:Number;
public var s1:Number;
public function Aim(_arg1:Number){
startY_ = _arg1;
addChild(new aim());
this.mouseChildren = false;
this.mouseEnabled = false;
this.visible = false;
}
public function reset():void{
y0 = startY_;
y1 = startY_;
v = -1.6;
targetAlpha = 0.6;
s0 = (s1 = 0.2);
this.scaleX = (this.scaleY = s0);
this.visible = true;
this.alpha = 0;
x0 = 0;
x1 = 0;
}
}
}//package com.midasplayer.africanrainmaker
Section 16
//Ball (com.midasplayer.africanrainmaker.Ball)
package com.midasplayer.africanrainmaker {
import flash.display.*;
public class Ball extends Sprite {
public var x0:Number;
public var x1:Number;
public var y0:Number;
public var y1:Number;
public var vx:Number;// = 0
public var vy:Number;// = 0
public var ax:Number;// = 0
public var ay:Number;// = 0
public var col:Number;// = 0
public var row:Number;// = 0
public var isMoving:Boolean;// = false
public var hasMoved:Boolean;// = false
public var ticksToRemoval_:int;// = -1
public var markId:int;// = 0
public var squareMarked:Boolean;// = false
public var color:int;// = 0
public var releaseX:Number;// = 0
public var releaseY:Number;// = 0
private var markedForColorCombo_:Boolean;// = false
private var markedForColumnCombo_:Boolean;// = false
private var lineBlast_:Boolean;// = false
public var bounceTick:int;// = 0
public var falling:Boolean;// = false
public var f0:Number;// = 0
public var f1:Number;// = 0
public var fb:Number;// = 0
public var clip:MovieClip;
public var lineblastClip:MovieClip;
public var lineblastTick:int;// = 0
public var id:int;// = 0
public static var WIDTH:int = 60;
public static var HEIGHT:int = 36;
public static var globalId:int = 0;
public function Ball(_arg1:int){
this.id = globalId;
globalId++;
this.color = _arg1;
clip = new ball();
clip.gotoAndStop(1);
fb = (((_arg1 - 1) * 40) + 1);
clip.color.gotoAndStop(fb);
this.addChild(clip);
this.mouseChildren = false;
this.mouseEnabled = false;
}
public function isBeingRemoved():Boolean{
if (ticksToRemoval_ >= 0){
return (true);
};
return (false);
}
public function isFalling():Boolean{
return (falling);
}
public function setIsLineBlast():void{
if (!lineBlast_){
lineblastClip = new lineblast_marker();
clip.addChild(lineblastClip);
lineblastClip.gotoAndStop(1);
lineblastClip.x = 35;
lineblastClip.y = 28;
lineBlast_ = true;
};
}
public function isLineBlast():Boolean{
return (lineBlast_);
}
public function isStone():Boolean{
return ((this.color == 10));
}
public function markForColorCombo():void{
markedForColorCombo_ = true;
}
public function isMarkedForColorCombo():Boolean{
return (markedForColorCombo_);
}
public function markForColumnCombo():void{
markedForColumnCombo_ = true;
}
public function isMarkedForColumnCombo():Boolean{
return (markedForColumnCombo_);
}
public function isMarkedForCombo():Boolean{
return (((isMarkedForColorCombo()) || (isMarkedForColumnCombo())));
}
}
}//package com.midasplayer.africanrainmaker
Section 17
//Board (com.midasplayer.africanrainmaker.Board)
package com.midasplayer.africanrainmaker {
import flash.display.*;
import com.midasplayer.math.*;
import com.midasplayer.util.*;
import flash.filters.*;
public class Board extends Sprite {
public var listener_:BoardListener;
private var random_:MtRandom;
private var randomJewel_:MtRandom;
private var randomStone_:MtRandom;
private var randomRipple_:MtRandom;
private var randomGenerateDrum_:MtRandom;
private var numColors_:int;
private var maxCols_:int;
private var maxRows_:int;
private var numInitialRows_:int;
private var colors_:Array;
private var balls_:Array;
private var tick_:int;// = 0
private var dragUpTick_:int;
private var dragDownTick_:int;
private var checkList_:Array;
private var markId_:int;// = 0
private var comboNumber_:int;// = 1
private var combos_:ArrayList;
private var fallingStones_:Array;
private var removeCombosTick_:int;// = 0
private var ballsRemoved_:Boolean;// = false
private var releaseTick_:int;// = 0
private var releaseBall_:Ball;// = null
private var releasingBall_:Boolean;// = false
private var compactingVertical_:Boolean;// = false
private var compactingHorizontal_:Boolean;// = false
private var removingCombos_:Boolean;// = false
private var newRowTick_:int;// = 0
private var drums_:Array;
private var insertNewRow_:Boolean;// = false
private var insertingNewRow_:Boolean;// = false
private var hitBottom_:Boolean;// = false
private var jewels_:Array;
private var drumMode_:Boolean;// = false
private var numBalls_:int;// = 0
private var hitBottomReported_:Boolean;// = false
private var cloudRipples_:CloudRipples;
private var ballsLayer_:Sprite;
private var ballsExplosionLayer_:Sprite;
private var drumsLayer_:Sprite;
private var bengalLayer_:Sprite;
private var jewelsLayer_:Sprite;
private var ballsToRemove_:ArrayList;
private var endGame_:Boolean;// = false
private var endGameTick_:int;
private var isDemo_:Boolean;// = false
private var height_:int;
private var outline1_:GlowFilter;
private var outline2_:GlowFilter;
public function Board(_arg1:BoardListener, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:Boolean=false){
listener_ = _arg1;
random_ = new MtRandom(_arg2);
randomJewel_ = new MtRandom(_arg2);
randomStone_ = new MtRandom(_arg2);
randomRipple_ = new MtRandom(_arg2);
randomGenerateDrum_ = new MtRandom(_arg2);
numColors_ = _arg3;
maxCols_ = _arg4;
maxRows_ = _arg5;
numInitialRows_ = _arg6;
isDemo_ = _arg8;
height_ = _arg7;
colors_ = new Array();
var _local9:int;
while (_local9 < 5) {
colors_.splice(random_.nextInt((_local9 + 1)), 0, (_local9 + 1));
_local9++;
};
outline1_ = new GlowFilter(0, 1, 1, 1, 10, 3);
outline2_ = new GlowFilter(0xFFFFFF, 1, 1, 1, 10, 3);
init();
}
public function init():void{
var _local1:int;
var _local2:int;
var _local3:Ball;
var _local4:int;
cloudRipples_ = new CloudRipples();
combos_ = new ArrayList();
ballsToRemove_ = new ArrayList();
ballsLayer_ = new Sprite();
this.addChild(ballsLayer_);
ballsExplosionLayer_ = new Sprite();
this.addChild(ballsExplosionLayer_);
drumsLayer_ = new Sprite();
this.addChild(drumsLayer_);
var _local5:Sprite = new bg_overlay();
drumsLayer_.addChild(_local5);
_local5.x = (88 - this.x);
_local5.y = (483 - this.y);
bengalLayer_ = new Sprite();
this.addChild(bengalLayer_);
jewelsLayer_ = new Sprite();
this.addChild(jewelsLayer_);
newRowTick_ = getNewRowDelay();
drums_ = new Array();
balls_ = new Array();
jewels_ = new Array();
fallingStones_ = new Array();
_local2 = 0;
while (_local2 < (maxRows_ + 1)) {
balls_[_local2] = new Array();
_local2++;
};
_local2 = 0;
while (_local2 < numInitialRows_) {
_local1 = 0;
while (_local1 < maxCols_) {
_local3 = addBall(_local2, _local1, (_local1 * Ball.WIDTH), (_local2 * Ball.HEIGHT), (_local2 < (numInitialRows_ - 1)));
_local3.visible = false;
_local1++;
};
_local2++;
};
}
public function showBalls():void{
var _local1:int;
var _local2:int;
var _local3:Ball;
_local1 = 0;
while (_local1 < numInitialRows_) {
_local2 = 0;
while (_local2 < maxCols_) {
_local3 = addBall(_local1, _local2, (_local2 * Ball.WIDTH), (_local1 * Ball.HEIGHT), (_local1 < (numInitialRows_ - 1)));
_local3.visible = true;
_local2++;
};
_local1++;
};
}
public function addBall(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number, _arg5:Boolean=true):Ball{
var _local6:Ball;
var _local7:int;
if (((_arg5) && ((random_.nextInt(1000) < 10)))){
_local7 = 10;
} else {
_local7 = colors_[random_.nextInt(numColors_)];
};
_local6 = new Ball(_local7);
new Ball(_local7).x0 = (new Ball(_local7).x1 = (_local6.x = _arg3));
_local6.y0 = (_local6.y1 = (_local6.y = _arg4));
_local6.col = _arg2;
_local6.row = _arg1;
balls_[_arg1][_arg2] = _local6;
ballsLayer_.addChild(_local6);
numBalls_++;
return (_local6);
}
public function getNextCannonBall():Ball{
var _local1:Ball;
var _local2:int;
_local2 = colors_[random_.nextInt(numColors_)];
_local1 = new Ball(_local2);
return (_local1);
}
public function getBallsExplosionLayer():Sprite{
return (ballsExplosionLayer_);
}
public function getDrumsLayer():Sprite{
return (drumsLayer_);
}
public function getBengalLayer():Sprite{
return (bengalLayer_);
}
public function getBalls():Array{
return (balls_);
}
public function getNumInitialRows():int{
return (numInitialRows_);
}
public function getMaxRows():int{
return (maxRows_);
}
public function getMaxCols():int{
return (maxCols_);
}
public function isReleasingBall():Boolean{
return (releasingBall_);
}
public function isReadyForRelease():Boolean{
return (((!(releasingBall_)) && (!(hitBottom_))));
}
public function getNewRowDelay():int{
var _local1:Number;
_local1 = (30 * 8);
if (isDemo_){
_local1 = (30 * 20);
};
return (_local1);
}
public function getNumColors():int{
return (numColors_);
}
public function setNumColors(_arg1:int):void{
numColors_ = _arg1;
}
public function handleCombos():void{
var _local1:Number;
findCombos();
if (hitBottom()){
return;
};
if (combos_.size() > 0){
removeCombos();
} else {
_local1 = (drumMode_) ? 0.4 : 0.3;
if ((((numBalls_ < ((maxCols_ * maxRows_) * _local1))) && (!(hitRow((maxRows_ - 2), true))))){
insertNewRow_ = true;
};
if (shouldInsertNewRow()){
newRow();
};
};
}
public function shouldInsertNewRow():Boolean{
if (compactingHorizontal_){
return (false);
};
if (insertingNewRow_){
return (false);
};
if (((endGame_) && (((tick_ - endGameTick_) > (30 * 5))))){
return (false);
};
return (insertNewRow_);
}
public function findCombos():void{
var _local1:int;
var _local2:int;
var _local3:Ball;
var _local5:Combo;
var _local6:Boolean;
var _local7:int;
var _local8:Drum;
var _local4:Array = new Array();
_local2 = 0;
while (_local2 < (maxRows_ + 1)) {
_local1 = 0;
while (_local1 < maxCols_) {
_local3 = getBall(_local2, _local1);
if (((((((!((_local3 == null))) && (_local3.hasMoved))) && (!(_local3.isMarkedForCombo())))) && (!(_local3.isMoving)))){
_local4.splice(0, _local4.length);
_local6 = getGroup(_local3, _local4);
_local7 = _local4.length;
if (((_local6) && ((_local7 >= 4)))){
_local5 = new Combo(this, comboNumber_, Combo.TYPE_COLOR, _local1, _local2);
comboNumber_++;
_local5.addBalls(_local4);
_local5.markBricks();
combos_.add(_local5);
_local3.hasMoved = false;
};
if (_local7 >= 4){
};
if (_local7 < 4){
_local3.hasMoved = false;
};
};
_local1++;
};
_local2++;
};
_local1 = 0;
while (_local1 < maxCols_) {
_local8 = drums_[_local1];
if (((!((_local8 == null))) && (_local8.getBlast()))){
_local8.setBlast(false);
_local4.splice(0, _local4.length);
_local2 = maxRows_;
while (_local2 >= 0) {
_local3 = getBall(_local2, _local1);
if (_local3 != null){
_local4.push(_local3);
};
_local2--;
};
_local5 = new Combo(this, comboNumber_, Combo.TYPE_COLUMN, _local1, 0);
comboNumber_++;
_local5.addBalls(_local4);
_local5.markBricks();
combos_.add(_local5);
};
_local1++;
};
}
public function getGroup(_arg1:Ball, _arg2:Array):Boolean{
var _local5:Ball;
var _local6:int;
var _local7:int;
var _local8:Ball;
var _local9:int;
var _local10:Boolean;
var _local3:Boolean;
if (_arg2.length == 0){
if (_arg1.isStone()){
return (_local3);
};
markId_++;
checkList_ = new Array();
_arg1.markId = markId_;
checkList_.push(_arg1);
_arg2.push(_arg1);
_local3 = !(_arg1.isMoving);
};
var _local4:int;
while (_local4 < checkList_.length) {
_local5 = checkList_.shift();
_local6 = _local5.col;
_local7 = _local5.row;
_local8 = null;
_local9 = _local5.color;
_local8 = getBall((_local7 - 1), _local6);
if (((((!((_local8 == null))) && (!((_local8.markId == markId_))))) && ((_local8.color == _local9)))){
_local8.markId = markId_;
checkList_.push(_local8);
_arg2.push(_local8);
_local3 = ((_local3) && (!(_local8.isMoving)));
};
_local8 = getBall(_local7, (_local6 + 1));
if (((((!((_local8 == null))) && (!((_local8.markId == markId_))))) && ((_local8.color == _local9)))){
_local8.markId = markId_;
checkList_.push(_local8);
_arg2.push(_local8);
_local3 = ((_local3) && (!(_local8.isMoving)));
};
_local8 = getBall((_local7 + 1), _local6);
if (((((!((_local8 == null))) && (!((_local8.markId == markId_))))) && ((_local8.color == _local9)))){
_local8.markId = markId_;
checkList_.push(_local8);
_arg2.push(_local8);
_local3 = ((_local3) && (!(_local8.isMoving)));
};
_local8 = getBall(_local7, (_local6 - 1));
if (((((!((_local8 == null))) && (!((_local8.markId == markId_))))) && ((_local8.color == _local9)))){
_local8.markId = markId_;
checkList_.push(_local8);
_arg2.push(_local8);
_local3 = ((_local3) && (!(_local8.isMoving)));
};
if (checkList_.length > 0){
_local10 = getGroup(_arg1, _arg2);
_local3 = ((_local3) && (_local10));
};
_local4++;
};
return (_local3);
}
public function removeCombos():void{
removeCombosTick_ = tick_;
removingCombos_ = true;
}
public function removeCombosTick():void{
var _local4:Combo;
var _local5:Number;
var _local6:Boolean;
var _local1:Number = combos_.size();
var _local2:Boolean;
var _local3:int = (_local1 - 1);
while (_local3 >= 0) {
_local4 = Combo(combos_.getI(_local3));
if (_local4 != null){
_local5 = ((tick_ - removeCombosTick_) - _local3);
_local6 = _local4.tick();
if (_local6){
combos_.setI(_local3, null);
combos_.removeI(_local3);
_local2 = true;
};
};
_local3--;
};
if ((((combos_.size() == 0)) && (_local2))){
removeCombosEnd();
};
}
public function removeCombosEnd():void{
removingCombos_ = false;
}
public function removeCombosRender(_arg1:Number, _arg2:Number):void{
var _local5:Combo;
var _local3:Number = combos_.size();
var _local4:int;
while (_local4 < _local3) {
_local5 = Combo(combos_.getI(_local4));
if (_local5 != null){
_arg1 = ((tick_ - removeCombosTick_) - _local4);
_local5.render(_arg2);
};
_local4++;
};
}
public function compactVertical():void{
var _local1:int;
var _local2:int;
var _local3:Ball;
var _local4:Number = 0;
_local1 = 0;
while (_local1 < maxCols_) {
_local4 = 0;
_local2 = 0;
while (_local2 < maxRows_) {
_local3 = getBall(_local2, _local1);
if (_local3 == null){
_local4++;
} else {
if (_local4 > 0){
_local3.row = (_local2 - _local4);
if (_local3.vy < 5){
_local3.vy = 5;
};
_local3.ay = 1;
_local3.hasMoved = true;
balls_[(_local2 - _local4)][_local1] = _local3;
balls_[_local2][_local1] = null;
};
};
_local2++;
};
_local1++;
};
dragUpTick_ = tick_;
}
public function compactVerticalTick():void{
var _local1:int;
var _local2:int;
var _local3:Ball;
var _local4:Number;
var _local5:Number;
compactingVertical_ = false;
compactingHorizontal_ = false;
_local1 = 0;
while (_local1 < maxCols_) {
_local2 = 0;
while (_local2 < (maxRows_ + 1)) {
_local3 = getBall(_local2, _local1);
if (_local3 == null){
} else {
if (_local3.isFalling()){
} else {
_local4 = (_local3.col * Ball.WIDTH);
_local5 = (_local3.row * Ball.HEIGHT);
if (_local3.y1 > _local5){
_local3.isMoving = true;
_local3.y1 = (_local3.y1 - _local3.vy);
_local3.vy = (_local3.vy + _local3.ay);
if (_local3.y1 < _local5){
_local3.y1 = _local5;
_local3.vy = 0;
_local3.ay = 0;
};
compactingVertical_ = true;
};
if (_local3.y1 < _local5){
_local3.isMoving = true;
_local3.y1 = (_local3.y1 + _local3.vy);
_local3.vy = (_local3.vy + _local3.ay);
if (_local3.y1 > _local5){
_local3.y1 = _local5;
_local3.vy = 0;
_local3.ay = 0;
};
compactingVertical_ = true;
};
if (_local3.x1 > _local4){
_local3.isMoving = true;
_local3.x1 = (_local3.x1 - 10);
if (_local3.x1 < _local4){
_local3.x1 = _local4;
};
compactingHorizontal_ = true;
};
if (_local3.x1 < _local4){
_local3.isMoving = true;
_local3.x1 = (_local3.x1 + 10);
if (_local3.x1 > _local4){
_local3.x1 = _local4;
};
compactingHorizontal_ = true;
};
if ((((_local3.y1 == _local5)) && ((_local3.x1 == _local4)))){
_local3.isMoving = false;
};
};
};
_local2++;
};
_local1++;
};
}
public function allStill():Boolean{
if (((compactingVertical_) || (compactingHorizontal_))){
return (false);
};
if (((!(hitBottom_)) && ((combos_.size() > 0)))){
return (false);
};
if (jewels_.length > 0){
return (false);
};
if (fallingStones_.length > 0){
return (false);
};
if (isReleasingBall()){
return (false);
};
return (true);
}
public function compactHorizontal():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Ball;
var _local5 = (maxCols_ >> 1);
var _local6:int;
var _local7:Boolean;
var _local8:Boolean;
_local6 = 0;
_local2 = (_local5 - 1);
while (_local2 >= 0) {
_local7 = true;
_local3 = 0;
while (_local3 < maxRows_) {
_local4 = balls_[_local3][_local2];
if (_local4 != null){
_local7 = false;
};
_local3++;
};
if (_local7){
_local8 = true;
_local6++;
} else {
if (_local6 > 0){
_local3 = 0;
while (_local3 < maxRows_) {
_local4 = balls_[_local3][_local2];
if (_local4 != null){
_local4.col = (_local4.col + _local6);
balls_[_local3][(_local2 + _local6)] = _local4;
balls_[_local3][_local2] = null;
_local4.hasMoved = ((_local4.hasMoved) || (_local8));
};
_local3++;
};
_local8 = false;
};
};
_local2--;
};
_local8 = false;
_local6 = 0;
_local2 = _local5;
while (_local2 < maxCols_) {
_local7 = true;
_local3 = 0;
while (_local3 < maxRows_) {
_local4 = balls_[_local3][_local2];
if (_local4 != null){
_local7 = false;
};
_local3++;
};
if (_local7){
_local8 = true;
_local6++;
} else {
if (_local6 > 0){
_local3 = 0;
while (_local3 < maxRows_) {
_local4 = balls_[_local3][_local2];
if (_local4 != null){
_local4.col = (_local4.col - _local6);
balls_[_local3][(_local2 - _local6)] = _local4;
balls_[_local3][_local2] = null;
_local4.hasMoved = ((_local4.hasMoved) || (_local8));
};
_local3++;
};
_local8 = false;
};
};
_local2++;
};
}
public function releaseBall(_arg1:Ball, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Number;
var _local6:Number;
var _local7:Ball;
var _local8:Number = -1;
comboNumber_ = 1;
releasingBall_ = true;
numBalls_++;
_arg1.x1 = (_arg1.x1 + _arg2);
_arg1.y1 = (_arg1.y1 + (_arg3 - 80));
_arg1.x0 = _arg1.x1;
_arg1.y0 = _arg1.y1;
_arg1.x = _arg1.x1;
_arg1.y = _arg1.y1;
_arg1.vy = 20;
_arg1.ay = 2;
ballsLayer_.addChild(_arg1);
_local5 = xToCol(_arg4);
_local6 = (maxRows_ - 1);
while (_local6 >= 0) {
_local7 = getBall(_local6, _local5);
_local8 = -1;
if (_local7 != null){
_local8 = (_local6 + 1);
} else {
if (_local6 == 0){
_local8 = 0;
};
};
if (_local8 >= 0){
_arg1.col = _local5;
_arg1.row = _local8;
_arg1.releaseX = _arg1.x1;
_arg1.releaseY = _arg1.y1;
balls_[_local8][_local5] = _arg1;
_arg1.hasMoved = true;
releaseBall_ = _arg1;
break;
};
_local6--;
};
releaseTick_ = tick_;
}
public function releaseBallTick():void{
var _local1:Number;
var _local2:Boolean;
if (releaseTick_ > 0){
_local1 = (tick_ - releaseTick_);
_local2 = releaseBallAnim(_local1);
if (_local2){
releaseTick_ = -1;
releaseBallEnd();
};
};
}
public function releaseBallAnim(_arg1:Number):Boolean{
var _local2:Number = AnimPlayer.tickToPercent(_arg1, 0, (0.2 * 30));
releaseBall_.clip.color.gotoAndStop((releaseBall_.fb + Math.floor((12 * _local2))));
return ((_local2 == 1));
}
public function releaseBallEnd():void{
releasingBall_ = false;
releaseBall_ = null;
}
public function newRow():void{
var _local1:Ball;
var _local2:int;
var _local3:int;
insertNewRow_ = false;
insertingNewRow_ = true;
_local2 = 0;
while (_local2 < maxCols_) {
_local3 = (maxRows_ - 1);
while (_local3 >= 0) {
_local1 = balls_[_local3][_local2];
if (_local1 != null){
balls_[(_local3 + 1)][_local2] = _local1;
_local1.row = (_local3 + 1);
if (_local1.vy < 5){
_local1.vy = 5;
};
_local1.ay = 1;
balls_[_local3][_local2] = null;
};
_local3--;
};
_local1 = addBall(0, _local2, (_local2 * Ball.WIDTH), -(Ball.HEIGHT));
_local1.vy = 5;
_local1.ay = 1;
_local2++;
};
dragDownTick_ = tick_;
}
public function newRowTick():void{
if ((dragDownTick_ + 20) == tick_){
insertingNewRow_ = false;
};
if (newRowTick_ < 0){
return;
};
if (tick_ >= newRowTick_){
if (insertingNewRow_){
return;
};
insertNewRow_ = true;
newRowTick_ = (newRowTick_ + getNewRowDelay());
};
}
public function generateDrum(_arg1:int, _arg2:Number, _arg3:Number):void{
var _local4:Drum;
var _local5:int;
_local5 = findEmptyDrumCol(xToCol(_arg2));
if (_local5 >= 0){
_arg2 = (_arg2 + (Ball.WIDTH / 2));
_arg3 = (_arg3 + (Ball.HEIGHT / 2));
_local4 = new Drum(_arg1);
new Drum(_arg1).x = (new Drum(_arg1).x0 = (_local4.x1 = _arg2));
_local4.y = (_local4.y0 = (_local4.y1 = _arg3));
_local4.startX = _local4.x;
_local4.startY = _local4.y;
_local4.scale0 = (_local4.scale1 = 0);
_local4.col = _local5;
_local4.fallTick = 0;
_local4.numFallTicks = 40;
drums_[_local5] = _local4;
drumsLayer_.addChild(_local4);
listener_.drumCreated();
addScore(200, ((_arg2 + this.x) + (Ball.WIDTH / 2)), ((_arg3 + this.y) + 40), Combo.TYPE_DRUM_GENERATED);
};
}
public function generateGroundDrum(_arg1:int, _arg2:int):Drum{
var _local3:Drum;
_arg2 = findEmptyDrumCol(_arg2);
if (_arg2 >= 0){
_local3 = new Drum(_arg1);
_local3.x = (_local3.x0 = (_local3.x1 = colToX(_arg2)));
_local3.y = (_local3.y0 = (_local3.y1 = 490));
_local3.startX = _local3.x;
_local3.startY = _local3.y;
_local3.scale0 = (_local3.scale1 = 1);
_local3.col = _arg2;
_local3.fallTick = 0;
_local3.numFallTicks = 0;
drums_[_arg2] = _local3;
drumsLayer_.addChild(_local3);
};
return (_local3);
}
public function findEmptyDrumCol(_arg1:int):int{
var _local2:int;
var _local3:int;
_local3 = _arg1;
if ((((((_local3 >= 0)) && ((_local3 < maxCols_)))) && ((drums_[_local3] == null)))){
return (_local3);
};
_local2 = 1;
while (_local2 < maxCols_) {
_local3 = (_arg1 - _local2);
if ((((((_local3 >= 0)) && ((_local3 < maxCols_)))) && ((drums_[_local3] == null)))){
return (_local3);
};
_local3 = (_arg1 + _local2);
if ((((((_local3 >= 0)) && ((_local3 < maxCols_)))) && ((drums_[_local3] == null)))){
return (_local3);
};
_local2++;
};
return (-1);
}
public function drumTick():void{
var _local1:Drum;
var _local2:int;
var _local3:Number;
_local2 = 0;
while (_local2 < maxCols_) {
_local1 = drums_[_local2];
if (_local1 != null){
if (_local1.isFalling()){
_local1.fallTick++;
_local3 = AnimPlayer.tickToPercent(_local1.fallTick, 0, _local1.numFallTicks);
_local1.x1 = (_local1.startX + (_local3 * ((_local1.col * Ball.WIDTH) - _local1.startX)));
_local1.y1 = AnimPlayer.easeInBack(_local3, _local1.startY, ((height_ - 76) - _local1.startY), 1, 0.4);
_local3 = AnimPlayer.tickToPercent(_local1.fallTick, 0, Math.min(25, _local1.numFallTicks));
_local3 = AnimPlayer.easeOutBack(_local3, 0, 1, 1, 2);
_local1.scale1 = _local3;
};
_local1.tick();
};
_local2++;
};
}
public function generateRandomDrums(_arg1:int, _arg2:Boolean):void{
var _local3:int;
var _local6:int;
var _local7:Drum;
if (_arg1 > getMaxCols()){
_arg1 = getMaxCols();
};
var _local4:Array = [];
_local3 = 0;
while (_local3 < getMaxCols()) {
_local4.push(_local3);
_local3++;
};
_inplaceShuffle(_local4, randomGenerateDrum_);
var _local5:Array = [];
_local3 = 0;
while (_local3 < getNumColors()) {
_local5.push(colors_[_local3]);
_local3++;
};
_inplaceShuffle(_local5, randomGenerateDrum_);
_local3 = 0;
while (_local3 < _arg1) {
_local6 = findEmptyDrumCol(_local4[_local3]);
if (_local6 >= 0){
_local7 = generateGroundDrum(_local5[_local3], _local6);
if (((_arg2) && (!((_local7 == null))))){
_local7.activate();
};
};
_local3++;
};
}
private function _inplaceShuffle(_arg1:Array, _arg2:MtRandom):void{
var _local5:*;
var _local6:int;
var _local3:int = _arg1.length;
var _local4:int;
while (_local4 < _local3) {
_local5 = _arg1[_local4];
_local6 = _arg2.nextInt(_local3);
_arg1[_local4] = _arg1[_local6];
_arg1[_local6] = _local5;
_local4++;
};
}
public function drumModeTick():void{
var _local1:int;
var _local2:Array;
var _local3:Drum;
var _local4:int;
if (!drumMode_){
_local2 = new Array();
_local1 = 0;
while (_local1 < colors_.length) {
_local2[colors_[_local1]] = 0;
_local1++;
};
_local4 = 0;
while (_local4 < maxCols_) {
_local3 = drums_[_local4];
if (_local3 != null){
if (_local3.isActive()){
var _local5 = _local2;
var _local6 = _local3.color;
var _local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
};
};
_local4++;
};
_local1 = 0;
while (_local1 < colors_.length) {
if (_local2[colors_[_local1]] >= 3){
activateDrumMode(colors_[_local1]);
};
_local1++;
};
};
}
public function activateDrumMode(_arg1:int):void{
var _local2:Drum;
var _local3:int;
drumMode_ = true;
listener_.activateDrumMode();
_local3 = 0;
while (_local3 < maxCols_) {
_local2 = drums_[_local3];
if (((!((_local2 == null))) && ((_local2.color == _arg1)))){
startColBlast(_local3);
};
_local3++;
};
}
public function startColBlast(_arg1:int):void{
var _local2:Drum;
_local2 = drums_[_arg1];
if (_local2 != null){
_local2.setBlast(true);
};
}
public function generateLineBlast():void{
listener_.generateLineBlast();
}
public function generateJewel(_arg1:int, _arg2:int, _arg3:Ball):void{
var _local4:Jewel;
var _local6:int;
var _local7:int;
var _local8:int;
var _local5:int;
if (_arg2 >= 15){
_local5 = 5;
} else {
if (_arg2 >= 10){
_local5 = 4;
} else {
if (_arg2 >= 8){
_local5 = 3;
} else {
if (_arg2 >= 6){
_local5 = 2;
} else {
if (_arg2 >= 4){
_local5 = 1;
};
};
};
};
};
if (_local5 > 0){
_local6 = (_arg3.x1 + (Ball.WIDTH / 2));
_local7 = (_arg3.y1 + (Ball.HEIGHT / 2));
_local4 = new Jewel(_arg1, _local5, _local6, _local7);
_local8 = 2;
_local4.vx = (((_local8 * randomJewel_.nextInt(1000)) / 1000) - (_local8 / 2));
_local4.vy = (-0.5 - (randomJewel_.nextInt(1000) / 1000));
jewels_.push(_local4);
jewelsLayer_.addChild(_local4);
};
}
public function jewelTick():void{
var _local1:Jewel;
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Drum;
var _local7:Number;
var _local8:int;
_local2 = jewels_.length;
_local3 = 0;
while (_local3 < _local2) {
_local1 = jewels_.shift();
_local1.vy = (_local1.vy + 0.2);
_local4 = (_local1.x1 + _local1.vx);
_local5 = (_local1.y1 + _local1.vy);
_local1.x1 = _local4;
_local1.y1 = _local5;
_local6 = jewelHitTest(_local1);
if (_local6 != null){
_local1.vy = (_local1.vy * (-1 * (0.7 + ((0.3 * randomJewel_.nextInt(1000)) / 1000))));
_local7 = (((2 * (_local1.x1 % Ball.WIDTH)) / Ball.WIDTH) - 1);
_local7 = (((((2 * (_local1.x1 % Ball.WIDTH)) / Ball.WIDTH) - 1) * _local7) * _local7);
_local1.vx = (_local1.vx + (_local7 * 4));
_local1.ts = (_local7 * 5);
_local6.bounce();
listener_.ripple((_local6.x1 + this.x), (_local6.y1 + this.y));
cloudRipples_.addRipple(_local6.col, 10, ((randomRipple_.nextDouble() * 0.2) + 0.3), ((randomRipple_.nextDouble() * 2) + 4));
listener_.drumHit();
_local8 = 300;
if (_local1.size == 2){
_local8 = 400;
};
if (_local1.size == 3){
_local8 = 500;
};
if (_local1.size == 4){
_local8 = 1000;
};
if (_local1.size == 5){
_local8 = 2000;
};
if (_local6.color == _local1.color){
_local8 = (_local8 * 2);
if (drumMode_){
startColBlast(_local6.col);
} else {
if (!_local6.isActive()){
_local6.activate();
listener_.drumActivated(_local6);
};
};
};
addScore(_local8, (_local1.x1 + this.x), (_local1.y1 + this.y), Combo.TYPE_JEWEL, _local1.size, ((_local6.color == _local1.color)) ? 2 : 1);
};
if (_local1.bounceTick > 0){
_local1.bounceTick++;
};
if (_local1.y1 > 600){
jewelsLayer_.removeChild(_local1);
} else {
if (_local1.bounceTick > 30){
jewelsLayer_.removeChild(_local1);
} else {
jewels_.push(_local1);
};
};
_local3++;
};
}
public function jewelHitTest(_arg1:Jewel):Drum{
var _local3:int;
var _local2:Drum;
if ((((_arg1.y1 >= (height_ - 81))) && ((_arg1.bounceTick == 0)))){
_arg1.bounceTick = 1;
_local3 = Math.floor((_arg1.x1 / Ball.WIDTH));
if ((((_local3 < 0)) || ((_local3 >= drums_.length)))){
return (null);
};
_local2 = drums_[_local3];
if (((!((_local2 == null))) && (_local2.isFalling()))){
return (null);
};
return (_local2);
};
return (_local2);
}
public function stonesFall():void{
var _local1:int;
var _local2:int;
var _local3:Ball;
_local1 = 0;
while (_local1 < maxCols_) {
_local2 = maxRows_;
while (_local2 >= 0) {
_local3 = getBall(_local2, _local1);
if (_local3 != null){
if (((((_local3.isStone()) && (!(_local3.isMarkedForCombo())))) && (!(_local3.isBeingRemoved())))){
fallingStones_.push(_local3);
_local3.falling = true;
_local3.vy = 0;
_local3.ay = (0.5 + (randomStone_.nextInt(10000) / 100000));
_local3.vx = 0;
balls_[_local3.row][_local3.col] = null;
numBalls_--;
} else {
break;
};
};
_local2--;
};
_local1++;
};
}
public function stonesTick():void{
var _local1:int;
var _local3:Ball;
var _local4:Drum;
stonesFall();
var _local2:int = fallingStones_.length;
_local1 = 0;
while (_local1 < _local2) {
_local3 = fallingStones_.shift();
_local3.x0 = _local3.x1;
_local3.y0 = _local3.y1;
_local3.y1 = (_local3.y1 + _local3.vy);
_local3.vy = (_local3.vy + _local3.ay);
_local3.x1 = (_local3.x1 + _local3.vx);
_local4 = stoneHitTest(_local3);
if (_local4 != null){
_local3.vy = (-(_local3.vy) * 0.3);
_local3.vx = (0.5 * (1 - (randomStone_.nextInt(1000) / 500)));
drums_[_local4.col] = null;
listener_.drumWrecked(_local4);
drumsLayer_.removeChild(_local4);
};
if (_local3.bounceTick > 0){
_local3.bounceTick++;
};
if (_local3.y1 > 600){
if (_local3.parent == ballsLayer_){
ballsLayer_.removeChild(_local3);
};
} else {
if (_local3.bounceTick > 20){
if (_local3.parent == ballsLayer_){
ballsLayer_.removeChild(_local3);
};
} else {
fallingStones_.push(_local3);
};
};
_local1++;
};
}
public function stoneHitTest(_arg1:Ball):Drum{
var _local3:int;
var _local2:Drum;
if ((((_arg1.y1 >= (485 - 30))) && ((_arg1.bounceTick == 0)))){
_arg1.bounceTick = 1;
_local2 = drums_[_arg1.col];
if (((!((_local2 == null))) && (_local2.isFalling()))){
return (null);
};
return (_local2);
};
return (_local2);
}
public function stonesRender(_arg1:Number):void{
var _local2:int;
var _local4:Ball;
var _local3:int = fallingStones_.length;
_local2 = 0;
while (_local2 < _local3) {
_local4 = fallingStones_[_local2];
if (_local4 != null){
_local4.y = (_local4.y0 + ((_local4.y1 - _local4.y0) * _arg1));
_local4.x = (_local4.x0 + ((_local4.x1 - _local4.x0) * _arg1));
if (_local4.bounceTick > 0){
_local4.alpha = (1 - (_local4.bounceTick / 20));
};
};
_local2++;
};
}
public function ballClicked(_arg1:Ball):void{
}
public function removeBall(_arg1:Ball, _arg2:int=5):void{
if (!_arg1.isBeingRemoved()){
_arg1.ticksToRemoval_ = _arg2;
_arg1.visible = false;
ballsToRemove_.add(_arg1);
};
}
public function removeBallsTick():void{
var _local1:Ball;
var _local2:int = ballsToRemove_.size();
var _local3:int = (_local2 - 1);
while (_local3 >= 0) {
_local1 = Ball(ballsToRemove_.getI(_local3));
if (_local1.ticksToRemoval_ == 0){
balls_[_local1.row][_local1.col] = null;
ballsRemoved_ = true;
ballsLayer_.removeChild(_local1);
numBalls_--;
ballsToRemove_.removeI(_local3);
} else {
_local1.ticksToRemoval_--;
};
_local3--;
};
}
public function getBall(_arg1:Number, _arg2:Number):Ball{
if ((((_arg1 < 0)) || ((_arg1 >= (maxRows_ + 1))))){
return (null);
};
if ((((_arg2 < 0)) || ((_arg2 >= maxCols_)))){
return (null);
};
return (balls_[_arg1][_arg2]);
}
public function getDrum(_arg1:Number):Drum{
if ((((_arg1 < 0)) || ((_arg1 >= maxCols_)))){
return (null);
};
return (drums_[_arg1]);
}
public function xToCol(_arg1:Number):Number{
_arg1 = Math.round((_arg1 / Ball.WIDTH));
return (_arg1);
}
public function yToRow(_arg1:Number):Number{
_arg1 = Math.round((_arg1 / Ball.HEIGHT));
return (_arg1);
}
public function rowToY(_arg1:Number):Number{
return ((_arg1 * Ball.HEIGHT));
}
public function colToX(_arg1:Number):Number{
return ((_arg1 * Ball.WIDTH));
}
public function hitBottom():Boolean{
if (hitBottom_){
return (true);
};
hitBottom_ = hitRow(maxRows_, false);
return (hitBottom_);
}
public function hitRow(_arg1:int, _arg2:Boolean):Boolean{
var _local3:Ball;
var _local4:int;
_local4 = 0;
while (_local4 < maxCols_) {
_local3 = balls_[_arg1][_local4];
if (((!((_local3 == null))) && (((_arg2) || (((!(_local3.isMarkedForCombo())) && (!(_local3.isMoving)))))))){
return (true);
};
_local4++;
};
return (false);
}
public function getNumRowsInCol(_arg1:int):int{
var _local2:int = maxRows_;
while (_local2 >= 0) {
if (balls_[_local2][_arg1] != null){
return (_local2);
};
_local2--;
};
return (0);
}
public function getMultiplier():int{
return (comboNumber_);
}
public function endGame():void{
endGame_ = true;
endGameTick_ = tick_;
}
public function addScore(_arg1:int, _arg2:Number, _arg3:Number, _arg4:int=0, _arg5:int=0, _arg6:int=0, _arg7:int=0):void{
listener_.addScore(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
}
public function tick():void{
var _local1:int;
var _local2:int;
var _local3:Ball;
var _local4:Drum;
var _local5:Jewel;
var _local6:int;
tick_++;
if (cloudRipples_.numRipples() == 0){
cloudRipples_.addRipple(((randomRipple_.nextDouble() * 30) - 15), ((randomRipple_.nextDouble() * 10) + 10), ((randomRipple_.nextDouble() * 0.2) + 0.3), ((randomRipple_.nextDouble() * 10) + 6));
};
cloudRipples_.apply(balls_, maxRows_, maxCols_);
_local2 = 0;
while (_local2 < (maxRows_ + 1)) {
_local1 = 0;
while (_local1 < maxCols_) {
_local3 = balls_[_local2][_local1];
if (_local3 != null){
_local3.x0 = _local3.x1;
_local3.y0 = _local3.y1;
if (_local3.isLineBlast()){
_local3.lineblastTick++;
};
};
_local1++;
};
_local2++;
};
_local1 = 0;
while (_local1 < maxCols_) {
_local4 = drums_[_local1];
if (_local4 != null){
_local4.x0 = _local4.x1;
_local4.y0 = _local4.y1;
_local4.scale0 = _local4.scale1;
};
_local1++;
};
_local6 = 0;
while (_local6 < jewels_.length) {
_local5 = jewels_[_local6];
if (_local5 != null){
_local5.x0 = _local5.x1;
_local5.y0 = _local5.y1;
_local5.tick(tick_);
};
_local6++;
};
if (hitBottom_){
if (!hitBottomReported_){
hitBottomReported_ = true;
listener_.boardFull();
listener_.endGame();
endGame_ = true;
};
};
removeCombosTick();
removeBallsTick();
compactVertical();
compactHorizontal();
compactVerticalTick();
newRowTick();
releaseBallTick();
drumTick();
jewelTick();
drumModeTick();
stonesTick();
handleCombos();
}
public function render(_arg1:int, _arg2:Number):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Ball;
var _local7:Drum;
var _local8:Jewel;
_local5 = 0;
while (_local5 < (maxRows_ + 1)) {
_local4 = 0;
while (_local4 < maxCols_) {
_local6 = balls_[_local5][_local4];
if (_local6 != null){
_local6.x = (_local6.x0 + ((_local6.x1 - _local6.x0) * _arg2));
_local6.y = (_local6.y0 + ((_local6.y1 - _local6.y0) * _arg2));
if (_local6 != releaseBall_){
_local6.clip.color.gotoAndStop((((_local6.fb + 12) + 20) - Math.ceil((20 * (_local6.f0 + ((_local6.f1 - _local6.f0) * _arg2))))));
};
if (_local6.isLineBlast()){
_local6.lineblastClip.gotoAndStop(((_local6.lineblastTick % 15) + 1));
};
};
_local4++;
};
_local5++;
};
_local4 = 0;
while (_local4 < maxCols_) {
_local7 = drums_[_local4];
if (_local7 != null){
_local7.scaleX = (_local7.scaleY = (_local7.scale0 + ((_local7.scale1 - _local7.scale0) * _arg2)));
_local7.x = (_local7.x0 + ((_local7.x1 - _local7.x0) * _arg2));
_local7.y = (_local7.y0 + ((_local7.y1 - _local7.y0) * _arg2));
_local7.x = (_local7.x + (((1 - _local7.scaleX) * _local7.width) / 2));
_local7.y = (_local7.y + (((1 - _local7.scaleX) * _local7.height) / 2));
_local7.render(_arg2);
};
_local4++;
};
_local3 = 0;
while (_local3 < jewels_.length) {
_local8 = jewels_[_local3];
if (_local8 != null){
_local8.x = (_local8.x0 + ((_local8.x1 - _local8.x0) * _arg2));
_local8.y = (_local8.y0 + ((_local8.y1 - _local8.y0) * _arg2));
_local8.render(_arg1, _arg2);
if (_local8.bounceTick > 0){
_local8.alpha = (1 - (_local8.bounceTick / 30));
};
};
_local3++;
};
removeCombosRender(_arg1, _arg2);
stonesRender(_arg2);
}
}
}//package com.midasplayer.africanrainmaker
Section 18
//BoardListener (com.midasplayer.africanrainmaker.BoardListener)
package com.midasplayer.africanrainmaker {
import com.midasplayer.africanrainmaker.anim.*;
public interface BoardListener {
function drumCreated():void;
function activateDrumMode():void;
function generateLineBlast():void;
function ripple(_arg1:Number, _arg2:Number):void;
function drumHit():void;
function drumActivated(_arg1:Drum):void;
function drumWrecked(_arg1:Drum):void;
function addScore(_arg1:int, _arg2:Number, _arg3:Number, _arg4:int=0, _arg5:int=0, _arg6:int=0, _arg7:int=0):void;
function boardFull():void;
function endGame():void;
function combo(_arg1:int):void;
function ballRemoved(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Number):void;
function bengalFire(_arg1:Number, _arg2:Number):BengalAnim;
function lineBlast(_arg1:Number, _arg2:Number):LineBlastAnim;
}
}//package com.midasplayer.africanrainmaker
Section 19
//Cannon (com.midasplayer.africanrainmaker.Cannon)
package com.midasplayer.africanrainmaker {
import flash.display.*;
import com.midasplayer.util.*;
public class Cannon extends Sprite {
private var listener_:CannonListener;
public var x0:Number;
public var x1:Number;
public var y0:Number;
public var y1:Number;
private var balls_:Array;
private var capacity_:int;
private var clip_:MovieClip;
private var ballsLayerBg_:MovieClip;
private var ballsLayer_:MovieClip;
private var ballsLayerFg_:MovieClip;
private var tick_:int;
private var isMoving_:Boolean;// = false
private var moveTick_:int;
private var moveTicks_:int;
private var moveToX_:int;
private var moveFromX_:int;
private var isSwitchingBalls_:Boolean;// = false
private var switchBallsTick_:int;
private var releaseTick_:int;
private var releaseBall_:Ball;
private var doRelease_:Boolean;// = false
private var hasReleased_:Boolean;// = false
private var releaseX_:Number;
private var ballAdded_:Boolean;// = false
private var ballAddedTick_:int;
private var ballPos_:Array;
private var framesStepBack:Array;
private var framesStepFront:Array;
private var framesFrontStart:Array;
private var framesFrontStop:Array;
public function Cannon(_arg1:CannonListener){
ballPos_ = [0, 0, 12, -5, 6, -42];
framesStepBack = [20, 21, 22, 23, 50, 51, 52, 1];
framesStepFront = [60, 61, 62, 63, 90, 91, 92, 1];
framesFrontStart = [1, 60, 61, 62];
framesFrontStop = [89, 90, 91, 91, 1];
super();
listener_ = _arg1;
setCapaticty(2);
balls_ = new Array();
ballsLayerBg_ = new MovieClip();
ballsLayer_ = new MovieClip();
ballsLayerFg_ = new MovieClip();
clip_ = new cannon();
clip_.gotoAndStop(1);
this.addChild(ballsLayerBg_);
this.addChild(clip_);
this.addChild(ballsLayer_);
this.addChild(ballsLayerFg_);
this.mouseChildren = false;
this.mouseEnabled = false;
releaseTick_ = -1;
}
public function setCapaticty(_arg1:int):void{
capacity_ = _arg1;
}
public function getCapactity():int{
return (capacity_);
}
public function getNumBalls():int{
return (balls_.length);
}
public function isFull():Boolean{
return ((getNumBalls() >= getCapactity()));
}
public function addBall(_arg1:Ball):Boolean{
var _local2:Boolean;
if (balls_.length < capacity_){
balls_.push(_arg1);
_local2 = true;
this.ballsLayerFg_.addChild(_arg1);
};
if (balls_.length == 1){
_arg1.x = (_arg1.x0 = (_arg1.x1 = 0));
_arg1.y = (_arg1.y0 = (_arg1.y1 = 0));
};
if (balls_.length == 2){
_arg1.x = (_arg1.x0 = (_arg1.x1 = -44));
_arg1.y = (_arg1.y0 = (_arg1.y1 = 19));
ballAdded_ = true;
ballAddedTick_ = tick_;
_arg1.clip.color.scaleX = (_arg1.clip.color.scaleY = 0);
};
return (_local2);
}
public function removeBall():void{
var _local1:Ball;
_local1 = balls_.shift();
}
public function isSwitchingBalls():Boolean{
return (isSwitchingBalls_);
}
public function canSwitchBalls():Boolean{
if (isSwitchingBalls_){
return (false);
};
if (doRelease_){
return (false);
};
return (true);
}
public function switchBalls():void{
var _local1:Ball;
isSwitchingBalls_ = true;
switchBallsTick_ = tick_;
_local1 = balls_[0];
_local1.parent.removeChild(_local1);
ballsLayerBg_.addChild(_local1);
}
public function switchBallsDone():void{
var _local1:Ball;
_local1 = balls_[0];
balls_[0] = balls_[1];
balls_[1] = _local1;
_local1 = balls_[0];
_local1.parent.removeChild(_local1);
ballsLayerFg_.addChild(_local1);
_local1 = balls_[1];
_local1.parent.removeChild(_local1);
ballsLayerFg_.addChild(_local1);
isSwitchingBalls_ = false;
}
public function generateLineBlast():void{
var _local1:Ball;
_local1 = balls_[0];
if (_local1 != null){
_local1.setIsLineBlast();
};
}
public function isReleasingBall():Boolean{
if (((doRelease_) && (!(hasReleased_)))){
return (true);
};
return (false);
}
public function releaseBall():void{
releaseTick_ = tick_;
doRelease_ = true;
hasReleased_ = false;
releaseBall_ = balls_[0];
releaseX_ = moveToX_;
}
public function doReleaseBall():void{
var _local1:Ball;
hasReleased_ = true;
releaseBall_.parent.removeChild(releaseBall_);
listener_.cannonReleasedBall(releaseBall_, releaseX_);
releaseBall_.clip.color.scaleX = 1;
releaseBall_.clip.color.scaleY = 1;
}
public function moveTo(_arg1:int):void{
if (((doRelease_) && (!(hasReleased_)))){
return;
};
if (moveToX_ != _arg1){
isMoving_ = true;
moveFromX_ = x1;
moveToX_ = _arg1;
moveTick_ = tick_;
moveTicks_ = 1;
};
}
public function tick(_arg1:Number):void{
var _local2:Ball;
var _local3:Number;
var _local5:int;
tick_ = _arg1;
var _local4:int;
while (_local4 < balls_.length) {
_local2 = balls_[_local4];
_local2.x0 = _local2.x1;
_local2.y0 = _local2.y1;
if (_local2.isLineBlast()){
_local2.lineblastTick++;
};
_local4++;
};
if (isMoving_){
x1 = moveToX_;
isMoving_ = false;
};
if (ballAdded_){
_local3 = AnimPlayer.tickToPercent(_arg1, ballAddedTick_, 8);
_local2.clip.color.scaleX = (_local2.clip.color.scaleY = _local3);
};
if (isSwitchingBalls_){
_local3 = AnimPlayer.tickToPercent(_arg1, switchBallsTick_, 5);
_local2 = balls_[0];
_local2.x1 = (0 - (44 * _local3));
_local2.y1 = (0 + (19 * _local3));
_local2 = balls_[1];
_local2.x1 = (-44 + (44 * _local3));
_local2.y1 = (19 - (19 * _local3));
if (_local3 >= 0.8){
_local2 = balls_[1];
_local2.parent.removeChild(_local2);
ballsLayerFg_.addChild(_local2);
};
if (_local3 >= 1){
switchBallsDone();
};
};
if (doRelease_){
_local2 = balls_[0];
_local3 = AnimPlayer.tickToPercent(_arg1, releaseTick_, 15);
_local5 = (1 + Math.floor((_local3 * 8)));
if (((!(hasReleased_)) && ((_local5 > 2)))){
_local5 = 3;
_local2.x = (_local2.x0 = (_local2.x1 = ballPos_[((2 * (_local5 - 1)) + 0)]));
_local2.y = (_local2.y0 = (_local2.y1 = ballPos_[((2 * (_local5 - 1)) + 1)]));
doReleaseBall();
};
_local3 = AnimPlayer.tickToPercent(_arg1, releaseTick_, 8);
_local2 = balls_[1];
_local2.x1 = (-44 + (44 * _local3));
_local2.y1 = (19 - (19 * _local3));
if (_local3 >= 1){
removeBall();
doRelease_ = false;
};
};
}
public function xToCol(_arg1:Number):Number{
_arg1 = Math.floor((_arg1 / Ball.WIDTH));
return (_arg1);
}
public function render(_arg1:int, _arg2:Number):void{
var _local3:Ball;
var _local5:Number;
this.x = (this.x0 + ((this.x1 - this.x0) * _arg2));
this.y = (this.y0 + ((this.y1 - this.y0) * _arg2));
var _local4 = 1;
var _local6:int;
while (_local6 < balls_.length) {
_local3 = balls_[_local6];
_local3.x = (_local3.x0 + ((_local3.x1 - _local3.x0) * _arg2));
_local3.y = (_local3.y0 + ((_local3.y1 - _local3.y0) * _arg2));
if (_local3.isLineBlast()){
_local3.lineblastClip.gotoAndStop(((_local3.lineblastTick % 15) + 1));
};
_local6++;
};
if (moveFromX_ < moveToX_){
_local5 = AnimPlayer.tickToPercent(x, (xToCol(x) * Ball.WIDTH), Ball.WIDTH);
_local4 = Math.floor((_local5 * 25));
_local4 = ((_local4 >= 26)) ? 1 : (_local4 + 63);
clip_.gotoAndStop(_local4);
};
if (moveFromX_ > moveToX_){
_local5 = (1 - AnimPlayer.tickToPercent(x, (xToCol(x) * Ball.WIDTH), Ball.WIDTH));
_local4 = Math.floor((_local5 * 25));
_local4 = ((_local4 >= 29)) ? 1 : (_local4 + 23);
clip_.gotoAndStop(_local4);
};
if (doRelease_){
_local5 = AnimPlayer.tickToPercent((_arg1 + _arg2), releaseTick_, 15);
_local4 = (1 + Math.floor((_local5 * 8)));
clip_.gotoAndStop(_local4);
if (((!(hasReleased_)) && ((_local4 <= 3)))){
_local3 = balls_[0];
_local3.x = (_local3.x0 = (_local3.x1 = ballPos_[((2 * (_local4 - 1)) + 0)]));
_local3.y = (_local3.y0 = (_local3.y1 = ballPos_[((2 * (_local4 - 1)) + 1)]));
};
};
}
}
}//package com.midasplayer.africanrainmaker
Section 20
//CannonListener (com.midasplayer.africanrainmaker.CannonListener)
package com.midasplayer.africanrainmaker {
public interface CannonListener {
function cannonReleasedBall(_arg1:Ball, _arg2:Number):void;
}
}//package com.midasplayer.africanrainmaker
Section 21
//Clock (com.midasplayer.africanrainmaker.Clock)
package com.midasplayer.africanrainmaker {
public class Clock {
private var maxTime_:Number;
private var time_:Number;
private var stopped_:Boolean;
public function Clock(){
time_ = 0;
stopped_ = true;
}
public function setMaxTime(_arg1:Number):void{
maxTime_ = _arg1;
}
public function getMaxTime():Number{
return (maxTime_);
}
public function setTime(_arg1:Number):void{
time_ = _arg1;
}
public function getTime():Number{
return (time_);
}
public function getTimeLeft():Number{
var _local1:Number = (maxTime_ - time_);
if (_local1 < 0){
_local1 = 0;
};
return (_local1);
}
public function getTimeLeftString():String{
var _local1:Number = getTimeLeft();
_local1 = Math.ceil((_local1 / 30));
var _local2:Number = (_local1 % 60);
var _local3:Number = Math.floor((_local1 / 60));
var _local4 = "";
if (_local3 <= 9){
_local4 = (_local4 + "0");
};
_local4 = (_local4 + _local3);
_local4 = (_local4 + ":");
if (_local2 <= 9){
_local4 = (_local4 + "0");
};
_local4 = (_local4 + _local2);
return (_local4);
}
public function start():void{
stopped_ = false;
}
public function stop():void{
stopped_ = true;
}
public function tick():void{
if (!stopped_){
setTime((time_ + 1));
};
}
}
}//package com.midasplayer.africanrainmaker
Section 22
//CloudRipple (com.midasplayer.africanrainmaker.CloudRipple)
package com.midasplayer.africanrainmaker {
public class CloudRipple {
public var x:int;
public var y:int;
public var speed:Number;
public var amp:Number;
public var pos:Number;// = 0
public function CloudRipple(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number){
this.x = _arg1;
this.y = _arg2;
this.speed = _arg3;
this.amp = _arg4;
}
public function tick():void{
pos = (pos + speed);
}
}
}//package com.midasplayer.africanrainmaker
Section 23
//CloudRipples (com.midasplayer.africanrainmaker.CloudRipples)
package com.midasplayer.africanrainmaker {
import com.midasplayer.util.*;
public class CloudRipples {
private var ripples_:ArrayList;
public function CloudRipples(){
ripples_ = new ArrayList();
}
public function numRipples():int{
return (ripples_.size());
}
public function addRipple(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number):void{
var _local5:CloudRipple;
if (ripples_.size() < 3){
_local5 = new CloudRipple(_arg1, _arg2, _arg3, _arg4);
ripples_.add(_local5);
};
}
public function apply(_arg1:Array, _arg2:int, _arg3:int):void{
var _local4:Ball;
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:CloudRipple;
var _local15:Number;
var _local20:Number;
var _local11 = 10000;
var _local12:int;
var _local13:Number = 0;
var _local14:Number = 0;
var _local16 = 10000;
var _local17:int;
var _local18:Number = 0;
var _local19:Number = 0;
var _local21:int = (ripples_.size() - 1);
while (_local21 >= 0) {
_local10 = CloudRipple(ripples_.get(_local21));
if (_local10.pos > 50){
ripples_.removeI(_local21);
};
_local21--;
};
if (ripples_.size() >= 1){
_local10 = CloudRipple(ripples_.get(0));
_local10.tick();
_local11 = _local10.x;
_local12 = _local10.y;
_local13 = _local10.speed;
_local14 = _local10.amp;
_local15 = _local10.pos;
};
if (ripples_.size() >= 2){
_local10 = CloudRipple(ripples_.get(1));
_local10.tick();
_local16 = _local10.x;
_local17 = _local10.y;
_local18 = _local10.speed;
_local19 = _local10.amp;
_local20 = _local10.pos;
};
_local5 = 0;
while (_local5 < (_arg2 + 1)) {
_local6 = 0;
while (_local6 < _arg3) {
_local4 = _arg1[_local5][_local6];
if (_local4 != null){
_local8 = (_local14 - Math.abs(((Math.abs((_local6 - _local11)) + Math.abs((_local5 - _local12))) - _local15)));
_local9 = (_local19 - Math.abs(((Math.abs((_local6 - _local16)) + Math.abs((_local5 - _local17))) - _local20)));
_local8 = ((_local8)>0) ? _local8 = (_local8 / _local14);
_local8 : 0;
_local9 = ((_local9)>0) ? _local9 = (_local9 / _local19);
_local9 : 0;
_local7 = _local8;
_local7 = ((_local9)>_local7) ? _local9 : _local7;
_local4.f0 = _local4.f1;
_local4.f1 = _local7;
};
_local6++;
};
_local5++;
};
}
}
}//package com.midasplayer.africanrainmaker
Section 24
//Combo (com.midasplayer.africanrainmaker.Combo)
package com.midasplayer.africanrainmaker {
import com.midasplayer.africanrainmaker.anim.*;
public class Combo {
private var type_:Number;
private var board_:Board;
private var sequenceNumber_:Number;
private var col1_:Number;
private var row1_:Number;
private var balls_:Array;
private var squareBalls_:Array;
private var drumsGenerated_:Boolean;// = false
private var jewelGenerated_:Boolean;// = false
private var lineBlastGenerated_:Boolean;// = false
private var lineBlasts_:Array;
private var animTime_:Number;// = 0
private var tick_:Number;// = 0
private var score_:Number;// = 0
private var bengalAnim_:BengalAnim;// = null
private var lineBlastAnims_:Array;// = null
private var numStonesDestroyed_:int;// = 0
public static var TYPE_COLOR:int = 1;
public static var TYPE_COLUMN:int = 2;
public static var TYPE_LINE:int = 3;
public static var TYPE_DRUM_GENERATED:int = 4;
public static var TYPE_JEWEL:int = 5;
public function Combo(_arg1:Board, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
board_ = _arg1;
sequenceNumber_ = _arg2;
type_ = _arg3;
col1_ = _arg4;
row1_ = _arg5;
balls_ = new Array();
lineBlastAnims_ = new Array();
animTime_ = 5;
if (type_ == TYPE_COLUMN){
animTime_ = 10;
};
}
public function addBalls(_arg1:Array):void{
var _local2:int;
while (_local2 < _arg1.length) {
balls_[_local2] = _arg1[_local2];
_local2++;
};
}
public function setSequenceNumber(_arg1:Number):void{
sequenceNumber_ = _arg1;
}
public function getType():Number{
return (type_);
}
public function markBricks():Number{
if (type_ == TYPE_COLOR){
markColorCombo();
};
if (type_ == TYPE_COLUMN){
};
return (balls_.length);
}
public function markColorCombo():void{
var _local1:int = balls_.length;
var _local2:int;
while (_local2 < _local1) {
balls_[_local2].markForColorCombo();
_local2++;
};
findSquares();
findLineBlasts();
}
public function markColumnCombo():void{
var _local1:int = balls_.length;
var _local2:int;
while (_local2 < _local1) {
balls_[_local2].markForColumnCombo();
_local2++;
};
}
public function findSquares():void{
var _local2:Ball;
var _local3:Ball;
var _local4:Ball;
var _local5:Ball;
var _local1:int = balls_.length;
squareBalls_ = new Array();
var _local6:int;
while (_local6 < _local1) {
_local2 = balls_[_local6];
_local3 = board_.getBall(_local2.row, (_local2.col + 1));
_local4 = board_.getBall((_local2.row + 1), _local2.col);
_local5 = board_.getBall((_local2.row + 1), (_local2.col + 1));
if (((((((((((((((((((!(_local2.squareMarked)) && (!((_local3 == null))))) && ((_local2.markId == _local3.markId)))) && (!(_local3.squareMarked)))) && (!((_local4 == null))))) && ((_local2.markId == _local4.markId)))) && (!(_local4.squareMarked)))) && (!((_local5 == null))))) && ((_local2.markId == _local5.markId)))) && (!(_local5.squareMarked)))){
_local2.squareMarked = true;
_local3.squareMarked = true;
_local4.squareMarked = true;
_local5.squareMarked = true;
squareBalls_.push(_local2);
};
_local6++;
};
}
public function hasSquare():Boolean{
return ((squareBalls_.length > 0));
}
public function findLineBlasts():void{
var _local1:Ball;
var _local2:int = balls_.length;
lineBlasts_ = new Array();
var _local3:int;
while (_local3 < _local2) {
_local1 = balls_[_local3];
if (_local1.isLineBlast()){
lineBlasts_.push(findLineBlastBalls(_local1));
};
_local3++;
};
}
public function findLineBlastBalls(_arg1:Ball):Array{
var _local2:Array = new Array();
var _local3:Ball;
_local2.push(_arg1);
var _local4:int = board_.getMaxCols();
var _local5 = 1;
while (_local5 < _local4) {
_local3 = board_.getBall(_arg1.row, (_arg1.col + _local5));
if (_local3 != null){
_local2.push(_local3);
};
_local3 = board_.getBall(_arg1.row, (_arg1.col - _local5));
if (_local3 != null){
_local2.push(_local3);
};
_local5++;
};
return (_local2);
}
public function tick():Boolean{
var _local10:int;
var _local11:Number;
var _local12:int;
var _local13:Array;
var _local14:LineBlastAnim;
var _local15:Number;
var _local16:Number;
var _local17:LineBlastAnim;
var _local18:Boolean;
var _local19:Drum;
var _local1:Boolean;
var _local2:Ball;
var _local3:int = balls_.length;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Number = 0;
var _local9:Number = 0;
if (type_ == Combo.TYPE_COLOR){
if (tick_ >= animTime_){
_local1 = true;
};
if (tick_ == 0){
board_.listener_.combo(sequenceNumber_);
};
if (tick_ == (animTime_ - 3)){
_local4 = 0;
while (_local4 < _local3) {
_local2 = balls_[_local4];
if ((((board_.getBall(_local2.row, _local2.col) == _local2)) && (!(_local2.isBeingRemoved())))){
board_.listener_.ballRemoved((_local2.x0 + (Ball.WIDTH / 2)), (_local2.y0 + (Ball.HEIGHT / 2)), false, 2);
board_.removeBall(_local2);
};
_local4++;
};
};
if (tick_ == (animTime_ - 1)){
_local4 = 0;
while (_local4 < _local3) {
_local2 = balls_[_local4];
if ((((board_.getBall(_local2.row, _local2.col) == _local2)) && (!(_local2.isBeingRemoved())))){
};
_local4++;
};
_local10 = (50 * (_local3 - 3));
_local11 = (1 + (0.2 * (sequenceNumber_ - 1)));
_local12 = ((_local3 * _local10) * sequenceNumber_);
_local8 = (((col1_ * Ball.WIDTH) + board_.x) + (Ball.WIDTH / 2));
_local9 = ((row1_ * Ball.HEIGHT) + board_.y);
board_.addScore(_local12, _local8, _local9, TYPE_COLOR, _local3, _local10, sequenceNumber_);
};
if ((((squareBalls_.length > 0)) && (!(drumsGenerated_)))){
_local4 = 0;
while (_local4 < squareBalls_.length) {
_local2 = squareBalls_[_local4];
board_.generateDrum(_local2.color, _local2.x1, _local2.y1);
_local4++;
};
drumsGenerated_ = true;
};
if ((((_local3 >= 8)) && (!(lineBlastGenerated_)))){
lineBlastGenerated_ = true;
board_.generateLineBlast();
};
if (!jewelGenerated_){
_local2 = balls_[0];
board_.generateJewel(_local2.color, balls_.length, _local2);
jewelGenerated_ = true;
};
if (lineBlasts_.length > 0){
_local6 = lineBlasts_.length;
_local4 = 0;
while (_local4 < _local6) {
_local13 = lineBlasts_[_local4];
_local7 = _local13.length;
_local2 = _local13[0];
if (tick_ == 0){
_local17 = board_.listener_.lineBlast((_local2.x0 + (Ball.WIDTH / 2)), (_local2.y0 + (Ball.HEIGHT / 2)));
lineBlastAnims_.push(_local17);
};
_local14 = lineBlastAnims_[_local4];
_local15 = _local2.x0;
_local16 = _local14.getDX();
if (!_local14.isDone()){
_local1 = false;
};
_local5 = 0;
while (_local5 < _local7) {
_local2 = _local13[_local5];
_local18 = false;
if (_local2.x0 == _local15){
_local18 = true;
} else {
if (_local2.x0 < _local15){
_local18 = (_local2.x0 >= ((_local15 - _local16) - Ball.WIDTH));
} else {
_local18 = (_local2.x0 <= ((_local15 + _local16) + Ball.WIDTH));
};
};
if (((((_local18) && ((board_.getBall(_local2.row, _local2.col) == _local2)))) && (!(_local2.isBeingRemoved())))){
if (_local2.isFalling()){
} else {
board_.removeBall(_local2, 12);
board_.listener_.ballRemoved((_local2.x0 + (Ball.WIDTH / 2)), (_local2.y0 + (Ball.HEIGHT / 2)), true, 2);
score_ = (score_ + (_local2.isStone()) ? 500 : 100);
if (_local2.isStone()){
numStonesDestroyed_++;
};
};
};
_local5++;
};
_local4++;
};
if (((_local1) && ((score_ > 0)))){
_local8 = (((col1_ * Ball.WIDTH) + board_.x) + (Ball.WIDTH / 2));
_local9 = ((row1_ * Ball.HEIGHT) + board_.y);
board_.addScore(score_, _local8, _local9, TYPE_LINE, numStonesDestroyed_, 0, sequenceNumber_);
};
};
} else {
if (type_ == Combo.TYPE_COLUMN){
if (tick_ == 0){
bengalAnim_ = board_.listener_.bengalFire(((col1_ * Ball.WIDTH) + (Ball.WIDTH / 2)), 470);
};
if (bengalAnim_ != null){
_local4 = 0;
while (_local4 < (board_.getMaxRows() + 1)) {
_local2 = board_.getBall(_local4, col1_);
if (((((!((_local2 == null))) && (!(_local2.isBeingRemoved())))) && ((_local2.y0 > bengalAnim_.getY())))){
board_.listener_.ballRemoved((_local2.x0 + (Ball.WIDTH / 2)), (_local2.y0 + (Ball.HEIGHT / 2)), true, 2);
board_.removeBall(_local2);
score_ = (score_ + 200);
if (_local2.isStone()){
numStonesDestroyed_++;
};
};
_local4++;
};
_local1 = bengalAnim_.isDone();
if (_local1){
_local19 = board_.getDrum(col1_);
if (_local19 != null){
_local19.setBlast(false);
};
};
if (((_local1) && ((score_ > 0)))){
_local8 = (((col1_ * Ball.WIDTH) + board_.x) + (Ball.WIDTH / 2));
_local9 = 400;
board_.addScore(score_, _local8, _local9, TYPE_COLUMN, numStonesDestroyed_, 0, sequenceNumber_);
};
};
};
};
tick_++;
return (_local1);
}
public function render(_arg1:Number):void{
}
}
}//package com.midasplayer.africanrainmaker
Section 25
//Drum (com.midasplayer.africanrainmaker.Drum)
package com.midasplayer.africanrainmaker {
import flash.display.*;
public class Drum extends Sprite {
public var x0:Number;
public var y0:Number;
public var x1:Number;
public var y1:Number;
public var scale0:Number;
public var scale1:Number;
public var startX:Number;
public var startY:Number;
public var col:Number;// = 0
public var color:int;
public var fallTick:int;// = 0
public var numFallTicks:int;// = 0
public var blast:Boolean;// = false
private var isActive_:Boolean;// = false
private var bounceTick_:Number;// = 0
private var activatedTick_:Number;// = 0
private var baseFrame_:int;// = 0
public var clip:MovieClip;
private var activatedFrames:Array;
public function Drum(_arg1:int){
activatedFrames = [15, 16, 17, 18, 19, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 11, 12, 13, 14];
super();
this.color = _arg1;
clip = new drum();
baseFrame_ = (((_arg1 - 1) * 30) + 1);
clip.gotoAndStop(baseFrame_);
inActivate();
setBlast(false);
this.addChild(clip);
this.mouseChildren = false;
this.mouseEnabled = false;
}
public function getBlast():Boolean{
return (this.blast);
}
public function setBlast(_arg1:Boolean):void{
this.blast = _arg1;
}
public function isFalling():Boolean{
return ((fallTick < numFallTicks));
}
public function isActive():Boolean{
return (isActive_);
}
public function activate():void{
isActive_ = true;
}
public function inActivate():void{
isActive_ = false;
}
public function bounce():void{
if (bounceTick_ == 0){
bounceTick_ = 1;
};
}
public function tick():void{
if (bounceTick_ > 0){
bounceTick_++;
if (bounceTick_ == 12){
bounceTick_ = 0;
activatedTick_ = 0;
};
};
if (isActive_){
activatedTick_++;
};
}
public function render(_arg1:Number):void{
if (bounceTick_ != 0){
clip.gotoAndStop((baseFrame_ + Math.round((9 * (bounceTick_ / 12)))));
} else {
if (isActive_){
clip.gotoAndStop(((baseFrame_ + activatedFrames[(Math.round((activatedTick_ * 0.8)) % activatedFrames.length)]) - 1));
} else {
clip.gotoAndStop(baseFrame_);
};
};
}
}
}//package com.midasplayer.africanrainmaker
Section 26
//Game (com.midasplayer.africanrainmaker.Game)
package com.midasplayer.africanrainmaker {
import flash.events.*;
import com.midasplayer.africanrainmaker.anim.*;
import com.midasplayer.gamecomm.*;
import flash.display.*;
import com.midasplayer.sound.*;
import com.midasplayer.math.*;
import com.midasplayer.util.*;
import flash.filters.*;
public class Game extends Sprite implements CannonListener, BoardListener {
private var state_:int;
private var seed_:Number;
private var random_:MtRandom;
private var randomBoard_:MtRandom;
private var randomCannonBalls_:MtRandom;
private var randomSound_:MtRandom;
private var board_:Board;
private var cannon_:Cannon;
private var releaseBall_:Boolean;// = false
private var switchBalls_:Boolean;// = false
private var ripple_:Ripple;
private var clock_:Clock;
private var score_:int;// = 0
private var soundManager:SoundManager;
private var endGameButtonClip_:MovieClip;
private var musicButtonClip_:MovieClip;
private var soundButtonClip_:MovieClip;
private var ripples_:Array;
protected var introAnim_:IntroAnim;// = null
private var gameStarted_:Boolean;// = false
private var bgClip_:Sprite;
private var bgLowClip_:Sprite;
private var gameOverClip_:MovieClip;
private var bgLayer_:Sprite;
private var introLayer_:Sprite;
private var boardLayer_:Sprite;
private var outroLayer_:Sprite;
private var outroBgLayer_:Sprite;
private var gameOverLayer_:Sprite;
private var scorePanelLayer_:Sprite;
private var buttonPanelLayer_:Sprite;
private var scorePopLayer_:Sprite;
protected var gameCommunicator_:IGameComm;
protected var gameData_:GameData;
private var quitGame_:Boolean;// = false
private var quitted_:Boolean;// = false
private var ended_:Boolean;// = false
private var soundOn_:Boolean;// = true
private var musicOn_:Boolean;// = true
private var drumMode_:Boolean;// = false
private var tick_:int;// = 0
private var lastBengalTick_:int;// = 0
private var endedTick_:int;// = 0
private var timeWarning_:Boolean;// = false
private var endGamePressed_:Boolean;// = false
private var animPlayer_:AnimPlayer;
private var bestScore_:int;
private var newBestScore_:Boolean;// = false
private var numBlackCloudsDestroyed_:int;
private var numBlackCloudsDestroyedNow_:int;// = 0
private var numLineBlasts_:int;
private var numLineBlastsNow_:int;// = 0
private var numBengalFires_:int;
private var numBengalFiresNow_:int;// = 0
private var numDrumsGenerated_:int;
private var numDrumsGeneratedNow_:int;// = 0
private var numGamesPlayed_:int;
public var hasElephantTrophy:Boolean;// = false
public var hasGiraffeTrophy:Boolean;// = false
public var hasLeopardTrophy:Boolean;// = false
public var hasRhinoTrophy:Boolean;// = false
public var hasLionTrophy:Boolean;// = false
public var hasMonkeyTrophy:Boolean;// = false
public var gotElephantTrophy:Boolean;// = false
public var gotGiraffeTrophy:Boolean;// = false
public var gotLeopardTrophy:Boolean;// = false
public var gotRhinoTrophy:Boolean;// = false
public var gotLionTrophy:Boolean;// = false
public var gotMonkeyTrophy:Boolean;// = false
private var glowFilters_:Array;
private var _hasEndedTimeWarning:Boolean;// = false
private static var GAME_VERSION:int = 1;
private static var STATE_INIT:int = 0;
private static var STATE_PLAY:int = 1;
private static var STATE_WAIT_END:int = 9;
private static var STATE_ENDED:int = 10;
public function Game(){
var _local1:String;
state_ = STATE_INIT;
super();
if (GameComm.isAvailable()){
gameCommunicator_ = new GameComm();
} else {
_local1 = (((((((((((((((((((((((((((((((((((((("<gamedata randomseed=\"952270296\">" + "<music>0</music>") + "<sound>0</sound>") + "<gameMode>0</gameMode>") + "<bestScore>299990</bestScore>") + "<numBlackCloudsDestroyed>2000</numBlackCloudsDestroyed>") + "<numLineBlasts>1199</numLineBlasts>") + "<numBengalFires>299</numBengalFires>") + "<numDrumsGenerated>999</numDrumsGenerated>") + "<numGamesPlayed>199</numGamesPlayed>") + "<booster_1>1</booster_1>") + "<booster_2>1</booster_2>") + "<text id=\"game_starts\">The game starts in {0} seconds</text>") + "<text id=\"game_starts_1sec\">The game starts in {0} second</text>") + "<text id=\"game_over\">Game over!</text>") + "<text id=\"game_ends\">The game ends in {0} seconds</text>") + "<text id=\"game_ends_1sec\">The game ends in {0} second</text>") + "<text id=\"score\">Score</text>") + "<text id=\"best_score\">Personal best</text>") + "<text id=\"new_best_score\">New personal best!</text>") + "<text id=\"drums_created_stats\">Drums created: {0} (total {1})</text>") + "<text id=\"line_blast_stats\">Line blasts: {0} (total {1})</text>") + "<text id=\"bengal_stats\">Bengal fires: {0} (total {1})</text>") + "<text id=\"black_cloud_stats\">Black clouds destroyed: {0} (total {1})</text>") + "<text id=\"games_played_stats\">Games played: {0}</text>") + "<text id=\"trophy_elephant\">Play 200 games to collect trophy!</text>") + "<text id=\"trophy_giraffe\">Set a high score of 100000 or more to collect trophy!</text>") + "<text id=\"trophy_leopard\">Detonate 200 line blasts to collect trophy!</text>") + "<text id=\"trophy_rhino\">Detonate 100 bengal fires to collect trophy!</text>") + "<text id=\"trophy_lion\">Destroy 100 black clouds to collect trophy!</text>") + "<text id=\"trophy_monkey\">Generate 1000 drums to collect trophy!</text>") + "<text id=\"instructions\">Instructions</text>") + "<text id=\"instructions1\">Move the medicine man sideways to select where to send up magic masks. If 4 or more masks of the same colour touch they disappear.\n\nNew masks advance towards you from above, do not let them reach you!\n\nMake a group of 4 squared masks of the same colour to create a magic drum.</text>") + "<text id=\"instructions2\">When falling bonus objects land on a drum of the same colour it will be activated\n\nActivate 3 drums of the same colour to reach the Rainmaker mode.</text>") + "<text id=\"instructions3\">Special powerballs can be generated by doing large combinations or long chains. Several special objects only appear during the rainmaker mode.</text>") + "<text id=\"instructions3_1\">Line blast: Clears a whole row. Create it by making a group of 8 or more touching masks</text>") + "<text id=\"instructions3_2\">Bengal fire: make a bounus gem bounce on a drum of the same colour to trigger a vertical bengal fire blast</text>") + "<text id=\"register\">Register to continue playing and complete the game!</text>") + "</gamedata>");
gameCommunicator_ = new DebugGameComm(_local1);
};
soundOn_ = true;
musicOn_ = true;
animPlayer_ = new AnimPlayer();
}
public function init():void{
var _local2:int;
gameData_ = new GameData(gameCommunicator_.getGameData());
seed_ = gameData_.randomSeed;
random_ = new MtRandom(seed_);
randomBoard_ = new MtRandom(seed_);
randomSound_ = new MtRandom(seed_);
stage.quality = "low";
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
if (gameData_.getElementTextAsInt("music") == 0){
musicOn_ = false;
};
if (gameData_.getElementTextAsInt("sound") == 0){
soundOn_ = false;
};
bestScore_ = gameData_.getElementTextAsInt("bestScore");
numBlackCloudsDestroyed_ = gameData_.getElementTextAsInt("numBlackCloudsDestroyed");
numLineBlasts_ = gameData_.getElementTextAsInt("numLineBlasts");
numBengalFires_ = gameData_.getElementTextAsInt("numBengalFires");
numDrumsGenerated_ = gameData_.getElementTextAsInt("numDrumsGenerated");
numGamesPlayed_ = gameData_.getElementTextAsInt("numGamesPlayed");
hasElephantTrophy = (numGamesPlayed_ >= 200);
hasGiraffeTrophy = (bestScore_ >= 100000);
hasLeopardTrophy = (numLineBlasts_ >= 200);
hasRhinoTrophy = (numBengalFires_ >= 100);
hasLionTrophy = (numBlackCloudsDestroyed_ >= 100);
hasMonkeyTrophy = (numDrumsGenerated_ >= 1000);
numGamesPlayed_++;
soundManager = new SoundManager();
soundManager.getFromClass(sound_intro).loop((musicOn_) ? 0.5 : 0);
var _local1 = 30;
clock_ = new Clock();
clock_.setMaxTime(((60 * 2) * _local1));
if (gameData_.getElementTextAsBool("booster_1")){
clock_.setMaxTime((clock_.getMaxTime() + (10 * _local1)));
};
if (gameData_.getElementTextAsInt("gameMode") == 1){
clock_.setMaxTime(((60 * 1) * _local1));
};
ripples_ = new Array();
bgLayer_ = new Sprite();
this.addChild(bgLayer_);
boardLayer_ = new Sprite();
this.addChild(boardLayer_);
boardLayer_.mouseChildren = false;
boardLayer_.mouseEnabled = false;
introLayer_ = new Sprite();
this.addChild(introLayer_);
scorePanelLayer_ = new Sprite();
this.addChild(scorePanelLayer_);
scorePanelLayer_.mouseChildren = false;
scorePanelLayer_.mouseEnabled = false;
scorePanelLayer_.visible = false;
scorePopLayer_ = new Sprite();
this.addChild(scorePopLayer_);
scorePopLayer_.mouseChildren = false;
scorePopLayer_.mouseEnabled = false;
outroBgLayer_ = new Sprite();
this.addChild(outroBgLayer_);
gameOverLayer_ = new Sprite();
this.addChild(gameOverLayer_);
outroLayer_ = new Sprite();
this.addChild(outroLayer_);
buttonPanelLayer_ = new Sprite();
this.addChild(buttonPanelLayer_);
glowFilters_ = new Array();
_local2 = 0;
while (_local2 < 16) {
glowFilters_.push([new GlowFilter(0xFFFFFF, 1, 6, 6, ((3 * _local2) / 16), 2, false, false)]);
_local2++;
};
_local2 = (16 - 1);
while (_local2 >= 0) {
glowFilters_.push([new GlowFilter(0xFFFFFF, 1, 6, 6, ((3 * _local2) / 16), 2, false, false)]);
_local2--;
};
initBackground();
initCannon();
initBoard();
initIntro();
initPanel();
fillCannon();
showIntro();
}
public function getGameData():GameData{
return (gameData_);
}
public function initIntro():void{
showBoard();
}
public function showIntro():void{
introAnim_ = new IntroAnim(this, introLayer_);
animPlayer_.addAnim(introAnim_);
}
public function endIntro():void{
gameCommunicator_.gameStart();
gameCommunicator_.addPlayData((((("11," + tick_) + " ") + GAME_VERSION) + "=0"));
showBoardIntro();
}
public function showBoardIntro():void{
animPlayer_.addAnim(new BoardIntroAnim(this, board_, seed_));
}
public function endBoardIntro():void{
showCannon();
soundManager.getFromClass(sound_intro).fadeToAndStop(0, 1000);
soundManager.getFromClass(sound_loop).loop(0);
soundManager.getFromClass(sound_loop_drum).loop(0);
soundManager.getFromClass(sound_loop).fadeTo((musicOn_) ? 0.5 : 0, 500);
soundManager.getFromClass(sound_loop_drum).fadeTo((musicOn_) ? 0 : 0, 500);
gameStarted_ = true;
gameCommunicator_.addPlayData((("12," + tick_) + "=0"));
bgLayer_.addEventListener(MouseEvent.CLICK, onMouseClick);
stage.focus = stage;
clock_.start();
showPanel();
state_ = STATE_PLAY;
}
public function initBackground():void{
bgClip_ = new bg();
bgLayer_.addChild(bgClip_);
bgLowClip_ = new bg_low();
bgLayer_.addChild(bgLowClip_);
bgLowClip_.y = (566 - 165);
}
public function initPanel():void{
var _local1:MovieClip;
var _local2:int;
var _local3:MovieClip;
_local1 = new end_game_button();
_local1.x = 0;
_local1.y = (566 - _local1.height);
_local1.buttonMode = true;
_local1.mouseChildren = false;
_local1.gotoAndStop(1);
endGameButtonClip_ = _local1;
_local1 = new music_button();
_local1.x = (_local1.width + 1);
_local1.y = (566 - _local1.height);
_local1.buttonMode = true;
_local1.mouseChildren = false;
_local1.gotoAndStop((musicOn_) ? 1 : 2);
_local1.addEventListener(MouseEvent.MOUSE_UP, musicPressed);
buttonPanelLayer_.addChild(_local1);
musicButtonClip_ = _local1;
_local1 = new sound_button();
_local1.x = ((_local1.width + 1) * 2);
_local1.y = (566 - _local1.height);
_local1.buttonMode = true;
_local1.mouseChildren = false;
_local1.gotoAndStop((soundOn_) ? 1 : 2);
_local1.addEventListener(MouseEvent.MOUSE_UP, soundPressed);
buttonPanelLayer_.addChild(_local1);
soundButtonClip_ = _local1;
gameOverClip_ = new scoreboard();
gameOverClip_.header_txt.text = "";
gameOverClip_.score_txt.text = "";
gameOverClip_.best_score_txt.text = "";
gameOverClip_.stats1_txt.text = "";
gameOverClip_.stats2_txt.text = "";
gameOverClip_.stats3_txt.text = "";
gameOverClip_.stats4_txt.text = "";
gameOverClip_.stats5_txt.text = "";
gameOverClip_.game_ends_txt.text = "";
gameOverClip_.register_txt.text = "";
if (gameData_.getElementTextAsInt("gameMode") == 1){
gameOverClip_.register_txt.text = gameData_.getText("register");
};
gameOverClip_.gotoAndStop(1);
}
public function showPanel():void{
buttonPanelLayer_.addChild(endGameButtonClip_);
endGameButtonClip_.addEventListener(MouseEvent.MOUSE_UP, endGamePressed);
animPlayer_.addAnim(new ShowScorePanelAnim(scorePanelLayer_));
animPlayer_.addAnim(new UpdateScorePanelAnim(this, scorePanelLayer_));
}
public function initBoard():void{
ripple_ = new Ripple(bgLowClip_, 10, 10);
var _local1:Number = randomBoard_.nextInt(1000000);
var _local2:Number = 3;
board_ = new Board(this, _local1, _local2, 10, 10, 5, 566);
board_.x = 100;
board_.y = 20;
if (gameData_.getElementTextAsBool("booster_2")){
board_.generateRandomDrums(3, true);
};
boardLayer_.addChild(board_);
randomCannonBalls_ = new MtRandom(_local1);
}
public function showBoard():void{
}
public function initCannon():void{
cannon_ = new Cannon(this);
cannon_.y = (cannon_.y0 = (cannon_.y1 = 440));
cannon_.visible = false;
boardLayer_.addChild(cannon_);
}
public function fillCannon():void{
while (!(cannon_.isFull())) {
cannon_.addBall(board_.getNextCannonBall());
};
}
public function showCannon():void{
var _local1:int = board_.xToCol((getMouseX() - (Ball.WIDTH / 2)));
_local1 = ((_local1 < 0)) ? 0 : _local1;
_local1 = ((_local1 >= board_.getMaxCols())) ? (board_.getMaxCols() - 1) : _local1;
cannon_.x = (cannon_.x0 = (cannon_.x1 = ((_local1 * Ball.WIDTH) + board_.x)));
cannon_.visible = true;
animPlayer_.addAnim(new AimAnim(cannon_, board_, 0, seed_));
}
public function onMouseClick(_arg1:MouseEvent):void{
setReleaseBall();
}
public function onMouseClickGameOver(_arg1:MouseEvent):void{
quitGame_ = true;
}
public function setReleaseBall():void{
releaseBall_ = true;
}
public function onKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 32){
setSwitchBalls();
};
}
public function setSwitchBalls():void{
switchBalls_ = true;
}
public function activateDrumMode():void{
if (!drumMode_){
drumMode_ = true;
if (!ended_){
soundManager.getFromClass(sound_loop).setVolume((musicOn_) ? (drumMode_) ? 0 : 0.5 : 0);
soundManager.getFromClass(sound_loop_drum).setVolume((musicOn_) ? (drumMode_) ? 0.5 : 0 : 0);
soundManager.getFromClass(sound_drum_mode).play((soundOn_) ? 1 : 0);
};
};
}
public function generateLineBlast():void{
cannon_.generateLineBlast();
}
public function addScore(_arg1:int, _arg2:Number, _arg3:Number, _arg4:int=0, _arg5:int=0, _arg6:int=0, _arg7:int=0):void{
animPlayer_.addAnim(new ScorePopAnim(scorePopLayer_, _arg1, _arg2, _arg3));
score_ = (score_ + _arg1);
if (_arg4 == Combo.TYPE_COLOR){
gameCommunicator_.addPlayData(((((((((("21," + tick_) + " ") + _arg5) + " ") + _arg6) + " ") + _arg7) + "=") + _arg1));
} else {
if (_arg4 == Combo.TYPE_COLUMN){
gameCommunicator_.addPlayData(((((((("22," + tick_) + " ") + _arg7) + " ") + _arg5) + "=") + _arg1));
numBlackCloudsDestroyed_ = (numBlackCloudsDestroyed_ + _arg5);
numBlackCloudsDestroyedNow_ = (numBlackCloudsDestroyedNow_ + _arg5);
numBengalFires_++;
numBengalFiresNow_++;
} else {
if (_arg4 == Combo.TYPE_LINE){
gameCommunicator_.addPlayData(((((((("23," + tick_) + " ") + _arg7) + " ") + _arg5) + "=") + _arg1));
numBlackCloudsDestroyed_ = (numBlackCloudsDestroyed_ + _arg5);
numBlackCloudsDestroyedNow_ = (numBlackCloudsDestroyedNow_ + _arg5);
numLineBlasts_++;
numLineBlastsNow_++;
} else {
if (_arg4 == Combo.TYPE_DRUM_GENERATED){
gameCommunicator_.addPlayData(((("24," + tick_) + "=") + _arg1));
numDrumsGenerated_++;
numDrumsGeneratedNow_++;
} else {
if (_arg4 == Combo.TYPE_JEWEL){
gameCommunicator_.addPlayData(((((((("25," + tick_) + " ") + _arg5) + " ") + _arg6) + "=") + _arg1));
};
};
};
};
};
}
public function setScore(_arg1:int):void{
score_ = _arg1;
}
public function drumCreated():void{
soundManager.getFromClass(sound_drum_created).play((soundOn_) ? 0.7 : 0);
}
public function drumHit():void{
var _local1:int = randomSound_.nextInt(7);
var _local2:Number = (0.5 + (randomSound_.nextDouble() * 0.3));
if (!soundOn_){
_local2 = 0;
};
if (_local1 == 0){
soundManager.getFromClass(sound_beat1).play(_local2);
};
if (_local1 == 1){
soundManager.getFromClass(sound_beat2).play(_local2);
};
if (_local1 == 2){
soundManager.getFromClass(sound_beat3).play(_local2);
};
if (_local1 == 3){
soundManager.getFromClass(sound_beat4).play(_local2);
};
if (_local1 == 4){
soundManager.getFromClass(sound_beat5).play(_local2);
};
if (_local1 == 5){
soundManager.getFromClass(sound_beat6).play(_local2);
};
if (_local1 == 6){
soundManager.getFromClass(sound_beat7).play(_local2);
};
}
public function drumActivated(_arg1:Drum):void{
gameCommunicator_.addPlayData(((("31," + tick_) + "=") + 0));
}
public function drumWrecked(_arg1:Drum):void{
var _local2:DrumBrokenAnim;
_local2 = new DrumBrokenAnim(board_.getBengalLayer(), (_arg1.x0 + (Ball.WIDTH / 2)), _arg1.y0);
animPlayer_.addAnim(_local2);
soundManager.getFromClass(sound_wrecked).play((soundOn_) ? 1 : 0);
}
public function boardFull():void{
soundManager.getFromClass(sound_full).play((soundOn_) ? 1 : 0);
}
public function combo(_arg1:int):void{
soundManager.getFromClass(sound_combo).play((soundOn_) ? 0.9 : 0);
}
public function ballRemoved(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Number):void{
var _local5:BallExplosionAnim = new BallExplosionAnim(board_.getBallsExplosionLayer(), _arg1, _arg2, _arg3, _arg4);
animPlayer_.addAnim(_local5);
}
public function bengalFire(_arg1:Number, _arg2:Number):BengalAnim{
var _local3:BengalAnim = new BengalAnim(board_.getBengalLayer(), _arg1, _arg2);
animPlayer_.addAnim(_local3);
if (tick_ != lastBengalTick_){
lastBengalTick_ = tick_;
soundManager.getFromClass(sound_bengal1).play((soundOn_) ? 0.45 : 0);
};
return (_local3);
}
public function lineBlast(_arg1:Number, _arg2:Number):LineBlastAnim{
var _local3:LineBlastAnim;
_local3 = new LineBlastAnim(board_.getBengalLayer(), (_arg1 + 30), _arg2, true);
animPlayer_.addAnim(_local3);
_local3 = new LineBlastAnim(board_.getBengalLayer(), (_arg1 - 30), _arg2, false);
animPlayer_.addAnim(_local3);
soundManager.getFromClass(sound_line_blast).play((soundOn_) ? 0.5 : 0);
return (_local3);
}
public function trophyUnlocked():void{
soundManager.getFromClass(sound_trophy).play((soundOn_) ? 0.5 : 0);
}
public function getClock():Clock{
return (clock_);
}
public function getScore():int{
return (score_);
}
public function getMultiplier():int{
return (board_.getMultiplier());
}
public function ripple(_arg1:Number, _arg2:Number):void{
ripples_.push(_arg1);
}
public function cannonReleasedBall(_arg1:Ball, _arg2:Number):void{
board_.releaseBall(_arg1, (cannon_.x0 - board_.x), (cannon_.y0 - board_.y), (_arg2 - board_.x));
}
public function musicPressed(_arg1:MouseEvent):void{
_arg1.stopPropagation();
musicOn_ = !(musicOn_);
setSoundButtons();
soundManager.getFromClass(sound_intro).setVolume((((musicOn_) && (!(ended_)))) ? 0.5 : 0);
soundManager.getFromClass(sound_loop).setVolume((((musicOn_) && (!(ended_)))) ? (drumMode_) ? 0 : 0.5 : 0);
soundManager.getFromClass(sound_loop_drum).setVolume((((musicOn_) && (!(ended_)))) ? (drumMode_) ? 0.5 : 0 : 0);
soundManager.getFromClass(sound_game_over).setVolume((musicOn_) ? 0.5 : 0);
}
public function soundPressed(_arg1:MouseEvent):void{
_arg1.stopPropagation();
soundOn_ = !(soundOn_);
setSoundButtons();
}
public function setSoundButtons():void{
var _local1:MovieClip;
_local1 = soundButtonClip_;
_local1.gotoAndStop((soundOn_) ? 1 : 2);
_local1 = musicButtonClip_;
_local1.gotoAndStop((musicOn_) ? 1 : 2);
}
public function endGamePressed(_arg1:MouseEvent):void{
endGamePressed_ = true;
}
public function endGame():void{
if (!ended_){
board_.endGame();
soundManager.getFromClass(sound_loop).fadeToAndStop(0, 1000);
soundManager.getFromClass(sound_loop_drum).fadeToAndStop(0, 1000);
soundManager.getFromClass(sound_game_over).play(0);
soundManager.getFromClass(sound_game_over).fadeTo((musicOn_) ? 0.5 : 0, 1000);
ended_ = true;
gameOverLayer_.addChild(gameOverClip_);
gameOverClip_.x = 200;
gameOverClip_.y = 100;
state_ = STATE_WAIT_END;
};
}
public function quitGame():void{
if (!quitted_){
quitted_ = true;
gameCommunicator_.gameQuit();
};
}
public function getMouseX():int{
var _local1:int;
_local1 = Math.round(board_.mouseX);
return (_local1);
}
public function tick(_arg1:int):void{
var _local4:int;
var _local5:int;
tick_ = _arg1;
animPlayer_.tick(_arg1);
cannon_.x0 = cannon_.x1;
cannon_.y0 = cannon_.y1;
var _local2:int = getMouseX();
var _local3:Number = (_local2 - (Ball.WIDTH / 2));
if (_local3 < 0){
_local3 = 0;
};
if (_local3 > ((board_.getMaxCols() - 1) * Ball.WIDTH)){
_local3 = ((board_.getMaxCols() - 1) * Ball.WIDTH);
};
cannon_.moveTo((_local3 + board_.x));
if (((switchBalls_) && (cannon_.canSwitchBalls()))){
gameCommunicator_.addPlayData((("91," + tick_) + "=0"));
cannon_.switchBalls();
soundManager.getFromClass(sound_shoot4).play((soundOn_) ? 0.5 : 0);
switchBalls_ = false;
};
if (((((((((releaseBall_) && (board_.isReadyForRelease()))) && (!(cannon_.isReleasingBall())))) && (!(cannon_.isSwitchingBalls())))) && (!(ended_)))){
gameCommunicator_.addPlayData((((("92," + tick_) + " ") + _local2) + "=0"));
releaseBall_ = false;
cannon_.releaseBall();
soundManager.getFromClass(sound_shoot3).play((soundOn_) ? 0.5 : 0);
};
while (!(cannon_.isFull())) {
cannon_.addBall(board_.getNextCannonBall());
};
if (state_ == STATE_INIT){
} else {
if (state_ == STATE_PLAY){
if (((endGamePressed_) && (!(ended_)))){
gameCommunicator_.addPlayData((("93," + tick_) + "=0"));
endGame();
};
board_.tick();
cannon_.tick(_arg1);
clock_.tick();
} else {
if (state_ == STATE_WAIT_END){
board_.tick();
cannon_.tick(_arg1);
gameOverClip_.header_txt.text = gameData_.getText("game_over");
gameOverClip_.score_txt.text = ((gameData_.getText("score") + ": ") + score_);
if (gameData_.getElementTextAsInt("gameMode") != 1){
gameOverClip_.best_score_txt.text = ((gameData_.getText("best_score") + ": ") + bestScore_);
gameOverClip_.stats1_txt.text = gameData_.getText("drums_created_stats", numDrumsGeneratedNow_, numDrumsGenerated_);
gameOverClip_.stats2_txt.text = gameData_.getText("line_blast_stats", numLineBlastsNow_, numLineBlasts_);
gameOverClip_.stats3_txt.text = gameData_.getText("bengal_stats", numBengalFiresNow_, numBengalFires_);
gameOverClip_.stats4_txt.text = gameData_.getText("black_cloud_stats", numBlackCloudsDestroyedNow_, numBlackCloudsDestroyed_);
gameOverClip_.stats5_txt.text = gameData_.getText("games_played_stats", numGamesPlayed_);
};
gameOverClip_.game_ends_txt.text = "";
if (((!(cannon_.isReleasingBall())) && (board_.allStill()))){
gameCommunicator_.addPlayData((((((("13," + tick_) + " ") + (soundOn_) ? 1 : 0) + " ") + (musicOn_) ? 1 : 0) + "=0"));
gameCommunicator_.gameEnd(score_);
state_ = STATE_ENDED;
endedTick_ = tick_;
if ((((score_ > bestScore_)) && (!((gameData_.getElementTextAsInt("gameMode") == 1))))){
newBestScore_ = true;
bestScore_ = score_;
gameOverClip_.best_score_txt.text = gameData_.getText("new_best_score");
gameOverClip_.best_score_txt.filters = glowFilters_[(int((tick_ * 0.8)) % 32)];
gameOverClip_.stats1_txt.text = gameData_.getText("drums_created_stats", numDrumsGeneratedNow_, numDrumsGenerated_);
gameOverClip_.stats2_txt.text = gameData_.getText("line_blast_stats", numLineBlastsNow_, numLineBlasts_);
gameOverClip_.stats3_txt.text = gameData_.getText("bengal_stats", numBengalFiresNow_, numBengalFires_);
gameOverClip_.stats4_txt.text = gameData_.getText("black_cloud_stats", numBlackCloudsDestroyedNow_, numBlackCloudsDestroyed_);
gameOverClip_.stats5_txt.text = gameData_.getText("games_played_stats", numGamesPlayed_);
};
gotElephantTrophy = (numGamesPlayed_ >= 200);
gotGiraffeTrophy = (bestScore_ >= 100000);
gotLeopardTrophy = (numLineBlasts_ >= 200);
gotRhinoTrophy = (numBengalFires_ >= 100);
gotLionTrophy = (numBlackCloudsDestroyed_ >= 100);
gotMonkeyTrophy = (numDrumsGenerated_ >= 1000);
};
} else {
if (state_ == STATE_ENDED){
board_.tick();
cannon_.tick(_arg1);
_local4 = 20;
if (gameData_.getElementTextAsInt("gameMode") == 1){
_local4 = 5;
};
if (tick_ == (endedTick_ + 30)){
animPlayer_.addAnim(new HideScorePanelAnim(scorePanelLayer_));
animPlayer_.addAnim(new OutroGoodAnim(this, outroBgLayer_, outroLayer_, gameOverClip_));
};
if (tick_ == (endedTick_ + 60)){
outroLayer_.addEventListener(MouseEvent.CLICK, this.onMouseClickGameOver);
outroLayer_.useHandCursor = true;
outroLayer_.buttonMode = true;
};
if ((((tick_ == (endedTick_ + (30 * (_local4 - 2))))) || (((quitGame_) && (!(quitted_)))))){
outroLayer_.useHandCursor = false;
outroLayer_.buttonMode = false;
quitGame();
};
gameOverClip_.score_txt.text = ((gameData_.getText("score") + ": ") + score_);
_local5 = Math.ceil((_local4 - ((tick_ - endedTick_) / 30)));
if (((quitGame_) || ((_local5 <= 1)))){
_local5 = 1;
};
if (_local5 == 1){
gameOverClip_.game_ends_txt.text = gameData_.getText("game_ends_1sec", _local5);
} else {
gameOverClip_.game_ends_txt.text = gameData_.getText("game_ends", _local5);
};
if (newBestScore_){
gameOverClip_.best_score_txt.filters = glowFilters_[(int((tick_ * 0.8)) % 32)];
};
};
};
};
};
if ((((timeWarning_ == false)) && ((clock_.getTimeLeft() < (30 * 5))))){
timeWarning_ = true;
soundManager.getFromClass(sound_timeover).loop((soundOn_) ? 0.8 : 0);
};
if (clock_.getTimeLeft() == 0){
if (((timeWarning_) && (!(_hasEndedTimeWarning)))){
soundManager.getFromClass(sound_timeover).fadeToAndStop(0, 1000);
_hasEndedTimeWarning = true;
};
endGame();
};
}
public function render(_arg1:int, _arg2:Number):void{
var _local3:int;
soundManager.update();
animPlayer_.render(_arg1, _arg2);
if (gameStarted_){
renderCannon(_arg1, _arg2);
renderBoard(_arg1, _arg2);
};
while (ripples_.length > 0) {
_local3 = ripples_.pop();
animPlayer_.addAnim(new DrumBeatAnim(board_.getDrumsLayer(), ((_local3 - board_.x) + 40), 500));
_local3 = (_local3 >> 4);
_local3 = (_local3 << 4);
_local3 = (_local3 + 1);
ripple_.drawRipple(_local3, 128, 10, 1);
};
}
public function renderCannon(_arg1:int, _arg2:Number):void{
cannon_.render(_arg1, _arg2);
}
public function renderBoard(_arg1:int, _arg2:Number):void{
board_.render(_arg1, _arg2);
}
}
}//package com.midasplayer.africanrainmaker
Section 27
//Jewel (com.midasplayer.africanrainmaker.Jewel)
package com.midasplayer.africanrainmaker {
import flash.display.*;
public class Jewel extends Sprite {
public var x0:Number;
public var y0:Number;
public var x1:Number;
public var y1:Number;
public var vx:Number;
public var vy:Number;
public var ax:Number;
public var ay:Number;
public var startX:Number;
public var startY:Number;
public var size:int;
public var color:int;
public var bounceTick:int;
public var clip:MovieClip;
public var rotPosition_:Number;// = 0
public var rotSpeed_:Number;// = 0
public var r0:Number;// = 0
public var r1:Number;// = 0
public var t0:Number;// = 0
public var t1:Number;// = 0
public var ts:Number;// = 0
public function Jewel(_arg1:int, _arg2:int, _arg3:int, _arg4:int){
this.size = _arg2;
this.color = _arg1;
if (_arg2 == 1){
clip = new jewel_square();
};
if (_arg2 == 2){
clip = new jewel_oval();
};
if (_arg2 == 3){
clip = new jewel_drop();
};
if (_arg2 == 4){
clip = new jewel_round();
};
if (_arg2 == 5){
clip = new jewel_diamond();
};
this.x = (x0 = (x1 = _arg3));
this.y = (y0 = (y1 = _arg4));
rotPosition_ = (_arg3 * _arg4);
rotSpeed_ = (((((_arg3 * _arg4) % 100) / 100) * 0.05) + 0.05);
r0 = (r1 = rotPosition_);
clip.gotoAndStop((((_arg1 - 1) * 10) + 1));
this.addChild(clip);
this.mouseChildren = false;
this.mouseEnabled = false;
}
public function tick(_arg1:int):void{
r0 = r1;
rotPosition_ = (rotPosition_ + rotSpeed_);
r1 = rotPosition_;
t0 = t1;
t1 = (t1 + ts);
}
public function render(_arg1:int, _arg2:Number):void{
var _local3:Number = (r0 + ((r1 - r0) * _arg2));
var _local4:Number = (Math.ceil((_local3 * 9)) % 9);
clip.gotoAndStop(((((color - 1) * 10) + _local4) + 1));
if (ts != 0){
clip.rotation = (t0 + ((t1 - t0) * _arg2));
};
}
}
}//package com.midasplayer.africanrainmaker
Section 28
//Main (com.midasplayer.africanrainmaker.Main)
package com.midasplayer.africanrainmaker {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Main extends Sprite {
private var frames:int;
private var fps:int;
private var lastTime:Number;// = -1
private var tickCount:int;// = 0
private var tick_:int;// = 0
private var initialized_:Boolean;// = false
private var game_:Game;// = null
private static var TICKS_PER_SECOND:int = 30;
private static var MAX_TICKS_PER_FRAME:int = 20;
public function Main(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(_arg1:Event):void{
if (!initialized_){
init();
};
advanceTime();
}
private function init():void{
initialized_ = true;
game_ = new Game();
this.addChild(game_);
game_.init();
}
public function advanceTime():void{
var _local1:Number = getTimer();
if (lastTime < 0){
lastTime = _local1;
};
var _local2:Number = (1000 / TICKS_PER_SECOND);
var _local3:int;
while ((_local1 - lastTime) > _local2) {
var _temp1 = _local3;
_local3 = (_local3 + 1);
if (_temp1 < MAX_TICKS_PER_FRAME){
if (game_ != null){
game_.tick(tick_);
};
tick_++;
};
lastTime = (lastTime + _local2);
tickCount++;
if ((tickCount % TICKS_PER_SECOND) == 0){
fps = frames;
frames = 0;
};
};
var _local4:Number = ((_local1 - lastTime) / _local2);
if (game_ != null){
game_.render(tick_, _local4);
};
frames++;
}
}
}//package com.midasplayer.africanrainmaker
Section 29
//Ripple (com.midasplayer.africanrainmaker.Ripple)
package com.midasplayer.africanrainmaker {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
public class Ripple {
private var _source:DisplayObject;
private var _buffer1:BitmapData;
private var _buffer2:BitmapData;
private var _defData:BitmapData;
private var _fullRect:Rectangle;
private var _drawRect:Rectangle;
private var _origin:Point;
private var _filter:DisplacementMapFilter;
private var _expandFilter:ConvolutionFilter;
private var _colourTransform:ColorTransform;
private var _matrix:Matrix;
private var _scaleInv:Number;
public function Ripple(_arg1:DisplayObject, _arg2:Number, _arg3:Number=2){
var _local4:Number;
var _local5:Number;
_origin = new Point();
super();
_source = _arg1;
_scaleInv = (1 / _arg3);
_buffer1 = new BitmapData((_arg1.width * _scaleInv), (_arg1.height * _scaleInv), false, 0);
_buffer2 = new BitmapData(_buffer1.width, _buffer1.height, false, 0);
_defData = new BitmapData(_arg1.width, _arg1.height, false, 0x7F7F7F);
_local4 = (_defData.width / _buffer1.width);
_local5 = (_defData.height / _buffer1.height);
_fullRect = new Rectangle(0, 0, _buffer1.width, _buffer1.height);
_drawRect = new Rectangle();
_filter = new DisplacementMapFilter(_defData, _origin, BitmapDataChannel.BLUE, BitmapDataChannel.BLUE, _arg2, _arg2, "wrap");
_source.filters = [_filter];
_source.addEventListener(Event.ENTER_FRAME, handleEnterFrame);
_expandFilter = new ConvolutionFilter(3, 3, [0.5, 1, 0.5, 1, 0, 1, 0.5, 1, 0.5], 3);
_colourTransform = new ColorTransform(1, 1, 1, 1, 128, 128, 128);
_matrix = new Matrix(_local4, 0, 0, _local5);
}
public function drawRipple(_arg1:int, _arg2:int, _arg3:int, _arg4:Number):void{
var _local5 = (_arg3 >> 1);
var _local6:int = (((_arg4 * 0xFF) & 0xFF) * _arg4);
_drawRect.x = ((-(_local5) + _arg1) * _scaleInv);
_drawRect.y = ((-(_local5) + _arg2) * _scaleInv);
_drawRect.width = (_drawRect.height = (_arg3 * _scaleInv));
_buffer1.fillRect(_drawRect, _local6);
}
public function getRippleImage():BitmapData{
return (_defData);
}
public function destroy():void{
_source.removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
_buffer1.dispose();
_buffer2.dispose();
_defData.dispose();
}
private function handleEnterFrame(_arg1:Event):void{
var _local2:BitmapData = _buffer2.clone();
_buffer2.applyFilter(_buffer1, _fullRect, _origin, _expandFilter);
_buffer2.draw(_local2, null, null, BlendMode.SUBTRACT, null, false);
_defData.draw(_buffer2, _matrix, _colourTransform, null, null, true);
_filter.mapBitmap = _defData;
_source.filters = [_filter];
_local2.dispose();
switchBuffers();
}
private function switchBuffers():void{
var _local1:BitmapData;
_local1 = _buffer1;
_buffer1 = _buffer2;
_buffer2 = _local1;
}
}
}//package com.midasplayer.africanrainmaker
Section 30
//Trophy (com.midasplayer.africanrainmaker.Trophy)
package com.midasplayer.africanrainmaker {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Trophy {
public var show:Boolean;
public var isNew:Boolean;
public var showStart:int;
public var clip:MovieClip;
public var clip2:MovieClip;
public var x:Number;
public var y:Number;
public var x1:Number;
public var y1:Number;
public var x2:Number;
public var y2:Number;
public var xCloud:Number;
public var yCloud:Number;
public var layer:Sprite;
public var isAnim:Boolean;
public var text:String;
public var textClip:MovieClip;
public var questionClip:MovieClip;
public var textOverTick:int;// = 0
public var textOver:Boolean;// = false
public static var TYPE_ELEPHANT:int = 1;
public static var TYPE_GIRAFFE:int = 2;
public static var TYPE_LEOPARD:int = 3;
public static var TYPE_RHINO:int = 4;
public static var TYPE_LION:int = 5;
public static var TYPE_MONKEY:int = 6;
public function Trophy(_arg1:Sprite, _arg2:int, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:String, _arg8:Sprite){
this.layer = _arg1;
this.x = _arg3;
this.y = _arg4;
this.x1 = _arg3;
this.y1 = _arg4;
this.xCloud = _arg5;
this.yCloud = _arg6;
this.text = _arg7;
if (_arg2 == TYPE_ELEPHANT){
this.clip = new trophy_elephant();
this.clip2 = new trophy_elephant();
clip2.gotoAndStop(1);
};
if (_arg2 == TYPE_GIRAFFE){
this.clip = new trophy_giraffe();
this.clip2 = new trophy_giraffe();
};
if (_arg2 == TYPE_LEOPARD){
this.clip = new trophy_leopard();
this.clip2 = new trophy_leopard();
};
if (_arg2 == TYPE_RHINO){
this.clip = new trophy_rhino();
this.clip2 = new trophy_rhino();
};
if (_arg2 == TYPE_LION){
this.clip = new trophy_lion();
this.clip2 = new trophy_lion();
};
if (_arg2 == TYPE_MONKEY){
this.clip = new trophy_monkey();
this.clip2 = new trophy_monkey();
};
this.clip.overMask.visible = false;
questionClip = new question_cloud();
questionClip.x = _arg5;
questionClip.y = _arg6;
questionClip.visible = false;
questionClip.gotoAndStop(1);
textClip = new question_cloud_text();
var _local9:TextField = textClip.txt;
_local9.text = _arg7;
_local9.autoSize = "left";
textClip.y = (_arg6 - _local9.textHeight);
if (textClip.y < 200){
textClip.y = (_arg6 + 70);
};
textClip.x = _arg5;
if ((textClip.x + _local9.textWidth) > 755){
textClip.x = (755 - _local9.textWidth);
};
textClip.visible = false;
clip.x = _arg3;
clip.y = _arg4;
clip.alpha = 0;
clip2.x = _arg3;
clip2.y = _arg4;
clip2.alpha = 0;
_arg1.addChild(clip);
_arg8.addChild(questionClip);
_arg8.addChild(textClip);
_arg8.addChild(clip2);
}
public function onMouseOver(_arg1:MouseEvent):void{
textOver = true;
}
public function onMouseOut(_arg1:MouseEvent):void{
textOver = false;
}
}
}//package com.midasplayer.africanrainmaker
Section 31
//Debug (com.midasplayer.debug.Debug)
package com.midasplayer.debug {
public class Debug {
private static var s_assertHandler:IAssertHandler = null;
public static function assert(_arg1:Boolean, _arg2:String):void{
var condition = _arg1;
var message = _arg2;
if (condition){
return;
};
if (s_assertHandler != null){
s_assertHandler.assert(message);
return;
};
try {
throw (new Error("StackTrace"));
} catch(e:Error) {
};
}
public static function setAssertHandler(_arg1:IAssertHandler):void{
s_assertHandler = _arg1;
}
}
}//package com.midasplayer.debug
Section 32
//IAssertHandler (com.midasplayer.debug.IAssertHandler)
package com.midasplayer.debug {
public interface IAssertHandler {
function assert(_arg1:String):void;
}
}//package com.midasplayer.debug
Section 33
//DebugGameComm (com.midasplayer.gamecomm.DebugGameComm)
package com.midasplayer.gamecomm {
import com.midasplayer.debug.*;
public class DebugGameComm implements IGameComm {
private var _state:int;// = 0
private var _gameData:String;
private var _playDatas:Array;
private static const _NotStarted:int = 0;
private static const _Started:int = 1;
private static const _Ended:int = 2;
private static const _Quited:int = 3;
public function DebugGameComm(_arg1:String){
_playDatas = new Array();
super();
_gameData = _arg1;
}
public function getGameData():String{
return (_gameData);
}
public function addPlayData(_arg1:String):void{
Debug.assert(!((_state == _NotStarted)), "Trying to add playdata before the game has been started.");
_playDatas.push(_arg1);
}
public function gameStart():void{
Debug.assert((_state == _NotStarted), "Trying to start the game when it's already started.");
_state = _Started;
}
public function gameEnd(_arg1:uint):void{
Debug.assert((_state == _Started), "Trying to end a game that is not in the started state.");
_state = _Ended;
}
public function gameQuit():void{
Debug.assert((_state == _Ended), "Trying to quit the game before it has been ended.");
}
public function get playDatas():Array{
return (_playDatas);
}
public function toString():String{
var _local1 = "";
var _local2:int;
while (_local2 < _playDatas.length) {
_local1 = (_local1 + (("<entry><![CDATA[" + _playDatas[_local2]) + "]]></entry>\n"));
_local2++;
};
return (_local1);
}
}
}//package com.midasplayer.gamecomm
Section 34
//GameComm (com.midasplayer.gamecomm.GameComm)
package com.midasplayer.gamecomm {
import com.midasplayer.debug.*;
import flash.utils.*;
import flash.external.*;
import flash.system.*;
public class GameComm implements IGameComm {
private var _state:int;// = 0
private static const _NotStarted:int = 0;
private static const _Started:int = 1;
private static const _Ended:int = 2;
private static const _Quitted:int = 3;
public function getGameData():String{
var _local1:Object = ExternalInterface.call("getGameData");
if (_local1 == null){
throw (new Error("The getGameData external interface call returned null."));
};
if (_local1.success == false){
throw (new Error("The getGameData returned object is not success."));
};
if (_local1.message == null){
throw (new Error("The GameData returned object has a null message."));
};
return (_local1.message);
}
public function addPlayData(_arg1:String):void{
Debug.assert(!((_state == _NotStarted)), "Trying to add playdata before the game has been started.");
ExternalInterface.call("playData", _arg1);
}
public function gameStart():void{
Debug.assert((_state == _NotStarted), "Trying to start the game when it's already started.");
fscommand("gameStart", "");
_state = _Started;
}
public function gameEnd(_arg1:uint):void{
Debug.assert((_state == _Started), "Trying to end a game that is not in the started state.");
fscommand("gameEnd", ("" + _arg1));
_state = _Ended;
}
public function gameQuit():void{
Debug.assert((_state == _Ended), "Quitting the game before it has been ended.");
setTimeout(_quit, 2000);
_state = _Quitted;
}
private function _quit():void{
fscommand("gameQuit", "");
}
public static function isAvailable():Boolean{
if (ExternalInterface.available){
return (!((ExternalInterface.call("getGameData") == null)));
};
return (false);
}
}
}//package com.midasplayer.gamecomm
Section 35
//GameData (com.midasplayer.gamecomm.GameData)
package com.midasplayer.gamecomm {
import com.midasplayer.debug.*;
public class GameData {
private var _seed:int;// = 0
private var _gameData:XML;
private var _textElements:XMLList;
public function GameData(_arg1:String){
Debug.assert(!((_arg1 == null)), "Could not parse the game data, the xml parameter is null.");
_gameData = new XML(_arg1);
Debug.assert((_gameData.length() == 1), "The game data XML should only have 1 root child.");
_seed = parseInt(_gameData.attribute("randomseed"));
Debug.assert(!((_seed == 0)), "The game data randomseed attribute is 0, this may result in complete randomness.");
_textElements = _gameData.child("text");
}
public function get randomSeed():int{
return (_seed);
}
public function getText(_arg1:String, ... _args):String{
var texts:XMLList;
var os:String;
var i:int;
var r:RegExp;
var id = _arg1;
var args = _args;
texts = _textElements.(@id == id);
Debug.assert((texts.length() == 1), (("Could not find the text element (or found more than 1) with attribute id '" + id) + "' in the game data."));
os = texts.text();
if (args.length > 0){
i = 0;
while (i < args.length) {
r = new RegExp((("\\{" + i) + "\\}"), "gi");
os = os.replace(r, args[i]);
i = (i + 1);
};
};
return (os);
}
public function getTexts():Object{
var _local1:Object = new Object();
var _local2:int;
while (_local2 < _textElements.length()) {
_local1[_textElements[_local2].@id] = _textElements[_local2];
_local2++;
};
return (_local1);
}
public function getElementTextAsString(_arg1:String):String{
return (_getOneElement(_arg1).text());
}
public function getElementTextAsInt(_arg1:String):int{
var _local2:XMLList;
_local2 = _getOneElement(_arg1);
var _local3:Number = parseInt(_local2.text());
Debug.assert(!(isNaN(_local3)), ((("Could not parse a game data property as int '" + _arg1) + "' value: ") + _local2.text()));
return (int(_local3));
}
public function getElementTextAsBool(_arg1:String):Boolean{
var _local2:String = getElementTextAsString(_arg1).toLowerCase();
Debug.assert((((((((_local2 == "0")) || ((_local2 == "1")))) || ((_local2 == "false")))) || ((_local2 == "true"))), ((("Could not parse a boolean, the value should be 'true', 'false', '0' or '1'. Element: " + _arg1) + ", value: ") + _local2));
return ((((_local2 == "true")) || ((_local2 == "1"))));
}
private function _getOneElement(_arg1:String):XMLList{
var _local2:XMLList = _gameData.child(_arg1);
Debug.assert((_local2.length() == 1), (("Could not find the element (or found more than 1) with the name '" + _arg1) + "' in the game data."));
return (_local2);
}
}
}//package com.midasplayer.gamecomm
Section 36
//IGameComm (com.midasplayer.gamecomm.IGameComm)
package com.midasplayer.gamecomm {
public interface IGameComm {
function getGameData():String;
function addPlayData(_arg1:String):void;
function gameStart():void;
function gameEnd(_arg1:uint):void;
function gameQuit():void;
}
}//package com.midasplayer.gamecomm
Section 37
//MtRandom (com.midasplayer.math.MtRandom)
package com.midasplayer.math {
import flash.utils.*;
public class MtRandom {
private var mt:Array;
private var mti:uint;
public static var N:int = 624;
public static var M:int = 397;
public static var MATRIX_A:uint = 2567483615;
public static var UPPER_MASK:uint = 2147483648;
public static var LOWER_MASK:uint = 2147483647;
private static var mag01:Array = [uint(0), uint(MATRIX_A)];
public function MtRandom(_arg1:uint=0){
mti = (N + 1);
super();
if (_arg1 == 0){
_arg1 = getTimer();
};
mt = new Array(N);
init_genrand(_arg1);
}
public function setSeed(_arg1:uint):void{
init_genrand(_arg1);
}
public function nextInt(_arg1:uint):uint{
return (((genrand_int32() & 2147483647) % _arg1));
}
public function nextFloat():Number{
return ((next(24) / 16777216));
}
public function nextDouble():Number{
return ((next(24) / 16777216));
}
private function next(_arg1:uint):uint{
return ((genrand_int32() & ((uint(1) << _arg1) - uint(1))));
}
private function init_genrand(_arg1:uint):void{
var _local2:uint;
var _local3:uint;
mt[0] = uint(_arg1);
mti = 1;
while (mti < N) {
_local2 = (mt[(mti - 1)] ^ (mt[(mti - 1)] >>> 30));
_local3 = uint((_local2 * 1289));
_local3 = uint((_local3 * 1406077));
_local3 = uint((_local3 + mti));
mt[mti] = _local3;
mti++;
};
}
private function genrand_int32():uint{
var _local1:Number;
var _local2:uint;
if (mti >= N){
if (mti == (N + 1)){
init_genrand(5489);
};
_local2 = 0;
while (_local2 < (N - M)) {
_local1 = ((mt[_local2] & UPPER_MASK) | (mt[(_local2 + 1)] & LOWER_MASK));
mt[_local2] = ((mt[(_local2 + M)] ^ (_local1 >>> 1)) ^ mag01[uint((_local1 & 1))]);
_local2++;
};
while (_local2 < (N - 1)) {
_local1 = ((mt[_local2] & UPPER_MASK) | (mt[(_local2 + 1)] & LOWER_MASK));
mt[_local2] = ((mt[(_local2 + (M - N))] ^ (_local1 >>> 1)) ^ mag01[uint((_local1 & 1))]);
_local2++;
};
_local1 = ((mt[(N - 1)] & UPPER_MASK) | (mt[0] & LOWER_MASK));
mt[(N - 1)] = ((mt[(M - 1)] ^ (_local1 >>> 1)) ^ mag01[uint((_local1 & 1))]);
mti = 0;
};
_local1 = mt[mti++];
_local1 = (_local1 ^ (_local1 >>> 11));
_local1 = (_local1 ^ ((_local1 << 7) & 2636928640));
_local1 = (_local1 ^ ((_local1 << 15) & 4022730752));
_local1 = (_local1 ^ (_local1 >>> 18));
return (uint(_local1));
}
}
}//package com.midasplayer.math
Section 38
//ManagedSound (com.midasplayer.sound.ManagedSound)
package com.midasplayer.sound {
import flash.media.*;
public class ManagedSound {
private var ClassReference:Class;
public var activeSounds:Array;
private var manager:SoundManager;
public function ManagedSound(_arg1:SoundManager, _arg2:Class){
activeSounds = new Array();
super();
this.manager = _arg1;
this.ClassReference = _arg2;
}
public function play(_arg1:Number=1, _arg2:Number=0):ManagedSoundChannel{
var _local3:SoundChannel = new ClassReference().play(0, 0, new SoundTransform(_arg1, _arg2));
return (new ManagedSoundChannel(manager, this, _local3));
}
public function loop(_arg1:Number=1, _arg2:Number=0, _arg3:Number=999999999):ManagedSoundChannel{
var _local4:SoundChannel = new ClassReference().play(0, _arg3, new SoundTransform(_arg1, _arg2));
return (new ManagedSoundChannel(manager, this, _local4));
}
public function stop():void{
var _local1:int;
while (_local1 < activeSounds.length) {
activeSounds[_local1].stop();
_local1++;
};
}
public function setPan(_arg1:Number):void{
var _local2:int;
while (_local2 < activeSounds.length) {
activeSounds[_local2].setPan(_arg1);
_local2++;
};
}
public function setVolume(_arg1:Number):void{
var _local2:int;
while (_local2 < activeSounds.length) {
activeSounds[_local2].setVolume(_arg1);
_local2++;
};
}
public function fadeTo(_arg1:Number, _arg2:Number):void{
var _local3:int;
while (_local3 < activeSounds.length) {
activeSounds[_local3].fadeTo(_arg1, _arg2);
_local3++;
};
}
public function fadeToAndStop(_arg1:Number, _arg2:Number):void{
var _local3:int;
while (_local3 < activeSounds.length) {
activeSounds[_local3].fadeToAndStop(_arg1, _arg2);
_local3++;
};
}
public function panTo(_arg1:Number, _arg2:Number):void{
var _local3:int;
while (_local3 < activeSounds.length) {
activeSounds[_local3].panTo(_arg1, _arg2);
_local3++;
};
}
public function isPlaying():Boolean{
return ((activeSounds.length > 0));
}
public function update():void{
var _local1:int;
while (_local1 < activeSounds.length) {
activeSounds[_local1].update();
_local1++;
};
}
}
}//package com.midasplayer.sound
Section 39
//ManagedSoundChannel (com.midasplayer.sound.ManagedSoundChannel)
package com.midasplayer.sound {
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class ManagedSoundChannel {
private var sound:ManagedSound;
private var channel:SoundChannel;
private var manager:SoundManager;
private var targetVolume:Number;
private var targetPan:Number;
private var fadeStartTime:Number;// = -1
private var fadeEndTime:Number;// = -1
private var fadeStartVolume:Number;// = -1
private var fadeEndVolume:Number;// = -1
private var panStartTime:Number;// = -1
private var panEndTime:Number;// = -1
private var panStartVolume:Number;// = -1
private var panEndVolume:Number;// = -1
private var stopAfterFade:Boolean;// = false
private var playing:Boolean;// = true
public function ManagedSoundChannel(_arg1:SoundManager, _arg2:ManagedSound, _arg3:SoundChannel){
this.manager = _arg1;
this.sound = _arg2;
this.channel = _arg3;
_arg2.activeSounds.push(this);
if (_arg3 == null){
soundComplete(null);
return;
};
_arg3.addEventListener(Event.SOUND_COMPLETE, soundComplete);
targetVolume = _arg3.soundTransform.volume;
targetPan = _arg3.soundTransform.pan;
update();
}
public function soundComplete(_arg1:Event):void{
if (!playing){
return;
};
sound.activeSounds.splice(sound.activeSounds.indexOf(this), 1);
playing = false;
}
public function setPan(_arg1:Number):void{
if (!playing){
return;
};
if (channel == null){
return;
};
channel.soundTransform.pan = _arg1;
panStartTime = -1;
update();
}
public function setVolume(_arg1:Number):void{
if (!playing){
return;
};
stopAfterFade = false;
this.targetVolume = _arg1;
fadeStartTime = -1;
update();
}
public function stop():void{
if (!playing){
return;
};
if (channel == null){
return;
};
channel.stop();
soundComplete(null);
}
public function fadeTo(_arg1:Number, _arg2:Number):void{
if (!playing){
return;
};
fadeStartVolume = Math.sqrt(targetVolume);
fadeEndVolume = Math.sqrt(_arg1);
fadeStartTime = getTimer();
fadeEndTime = (getTimer() + _arg2);
stopAfterFade = false;
}
public function fadeToAndStop(_arg1:Number, _arg2:Number):void{
if (!playing){
return;
};
fadeTo(_arg1, _arg2);
stopAfterFade = true;
}
public function panTo(_arg1:Number, _arg2:Number):void{
if (!playing){
return;
};
panStartVolume = targetPan;
panEndVolume = _arg1;
panStartTime = getTimer();
panEndTime = (getTimer() + _arg2);
}
public function update():void{
var _local1:Number;
if (!playing){
return;
};
if (fadeStartTime >= 0){
_local1 = ((getTimer() - fadeStartTime) / (fadeEndTime - fadeStartTime));
if (_local1 < 0){
_local1 = 0;
};
if (_local1 > 1){
_local1 = 1;
};
targetVolume = (fadeStartVolume + ((fadeEndVolume - fadeStartVolume) * _local1));
targetVolume = (targetVolume * targetVolume);
if (_local1 == 1){
fadeStartTime = -1;
};
if ((((_local1 == 1)) && (stopAfterFade))){
stop();
};
};
if (panStartTime >= 0){
_local1 = ((getTimer() - panStartTime) / (panEndTime - panStartTime));
if (_local1 < 0){
_local1 = 0;
};
if (_local1 > 1){
_local1 = 1;
};
targetPan = (panStartVolume + ((panEndVolume - panStartVolume) * _local1));
if (_local1 == 1){
panStartTime = -1;
};
};
var _local2:Number = (targetVolume * manager.volume);
var _local3:Number = targetPan;
if (channel == null){
return;
};
if (((!((_local2 == channel.soundTransform.volume))) || (!((_local3 == channel.soundTransform.pan))))){
channel.soundTransform = new SoundTransform(_local2, _local3);
};
}
public function isPlaying():Boolean{
return (playing);
}
}
}//package com.midasplayer.sound
Section 40
//SoundManager (com.midasplayer.sound.SoundManager)
package com.midasplayer.sound {
import flash.utils.*;
public class SoundManager {
private var managedSoundMap:Object;
private var managedSounds:Array;
private var lastTime:Number;// = -1
public var volume:Number;// = 1
private var fadeStartTime:Number;// = -1
private var fadeEndTime:Number;// = -1
private var fadeStartVolume:Number;// = -1
private var fadeEndVolume:Number;// = -1
public function SoundManager(){
managedSoundMap = new Object();
managedSounds = new Array();
super();
}
public function get(_arg1:String):ManagedSound{
var _local2:Class;
if (managedSoundMap[_arg1] == null){
_local2 = (getDefinitionByName(_arg1) as Class);
if (_local2 == null){
_local2 = (getDefinitionByName(("sound." + _arg1)) as Class);
};
if (_local2 == null){
_local2 = (getDefinitionByName(("snd." + _arg1)) as Class);
};
if (_local2 == null){
throw (new Error(("Failed to find sound " + _arg1)));
};
managedSoundMap[_arg1] = new ManagedSound(this, _local2);
managedSounds.push(managedSoundMap[_arg1]);
};
return (managedSoundMap[_arg1]);
}
public function getFromClass(_arg1:Class):ManagedSound{
var _local2:String = getQualifiedClassName(_arg1);
if (managedSoundMap[_local2] == null){
managedSoundMap[_local2] = new ManagedSound(this, _arg1);
managedSounds.push(managedSoundMap[_local2]);
};
return (managedSoundMap[_local2]);
}
public function fadeTo(_arg1:Number, _arg2:Number):void{
fadeStartVolume = Math.sqrt(volume);
fadeEndVolume = Math.sqrt(_arg1);
fadeStartTime = getTimer();
fadeEndTime = (getTimer() + _arg2);
}
public function setVolume(_arg1:Number):void{
this.volume = _arg1;
fadeStartTime = -1;
}
public function stopAll():void{
var _local1:int;
while (_local1 < managedSounds.length) {
managedSounds[_local1].stop();
_local1++;
};
}
public function update():void{
var _local3:Number;
var _local1:Number = getTimer();
if (lastTime < 0){
lastTime = _local1;
};
if (fadeStartTime >= 0){
_local3 = ((getTimer() - fadeStartTime) / (fadeEndTime - fadeStartTime));
if (_local3 < 0){
_local3 = 0;
};
if (_local3 > 1){
_local3 = 1;
};
volume = (fadeStartVolume + ((fadeEndVolume - fadeStartVolume) * _local3));
volume = (volume * volume);
if (_local3 == 1){
fadeStartTime = -1;
};
};
var _local2:int;
while (_local2 < managedSounds.length) {
managedSounds[_local2].update();
_local2++;
};
}
}
}//package com.midasplayer.sound
Section 41
//Anim (com.midasplayer.util.Anim)
package com.midasplayer.util {
public class Anim {
public var lastTick:Boolean;
public var startTick:Number;
public function tick(_arg1:Number):Boolean{
return (true);
}
public function render(_arg1:Number):void{
}
public function end():void{
}
}
}//package com.midasplayer.util
Section 42
//AnimPlayer (com.midasplayer.util.AnimPlayer)
package com.midasplayer.util {
public class AnimPlayer {
private var anims_:ArrayList;
public function AnimPlayer(){
anims_ = new ArrayList();
}
public function addAnim(_arg1:Object):void{
_arg1.lastTick = false;
_arg1.startTick = -1;
anims_.add(_arg1);
}
public function getNumAnims():int{
return (anims_.size());
}
public function tick(_arg1:Number):void{
var _local4:Anim;
var _local2:int = anims_.size();
var _local3:int = (_local2 - 1);
while (_local3 >= 0) {
_local4 = Anim(anims_.get(_local3));
if (_local4.startTick == -1){
_local4.startTick = _arg1;
};
if (_local4.lastTick){
_local4.render(1);
_local4.end();
anims_.removeI(_local3);
} else {
_local4.lastTick = _local4.tick((_arg1 - _local4.startTick));
};
_local3--;
};
}
public function render(_arg1:Number, _arg2:Number):void{
var _local5:Anim;
var _local3:int = anims_.size();
var _local4:int = (_local3 - 1);
while (_local4 >= 0) {
_local5 = Anim(anims_.get(_local4));
_local5.render(_arg2);
_local4--;
};
}
public static function tickToPercent(_arg1:Number, _arg2:Number, _arg3:Number):Number{
var _local4:Number = ((_arg1 - _arg2) / _arg3);
_local4 = ((_local4 < 0)) ? 0 : _local4;
_local4 = ((_local4 > 1)) ? 1 : _local4;
return (_local4);
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * _arg1) - 1)) + _arg2));
};
--_arg1;
return ((((_arg3 / 2) * ((_arg1 * _arg1) + 1)) + _arg2));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
--_arg1;
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
--_arg1;
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
};
--_arg1;
return ((((_arg3 / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
--_arg1;
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((_arg3 / 2) * Math.sin(((Math.PI * _arg1) / 2))) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / 2)) - 2)) + _arg2));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==0) ? _arg2 : ((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2));
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : ((_arg3 * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2));
};
--_arg1;
return ((((_arg3 / 2) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((_arg3 / 2) * (-(Math.pow(2, (-10 * _arg1))) + 1)) + _arg2));
};
return ((((_arg3 / 2) * (Math.pow(2, (10 * (_arg1 - 2))) + 1)) + _arg2));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
--_arg1;
return ((((_arg3 / 2) * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
};
--_arg1;
return ((((_arg3 / 2) * (2 - Math.sqrt((1 - (_arg1 * _arg1))))) + _arg2));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (_arg5 < Math.abs(_arg3)){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (_arg5 < Math.abs(_arg3)){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (_arg5 < Math.abs(_arg3)){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (_arg5 < Math.abs(_arg3)){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
return ((((0.5 * ((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + (_arg3 / 2)) + _arg2));
};
return ((((_arg3 / 2) + (0.5 * ((_arg5 * Math.pow(2, (10 * (_arg1 - 2)))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))))) + _arg2));
}
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
--_arg1;
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
};
--_arg1;
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + 1)) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeOutBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeInBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package com.midasplayer.util
Section 43
//ArrayList (com.midasplayer.util.ArrayList)
package com.midasplayer.util {
public class ArrayList {
private var arr:Array;
public function ArrayList(_arg1:int=0){
arr = new Array(_arg1);
}
public function add(_arg1:Object):void{
arr.push(_arg1);
}
public function addI(_arg1:int, _arg2:Object):void{
arr.splice(_arg1, 0, _arg2);
}
public function set(_arg1:int, _arg2:Object):void{
arr[_arg1] = _arg2;
}
public function get(_arg1:int):Object{
return (arr[_arg1]);
}
public function setI(_arg1:int, _arg2:Object):void{
arr[_arg1] = _arg2;
}
public function getI(_arg1:int):Object{
return (arr[_arg1]);
}
public function clear():void{
arr = new Array();
}
public function isEmpty():Boolean{
return ((arr.length == 0));
}
public function size():int{
return (arr.length);
}
public function removeI(_arg1:int):Object{
return (arr.splice(_arg1, 1)[0]);
}
public function removeO(_arg1:Object):Boolean{
var _local2:int = (arr.length - 1);
do {
if (_arg1 == arr[_local2]){
arr.splice(_local2, 1);
return (true);
};
var _temp1 = _local2;
_local2 = (_local2 - 1);
} while (_temp1 > 0);
return (false);
}
}
}//package com.midasplayer.util
Section 44
//aim (aim)
package {
import flash.display.*;
public dynamic class aim extends MovieClip {
}
}//package
Section 45
//ball (ball)
package {
import flash.display.*;
public dynamic class ball extends MovieClip {
public var color:MovieClip;
}
}//package
Section 46
//bengal (bengal)
package {
import flash.display.*;
public dynamic class bengal extends MovieClip {
}
}//package
Section 47
//bengal_smoke (bengal_smoke)
package {
import flash.display.*;
public dynamic class bengal_smoke extends MovieClip {
}
}//package
Section 48
//bg (bg)
package {
import flash.display.*;
public dynamic class bg extends MovieClip {
}
}//package
Section 49
//bg_low (bg_low)
package {
import flash.display.*;
public dynamic class bg_low extends MovieClip {
}
}//package
Section 50
//bg_overlay (bg_overlay)
package {
import flash.display.*;
public dynamic class bg_overlay extends MovieClip {
}
}//package
Section 51
//cannon (cannon)
package {
import flash.display.*;
public dynamic class cannon extends MovieClip {
}
}//package
Section 52
//cloud_expl (cloud_expl)
package {
import flash.display.*;
public dynamic class cloud_expl extends MovieClip {
}
}//package
Section 53
//cloud_expl_big (cloud_expl_big)
package {
import flash.display.*;
public dynamic class cloud_expl_big extends MovieClip {
}
}//package
Section 54
//drum (drum)
package {
import flash.display.*;
public dynamic class drum extends MovieClip {
}
}//package
Section 55
//drum_beat (drum_beat)
package {
import flash.display.*;
public dynamic class drum_beat extends MovieClip {
}
}//package
Section 56
//drum_broken (drum_broken)
package {
import flash.display.*;
public dynamic class drum_broken extends MovieClip {
}
}//package
Section 57
//end_game_button (end_game_button)
package {
import flash.display.*;
public dynamic class end_game_button extends MovieClip {
}
}//package
Section 58
//gui_numbers (gui_numbers)
package {
import flash.display.*;
public dynamic class gui_numbers extends MovieClip {
}
}//package
Section 59
//intro (intro)
package {
import flash.display.*;
public dynamic class intro extends MovieClip {
}
}//package
Section 60
//introframe (introframe)
package {
import flash.display.*;
import flash.text.*;
public dynamic class introframe extends MovieClip {
public var main_txt:TextField;
public var starts_in_txt:TextField;
public var side_1_txt:TextField;
public var side_2_txt:TextField;
public var header_txt:TextField;
}
}//package
Section 61
//jewel_diamond (jewel_diamond)
package {
import flash.display.*;
public dynamic class jewel_diamond extends MovieClip {
}
}//package
Section 62
//jewel_drop (jewel_drop)
package {
import flash.display.*;
public dynamic class jewel_drop extends MovieClip {
}
}//package
Section 63
//jewel_oval (jewel_oval)
package {
import flash.display.*;
public dynamic class jewel_oval extends MovieClip {
}
}//package
Section 64
//jewel_round (jewel_round)
package {
import flash.display.*;
public dynamic class jewel_round extends MovieClip {
}
}//package
Section 65
//jewel_square (jewel_square)
package {
import flash.display.*;
public dynamic class jewel_square extends MovieClip {
}
}//package
Section 66
//lineblast (lineblast)
package {
import flash.display.*;
public dynamic class lineblast extends MovieClip {
}
}//package
Section 67
//lineblast_marker (lineblast_marker)
package {
import flash.display.*;
public dynamic class lineblast_marker extends MovieClip {
}
}//package
Section 68
//logo (logo)
package {
import flash.display.*;
public dynamic class logo extends MovieClip {
}
}//package
Section 69
//music_button (music_button)
package {
import flash.display.*;
public dynamic class music_button extends MovieClip {
}
}//package
Section 70
//numbers (numbers)
package {
import flash.display.*;
public dynamic class numbers extends MovieClip {
}
}//package
Section 71
//numbers50 (numbers50)
package {
import flash.display.*;
public dynamic class numbers50 extends MovieClip {
}
}//package
Section 72
//numbers60 (numbers60)
package {
import flash.display.*;
public dynamic class numbers60 extends MovieClip {
}
}//package
Section 73
//numbers80 (numbers80)
package {
import flash.display.*;
public dynamic class numbers80 extends MovieClip {
}
}//package
Section 74
//outro_good_bg (outro_good_bg)
package {
import flash.display.*;
public dynamic class outro_good_bg extends MovieClip {
}
}//package
Section 75
//outro_good_fg1 (outro_good_fg1)
package {
import flash.display.*;
public dynamic class outro_good_fg1 extends MovieClip {
}
}//package
Section 76
//outro_good_fg2 (outro_good_fg2)
package {
import flash.display.*;
public dynamic class outro_good_fg2 extends MovieClip {
}
}//package
Section 77
//question_cloud (question_cloud)
package {
import flash.display.*;
public dynamic class question_cloud extends MovieClip {
}
}//package
Section 78
//question_cloud_text (question_cloud_text)
package {
import flash.display.*;
import flash.text.*;
public dynamic class question_cloud_text extends MovieClip {
public var txt:TextField;
}
}//package
Section 79
//scoreboard (scoreboard)
package {
import flash.display.*;
import flash.text.*;
public dynamic class scoreboard extends MovieClip {
public var score_txt:TextField;
public var stats2_txt:TextField;
public var stats3_txt:TextField;
public var stats4_txt:TextField;
public var stats5_txt:TextField;
public var best_score_txt:TextField;
public var stats1_txt:TextField;
public var register_txt:TextField;
public var game_ends_txt:TextField;
public var header_txt:TextField;
}
}//package
Section 80
//sound_beat1 (sound_beat1)
package {
import flash.media.*;
public dynamic class sound_beat1 extends Sound {
}
}//package
Section 81
//sound_beat2 (sound_beat2)
package {
import flash.media.*;
public dynamic class sound_beat2 extends Sound {
}
}//package
Section 82
//sound_beat3 (sound_beat3)
package {
import flash.media.*;
public dynamic class sound_beat3 extends Sound {
}
}//package
Section 83
//sound_beat4 (sound_beat4)
package {
import flash.media.*;
public dynamic class sound_beat4 extends Sound {
}
}//package
Section 84
//sound_beat5 (sound_beat5)
package {
import flash.media.*;
public dynamic class sound_beat5 extends Sound {
}
}//package
Section 85
//sound_beat6 (sound_beat6)
package {
import flash.media.*;
public dynamic class sound_beat6 extends Sound {
}
}//package
Section 86
//sound_beat7 (sound_beat7)
package {
import flash.media.*;
public dynamic class sound_beat7 extends Sound {
}
}//package
Section 87
//sound_bengal1 (sound_bengal1)
package {
import flash.media.*;
public dynamic class sound_bengal1 extends Sound {
}
}//package
Section 88
//sound_button (sound_button)
package {
import flash.display.*;
public dynamic class sound_button extends MovieClip {
}
}//package
Section 89
//sound_combo (sound_combo)
package {
import flash.media.*;
public dynamic class sound_combo extends Sound {
}
}//package
Section 90
//sound_drum_created (sound_drum_created)
package {
import flash.media.*;
public dynamic class sound_drum_created extends Sound {
}
}//package
Section 91
//sound_drum_mode (sound_drum_mode)
package {
import flash.media.*;
public dynamic class sound_drum_mode extends Sound {
}
}//package
Section 92
//sound_full (sound_full)
package {
import flash.media.*;
public dynamic class sound_full extends Sound {
}
}//package
Section 93
//sound_game_over (sound_game_over)
package {
import flash.media.*;
public dynamic class sound_game_over extends Sound {
}
}//package
Section 94
//sound_intro (sound_intro)
package {
import flash.media.*;
public dynamic class sound_intro extends Sound {
}
}//package
Section 95
//sound_line_blast (sound_line_blast)
package {
import flash.media.*;
public dynamic class sound_line_blast extends Sound {
}
}//package
Section 96
//sound_loop (sound_loop)
package {
import flash.media.*;
public dynamic class sound_loop extends Sound {
}
}//package
Section 97
//sound_loop_drum (sound_loop_drum)
package {
import flash.media.*;
public dynamic class sound_loop_drum extends Sound {
}
}//package
Section 98
//sound_shoot3 (sound_shoot3)
package {
import flash.media.*;
public dynamic class sound_shoot3 extends Sound {
}
}//package
Section 99
//sound_shoot4 (sound_shoot4)
package {
import flash.media.*;
public dynamic class sound_shoot4 extends Sound {
}
}//package
Section 100
//sound_timeover (sound_timeover)
package {
import flash.media.*;
public dynamic class sound_timeover extends Sound {
}
}//package
Section 101
//sound_trophy (sound_trophy)
package {
import flash.media.*;
public dynamic class sound_trophy extends Sound {
}
}//package
Section 102
//sound_wrecked (sound_wrecked)
package {
import flash.media.*;
public dynamic class sound_wrecked extends Sound {
}
}//package
Section 103
//trophy_elephant (trophy_elephant)
package {
import flash.display.*;
public dynamic class trophy_elephant extends MovieClip {
public var overMask:MovieClip;
}
}//package
Section 104
//trophy_giraffe (trophy_giraffe)
package {
import flash.display.*;
public dynamic class trophy_giraffe extends MovieClip {
public var overMask:MovieClip;
}
}//package
Section 105
//trophy_leopard (trophy_leopard)
package {
import flash.display.*;
public dynamic class trophy_leopard extends MovieClip {
public var overMask:MovieClip;
}
}//package
Section 106
//trophy_lion (trophy_lion)
package {
import flash.display.*;
public dynamic class trophy_lion extends MovieClip {
public var overMask:MovieClip;
}
}//package
Section 107
//trophy_monkey (trophy_monkey)
package {
import flash.display.*;
public dynamic class trophy_monkey extends MovieClip {
public var overMask:MovieClip;
}
}//package
Section 108
//trophy_rhino (trophy_rhino)
package {
import flash.display.*;
public dynamic class trophy_rhino extends MovieClip {
public var overMask:MovieClip;
}
}//package