Section 1
//BombSheet (art.BombSheet)
package art {
import flash.display.*;
public dynamic class BombSheet extends BitmapData {
public function BombSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 2
//BulletSheet (art.BulletSheet)
package art {
import flash.display.*;
public dynamic class BulletSheet extends BitmapData {
public function BulletSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 3
//DeathAnimSheet (art.DeathAnimSheet)
package art {
import flash.display.*;
public dynamic class DeathAnimSheet extends BitmapData {
public function DeathAnimSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 4
//DeathSheet (art.DeathSheet)
package art {
import flash.display.*;
public dynamic class DeathSheet extends BitmapData {
public function DeathSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 5
//DemonSheet (art.DemonSheet)
package art {
import flash.display.*;
public dynamic class DemonSheet extends BitmapData {
public function DemonSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 6
//DoorSheet (art.DoorSheet)
package art {
import flash.display.*;
public dynamic class DoorSheet extends BitmapData {
public function DoorSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 7
//FireballSheet (art.FireballSheet)
package art {
import flash.display.*;
public dynamic class FireballSheet extends BitmapData {
public function FireballSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 8
//FireSheet (art.FireSheet)
package art {
import flash.display.*;
public dynamic class FireSheet extends BitmapData {
public function FireSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 9
//FireSheet2 (art.FireSheet2)
package art {
import flash.display.*;
public dynamic class FireSheet2 extends BitmapData {
public function FireSheet2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 10
//FloorSheet1 (art.FloorSheet1)
package art {
import flash.display.*;
public dynamic class FloorSheet1 extends BitmapData {
public function FloorSheet1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 11
//FloorSheet2 (art.FloorSheet2)
package art {
import flash.display.*;
public dynamic class FloorSheet2 extends BitmapData {
public function FloorSheet2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 12
//FloorSheet3 (art.FloorSheet3)
package art {
import flash.display.*;
public dynamic class FloorSheet3 extends BitmapData {
public function FloorSheet3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 13
//FloorSheet4 (art.FloorSheet4)
package art {
import flash.display.*;
public dynamic class FloorSheet4 extends BitmapData {
public function FloorSheet4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 14
//FloorSheet5 (art.FloorSheet5)
package art {
import flash.display.*;
public dynamic class FloorSheet5 extends BitmapData {
public function FloorSheet5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 15
//GhostSheet (art.GhostSheet)
package art {
import flash.display.*;
public dynamic class GhostSheet extends BitmapData {
public function GhostSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 16
//GruntSheet (art.GruntSheet)
package art {
import flash.display.*;
public dynamic class GruntSheet extends BitmapData {
public function GruntSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 17
//HouseSheet0 (art.HouseSheet0)
package art {
import flash.display.*;
public dynamic class HouseSheet0 extends BitmapData {
public function HouseSheet0(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 18
//HouseSheet1 (art.HouseSheet1)
package art {
import flash.display.*;
public dynamic class HouseSheet1 extends BitmapData {
public function HouseSheet1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 19
//HouseSheet2 (art.HouseSheet2)
package art {
import flash.display.*;
public dynamic class HouseSheet2 extends BitmapData {
public function HouseSheet2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 20
//HouseSheet3 (art.HouseSheet3)
package art {
import flash.display.*;
public dynamic class HouseSheet3 extends BitmapData {
public function HouseSheet3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 21
//LobberSheet (art.LobberSheet)
package art {
import flash.display.*;
public dynamic class LobberSheet extends BitmapData {
public function LobberSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 22
//PickupSheet (art.PickupSheet)
package art {
import flash.display.*;
public dynamic class PickupSheet extends BitmapData {
public function PickupSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 23
//PlayerSheet (art.PlayerSheet)
package art {
import flash.display.*;
public dynamic class PlayerSheet extends BitmapData {
public function PlayerSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 24
//SorcererSheet (art.SorcererSheet)
package art {
import flash.display.*;
public dynamic class SorcererSheet extends BitmapData {
public function SorcererSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 25
//SpecialSheet (art.SpecialSheet)
package art {
import flash.display.*;
public dynamic class SpecialSheet extends BitmapData {
public function SpecialSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 26
//TeleporterSheet (art.TeleporterSheet)
package art {
import flash.display.*;
public dynamic class TeleporterSheet extends BitmapData {
public function TeleporterSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 27
//WallSheet1 (art.WallSheet1)
package art {
import flash.display.*;
public dynamic class WallSheet1 extends BitmapData {
public function WallSheet1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 28
//WallSheet2 (art.WallSheet2)
package art {
import flash.display.*;
public dynamic class WallSheet2 extends BitmapData {
public function WallSheet2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 29
//WallSheet3 (art.WallSheet3)
package art {
import flash.display.*;
public dynamic class WallSheet3 extends BitmapData {
public function WallSheet3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 30
//WallSheet4 (art.WallSheet4)
package art {
import flash.display.*;
public dynamic class WallSheet4 extends BitmapData {
public function WallSheet4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package art
Section 31
//AirTube_11 (blast_passage_fla.AirTube_11)
package blast_passage_fla {
import flash.display.*;
public dynamic class AirTube_11 extends MovieClip {
public var light:MovieClip;
public var airTube:MovieClip;
}
}//package blast_passage_fla
Section 32
//click_skylt_17 (blast_passage_fla.click_skylt_17)
package blast_passage_fla {
import flash.text.*;
import flash.display.*;
public dynamic class click_skylt_17 extends MovieClip {
public var text:TextField;
}
}//package blast_passage_fla
Section 33
//lampa_blinkar_13 (blast_passage_fla.lampa_blinkar_13)
package blast_passage_fla {
import flash.display.*;
public dynamic class lampa_blinkar_13 extends MovieClip {
public var ll:MovieClip;
}
}//package blast_passage_fla
Section 34
//MainTimeline (blast_passage_fla.MainTimeline)
package blast_passage_fla {
import src.*;
import flash.display.*;
public dynamic class MainTimeline extends MovieClip {
public var game:BlastPassage;
}
}//package blast_passage_fla
Section 35
//visare_15 (blast_passage_fla.visare_15)
package blast_passage_fla {
import flash.display.*;
public dynamic class visare_15 extends MovieClip {
public var arrow:MovieClip;
}
}//package blast_passage_fla
Section 36
//BombExplode (sound.BombExplode)
package sound {
import flash.media.*;
public dynamic class BombExplode extends Sound {
}
}//package sound
Section 37
//DemonFire (sound.DemonFire)
package sound {
import flash.media.*;
public dynamic class DemonFire extends Sound {
}
}//package sound
Section 38
//GameMusic (sound.GameMusic)
package sound {
import flash.media.*;
public dynamic class GameMusic extends Sound {
}
}//package sound
Section 39
//HappyEndMusic (sound.HappyEndMusic)
package sound {
import flash.media.*;
public dynamic class HappyEndMusic extends Sound {
}
}//package sound
Section 40
//HealthWarning (sound.HealthWarning)
package sound {
import flash.media.*;
public dynamic class HealthWarning extends Sound {
}
}//package sound
Section 41
//HurtFire (sound.HurtFire)
package sound {
import flash.media.*;
public dynamic class HurtFire extends Sound {
}
}//package sound
Section 42
//HurtMonster (sound.HurtMonster)
package sound {
import flash.media.*;
public dynamic class HurtMonster extends Sound {
}
}//package sound
Section 43
//IntroMusic (sound.IntroMusic)
package sound {
import flash.media.*;
public dynamic class IntroMusic extends Sound {
}
}//package sound
Section 44
//KickBomb (sound.KickBomb)
package sound {
import flash.media.*;
public dynamic class KickBomb extends Sound {
}
}//package sound
Section 45
//LobberToss (sound.LobberToss)
package sound {
import flash.media.*;
public dynamic class LobberToss extends Sound {
}
}//package sound
Section 46
//MonsterDeath (sound.MonsterDeath)
package sound {
import flash.media.*;
public dynamic class MonsterDeath extends Sound {
}
}//package sound
Section 47
//MonsterSpawn (sound.MonsterSpawn)
package sound {
import flash.media.*;
public dynamic class MonsterSpawn extends Sound {
}
}//package sound
Section 48
//OpenSecret (sound.OpenSecret)
package sound {
import flash.media.*;
public dynamic class OpenSecret extends Sound {
}
}//package sound
Section 49
//PlantBomb (sound.PlantBomb)
package sound {
import flash.media.*;
public dynamic class PlantBomb extends Sound {
}
}//package sound
Section 50
//TakeFood1 (sound.TakeFood1)
package sound {
import flash.media.*;
public dynamic class TakeFood1 extends Sound {
}
}//package sound
Section 51
//TakeFood2 (sound.TakeFood2)
package sound {
import flash.media.*;
public dynamic class TakeFood2 extends Sound {
}
}//package sound
Section 52
//TakeFood3 (sound.TakeFood3)
package sound {
import flash.media.*;
public dynamic class TakeFood3 extends Sound {
}
}//package sound
Section 53
//TakeFood4 (sound.TakeFood4)
package sound {
import flash.media.*;
public dynamic class TakeFood4 extends Sound {
}
}//package sound
Section 54
//TakeKey (sound.TakeKey)
package sound {
import flash.media.*;
public dynamic class TakeKey extends Sound {
}
}//package sound
Section 55
//TakePowerup (sound.TakePowerup)
package sound {
import flash.media.*;
public dynamic class TakePowerup extends Sound {
}
}//package sound
Section 56
//TakeTreasure1 (sound.TakeTreasure1)
package sound {
import flash.media.*;
public dynamic class TakeTreasure1 extends Sound {
}
}//package sound
Section 57
//TakeTreasure2 (sound.TakeTreasure2)
package sound {
import flash.media.*;
public dynamic class TakeTreasure2 extends Sound {
}
}//package sound
Section 58
//Teleport (sound.Teleport)
package sound {
import flash.media.*;
public dynamic class Teleport extends Sound {
}
}//package sound
Section 59
//TimeWarning (sound.TimeWarning)
package sound {
import flash.media.*;
public dynamic class TimeWarning extends Sound {
}
}//package sound
Section 60
//TreasureDeath (sound.TreasureDeath)
package sound {
import flash.media.*;
public dynamic class TreasureDeath extends Sound {
}
}//package sound
Section 61
//UseKey (sound.UseKey)
package sound {
import flash.media.*;
public dynamic class UseKey extends Sound {
}
}//package sound
Section 62
//UsePotion (sound.UsePotion)
package sound {
import flash.media.*;
public dynamic class UsePotion extends Sound {
}
}//package sound
Section 63
//WinLevel (sound.WinLevel)
package sound {
import flash.media.*;
public dynamic class WinLevel extends Sound {
}
}//package sound
Section 64
//Bomb (src.entity.bomb.Bomb)
package src.entity.bomb {
import src.player.*;
import flash.utils.*;
import src.entity.*;
public class Bomb extends Mob {
private var ya:int;// = 0
private var xa:int;// = 0
private var lastKickTime:int;// = 0
private var step:int;// = 0
public var player:Player;
private var lifeTime:int;// = 30
private static var KICK_SPEED:int = 6;
public function Bomb(_arg1:Player, _arg2:int, _arg3:int){
step = 0;
lifeTime = (2 * 15);
xa = 0;
ya = 0;
lastKickTime = 0;
super(_arg2, _arg3);
this.player = _arg1;
this.x = _arg2;
this.y = _arg3;
slide = false;
}
override public function blocks(_arg1:GameEntity):Boolean{
if ((_arg1 is BomberMan)){
melee(BomberMan(_arg1));
return (true);
};
return (true);
}
override public function init():void{
player.activeBombs++;
setAlwaysTick();
}
override public function render():void{
var _local1:int;
_local1 = ((((step + level.alpha) * 3) / 8) & 3);
if (_local1 == 2){
_local1 = 0;
};
if (_local1 == 3){
_local1 = 2;
};
drawImage(gr.bomb, _local1, 0, -8, (-8 - 2));
}
override public function tick():void{
if (((!((xa == 0))) || (!((ya == 0))))){
if (!(attemptMove(xa, ya))){
if (attemptMove(xa, 0)){
ya = 0;
} else {
if (attemptMove(0, ya)){
xa = 0;
} else {
xa = (ya = 0);
};
};
};
};
step++;
if (step == lifeTime){
blowUp();
};
}
override public function initialBurn(_arg1:Fire):Boolean{
blowUp();
return (true);
}
override public function blocksBomb(_arg1:Bomb):Boolean{
return (true);
}
public function getPlayer():Player{
return (player);
}
public function blowUp():void{
playSound("BombExplode");
player.activeBombs--;
level.addEntity(new BombExplosion(this));
remove();
}
override public function melee(_arg1:BomberMan):Boolean{
if ((getTimer() - lastKickTime) > 200){
lastKickTime = getTimer();
playSound("KickBomb");
};
xa = (_arg1.xa * KICK_SPEED);
ya = (_arg1.ya * KICK_SPEED);
return (false);
}
}
}//package src.entity.bomb
Section 65
//BombExplosion (src.entity.bomb.BombExplosion)
package src.entity.bomb {
import src.particle.*;
import src.player.*;
import src.entity.*;
public class BombExplosion extends GameEntity {
public var bomb:Bomb;
private var step:int;// = 0
public function BombExplosion(_arg1:Bomb){
step = 0;
super();
this.bomb = _arg1;
this.x = _arg1.x;
this.y = _arg1.y;
}
override public function init():void{
setAlwaysTick();
}
override public function tick():void{
var _local1:int;
var _local2:int;
var _local3:int;
step++;
if (step == 1){
_local1 = 0;
while (_local1 < 16) {
level.addParticle(new BombParticle((x * 2), (y * 2)));
_local1++;
};
level.camera.shake();
_local2 = (((x >> 4) * 16) + 8);
_local3 = (((y >> 4) * 16) + 8);
level.addEntity(new Fire(this, _local2, _local3, -1, getPlayer().firePower));
};
if (step == (3 * 3)){
remove();
};
}
override public function render():void{
var _local1:int;
_local1 = ((((step + level.alpha) * 3) / 8) + 3);
drawImage(gr.bomb, _local1, 0, -8, (-8 - 2));
}
override public function blocksBomb(_arg1:Bomb):Boolean{
return (true);
}
public function getPlayer():Player{
return (bomb.getPlayer());
}
override public function burn(_arg1:Fire):Boolean{
if (_arg1.explosion == this){
return (false);
};
return ((step < (3 * 2)));
}
}
}//package src.entity.bomb
Section 66
//Fire (src.entity.bomb.Fire)
package src.entity.bomb {
import src.entity.*;
import src.player.*;
public class Fire extends GameEntity {
private var hurtTime:int;
private var power:int;
private var dir:int;
public var explosion:BombExplosion;
private var speed:Number;
private var step:int;// = 0
private var slidePower:Number;
private var blowDelay:int;// = 1
private var life:int;// = 16
public function Fire(_arg1:BombExplosion, _arg2:int, _arg3:int, _arg4:int, _arg5:int){
step = 0;
blowDelay = 1;
life = (2 * 8);
hurtTime = (life - 4);
speed = (((Math.random() * Math.random()) * 0.5) + 0.75);
slidePower = ((Math.random() * 0.75) + 0.25);
super();
this.explosion = _arg1;
this.xRadius = 4;
this.yRadius = 4;
if ((((((_arg4 == 0)) || ((_arg4 == 2)))) || ((_arg4 == -1)))){
yRadius = 8;
};
if ((((((_arg4 == 1)) || ((_arg4 == 3)))) || ((_arg4 == -1)))){
xRadius = 8;
};
this.x = _arg2;
this.y = _arg3;
this.dir = _arg4;
this.power = _arg5;
layer = -1;
}
override public function init():void{
setAlwaysTick();
}
override public function tick():void{
var _local1:int;
var _local2:int;
var _local3:Array;
var _local4:int;
var _local5:GameEntity;
if ((((power > 0)) && ((step == blowDelay)))){
_local1 = x;
_local2 = y;
if ((((((dir == 0)) || ((dir == -1)))) && (level.fireTo((x >> 4), ((y >> 4) + 1))))){
attemptFire(new Fire(explosion, x, (_local2 + 16), 0, (power - 1)));
};
if ((((((dir == 1)) || ((dir == -1)))) && (level.fireTo(((x >> 4) + 1), (y >> 4))))){
attemptFire(new Fire(explosion, (_local1 + 16), y, 1, (power - 1)));
};
if ((((((dir == 2)) || ((dir == -1)))) && (level.fireTo((x >> 4), ((y >> 4) - 1))))){
attemptFire(new Fire(explosion, x, (_local2 - 16), 2, (power - 1)));
};
if ((((((dir == 3)) || ((dir == -1)))) && (level.fireTo(((x >> 4) - 1), (y >> 4))))){
attemptFire(new Fire(explosion, (_local1 - 16), y, 3, (power - 1)));
};
};
if (step < hurtTime){
_local3 = level.blockMap.getIntersectingEntity(this);
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = _local3[_local4];
_local5.burn(this);
_local4++;
};
};
step++;
if (step == life){
remove();
};
}
private function attemptFire(_arg1:Fire):Boolean{
var _local2:Array;
var _local3:int;
var _local4:GameEntity;
_local2 = level.blockMap.getIntersectingEntity(_arg1);
_local3 = 0;
while (_local3 < _local2.length) {
_local4 = _local2[_local3];
if (_local4.initialBurn(this)){
return (false);
};
_local3++;
};
level.addEntity(_arg1);
return (true);
}
override public function render():void{
var _local1:int;
var _local2:Number;
var _local3:Number;
var _local4:int;
var _local5:Number;
_local1 = 0;
if (dir == -1){
_local1 = 2;
};
if ((((dir == 0)) || ((dir == 2)))){
_local1 = 1;
};
if ((((dir == 1)) || ((dir == 3)))){
_local1 = 6;
};
if ((((power == 0)) || ((step < blowDelay)))){
if (dir == 0){
_local1 = 4;
};
if (dir == 2){
_local1 = 0;
};
if (dir == 1){
_local1 = 8;
};
if (dir == 3){
_local1 = 5;
};
};
_local2 = 0;
_local3 = 0;
if (dir == 0){
_local3 = -1;
};
if (dir == 1){
_local2 = -1;
};
if (dir == 2){
_local3 = 1;
};
if (dir == 3){
_local2 = 1;
};
_local4 = int(((((step * speed) * 18) / life) + 1));
_local5 = (1 - (step / life));
_local5 = ((((_local5 * _local5) * 16) - 8) * slidePower);
if ((((_local4 <= 18)) && ((_local4 > 0)))){
drawImage32x32(gr.fire2, (_local4 - 1), 0, (-16 + (_local2 * _local5)), ((-16 + (_local3 * _local5)) - ((step * 7) / life)));
};
}
override public function blocksBomb(_arg1:Bomb):Boolean{
return ((step < hurtTime));
}
public function getPlayer():Player{
return (explosion.getPlayer());
}
}
}//package src.entity.bomb
Section 67
//Exit (src.entity.level.Exit)
package src.entity.level {
import src.entity.*;
public class Exit extends GameEntity {
public var toLevel:int;
public function Exit(_arg1:int, _arg2:int, _arg3:int){
this.x = _arg1;
this.y = _arg2;
this.toLevel = _arg3;
layer = -2;
}
override public function blocks(_arg1:GameEntity):Boolean{
var _local2:BomberMan;
if ((_arg1 is BomberMan)){
_local2 = BomberMan(_arg1);
_local2.exit(this);
playSound("WinLevel");
};
return (false);
}
override public function remove():void{
clearStatic();
super.remove();
}
override public function renderStatic():void{
drawStatic(gr.special, 0, 0);
}
override public function render():void{
}
}
}//package src.entity.level
Section 68
//Teleporter (src.entity.level.Teleporter)
package src.entity.level {
import src.entity.*;
public class Teleporter extends GameEntity {
var frames:Array;
public var step:int;// = 0
public var activateTime:int;// = 0
public function Teleporter(_arg1:int, _arg2:int){
step = 0;
activateTime = 0;
frames = new Array(0, 1, 0, 2);
super();
this.x = _arg1;
this.y = _arg2;
layer = -2;
}
override public function blocks(_arg1:GameEntity):Boolean{
var _local2:BomberMan;
var _local3:Array;
var _local4:Array;
var _local5:int;
var _local6:GameEntity;
var _local7:int;
var _local8:Teleporter;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
if ((_arg1 is BomberMan)){
_local2 = BomberMan(_arg1);
_local3 = level.getVisibleEntities();
_local4 = new Array();
_local5 = 0;
while (_local5 < _local3.length) {
_local6 = _local3[_local5];
if ((((_local6 is Teleporter)) && (!((_local6 == this))))){
_local4.push(Teleporter(_local6));
};
_local5++;
};
if (_local4.length > 0){
_local7 = 0;
while (_local7 < 10) {
_local5 = random.nextInt(_local4.length);
_local8 = _local4[_local5];
_local9 = ((random.nextInt(3) * 14) - 14);
_local10 = ((random.nextInt(3) * 14) - 14);
if (((!((_local9 == 0))) || (!((_local10 == 0))))){
_local11 = (_local8.x + _local9);
_local12 = (_local8.y + _local10);
if (((_local2.canMoveTo(_local11, _local12)) && (level.isFree(_local11, _local12, _local2)))){
_local8.activateTime = (activateTime = 10);
_local2.teleport(_local11, _local12);
playSound("Teleport");
return (false);
};
};
_local7++;
};
};
};
return (false);
}
override public function tick():void{
if (activateTime > 0){
activateTime--;
};
step++;
}
override public function render():void{
var _local1:int;
if ((activateTime % 2) == 1){
} else {
_local1 = ((int(((step + level.alpha) * 3)) >> 3) % 6);
if (_local1 >= 0){
drawImage16x32(gr.teleporter, _local1, 0, -8, (-8 - 10));
};
};
}
}
}//package src.entity.level
Section 69
//Trigger (src.entity.level.Trigger)
package src.entity.level {
import src.entity.*;
public class Trigger extends GameEntity {
var frames:Array;
public var step:int;// = 0
public function Trigger(_arg1:int, _arg2:int){
step = 0;
frames = new Array(3, 0, 1, 0, 3, 2, -1, -1, 2);
super();
this.x = _arg1;
this.y = _arg2;
layer = -2;
}
override public function blocks(_arg1:GameEntity):Boolean{
if ((_arg1 is BomberMan)){
remove();
level.trigger((x >> 4), (y >> 4));
playSound("OpenSecret");
};
return (false);
}
override public function tick():void{
step++;
}
override public function render():void{
var _local1:int;
_local1 = frames[((int(((step + level.alpha) * 3)) >> 3) % frames.length)];
if (_local1 >= 0){
drawImage(gr.special, _local1, 1, -8, -8);
};
}
}
}//package src.entity.level
Section 70
//Bullet (src.entity.monster.Bullet)
package src.entity.monster {
import src.entity.*;
public class Bullet extends GameEntity {
private var tickCount:int;// = 0
public var yo:int;
public var yt:int;// = 0
public var xo:int;
public var xt:int;// = 0
public static var BULLET_DURATION:int = 15;
public function Bullet(_arg1:int, _arg2:int, _arg3:int, _arg4:int){
xt = 0;
yt = 0;
tickCount = 0;
super();
this.xo = (this.x = _arg1);
this.yo = (this.y = _arg2);
this.xt = _arg3;
this.yt = _arg4;
}
override public function init():void{
layer = 1;
setAlwaysTick();
}
override public function tick():void{
var _local1:Array;
var _local2:int;
tickCount++;
x = int((xo + ((((xt - xo) * tickCount) * 1) / BULLET_DURATION)));
y = int((yo + ((((yt - yo) * tickCount) * 1) / BULLET_DURATION)));
updatePos();
if (tickCount == BULLET_DURATION){
_local1 = level.blockMap.getIntersectingEntity(this);
_local2 = 0;
while (_local2 < _local1.length) {
_local1[_local2].monsterFireDamage(this, 3);
_local2++;
};
remove();
};
}
override public function render():void{
var _local1:int;
_local1 = ((tickCount * 8) / BULLET_DURATION);
if (_local1 > 3){
_local1 = (3 - (_local1 - 4));
};
drawImage(gr.bullet, _local1, 0, -8, -14);
}
}
}//package src.entity.monster
Section 71
//Death (src.entity.monster.Death)
package src.entity.monster {
import src.entity.bomb.*;
import src.entity.*;
public class Death extends Monster {
public var life:int;// = 200
public function Death(_arg1:int, _arg2:int){
life = 200;
super(_arg1, _arg2);
meleeDamage = 1;
meleeInterval = 0;
}
override public function init():void{
super.init();
sheet = gr.death;
scoreOnPotion = 10;
}
override public function melee(_arg1:BomberMan):Boolean{
level.monsterInteracted();
life = (life - 1);
_arg1.hurt(1);
if (life <= 0){
remove();
return (false);
};
return (true);
}
override public function burn(_arg1:Fire):Boolean{
return (true);
}
}
}//package src.entity.monster
Section 72
//Demon (src.entity.monster.Demon)
package src.entity.monster {
public class Demon extends Monster {
private var fireTime:int;
private static var FIRE_INTERVAL:int = 60;
public function Demon(_arg1:int, _arg2:int){
super(_arg1, _arg2);
}
override public function init():void{
super.init();
fireTime = random.nextInt(FIRE_INTERVAL);
sheet = gr.demon;
speed = 4;
}
override public function tick():void{
var _local1:FireBall;
super.tick();
if (--fireTime < 0){
_local1 = new FireBall(x, y, dir);
_local1.x = (_local1.x + (_local1.xa * 14));
_local1.y = (_local1.y + (_local1.ya * 14));
if (_local1.fitsIn(level)){
level.addEntity(_local1);
playSound("DemonFire", 0.5);
};
fireTime = FIRE_INTERVAL;
};
}
}
}//package src.entity.monster
Section 73
//FireBall (src.entity.monster.FireBall)
package src.entity.monster {
import src.entity.*;
public class FireBall extends Mob {
private var tickCount:int;// = 0
private var dir:int;
public var ya:int;// = 0
public var xa:int;// = 0
public function FireBall(_arg1:int, _arg2:int, _arg3:int){
xa = 0;
ya = 0;
tickCount = 0;
super(_arg1, _arg2);
this.dir = _arg3;
if ((((((_arg3 == 0)) || ((_arg3 == 1)))) || ((_arg3 == 7)))){
ya--;
};
if ((((((_arg3 == 3)) || ((_arg3 == 4)))) || ((_arg3 == 5)))){
ya++;
};
if ((((((_arg3 == 1)) || ((_arg3 == 2)))) || ((_arg3 == 3)))){
xa--;
};
if ((((((_arg3 == 5)) || ((_arg3 == 6)))) || ((_arg3 == 7)))){
xa++;
};
}
override public function init():void{
slide = false;
setAlwaysTick();
}
override public function render():void{
var _local1:int;
_local1 = 1;
if (tickCount < 1){
_local1 = 0;
};
if (tickCount >= ((3 * 20) - 1)){
_local1 = 2;
};
drawImage(gr.fireball, (((dir % 2) * 3) + _local1), (dir / 2), -8, -8);
}
override public function tick():void{
var _local1:int;
_local1 = 0;
while (_local1 < 3) {
if (!(attemptMove(xa, ya))){
remove();
return;
};
if (removed){
return;
};
_local1++;
};
if (tickCount++ == (3 * 20)){
remove();
};
}
override public function meleed(_arg1:BomberMan):Boolean{
if (((!(alive)) || (removed))){
return (false);
};
level.monsterInteracted();
_arg1.getPlayer().hurt(10);
remove();
return (false);
}
override public function melee(_arg1:BomberMan):Boolean{
if (((!(alive)) || (removed))){
return (false);
};
return (meleed(_arg1));
}
}
}//package src.entity.monster
Section 74
//Ghost (src.entity.monster.Ghost)
package src.entity.monster {
import src.entity.*;
public class Ghost extends Monster {
public function Ghost(_arg1:int, _arg2:int){
super(_arg1, _arg2);
hurtOnMeleed = true;
meleeDamage = 15;
}
override public function init():void{
super.init();
sheet = gr.ghost;
}
override public function meleed(_arg1:BomberMan):Boolean{
if (((!(alive)) || (removed))){
return (false);
};
super.melee(_arg1);
remove();
return (false);
}
override public function melee(_arg1:BomberMan):Boolean{
if (((!(alive)) || (removed))){
return (false);
};
super.melee(_arg1);
remove();
return (false);
}
}
}//package src.entity.monster
Section 75
//Grunt (src.entity.monster.Grunt)
package src.entity.monster {
public class Grunt extends Monster {
public function Grunt(_arg1:int, _arg2:int){
super(_arg1, _arg2);
}
override public function init():void{
super.init();
sheet = gr.grunt;
speed = 4;
}
}
}//package src.entity.monster
Section 76
//House (src.entity.monster.House)
package src.entity.monster {
import src.entity.*;
import src.player.*;
import src.particle.*;
import src.entity.pickup.*;
import src.entity.bomb.*;
import flash.display.*;
public class House extends GameEntity {
private var bmd:BitmapData;
private var xSliceOffs:int;// = 0
private var xSlice:int;// = 0
private var ySlice:int;// = 0
private var ySliceOffs:int;// = 0
private var type:int;// = 0
private var ySliceSize:int;// = 0
private var xSliceSize:int;// = 0
private var spawnInterval:int;// = 60
private var spawnTime:int;// = 0
private var damage:int;// = 0
public function House(_arg1:int, _arg2:int, _arg3:int){
spawnInterval = (20 * 3);
spawnTime = 0;
damage = 0;
type = 0;
xSliceSize = 0;
ySliceSize = 0;
xSlice = 0;
ySlice = 0;
xSliceOffs = 0;
ySliceOffs = 0;
super();
this.type = _arg3;
this.x = _arg1;
this.y = _arg2;
layer = 0;
}
override public function blocks(_arg1:GameEntity):Boolean{
if (_arg1 == this){
return (false);
};
return (true);
}
override public function remove():void{
super.remove();
clearStatic();
}
override public function init():void{
var _local1:int;
var _local2:int;
xSlice = 0;
ySlice = 0;
_local1 = 3;
_local2 = 1;
xSliceOffs = -10;
ySliceOffs = -10;
if (type == 0){
bmd = gr.house0;
};
if (type == 1){
bmd = gr.house3;
_local2 = 2;
xSortDir = -1;
};
if (type == 2){
bmd = gr.house2;
};
if (type == 3){
bmd = gr.house3;
ySlice = 1;
_local2 = 2;
};
if (type == 4){
bmd = gr.house1;
xSliceOffs = (xSliceOffs - 4);
};
xSliceSize = (bmd.width / _local1);
ySliceSize = (bmd.height / _local2);
xSliceOffs = (xSliceOffs - (xSliceSize - 32));
ySliceOffs = (ySliceOffs - (ySliceSize - 32));
spawnTime = random.nextInt(spawnInterval);
}
override public function tick():void{
if (!(level.hasPlayer())){
return;
};
if (--spawnTime <= 0){
attemptSpawn();
spawnTime = spawnInterval;
};
}
override public function render():void{
xSlice = damage;
gr.drawCustom(bmd, (xSlice * xSliceSize), (ySlice * ySliceSize), xSliceSize, ySliceSize, ((x * 2) + xSliceOffs), ((y * 2) + ySliceOffs));
}
private function attemptSpawn():void{
var _local1:int;
var _local2:int;
var _local3:Monster;
_local1 = ((random.nextInt(3) * 12) - 12);
_local2 = ((random.nextInt(3) * 12) - 12);
_local3 = null;
if (type == 0){
_local3 = new Ghost((x + _local1), (y + _local2));
};
if (type == 1){
_local3 = new Grunt((x + _local1), (y + _local2));
};
if (type == 2){
_local3 = new Sorcerer((x + _local1), (y + _local2));
};
if (type == 3){
_local3 = new Demon((x + _local1), (y + _local2));
};
if (type == 4){
_local3 = new Lobber((x + _local1), (y + _local2));
};
if (_local3.fitsIn(level)){
level.addEntity(_local3);
playSound("MonsterSpawn", 0.8);
};
}
override public function initialBurn(_arg1:Fire):Boolean{
var _local2:int;
level.monsterInteracted();
damage = (damage + 2);
_local2 = 0;
while (_local2 < 2) {
level.addParticle(new HouseDeathParticle((x * 2), (y * 2)));
_local2++;
};
if (damage >= 3){
_local2 = 0;
while (_local2 < 20) {
level.addParticle(new HouseDeathParticle((x * 2), (y * 2)));
_local2++;
};
_arg1.getPlayer().addScore(25);
remove();
if (random.nextInt(2) == 0){
level.addEntity(new Powerup(x, y, random.nextInt(2)));
};
};
renderStatic();
return (true);
}
override public function potionActivated(_arg1:Player):void{
damage = (damage + 2);
if (damage >= 3){
remove();
};
}
}
}//package src.entity.monster
Section 77
//Lobber (src.entity.monster.Lobber)
package src.entity.monster {
import src.entity.*;
public class Lobber extends Monster {
private var fireTime:int;
private static var FIRE_INTERVAL:int = 25;
public function Lobber(_arg1:int, _arg2:int){
super(_arg1, _arg2);
}
override public function init():void{
super.init();
fleeDistance = (2 * 16);
stationaryDistance = (3 * 16);
fireTime = random.nextInt(FIRE_INTERVAL);
speed = 2;
sheet = gr.lobber;
}
override public function tick():void{
var _local1:BomberMan;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Bullet;
super.tick();
if (--fireTime < 0){
fireTime = FIRE_INTERVAL;
_local1 = level.getNearestBomberMan(this);
if (_local1 != null){
_local2 = (_local1.x + (_local1.xxa * Bullet.BULLET_DURATION));
_local3 = (_local1.y + (_local1.yya * Bullet.BULLET_DURATION));
_local4 = ((x - _local2) / 4);
_local5 = ((y - _local3) / 4);
if (((_local4 * _local4) + (_local5 * _local5)) < (((6 * 4) * 6) * 4)){
_local6 = new Bullet(x, y, _local2, _local3);
level.addEntity(_local6);
playSound("LobberToss", 0.5);
};
};
};
}
}
}//package src.entity.monster
Section 78
//Monster (src.entity.monster.Monster)
package src.entity.monster {
import src.entity.bomb.*;
import src.entity.*;
import src.player.*;
import src.particle.*;
import flash.display.*;
public class Monster extends Mob {
protected var meleeDamage:int;// = 5
protected var scoreOnPotion:int;// = 0
protected var wanderTime:int;// = 0
protected var speed:int;// = 3
protected var meleeInterval:int;// = 10
protected var hurtOnMeleed:Boolean;// = false
protected var sheet:BitmapData;
protected var ss:int;// = 0
protected var meleeDelay:int;// = 0
protected var dir:int;// = 0
protected var killValue:int;// = 5
protected var stationaryDistance:int;// = 0
protected var step:int;// = 0
private var move:Boolean;// = true
protected var blocksFire:Boolean;// = false
protected var fleeDistance:int;// = 0
public static var firstMonster:Monster = null;
public function Monster(_arg1:int, _arg2:int){
dir = 0;
step = 0;
wanderTime = 0;
killValue = 5;
blocksFire = false;
scoreOnPotion = 0;
speed = 3;
ss = 0;
hurtOnMeleed = false;
meleeDamage = 5;
meleeInterval = 10;
meleeDelay = 0;
fleeDistance = 0;
stationaryDistance = 0;
move = true;
super(_arg1, _arg2);
xRadius = (yRadius = 6);
if (firstMonster == null){
firstMonster = this;
};
}
override public function init():void{
step = random.nextInt(16);
dir = random.nextInt(8);
}
override public function meleed(_arg1:BomberMan):Boolean{
level.monsterInteracted();
if (hurtOnMeleed){
return (melee(_arg1));
};
return (true);
}
override public function melee(_arg1:BomberMan):Boolean{
if (meleeDelay > 0){
return (true);
};
meleeDelay = meleeInterval;
_arg1.hurt(meleeDamage);
level.monsterInteracted();
return (true);
}
override public function potionActivated(_arg1:Player):void{
if (scoreOnPotion > 0){
_arg1.addScore(scoreOnPotion);
};
remove();
}
override public function remove():void{
var _local1:int;
playSound("MonsterDeath");
_local1 = 0;
while (_local1 < 20) {
level.addParticle(new EnemyDeathParticle((x * 2), (y * 2)));
_local1++;
};
level.monsterInteracted();
super.remove();
}
override public function render():void{
var _local1:int;
_local1 = ((int(((step + level.alpha) * 3)) / 8) & 1);
drawImage(sheet, (((dir % 2) * 2) + _local1), (dir / 2), -8, -9);
}
override public function tick():void{
ss = (ss + 3);
while ((((ss >= speed)) && (!(removed)))) {
ss = (ss - 3);
performTick();
};
}
private function performTick():void{
var _local1:BomberMan;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
if (meleeDelay > 0){
meleeDelay--;
};
_local1 = level.getNearestBomberMan(this);
if (wanderTime > 0){
wanderTime--;
};
if (((!((_local1 == null))) && (((step % 4) == 0)))){
_local4 = ((_local1.x - x) / 8);
_local5 = ((_local1.y - y) / 8);
move = true;
if ((((fleeDistance > 0)) && ((((_local4 * _local4) + (_local5 * _local5)) < ((fleeDistance * fleeDistance) >> 4))))){
_local4 = -(_local4);
_local5 = -(_local5);
} else {
if ((((stationaryDistance > 0)) && ((((_local4 * _local4) + (_local5 * _local5)) < ((stationaryDistance * stationaryDistance) >> 4))))){
move = false;
};
};
if (wanderTime == 0){
if ((((_local5 < 0)) && ((_local4 == 0)))){
dir = 0;
};
if ((((_local5 < 0)) && ((_local4 < 0)))){
dir = 1;
};
if ((((_local5 == 0)) && ((_local4 < 0)))){
dir = 2;
};
if ((((_local5 > 0)) && ((_local4 < 0)))){
dir = 3;
};
if ((((_local5 > 0)) && ((_local4 == 0)))){
dir = 4;
};
if ((((_local5 > 0)) && ((_local4 > 0)))){
dir = 5;
};
if ((((_local5 == 0)) && ((_local4 > 0)))){
dir = 6;
};
if ((((_local5 < 0)) && ((_local4 > 0)))){
dir = 7;
};
};
};
_local2 = 0;
_local3 = 0;
if ((((((dir == 1)) || ((dir == 2)))) || ((dir == 3)))){
_local2 = -1;
};
if ((((((dir == 5)) || ((dir == 6)))) || ((dir == 7)))){
_local2 = 1;
};
if ((((((dir == 0)) || ((dir == 1)))) || ((dir == 7)))){
_local3 = -1;
};
if ((((((dir == 3)) || ((dir == 4)))) || ((dir == 5)))){
_local3 = 1;
};
step++;
if (((!((_local1 == null))) && (move))){
if (((!(attemptMove(_local2, _local3))) && ((wanderTime == 0)))){
dir = (((dir + random.nextInt(5)) - 2) & 7);
wanderTime = 11;
};
};
updatePos();
}
override public function burn(_arg1:Fire):Boolean{
_arg1.getPlayer().addScore(killValue);
remove();
return (blocksFire);
}
}
}//package src.entity.monster
Section 79
//Sorcerer (src.entity.monster.Sorcerer)
package src.entity.monster {
import src.entity.*;
import src.entity.bomb.*;
public class Sorcerer extends Monster {
private var blinkTime:int;
public var blink:Boolean;// = false
private static var BLINK_INTERVAL:int = 13;
public function Sorcerer(_arg1:int, _arg2:int){
blink = false;
super(_arg1, _arg2);
}
override public function init():void{
super.init();
blinkTime = random.nextInt(BLINK_INTERVAL);
sheet = gr.sorcerer;
speed = 4;
}
override public function meleed(_arg1:BomberMan):Boolean{
if (!(blink)){
super.meleed(_arg1);
};
return (true);
}
override public function melee(_arg1:BomberMan):Boolean{
if (!(blink)){
super.melee(_arg1);
};
return (true);
}
override public function render():void{
var _local1:int;
_local1 = ((int(((step + level.alpha) * 3)) / 8) & 1);
drawImage(sheet, _local1, (blink) ? 1 : 0, -8, -8);
}
override public function tick():void{
super.tick();
if (--blinkTime < 0){
blink = !(blink);
blinkTime = BLINK_INTERVAL;
};
}
override public function burn(_arg1:Fire):Boolean{
if (!(blink)){
return (super.burn(_arg1));
};
return (false);
}
}
}//package src.entity.monster
Section 80
//Food (src.entity.pickup.Food)
package src.entity.pickup {
import src.entity.bomb.*;
import src.entity.*;
import src.level.*;
public class Food extends Pickup {
private var value:int;
public function Food(_arg1:int, _arg2:int, _arg3:int){
super(_arg1, _arg2);
blowUp = (_arg3 == 3);
this.value = _arg3;
xImage = _arg3;
yImage = 1;
}
override public function take(_arg1:BomberMan):Boolean{
_arg1.getPlayer().addHealth(getValue(level));
playSound(("TakeFood" + (value + 1)), 0.7);
return (true);
}
override protected function burned(_arg1:Fire):void{
}
public function getValue(_arg1:Level):int{
return (((value + 1) * _arg1.getFoodValue()));
}
override public function getParticleType():int{
return (1);
}
}
}//package src.entity.pickup
Section 81
//Key (src.entity.pickup.Key)
package src.entity.pickup {
import src.entity.*;
public class Key extends Pickup {
public function Key(_arg1:int, _arg2:int){
super(_arg1, _arg2);
blowUp = false;
blockFire = false;
}
override public function take(_arg1:BomberMan):Boolean{
if (!(_arg1.getPlayer().canGetKey())){
return (false);
};
_arg1.addKey();
playSound("TakeKey");
return (true);
}
}
}//package src.entity.pickup
Section 82
//Pickup (src.entity.pickup.Pickup)
package src.entity.pickup {
import src.particle.*;
import src.entity.bomb.*;
import src.entity.*;
public class Pickup extends GameEntity {
public var blockPassage:Boolean;// = true
public var xImage:int;
public var yImage:int;
public var blockFire:Boolean;// = true
public var blowUp:Boolean;// = true
public function Pickup(_arg1:int, _arg2:int){
blowUp = true;
blockFire = true;
blockPassage = true;
super();
this.x = _arg1;
this.y = _arg2;
layer = -2;
}
override public function blocks(_arg1:GameEntity):Boolean{
if (_arg1 == this){
return (false);
};
if ((_arg1 is BomberMan)){
melee(BomberMan(_arg1));
return (false);
};
return (blockPassage);
}
override public function remove():void{
super.remove();
clearStatic();
}
public function take(_arg1:BomberMan):Boolean{
return (true);
}
override public function renderStatic():void{
drawStatic(gr.pickup, xImage, yImage);
}
override public function render():void{
}
protected function burned(_arg1:Fire):void{
}
override public function initialBurn(_arg1:Fire):Boolean{
var _local2:int;
if (blowUp){
playSound("TreasureDeath");
_local2 = 0;
while (_local2 < 16) {
level.addParticle(new BurnPowerupParticle((x * 2), (y * 2)));
_local2++;
};
burned(_arg1);
remove();
};
return (blockFire);
}
public function getParticleType():int{
return (0);
}
override public function melee(_arg1:BomberMan):Boolean{
var _local2:int;
if (take(_arg1)){
_local2 = 0;
while (_local2 < 16) {
level.addParticle(new PickupParticle((x * 2), (y * 2), getParticleType(), level.getRandomBomberMan()));
_local2++;
};
remove();
};
return (false);
}
}
}//package src.entity.pickup
Section 83
//Potion (src.entity.pickup.Potion)
package src.entity.pickup {
import src.entity.bomb.*;
import src.entity.*;
public class Potion extends Pickup {
public function Potion(_arg1:int, _arg2:int, _arg3:int){
super(_arg1, _arg2);
blowUp = (_arg3 == 0);
xImage = (_arg3 + 1);
yImage = 0;
}
override public function take(_arg1:BomberMan):Boolean{
if (!(_arg1.getPlayer().canGetPowerup())){
return (false);
};
playSound("TakePowerup");
_arg1.getPlayer().addPotion();
return (true);
}
override protected function burned(_arg1:Fire):void{
level.activatePotion(_arg1.getPlayer());
}
}
}//package src.entity.pickup
Section 84
//Powerup (src.entity.pickup.Powerup)
package src.entity.pickup {
import src.entity.bomb.*;
import src.entity.*;
public class Powerup extends Pickup {
private var type:int;
public function Powerup(_arg1:int, _arg2:int, _arg3:int){
super(_arg1, _arg2);
this.type = _arg3;
xImage = _arg3;
yImage = 2;
blowUp = true;
blockPassage = false;
}
override public function take(_arg1:BomberMan):Boolean{
if (!(_arg1.getPlayer().canGetPowerup())){
return (false);
};
playSound("TakePowerup");
if (type == 0){
_arg1.getPlayer().maxBombs++;
} else {
if (type == 1){
_arg1.getPlayer().firePower++;
};
};
return (true);
}
override protected function burned(_arg1:Fire):void{
super.burned(_arg1);
}
}
}//package src.entity.pickup
Section 85
//Treasure (src.entity.pickup.Treasure)
package src.entity.pickup {
import src.entity.*;
public class Treasure extends Pickup {
private var value:int;
public function Treasure(_arg1:int, _arg2:int, _arg3:int){
super(_arg1, _arg2);
blowUp = false;
this.value = _arg3;
xImage = _arg3;
yImage = 3;
}
override public function take(_arg1:BomberMan):Boolean{
playSound(("TakeTreasure" + (value + 1)), 0.5);
_arg1.getPlayer().addScore(getValue());
return (true);
}
public function getValue():int{
return (((value + 1) * 50));
}
override public function getParticleType():int{
return (2);
}
}
}//package src.entity.pickup
Section 86
//BomberMan (src.entity.BomberMan)
package src.entity {
import src.player.*;
import src.entity.bomb.*;
import src.entity.level.*;
import flash.utils.*;
import src.particle.*;
import src.entity.monster.*;
public class BomberMan extends Mob {
public var animation:TeleportAnimation;
private var dir:int;// = 0
public var ya:int;
private var lastHurtTime:int;// = 0
public var yya:int;
private var step:int;// = 0
private var player:Player;
public var color:int;// = 0
public var xxa:int;
public var xa:int;
private static var ALLOW_DIAGONAL_MOVEMENT:Boolean = true;
public function BomberMan(_arg1:int, _arg2:int, _arg3:Player){
dir = 0;
step = 0;
color = 0;
lastHurtTime = 0;
super(_arg1, _arg2);
this.player = _arg3;
this.color = color;
}
public function die():void{
var _local1:DeathAnim;
_local1 = new DeathAnim(this, player);
level.addEntity(_local1);
level.camera.add(_local1);
remove();
}
override public function blocks(_arg1:GameEntity):Boolean{
if (animation != null){
return (false);
};
_arg1.melee(this);
return (true);
}
public function exit(_arg1:Exit):void{
var _local2:ExitAnim;
_local2 = new ExitAnim(this, player, _arg1.x, _arg1.y);
level.addEntity(_local2);
level.camera.add(_local2);
player.setExit(_arg1.toLevel);
remove();
}
override public function render():void{
var _local1:int;
if (animation != null){
animation.render();
return;
};
_local1 = ((step / 8) & 3);
if (_local1 == 2){
_local1 = 0;
};
if (_local1 == 3){
_local1 = 2;
};
if (((int(((player.invulnTime + level.alpha) * 2)) / 4) & 1) == 0){
drawImage47x50(gr.player, (((dir % 2) * 3) + _local1), (dir / 2), -8, ((-16 - 8) - 4));
};
}
override public function canMoveTo(_arg1:int, _arg2:int):Boolean{
if (level.camera == null){
return (true);
};
return (level.camera.fits(this, _arg1, _arg2));
}
override public function tick():void{
var _local1:int;
_local1 = 0;
while (_local1 < 3) {
performTick();
if (_local1 > 0){
player.controller.tick();
};
_local1++;
};
}
public function addKey():void{
player.keys++;
}
public function removeKey():void{
player.keys--;
}
public function hurt(_arg1:int):void{
var _local2:int;
if ((((_arg1 < 100)) && (((getTimer() - lastHurtTime) > 200)))){
lastHurtTime = getTimer();
playSound("HurtMonster");
};
_local2 = 0;
while (_local2 < _arg1) {
level.addParticle(new HurtPlayerParticle((x * 2), (y * 2)));
_local2 = (_local2 + 50);
};
player.hurt(_arg1);
}
private function attemptBomb(_arg1:int, _arg2:int):Boolean{
var _local3:Bomb;
var _local4:Array;
var _local5:int;
var _local6:GameEntity;
if (!(level.isFree((_arg1 >> 4), (_arg2 >> 4)))){
return (false);
};
_local3 = new Bomb(player, (((_arg1 >> 4) * 16) + 8), (((_arg2 >> 4) * 16) + 8));
_local4 = level.blockMap.getIntersectingEntity(_local3);
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5];
if (((!((_local6 == this))) && (_local6.blocksBomb(_local3)))){
return (false);
};
_local5++;
};
playSound("PlantBomb");
level.addEntity(_local3);
return (true);
}
override public function monsterFireDamage(_arg1:Bullet, _arg2:int):void{
hurt(_arg2);
level.monsterInteracted();
}
private function performTick():void{
var _local1:Boolean;
var _local2:Boolean;
var _local3:Boolean;
var _local4:Boolean;
var _local5:Boolean;
var _local6:Boolean;
var _local7:Boolean;
var _local8:Boolean;
var _local9:Boolean;
if (animation != null){
animation.tick();
return;
};
_local1 = false;
_local2 = player.controller.buttons[Controller.BUTTON_DOWN];
_local3 = player.controller.buttons[Controller.BUTTON_RIGHT];
_local4 = player.controller.buttons[Controller.BUTTON_UP];
_local5 = player.controller.buttons[Controller.BUTTON_LEFT];
_local6 = player.controller.old[Controller.BUTTON_DOWN];
_local7 = player.controller.old[Controller.BUTTON_RIGHT];
_local8 = player.controller.old[Controller.BUTTON_UP];
_local9 = player.controller.old[Controller.BUTTON_LEFT];
if (ALLOW_DIAGONAL_MOVEMENT){
if (((((((_local4) || (_local2))) || (_local3))) || (_local5))){
if (((!(_local6)) && (_local2))){
ya = 1;
};
if (((!(_local7)) && (_local3))){
xa = 1;
};
if (((!(_local8)) && (_local4))){
ya = -1;
};
if (((!(_local9)) && (_local5))){
xa = -1;
};
if (((!(_local2)) && (!(_local4)))){
ya = 0;
};
if (((!(_local5)) && (!(_local3)))){
xa = 0;
};
if ((((((xa == -1)) && (!(_local5)))) || ((((xa == 1)) && (!(_local3)))))){
if (_local5){
xa = -1;
};
if (_local3){
xa = 1;
};
};
if ((((((ya == -1)) && (!(_local4)))) || ((((ya == 1)) && (!(_local2)))))){
if (_local4){
ya = -1;
};
if (_local2){
ya = 1;
};
};
_local1 = ((!((xa == 0))) || (!((ya == 0))));
if (xa == 1){
dir = 0;
};
if (ya == -1){
dir = 2;
};
if (xa == -1){
dir = 4;
};
if (ya == 1){
dir = 6;
};
if ((((xa == 1)) && ((ya == -1)))){
dir = 1;
};
if ((((ya == -1)) && ((xa == -1)))){
dir = 3;
};
if ((((xa == -1)) && ((ya == 1)))){
dir = 5;
};
if ((((ya == 1)) && ((xa == 1)))){
dir = 7;
};
};
} else {
xa = 0;
ya = 0;
if (((((((_local4) || (_local2))) || (_local3))) || (_local5))){
_local1 = true;
if ((((dir == 0)) && (!(_local2)))){
_local1 = false;
};
if ((((dir == 1)) && (!(_local3)))){
_local1 = false;
};
if ((((dir == 2)) && (!(_local4)))){
_local1 = false;
};
if ((((dir == 3)) && (!(_local5)))){
_local1 = false;
};
if (((((!(_local6)) || (!(_local1)))) && (_local2))){
dir = 0;
};
if (((((!(_local7)) || (!(_local1)))) && (_local3))){
dir = 1;
};
if (((((!(_local8)) || (!(_local1)))) && (_local4))){
dir = 2;
};
if (((((!(_local9)) || (!(_local1)))) && (_local5))){
dir = 3;
};
};
xa = 0;
ya = 0;
if (_local1){
if (dir == 0){
ya = 1;
};
if (dir == 1){
xa = 1;
};
if (dir == 2){
ya = -1;
};
if (dir == 3){
xa = -1;
};
};
};
xxa = 0;
yya = 0;
if (_local1){
step++;
level.playerMoved();
if (attemptMove(xa, ya)){
xxa = xa;
yya = ya;
};
};
updatePos();
if (((player.controller.isTyped(Controller.BUTTON_FIRE)) && (player.canBomb()))){
attemptBomb(x, y);
player.controller.old[Controller.BUTTON_FIRE] = true;
};
if (((player.controller.isTyped(Controller.BUTTON_SPECIAL)) && ((player.potions > 0)))){
player.potions--;
level.activatePotion(player);
playSound("UsePotion");
player.controller.old[Controller.BUTTON_SPECIAL] = true;
};
}
public function teleport(_arg1:int, _arg2:int):void{
animation = new TeleportAnimation(this, _arg1, _arg2);
}
override public function burn(_arg1:Fire):Boolean{
if (player.hitByFire()){
playSound("HurtFire");
};
return (false);
}
public function hasKey():Boolean{
return ((player.keys > 0));
}
public function getPlayer():Player{
return (player);
}
}
}//package src.entity
Section 87
//DeathAnim (src.entity.DeathAnim)
package src.entity {
import src.player.*;
import src.particle.*;
public class DeathAnim extends GameEntity {
private var deathTime:int;// = 0
public function DeathAnim(_arg1:BomberMan, _arg2:Player){
deathTime = 0;
super();
_arg2.setAnimation(this);
x = _arg1.x;
y = _arg1.y;
deathTime = -15;
}
override public function tick():void{
level.addParticle(new HurtPlayerParticle((x * 2), (y * 2)));
deathTime++;
if (deathTime == 21){
remove();
};
}
override public function render():void{
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = (((deathTime + level.alpha) * 3) / 8);
if (_local1 > 4){
_local1 = 4;
};
if (_local1 < 0){
drawImage47x50(gr.player, 0, 3, -8, ((-16 - 8) - 4));
} else {
if (_local1 < 0){
_local1 = 0;
};
_local2 = (310 / 5);
_local3 = (60 / 1);
drawCustom(gr.deathAnim, _local1, 0, _local2, _local3, -14, -21);
};
}
}
}//package src.entity
Section 88
//ExitAnim (src.entity.ExitAnim)
package src.entity {
import src.player.*;
public class ExitAnim extends GameEntity {
private var exitTime:int;// = 0
private var xTarget:int;
private var xStart:int;
private var yStart:int;
var frame:Array;
private var yTarget:int;
public function ExitAnim(_arg1:BomberMan, _arg2:Player, _arg3:int, _arg4:int){
exitTime = 0;
frame = new Array(1, 2, 5, 4, 8, 7, 10, 11);
super();
_arg2.setAnimation(this);
xStart = (x = _arg1.x);
yStart = (y = _arg1.y);
this.xTarget = _arg3;
this.yTarget = _arg4;
}
override public function tick():void{
exitTime++;
x = (xStart + (((xTarget - xStart) * exitTime) / 64));
y = (yStart + (((yTarget - yStart) * exitTime) / 64));
if (exitTime == 21){
remove();
};
}
override public function render():void{
var _local1:int;
var _local2:int;
_local1 = int((((exitTime + level.alpha) * 3) / 2));
_local2 = (_local1 % 8);
drawImage47x50(gr.player, (((_local2 % 2) * 3) + 0), (_local2 / 2), -8, ((-16 - 8) - 4));
}
}
}//package src.entity
Section 89
//GameEntity (src.entity.GameEntity)
package src.entity {
import src.level.*;
import flash.display.*;
import src.entity.bomb.*;
import src.player.*;
import src.entity.monster.*;
import src.*;
import src.math.*;
public class GameEntity {
public var level:Level;
public var id:int;
public var xOld:int;
public var xRadius:int;// = 4
protected var random:MtRandom;
public var depth:int;// = 0
public var xPrev:int;
public var yPrev:int;
public var alive:Boolean;// = true
public var layer:int;// = 0
public var removed:Boolean;// = false
public var yRadius:int;// = 4
public var yOld:int;
public var xSortDir:int;// = 1
public var x:int;
public var y:int;
public var gr:GraphicsContext;
private static var cid:int = 0;
public function GameEntity(){
id = cid++;
xRadius = 4;
yRadius = 4;
alive = true;
removed = false;
layer = 0;
depth = 0;
xSortDir = 1;
super();
}
public function potionActivated(_arg1:Player):void{
}
public function remove():void{
if (removed){
return;
};
removed = true;
level.blockMap.remove(this);
level.removeEntity(this);
}
public function drawImage32x32(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:Number, _arg5:Number):void{
var _local6:int;
var _local7:int;
_local6 = int((((xPrev * 2) + (((x - xPrev) * 2) * level.alpha)) + (_arg4 * 2)));
_local7 = int((((yPrev * 2) + (((y - yPrev) * 2) * level.alpha)) + (_arg5 * 2)));
gr.drawSprite32x32(_arg1, _arg2, _arg3, _local6, _local7);
}
public function meleed(_arg1:BomberMan):Boolean{
return (true);
}
public function blocks(_arg1:GameEntity):Boolean{
return (false);
}
public function render():void{
}
public function init():void{
}
public function drawImage47x50(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
var _local6:int;
var _local7:int;
_local6 = int(((xPrev * 2) + (((x - xPrev) * 2) * level.alpha)));
_local7 = int(((yPrev * 2) + (((y - yPrev) * 2) * level.alpha)));
gr.drawSprite47x50(_arg1, _arg2, _arg3, (_local6 + (_arg4 * 2)), (_local7 + (_arg5 * 2)));
}
public function tick():void{
}
public function renderStatic():void{
}
public function clearStatic():void{
var _local1:int;
var _local2:int;
_local1 = (x >> 4);
_local2 = (y >> 4);
level.updateImages(_local1, _local2, _local1, _local2);
}
public function initialBurn(_arg1:Fire):Boolean{
return (burn(_arg1));
}
public function playSound(_arg1:String, _arg2:Number=1):void{
var _local3:Number;
var _local4:Number;
_local3 = (x - (level.camera.x + (level.camera.width / 2)));
_local4 = (_local3 / 200);
if (_local4 < -1){
_local4 = -1;
};
if (_local4 > 1){
_local4 = 1;
};
BlastPassage.sound.get(_arg1).stop();
BlastPassage.sound.get(_arg1).play(_arg2, _local4);
}
public function monsterFireDamage(_arg1:Bullet, _arg2:int):void{
}
public function setLevel(_arg1:Level):void{
this.level = _arg1;
random = _arg1.nextRandom();
_arg1.blockMap.insert(this);
gr = _arg1.getGraphicsContext();
init();
xOld = x;
yOld = y;
xPrev = x;
yPrev = y;
}
public function doTick():void{
xPrev = x;
yPrev = y;
tick();
}
public function setAlwaysTick():void{
level.setAlwaysTick(this);
}
public function burn(_arg1:Fire):Boolean{
return (false);
}
public function updatePos():void{
if (removed){
return;
};
level.blockMap.moved(this);
}
public function drawCustom(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):void{
var _local8:int;
var _local9:int;
_local8 = int(((xPrev * 2) + (((x - xPrev) * 2) * level.alpha)));
_local9 = int(((yPrev * 2) + (((y - yPrev) * 2) * level.alpha)));
gr.drawCustom(_arg1, (_arg2 * _arg4), (_arg3 * _arg4), _arg4, _arg5, (_local8 + (_arg6 * 2)), (_local9 + (_arg7 * 2)));
}
public function blocksBomb(_arg1:Bomb):Boolean{
return (false);
}
public function drawStatic(_arg1:BitmapData, _arg2:int, _arg3:int):void{
var _local4:int;
var _local5:int;
_local4 = (x >> 4);
_local5 = (y >> 4);
level.updateImages(_local4, _local5, _local4, _local5);
gr.drawFloorImage(_arg1, _arg2, _arg3, _local4, _local5);
}
public function melee(_arg1:BomberMan):Boolean{
return (true);
}
public function drawImage16x32(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
var _local6:int;
var _local7:int;
_local6 = int(((xPrev * 2) + (((x - xPrev) * 2) * level.alpha)));
_local7 = int(((yPrev * 2) + (((y - yPrev) * 2) * level.alpha)));
gr.drawSprite16x32(_arg1, _arg2, _arg3, (_local6 + (_arg4 * 2)), (_local7 + (_arg5 * 2)));
}
public function calcDepth():void{
depth = (((16 * 32) + (((((layer + 1) * 16) * 32) + y) * 32)) + (x * xSortDir));
}
public function drawImage(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
var _local6:int;
var _local7:int;
_local6 = int(((xPrev * 2) + (((x - xPrev) * 2) * level.alpha)));
_local7 = int(((yPrev * 2) + (((y - yPrev) * 2) * level.alpha)));
gr.drawSprite(_arg1, _arg2, _arg3, (_local6 + (_arg4 * 2)), (_local7 + (_arg5 * 2)));
}
public function drawHouseImage(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
var _local6:int;
var _local7:int;
_local6 = int((x * 2));
_local7 = int((y * 2));
gr.drawSprite(_arg1, _arg2, _arg3, _local6, _local7);
}
}
}//package src.entity
Section 90
//Mob (src.entity.Mob)
package src.entity {
import src.level.*;
public class Mob extends GameEntity {
protected var slide:Boolean;// = true
public function Mob(_arg1:int, _arg2:int){
slide = true;
super();
this.x = _arg1;
this.y = _arg2;
}
override public function blocks(_arg1:GameEntity):Boolean{
var _local2:Boolean;
if (_arg1 == this){
return (false);
};
_local2 = true;
if ((_arg1 is BomberMan)){
_local2 = meleed(BomberMan(_arg1));
};
return (_local2);
}
private function _attemptMove(_arg1:int, _arg2:int):Boolean{
if (!(couldMove(_arg1, _arg2))){
return (false);
};
x = (x + _arg1);
y = (y + _arg2);
return (true);
}
public function canMoveTo(_arg1:int, _arg2:int):Boolean{
return (true);
}
protected function couldMove(_arg1:int, _arg2:int):Boolean{
var _local3:Array;
var _local4:int;
var _local5:GameEntity;
if (!(level.isFree((x + _arg1), (y + _arg2), this))){
return (false);
};
if (!(canMoveTo((x + _arg1), (y + _arg2)))){
return (false);
};
_local3 = level.blockMap.getIntersecting((x + _arg1), (y + _arg2), xRadius, yRadius);
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = _local3[_local4];
if ((((((((xOld >= ((_local5.x - xRadius) - _local5.xRadius))) && ((yOld >= ((_local5.y - yRadius) - _local5.yRadius))))) && ((xOld <= ((_local5.x + xRadius) + _local5.xRadius))))) && ((yOld <= ((_local5.y + yRadius) + _local5.yRadius))))){
} else {
if (((!((_local5 == this))) && (_local5.blocks(this)))){
return (false);
};
};
_local4++;
};
return (true);
}
public function attemptMove(_arg1:int, _arg2:int):Boolean{
var _local3:Boolean;
if ((((_arg1 == 0)) && ((_arg2 == 0)))){
return (true);
};
if ((((_arg1 == 0)) || ((_arg2 == 0)))){
if (_attemptMove(_arg1, _arg2)){
return (true);
};
if (!(slide)){
return (false);
};
if (_arg1 == 0){
if (couldMove(-6, _arg2)){
return (_attemptMove(-1, 0));
};
if (couldMove(6, _arg2)){
return (_attemptMove(1, 0));
};
return (false);
} else {
if (couldMove(_arg1, -6)){
return (_attemptMove(0, -1));
};
if (couldMove(_arg1, 6)){
return (_attemptMove(0, 1));
};
return (false);
};
};
if (_attemptMove(_arg1, _arg2)){
return (true);
};
if (!(slide)){
return (false);
};
_local3 = false;
_local3 = ((_local3) || (_attemptMove(_arg1, 0)));
_local3 = ((_local3) || (_attemptMove(0, _arg2)));
return (_local3);
}
public function fitsIn(_arg1:Level):Boolean{
var _local2:Array;
this.level = _arg1;
if (!(_arg1.isFree(x, y, this))){
return (false);
};
if (!(canMoveTo(x, y))){
return (false);
};
_local2 = _arg1.blockMap.getIntersecting(x, y, xRadius, yRadius);
return ((_local2.length == 0));
}
}
}//package src.entity
Section 91
//TeleportAnimation (src.entity.TeleportAnimation)
package src.entity {
public class TeleportAnimation {
private var bomberMan:BomberMan;
public var time:int;// = 0
var frame:Array;
private var xo:int;
private var yt:int;
private var xt:int;
private var yo:int;
private static var ANIM_DURATION:Number = 40;
public function TeleportAnimation(_arg1:BomberMan, _arg2:int, _arg3:int){
time = 0;
frame = new Array(1, 2, 5, 4, 8, 7, 10, 11);
super();
this.bomberMan = _arg1;
this.xo = _arg1.x;
this.yo = _arg1.y;
this.xt = _arg2;
this.yt = _arg3;
}
public function render():void{
var _local1:int;
var _local2:int;
_local1 = (time / 2);
_local2 = (_local1 % 8);
bomberMan.drawImage47x50(bomberMan.gr.player, (((_local2 % 2) * 3) + 0), (_local2 / 2), -8, ((-16 - 8) - 4));
}
public function tick():void{
var _local1:Number;
time++;
_local1 = (time / ANIM_DURATION);
_local1 = ((_local1 * 1.2) - 0.2);
if (_local1 < 0){
_local1 = 0;
};
if (_local1 > 1){
_local1 = 1;
};
_local1 = (((_local1 * _local1) + _local1) / 2);
bomberMan.x = int((xo + ((xt - xo) * _local1)));
bomberMan.y = int((yo + ((yt - yo) * _local1)));
if (time == ANIM_DURATION){
bomberMan.animation = null;
};
}
}
}//package src.entity
Section 92
//ButtonListener (src.gui.ButtonListener)
package src.gui {
public interface ButtonListener {
function buttonToggled(_arg1:int, _arg2:Boolean):Boolean;
}
}//package src.gui
Section 93
//Gui (src.gui.Gui)
package src.gui {
import flash.display.*;
import src.*;
import src.player.*;
import src.screen.game.*;
import flash.utils.*;
import flash.text.*;
public class Gui extends MovieClip implements ButtonListener {
private var gameScreen:GameScreen;
private var lWarn:int;// = -1
public var bombs:TextField;
public var keys:TextField;
public var soundButton:GuiButton;
private var lBombs:int;// = 0
private var blastPassage:BlastPassage;
public var oxygenLabel:TextField;
private var lPotions:int;// = 0
public var airMeter:MovieClip;
public var potions:TextField;
public var quitButton:GuiButton;
public var scoreLabel:TextField;
private var lScore:int;// = 0
private var lKeys:int;// = 0
public var score:TextField;
private var lSeconds:Number;// = 0
public var musicButton:GuiButton;
public var timeMeter:MovieClip;
private var lFire:int;// = 0
public var time:TextField;
private var lAirFrame:int;// = -999
private var lRot:Number;// = 0
private var lHealth:int;// = 0
public var fires:TextField;
public function Gui(){
lBombs = 0;
lFire = 0;
lKeys = 0;
lPotions = 0;
lScore = 0;
lRot = 0;
lAirFrame = -999;
lSeconds = 0;
lHealth = 0;
lWarn = -1;
super();
bombs.text = "0";
fires.text = "0";
keys.text = "0";
potions.text = "0";
score.text = "0";
musicButton.init(this, 0);
soundButton.init(this, 1);
quitButton.init(this, 2);
airMeter.light.gotoAndStop(1);
airMeter.light.ll.gotoAndStop(1);
airMeter.airTube.gotoAndStop(1);
}
public function buttonToggled(_arg1:int, _arg2:Boolean):Boolean{
if (blastPassage != null){
if (_arg1 == 0){
blastPassage.introButtons.musicButton.setPressed(_arg2);
BlastPassage.music.fadeTo((_arg2) ? 0 : 1, 200);
return (true);
};
if (_arg1 == 1){
blastPassage.introButtons.soundButton.setPressed(_arg2);
BlastPassage.sound.fadeTo((_arg2) ? 0 : 1, 200);
return (true);
};
if ((((_arg1 == 2)) && (_arg2))){
return (blastPassage.abortGame());
};
return (false);
};
return (false);
}
public function init(_arg1:BlastPassage):void{
this.blastPassage = _arg1;
}
public function reset():void{
quitButton.setPressed(false);
}
public function setScreen(_arg1:GameScreen):void{
this.gameScreen = _arg1;
}
public function animateLight():void{
var _local1:int;
var _local2:Number;
_local1 = 0;
if (gameScreen.player.getHealth() < (Player.MAX_HEALTH / 8)){
_local1 = 1;
};
if ((((_local1 == lWarn)) && ((_local1 == 0)))){
return;
};
lWarn = _local1;
if (_local1 == 0){
airMeter.light.gotoAndStop(1);
airMeter.light.ll.gotoAndStop(1);
} else {
_local2 = ((Math.sin((getTimer() / 100)) * 0.5) + 0.5);
airMeter.light.gotoAndStop((int((_local2 * 100)) + 1));
airMeter.light.ll.gotoAndStop((int((_local2 * 3)) + 1));
};
}
public function update():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Number;
var _local9:int;
var _local10:String;
if (gameScreen.player != null){
_local1 = (gameScreen.player.maxBombs - Player.START_BOMBS);
_local2 = (gameScreen.player.firePower - Player.START_FIRE);
_local3 = gameScreen.player.keys;
_local4 = gameScreen.player.potions;
_local5 = gameScreen.player.score;
_local6 = gameScreen.player.getHealth();
if (_local1 != lBombs){
bombs.text = ("" + (lBombs = _local1));
};
if (_local2 != lFire){
fires.text = ("" + (lFire = _local2));
};
if (_local3 != lKeys){
keys.text = ("" + (lKeys = _local3));
};
if (_local4 != lPotions){
potions.text = ("" + (lPotions = _local4));
};
if (_local5 != lScore){
score.text = ("" + (lScore = _local5));
};
if (_local6 != lHealth){
oxygenLabel.text = (((("" + int((_local6 / 10))) + ".") + ((lHealth = _local6) % 10)) + "%");
};
_local7 = int((((gameScreen.remainingTicks + BlastPassage.TICKS_PER_SECOND) - 1) / BlastPassage.TICKS_PER_SECOND));
if (_local7 != lSeconds){
lSeconds = _local7;
_local10 = (int((_local7 / 60)) + ":");
_local7 = (_local7 % 60);
time.text = ((_local10 + ((_local7 < 10)) ? "0" : "") + _local7);
};
_local8 = int(((1 - (gameScreen.remainingTicks / GameScreen.GAME_TIME)) * 180));
if (_local8 < 0){
_local8 = 0;
};
if (_local8 > 180){
_local8 = 180;
};
if (_local8 != lRot){
timeMeter.arrow.rotation = -((lRot = _local8));
};
_local9 = int(((((1000 - gameScreen.player.getHealth()) / 1000) * 96) + 4));
if (_local9 != lAirFrame){
airMeter.airTube.gotoAndStop(((lAirFrame = _local9) + 1));
};
animateLight();
};
}
}
}//package src.gui
Section 94
//GuiButton (src.gui.GuiButton)
package src.gui {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public class GuiButton extends MovieClip {
private var id:int;
private var gui:ButtonListener;
private var animating:Boolean;// = false
private var animPos:Number;// = 0
private var lastTime:int;// = 0
private var animDir:int;// = -1
public function GuiButton(){
animating = false;
animPos = 0;
animDir = -1;
lastTime = 0;
super();
gotoAndStop(1);
addEventListener(MouseEvent.MOUSE_DOWN, click);
mouseEnabled = true;
useHandCursor = true;
buttonMode = true;
tabEnabled = false;
}
public function init(_arg1:ButtonListener, _arg2:int):void{
this.gui = _arg1;
this.id = _arg2;
}
public function toggle():void{
if (gui == null){
return;
};
if (!(gui.buttonToggled(id, (animDir == -1)))){
return;
};
animDir = -(animDir);
if (!(animating)){
lastTime = getTimer();
addEventListener(Event.ENTER_FRAME, animate);
animating = true;
};
}
public function click(_arg1:MouseEvent):void{
toggle();
}
public function setPressed(_arg1:Boolean):void{
animDir = (_arg1) ? 1 : -1;
animPos = (_arg1) ? 1 : 0;
gotoAndStop(int(((animPos * 5) + 1)));
}
public function animate(_arg1:Event):void{
var _local2:int;
var _local3:int;
_local2 = getTimer();
_local3 = (_local2 - lastTime);
lastTime = _local2;
animPos = (animPos + ((animDir * _local3) / 170));
if (animPos < 0){
animPos = 0;
animating = false;
removeEventListener(Event.ENTER_FRAME, animate);
};
if (animPos > 1){
animPos = 1;
animating = false;
removeEventListener(Event.ENTER_FRAME, animate);
};
gotoAndStop(int(((animPos * 5) + 1)));
}
}
}//package src.gui
Section 95
//IntroMusicButton (src.gui.IntroMusicButton)
package src.gui {
public dynamic class IntroMusicButton extends GuiButton {
}
}//package src.gui
Section 96
//IntroOffButton (src.gui.IntroOffButton)
package src.gui {
public dynamic class IntroOffButton extends GuiButton {
}
}//package src.gui
Section 97
//IntroSoundButton (src.gui.IntroSoundButton)
package src.gui {
public dynamic class IntroSoundButton extends GuiButton {
}
}//package src.gui
Section 98
//BlockMap (src.level.BlockMap)
package src.level {
import src.entity.*;
public class BlockMap {
public var ly0:int;
public var ly1:int;
public var width:int;
public var entityGrid:Array;
public var lx0:int;
public var lx1:int;
public var height:int;
public var slot2:BlockSlot;
public var slot:BlockSlot;
public static var SCALE:int = 64;
public function BlockMap(_arg1:int, _arg2:int){
var _local3:int;
var _local4:int;
super();
slot = new BlockSlot(this);
slot2 = new BlockSlot(this);
this.width = (_arg1 / SCALE);
this.height = (_arg2 / SCALE);
if (width == 0){
width = 1;
};
if (height == 0){
height = 1;
};
entityGrid = new Array(width);
_local3 = 0;
while (_local3 < width) {
entityGrid[_local3] = new Array(height);
_local4 = 0;
while (_local4 < height) {
entityGrid[_local3][_local4] = new Array();
_local4++;
};
_local3++;
};
}
public function remove(_arg1:GameEntity):void{
getSlot(_arg1.xOld, _arg1.yOld).remove(_arg1);
}
public function clear():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < width) {
_local2 = 0;
while (_local2 < height) {
entityGrid[_local1][_local2] = new Array();
_local2++;
};
_local1++;
};
}
public function getIntersecting(_arg1:int, _arg2:int, _arg3:int, _arg4:int):Array{
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Array;
var _local10:BlockSlot;
var _local11:BlockSlot;
var _local12:Array;
var _local13:int;
var _local14:int;
var _local15:GameEntity;
_local5 = (_arg1 - _arg3);
_local6 = (_arg2 - _arg4);
_local7 = (_arg1 + _arg3);
_local8 = (_arg2 + _arg4);
_local9 = new Array();
_local10 = slot.init((_local5 - 16), (_local6 - 16));
_local11 = slot2.init((_local7 + 16), (_local8 + 16));
lx0 = _local10.xSlot;
ly0 = _local10.ySlot;
lx1 = _local11.xSlot;
ly1 = _local11.ySlot;
_arg1 = _local10.xSlot;
while (_arg1 <= _local11.xSlot) {
_arg2 = _local10.ySlot;
while (_arg2 <= _local11.ySlot) {
_local12 = entityGrid[_arg1][_arg2];
_local13 = _local12.length;
_local14 = 0;
while (_local14 < _local13) {
_local15 = _local12[_local14];
if (!(((((((((_local15.removed) || (((_local15.x + _local15.xRadius) < _local5)))) || (((_local15.y + _local15.yRadius) < _local6)))) || (((_local15.x - _local15.xRadius) > _local7)))) || (((_local15.y - _local15.yRadius) > _local8))))){
_local9.push(_local15);
};
_local14++;
};
_arg2++;
};
_arg1++;
};
return (_local9);
}
public function getIntersectingEntity(_arg1:GameEntity):Array{
return (getIntersecting(_arg1.x, _arg1.y, _arg1.xRadius, _arg1.yRadius));
}
public function getEntities(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Array=null):Array{
var _local6:BlockSlot;
var _local7:BlockSlot;
var _local8:int;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:int;
var _local13:GameEntity;
if (_arg5 == null){
_arg5 = new Array();
};
_local6 = slot.init(_arg1, _arg2);
_local7 = slot2.init(_arg3, _arg4);
lx0 = _local6.xSlot;
ly0 = _local6.ySlot;
lx1 = _local7.xSlot;
ly1 = _local7.ySlot;
_local8 = _local6.xSlot;
while (_local8 <= _local7.xSlot) {
_local9 = _local6.ySlot;
while (_local9 <= _local7.ySlot) {
_local10 = entityGrid[_local8][_local9];
_local11 = _local10.length;
_local12 = 0;
while (_local12 < _local11) {
_local13 = _local10[_local12];
if (!(((((((((_local13.removed) || (((_local13.x + _local13.xRadius) < _arg1)))) || (((_local13.y + _local13.yRadius) < _arg2)))) || (((_local13.x - _local13.xRadius) > _arg3)))) || (((_local13.y - _local13.yRadius) > _arg4))))){
_arg5.push(_local13);
};
_local12++;
};
_local9++;
};
_local8++;
};
return (_arg5);
}
public function insert(_arg1:GameEntity):void{
getSlot(_arg1.x, _arg1.y).add(_arg1);
_arg1.xOld = _arg1.x;
_arg1.yOld = _arg1.y;
}
public function moved(_arg1:GameEntity):void{
var _local2:BlockSlot;
var _local3:BlockSlot;
_local2 = slot.init(_arg1.xOld, _arg1.yOld);
_local3 = slot2.init(_arg1.x, _arg1.y);
_arg1.xOld = _arg1.x;
_arg1.yOld = _arg1.y;
if (_local2.equals(_local3)){
return;
};
_local2.remove(_arg1);
_local3.add(_arg1);
}
private function getSlot(_arg1:int, _arg2:int):BlockSlot{
return (slot.init(_arg1, _arg2));
}
}
}//package src.level
Section 99
//BlockSlot (src.level.BlockSlot)
package src.level {
import src.entity.*;
public class BlockSlot {
public var blockMap:BlockMap;
public var xSlot:int;
public var ySlot:int;
public function BlockSlot(_arg1:BlockMap){
this.blockMap = _arg1;
}
public function remove(_arg1:GameEntity):void{
if ((((xSlot >= 0)) && ((ySlot >= 0)))){
blockMap.entityGrid[xSlot][ySlot].splice(blockMap.entityGrid[xSlot][ySlot].indexOf(_arg1), 1);
};
}
public function add(_arg1:GameEntity):void{
if ((((xSlot >= 0)) && ((ySlot >= 0)))){
blockMap.entityGrid[xSlot][ySlot].push(_arg1);
};
}
public function init(_arg1:int, _arg2:int):BlockSlot{
xSlot = (_arg1 / BlockMap.SCALE);
ySlot = (_arg2 / BlockMap.SCALE);
if (xSlot < 0){
xSlot = 0;
};
if (ySlot < 0){
ySlot = 0;
};
if (xSlot >= blockMap.width){
xSlot = (blockMap.width - 1);
};
if (ySlot >= blockMap.height){
ySlot = (blockMap.height - 1);
};
return (this);
}
public function equals(_arg1:BlockSlot):Boolean{
return ((((_arg1.xSlot == xSlot)) && ((_arg1.ySlot == ySlot))));
}
}
}//package src.level
Section 100
//FileLevelLoader (src.level.FileLevelLoader)
package src.level {
import flash.net.*;
import src.*;
import flash.events.*;
public class FileLevelLoader extends LevelLoader {
private var bp:BlastPassage;
private var levelData:String;
private var myLoader:URLLoader;
public function FileLevelLoader(_arg1:BlastPassage){
super(_arg1);
this.bp = _arg1;
myLoader = new URLLoader(new URLRequest("test.dat"));
myLoader.addEventListener("complete", levelLoaded);
}
function levelLoaded(_arg1:Event):void{
var _local2:String;
_local2 = String(myLoader.data);
this.levelData = _local2;
bp.levelsLoaded();
}
override public function loadLevel(_arg1:GraphicsContext, _arg2:int, _arg3:String, _arg4:int):Level{
return (super.loadLevel(_arg1, _arg2, this.levelData, _arg4));
}
}
}//package src.level
Section 101
//GameCamera (src.level.GameCamera)
package src.level {
import src.entity.*;
public class GameCamera {
private var level:Level;
public var width:int;
private var entities:Array;
public var xx:Number;
public var yi:int;
public var yyLast:Number;
private var shakeLevel:int;// = 0
public var height:int;
public var yy:Number;
public var xi:int;
public var xxLast:Number;
public var x:int;
public var y:int;
public function GameCamera(_arg1:Level, _arg2:int, _arg3:int){
entities = new Array();
shakeLevel = 0;
super();
this.level = _arg1;
this.width = _arg2;
this.height = _arg3;
xxLast = (xx = (x = (((_arg1.xStart * 16) + 8) - (_arg2 / 2))));
yyLast = (yy = (y = (((_arg1.yStart * 16) + 8) - (_arg3 / 2))));
if (x < 0){
x = 0;
};
if (y < 0){
y = 0;
};
if (x > ((_arg1.width * 16) - _arg2)){
x = ((_arg1.width * 16) - _arg2);
};
if (y > ((_arg1.height * 16) - _arg3)){
y = ((_arg1.height * 16) - _arg3);
};
}
public function fits(_arg1:GameEntity, _arg2:int, _arg3:int):Boolean{
return ((((((((_arg2 >= (x + _arg1.xRadius))) && ((_arg3 >= (y + _arg1.yRadius))))) && ((_arg2 <= ((x + width) - _arg1.xRadius))))) && ((_arg3 <= ((y + height) - _arg1.yRadius)))));
}
public function shake():void{
shakeLevel = (shakeLevel + 24);
if (shakeLevel > 60){
shakeLevel = 60;
};
}
public function add(_arg1:GameEntity):void{
entities.push(_arg1);
}
public function tick():void{
var _local1:int;
xxLast = xx;
yyLast = yy;
_local1 = 0;
while (_local1 < 3) {
performTick();
_local1++;
};
}
public function performTick():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:GameEntity;
if (shakeLevel > 0){
shakeLevel--;
};
_local1 = 0;
_local2 = 0;
if (entities.length != 0){
_local3 = 1000000;
_local4 = -1000000;
_local5 = 1000000;
_local6 = -1000000;
_local7 = 0;
while (_local7 < entities.length) {
_local8 = entities[_local7];
if (_local8.removed){
var _temp1 = _local7;
_local7 = (_local7 - 1);
entities.splice(_temp1, 1);
} else {
if (_local8.x < _local3){
_local3 = _local8.x;
};
if (_local8.x > _local4){
_local4 = _local8.x;
};
if (_local8.y < _local5){
_local5 = _local8.y;
};
if (_local8.y > _local6){
_local6 = _local8.y;
};
};
_local7++;
};
_local1 = (((_local3 + _local4) / 2) - (width / 2));
_local2 = (((_local5 + _local6) / 2) - (height / 2));
} else {
_local1 = (((level.xStart * 16) + 8) - (width / 2));
_local2 = (((level.yStart * 16) + 8) - (height / 2));
};
xx = (xx + ((_local1 - xx) / 8));
yy = (yy + ((_local2 - yy) / 8));
x = int(xx);
y = int(yy);
if (x < 0){
x = 0;
};
if (y < 0){
y = 0;
};
if (x > ((level.width * 16) - width)){
x = ((level.width * 16) - width);
};
if (y > ((level.height * 16) - height)){
y = ((level.height * 16) - height);
};
}
public function lerp(_arg1:Number):void{
xi = int(((xxLast * 2) + (((xx - xxLast) * _arg1) * 2)));
yi = int(((yyLast * 2) + (((yy - yyLast) * _arg1) * 2)));
if (xi < 0){
xi = 0;
};
if (yi < 0){
yi = 0;
};
if (xi > (((level.width * 16) - width) * 2)){
xi = (((level.width * 16) - width) * 2);
};
if (yi > (((level.height * 16) - height) * 2)){
yi = (((level.height * 16) - height) * 2);
};
if (shakeLevel > 0){
xi = (xi + (((Math.random() - Math.random()) * shakeLevel) * 0.2));
yi = (yi + (((Math.random() - Math.random()) * shakeLevel) * 0.2));
};
}
public function shakeMax():void{
shakeLevel = 70;
}
}
}//package src.level
Section 102
//Level (src.level.Level)
package src.level {
import src.math.*;
import src.particle.*;
import src.entity.*;
import src.entity.monster.*;
import src.entity.pickup.*;
import src.entity.level.*;
import flash.display.*;
import src.player.*;
import src.*;
public class Level {
public var potionTime:int;// = 0
private var bomberMen:Array;
private var totalTreasure:int;// = 0
public var blockMap:BlockMap;
public var wallType:int;// = 2
public var camera:GameCamera;
private var toAdd:Array;
public var height:int;
private var noMoveTime:int;// = 0
public var foodValue:int;// = 20
public var floorColor:int;// = 6
public var wallColor:int;// = 13
private var totalHealth:int;// = 0
private var entities:Array;
public var random:MtRandom;
public var width:int;
public var xStart:int;
private var alwaysTick:Array;
public var map:Array;
public var alpha:Number;
private var toRemove:Array;
private var noMonsterInteractionTime:int;// = 0
public var levelNum:int;// = 1
public var gr:GraphicsContext;
public var floorType:int;// = 2
public var yStart:int;
private var seed:int;
private var particleLayer:Sprite;
public var randomAccesses:int;// = 0
public static var AUTO_DOOR_OPEN_TIME:int = 1800;
public static var WALL_CHARS:String = "#%&";
public static var AUTO_WALL_TO_EXIT_TIME:int = 12000;
public function Level(_arg1:int, _arg2:int, _arg3:int){
entities = new Array();
bomberMen = new Array();
alwaysTick = new Array();
toAdd = new Array();
toRemove = new Array();
random = new MtRandom(42);
floorColor = 6;
wallColor = 13;
floorType = 2;
wallType = 2;
potionTime = 0;
noMonsterInteractionTime = 0;
noMoveTime = 0;
totalTreasure = 0;
totalHealth = 0;
levelNum = 1;
foodValue = 20;
randomAccesses = 0;
super();
this.seed = _arg3;
random.setSeed(_arg3);
this.width = _arg1;
this.height = _arg2;
blockMap = new BlockMap((_arg1 * 16), (_arg2 * 16));
}
public function getNearestBomberMan(_arg1:GameEntity):BomberMan{
var _local2:BomberMan;
var _local3:int;
var _local4:int;
var _local5:BomberMan;
var _local6:int;
var _local7:int;
var _local8:int;
_local2 = null;
_local3 = 0;
_local4 = 0;
while (_local4 < bomberMen.length) {
_local5 = bomberMen[_local4];
_local6 = (_local5.x - _arg1.x);
_local7 = (_local5.y - _arg1.y);
_local8 = ((_local6 * _local6) + (_local7 * _local7));
if ((((_local2 == null)) || ((_local8 < _local3)))){
_local3 = _local8;
_local2 = _local5;
};
_local4++;
};
return (_local2);
}
public function getGraphicsContext():GraphicsContext{
return (gr);
}
public function calcHealth():int{
return (totalHealth);
}
public function calcTreasure():int{
return (totalTreasure);
}
public function hasPlayer():Boolean{
return ((bomberMen.length > 0));
}
public function tick():void{
var _local1:Array;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:GameEntity;
if (bomberMen.length > 0){
noMonsterInteractionTime++;
noMoveTime++;
if ((((noMonsterInteractionTime == AUTO_DOOR_OPEN_TIME)) && (!(hasKey())))){
unlockAll();
};
if (noMonsterInteractionTime == (AUTO_DOOR_OPEN_TIME * 2)){
unlockAll();
};
if (noMoveTime == AUTO_WALL_TO_EXIT_TIME){
exitAll();
};
};
if (potionTime > 0){
potionTime--;
};
_local1 = blockMap.getEntities(camera.x, camera.y, (camera.x + camera.width), (camera.y + camera.height));
_local2 = 0;
while (_local2 < alwaysTick.length) {
_local4 = _local1.indexOf(alwaysTick[_local2]);
if (_local4 >= 0){
_local1.splice(_local4, 1);
};
_local1.push(alwaysTick[_local2]);
_local2++;
};
_local3 = 0;
while (_local3 < _local1.length) {
_local5 = _local1[_local3];
if (!(_local5.removed)){
_local5.doTick();
};
_local3++;
};
_local3 = 0;
while (_local3 < toAdd.length) {
toAdd[_local3].renderStatic();
_local3++;
};
entities = entities.concat(toAdd);
_local2 = 0;
while (_local2 < toRemove.length) {
_local4 = entities.indexOf(toRemove[_local2]);
if (_local4 >= 0){
entities.splice(_local4, 1);
};
_local4 = alwaysTick.indexOf(toRemove[_local2]);
if (_local4 >= 0){
alwaysTick.splice(_local4, 1);
};
_local2++;
};
toRemove = new Array();
toAdd = new Array();
}
public function updateImages(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
var _local5:int;
var _local6:int;
var _local7:BitmapData;
var _local8:int;
var _local9:int;
var _local10:String;
var _local11:String;
var _local12:String;
var _local13:String;
var _local14:String;
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg2 < 0){
_arg2 = 0;
};
if (_arg3 >= width){
_arg3 = (width - 1);
};
if (_arg4 >= height){
_arg4 = (height - 1);
};
_local8 = _arg1;
while (_local8 <= _arg3) {
_local9 = _arg2;
while (_local9 <= _arg4) {
_local10 = getTile(_local8, _local9);
gr.drawFloorImage(gr.floor, _local8, _local9, _local8, _local9);
if (wallType == 2){
if (_local10 == "%"){
_local5 = (2 + (_local8 % 2));
_local6 = 0;
_local7 = gr.wall;
if (WALL_CHARS.indexOf(getTile(_local8, (_local9 + 1))) < 0){
_local6 = (_local6 + 1);
};
gr.drawFloorImage(_local7, _local5, _local6, _local8, _local9);
} else {
if (_local10 == "C"){
_local5 = 4;
_local6 = 0;
_local7 = gr.wall;
gr.drawFloorImage(_local7, _local5, _local6, _local8, _local9);
} else {
if (WALL_CHARS.indexOf(_local10) >= 0){
_local5 = (0 + (_local8 % 2));
_local6 = 0;
_local7 = gr.wall;
if (WALL_CHARS.indexOf(getTile(_local8, (_local9 + 1))) < 0){
_local6 = (_local6 + 1);
};
gr.drawFloorImage(_local7, _local5, _local6, _local8, _local9);
};
};
};
} else {
if (_local10 == "%"){
_local5 = 0;
_local6 = 4;
_local7 = gr.wall;
if (WALL_CHARS.indexOf(getTile((_local8 - 1), _local9)) >= 0){
_local5 = (_local5 + 1);
};
if (WALL_CHARS.indexOf(getTile(_local8, (_local9 - 1))) >= 0){
_local5 = (_local5 + 2);
};
if (WALL_CHARS.indexOf(getTile((_local8 + 1), _local9)) >= 0){
_local5 = (_local5 + 4);
};
if (WALL_CHARS.indexOf(getTile(_local8, (_local9 + 1))) >= 0){
_local5 = (_local5 + 8);
};
gr.drawFloorImage(_local7, _local5, _local6, _local8, _local9);
} else {
if (_local10 == "C"){
_local5 = 0;
_local6 = 5;
_local7 = gr.wall;
gr.drawFloorImage(_local7, _local5, _local6, _local8, _local9);
} else {
if (WALL_CHARS.indexOf(_local10) >= 0){
_local5 = 0;
_local6 = ((_local8 + _local9) % 4);
_local7 = gr.wall;
if (WALL_CHARS.indexOf(getTile((_local8 - 1), _local9)) >= 0){
_local5 = (_local5 + 1);
};
if (WALL_CHARS.indexOf(getTile(_local8, (_local9 - 1))) >= 0){
_local5 = (_local5 + 2);
};
if (WALL_CHARS.indexOf(getTile((_local8 + 1), _local9)) >= 0){
_local5 = (_local5 + 4);
};
if (WALL_CHARS.indexOf(getTile(_local8, (_local9 + 1))) >= 0){
_local5 = (_local5 + 8);
};
gr.drawFloorImage(_local7, _local5, _local6, _local8, _local9);
};
};
};
};
if (_local10 == "-"){
_local11 = getTile(_local8, (_local9 + 1));
_local12 = getTile(_local8, (_local9 - 1));
_local13 = getTile((_local8 - 1), _local9);
_local14 = getTile((_local8 + 1), _local9);
_local5 = 1;
_local6 = 0;
if ((((_local11 == "-")) && ((_local14 == "-")))){
_local5 = 2;
} else {
if ((((_local11 == "-")) && ((_local13 == "-")))){
_local5 = 0;
} else {
if ((((_local12 == "-")) && ((_local14 == "-")))){
_local5 = 0;
} else {
if ((((_local12 == "-")) && ((_local13 == "-")))){
_local5 = 2;
} else {
if ((((_local12 == "-")) || ((_local11 == "-")))){
_local5 = 3;
} else {
if ((((_local13 == "-")) || ((_local14 == "-")))){
_local5 = 1;
} else {
if ((((_local12 == "#")) || ((_local11 == "#")))){
_local5 = 3;
} else {
if ((((_local13 == "#")) || ((_local14 == "#")))){
_local5 = 1;
};
};
};
};
};
};
};
};
gr.drawFloorImage(gr.door, _local5, _local6, _local8, _local9);
};
_local9++;
};
_local8++;
};
}
public function exitAll():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < width) {
_local2 = 0;
while (_local2 < height) {
if (WALL_CHARS.indexOf(getTile(_local1, _local2)) >= 0){
addEntity(new Exit(((_local1 * 16) + 8), ((_local2 * 16) + 8), 0));
setTile(_local1, _local2, " ");
};
_local2++;
};
_local1++;
};
}
public function removeEntity(_arg1:GameEntity):void{
if ((_arg1 is BomberMan)){
bomberMen.splice(bomberMen.indexOf(_arg1), 1);
};
_arg1.alive = false;
toRemove.push(_arg1);
}
private function getTile(_arg1:int, _arg2:int):String{
if ((((((((_arg1 < 0)) || ((_arg2 < 0)))) || ((_arg1 >= width)))) || ((_arg2 >= height)))){
return (" ");
};
return (map[(_arg1 + (_arg2 * width))]);
}
public function setData(_arg1:Array):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:GameEntity;
random.setSeed(seed);
toAdd = new Array();
toRemove = new Array();
entities = new Array();
bomberMen = new Array();
alwaysTick = new Array();
blockMap.clear();
this.map = _arg1;
totalHealth = 0;
totalTreasure = 0;
_local2 = 0;
while (_local2 < _arg1.length) {
_local3 = (_local2 % width);
_local4 = (_local2 / width);
_local5 = null;
if (_arg1[_local2] == "."){
_local5 = new Ghost(((_local3 * 16) + 8), ((_local4 * 16) + 8));
};
if (_arg1[_local2] == ","){
_local5 = new Grunt(((_local3 * 16) + 8), ((_local4 * 16) + 8));
};
if (_arg1[_local2] == ";"){
_local5 = new Sorcerer(((_local3 * 16) + 8), ((_local4 * 16) + 8));
};
if (_arg1[_local2] == ":"){
_local5 = new Demon(((_local3 * 16) + 8), ((_local4 * 16) + 8));
};
if (_arg1[_local2] == "*"){
_local5 = new Lobber(((_local3 * 16) + 8), ((_local4 * 16) + 8));
};
if (_arg1[_local2] == "'"){
_local5 = new Death(((_local3 * 16) + 8), ((_local4 * 16) + 8));
};
if (_arg1[_local2] == "1"){
_local5 = new House(((_local3 * 16) + 8), ((_local4 * 16) + 8), 0);
};
if (_arg1[_local2] == "2"){
_local5 = new House(((_local3 * 16) + 8), ((_local4 * 16) + 8), 1);
};
if (_arg1[_local2] == "3"){
_local5 = new House(((_local3 * 16) + 8), ((_local4 * 16) + 8), 2);
};
if (_arg1[_local2] == "4"){
_local5 = new House(((_local3 * 16) + 8), ((_local4 * 16) + 8), 3);
};
if (_arg1[_local2] == "5"){
_local5 = new House(((_local3 * 16) + 8), ((_local4 * 16) + 8), 4);
};
if (_arg1[_local2] == "K"){
_local5 = new Key(((_local3 * 16) + 8), ((_local4 * 16) + 8));
};
if (_arg1[_local2] == "$"){
_local5 = new Treasure(((_local3 * 16) + 8), ((_local4 * 16) + 8), 0);
};
if (_arg1[_local2] == "£"){
_local5 = new Treasure(((_local3 * 16) + 8), ((_local4 * 16) + 8), 1);
};
if (_arg1[_local2] == "a"){
_local5 = new Food(((_local3 * 16) + 8), ((_local4 * 16) + 8), 0);
};
if (_arg1[_local2] == "b"){
_local5 = new Food(((_local3 * 16) + 8), ((_local4 * 16) + 8), 1);
};
if (_arg1[_local2] == "c"){
_local5 = new Food(((_local3 * 16) + 8), ((_local4 * 16) + 8), 2);
};
if (_arg1[_local2] == "d"){
_local5 = new Food(((_local3 * 16) + 8), ((_local4 * 16) + 8), 3);
};
if (_arg1[_local2] == "!"){
_local5 = new Potion(((_local3 * 16) + 8), ((_local4 * 16) + 8), 0);
};
if (_arg1[_local2] == "?"){
_local5 = new Potion(((_local3 * 16) + 8), ((_local4 * 16) + 8), 1);
};
if (_arg1[_local2] == "/"){
_local5 = new Teleporter(((_local3 * 16) + 8), ((_local4 * 16) + 8));
};
if (_arg1[_local2] == ">"){
_local5 = new Exit(((_local3 * 16) + 8), ((_local4 * 16) + 8), 0);
};
if (_arg1[_local2] == "x"){
_local5 = new Exit(((_local3 * 16) + 8), ((_local4 * 16) + 8), 1);
};
if (_arg1[_local2] == "X"){
_local5 = new Exit(((_local3 * 16) + 8), ((_local4 * 16) + 8), 2);
};
if (_arg1[_local2] == "Y"){
_local5 = new Exit(((_local3 * 16) + 8), ((_local4 * 16) + 8), 3);
};
if (_arg1[_local2] == "="){
_local5 = new Trigger(((_local3 * 16) + 8), ((_local4 * 16) + 8));
};
if (_local5 != null){
if ((_local5 is Food)){
totalHealth = (totalHealth + Food(_local5).getValue(this));
};
if ((_local5 is Treasure)){
totalTreasure = (totalTreasure + Treasure(_local5).getValue());
};
addEntity(_local5);
};
if (_local5 != null){
_arg1[_local2] = " ";
};
_local2++;
};
updateImages(0, 0, width, height);
}
private function setTile(_arg1:int, _arg2:int, _arg3:String):void{
var _local4:Array;
var _local5:int;
if ((((((((_arg1 < 0)) || ((_arg2 < 0)))) || ((_arg1 >= width)))) || ((_arg2 >= height)))){
return;
};
map[(_arg1 + (_arg2 * width))] = _arg3;
updateImages((_arg1 - 1), (_arg2 - 1), (_arg1 + 1), (_arg2 + 1));
_local4 = blockMap.getEntities(((_arg1 * 16) - 16), ((_arg2 * 16) - 16), ((_arg1 * 16) + 32), ((_arg2 * 16) + 32));
_local5 = 0;
while (_local5 < _local4.length) {
GameEntity(_local4[_local5]).renderStatic();
_local5++;
};
}
public function getVisibleEntities():Array{
var _local1:int;
_local1 = 0;
return (blockMap.getEntities((camera.x - _local1), (camera.y - _local1), (((camera.x + camera.width) - 16) + _local1), ((camera.y + camera.height) + _local1)));
}
public function isFree(_arg1:int, _arg2:int, _arg3:Mob=null):Boolean{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:String;
var _local10:int;
if (_arg3 == null){
if ((((((((_arg1 < 0)) || ((_arg2 < 0)))) || ((_arg1 >= width)))) || ((_arg2 >= height)))){
return (false);
};
_local9 = getTile(_arg1, _arg2);
return ((((_local9 == " ")) || ((_local9 == "C"))));
};
_local4 = ((_arg1 - 4) >> 4);
_local5 = ((_arg2 + 4) >> 4);
_local6 = ((_arg2 - 4) >> 4);
_local7 = ((_arg1 + 4) >> 4);
if (_local4 < 0){
_local4 = 0;
};
if (_local6 < 0){
_local6 = 0;
};
if (_local4 >= width){
_local4 = (width - 1);
};
if (_local6 >= height){
_local6 = (height - 1);
};
_local8 = _local4;
while (_local8 <= _local7) {
_local10 = _local6;
while (_local10 <= _local5) {
if (getTile(_local8, _local10) == "-"){
//unresolved if
//unresolved if
_arg3.playSound("UseKey");
noMonsterInteractionTime = 0;
BomberMan(_arg3).removeKey();
unlock(_local8, _local10);
} else {
_local9 = getTile(_local8, _local10);
if (((!((_local9 == " "))) && (!((_local9 == "C"))))){
return (false);
};
};
_local10++;
};
_local8++;
};
return (true);
}
public function unlockAll():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < width) {
_local2 = 0;
while (_local2 < height) {
if (getTile(_local1, _local2) == "-"){
setTile(_local1, _local2, " ");
};
_local2++;
};
_local1++;
};
}
public function setCamera(_arg1:GameCamera):void{
this.camera = _arg1;
}
public function addParticle(_arg1:Particle):void{
particleLayer.addChild(_arg1);
}
public function unlock(_arg1:int, _arg2:int):void{
if ((((((((_arg1 < 0)) || ((_arg2 < 0)))) || ((_arg1 >= width)))) || ((_arg2 >= height)))){
return;
};
if (getTile(_arg1, _arg2) == "-"){
setTile(_arg1, _arg2, " ");
unlock((_arg1 - 1), _arg2);
unlock((_arg1 + 1), _arg2);
unlock(_arg1, (_arg2 - 1));
unlock(_arg1, (_arg2 + 1));
};
}
public function unlockTriggerWall(_arg1:int, _arg2:int):void{
if ((((((((_arg1 < 0)) || ((_arg2 < 0)))) || ((_arg1 >= width)))) || ((_arg2 >= height)))){
return;
};
if (getTile(_arg1, _arg2) == "&"){
setTile(_arg1, _arg2, " ");
unlockTriggerWall((_arg1 - 1), _arg2);
unlockTriggerWall((_arg1 + 1), _arg2);
unlockTriggerWall(_arg1, (_arg2 - 1));
unlockTriggerWall(_arg1, (_arg2 + 1));
};
}
public function nextRandom():MtRandom{
randomAccesses++;
return (random);
}
public function trigger(_arg1:int, _arg2:int):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
_local3 = -1;
_local4 = -1;
_local5 = 0;
_local6 = 0;
while (_local6 < height) {
_local7 = 0;
while (_local7 < width) {
if (map[(_local7 + (_local6 * width))] == "&"){
_local8 = (_local7 - _arg1);
_local9 = (_local6 - _arg2);
_local10 = ((_local8 * _local8) + (_local9 * _local9));
if ((((_local3 < 0)) || ((_local10 < _local3)))){
_local3 = _local10;
_local4 = _local5;
};
};
_local5++;
_local7++;
};
_local6++;
};
if (_local4 >= 0){
unlockTriggerWall((_local4 % width), (_local4 / width));
};
}
public function setAlwaysTick(_arg1:GameEntity):void{
alwaysTick.push(_arg1);
}
public function renderSprites(_arg1:GameCamera):void{
var _local2:int;
var _local3:Array;
var _local4:int;
var _local5:int;
if (potionTime > 0){
return;
};
_local2 = 16;
_local3 = blockMap.getEntities(((_arg1.xi / 2) - _local2), ((_arg1.yi / 2) - _local2), ((((_arg1.xi / 2) + _arg1.width) - 16) + _local2), (((_arg1.yi / 2) + _arg1.height) + _local2));
_local4 = 0;
while (_local4 < _local3.length) {
GameEntity(_local3[_local4]).calcDepth();
_local4++;
};
_local3.sortOn("depth");
_local5 = 0;
while (_local5 < _local3.length) {
_local3[_local5].render();
_local5++;
};
}
public function getRandomBomberMan():BomberMan{
if (bomberMen.length == 0){
return (null);
};
return (bomberMen[0]);
}
public function getEntityById(_arg1:int):GameEntity{
var _local2:int;
_local2 = 0;
while (_local2 < entities.length) {
if (entities[_local2].id == _arg1){
return (entities[_local2]);
};
_local2++;
};
return (null);
}
public function fireTo(_arg1:int, _arg2:int):Boolean{
var _local3:String;
if ((((((((_arg1 < 0)) || ((_arg2 < 0)))) || ((_arg1 >= width)))) || ((_arg2 >= height)))){
return (false);
};
_local3 = getTile(_arg1, _arg2);
if (_local3 == "%"){
setTile(_arg1, _arg2, "C");
return (false);
};
return ((((_local3 == " ")) || ((_local3 == "C"))));
}
public function playerMoved():void{
noMoveTime = 0;
}
private function hasKey():Boolean{
var _local1:int;
_local1 = 0;
while (_local1 < bomberMen.length) {
if (bomberMen[_local1].hasKey()){
return (true);
};
_local1++;
};
return (false);
}
public function monsterInteracted():void{
noMonsterInteractionTime = 0;
}
public function setParticleLayer(_arg1:Sprite):void{
this.particleLayer = _arg1;
}
public function addEntity(_arg1:GameEntity):void{
if ((_arg1 is BomberMan)){
bomberMen.push(BomberMan(_arg1));
};
toAdd.push(_arg1);
_arg1.setLevel(this);
}
public function paintTiles():void{
gr.setFloorType(floorType);
gr.setWallType(wallType);
}
public function updateAllImages():void{
updateImages(0, 0, width, height);
}
public function renderJustBombermenSprites(_arg1:GameCamera):void{
var _local2:int;
var _local3:Array;
var _local4:int;
var _local5:int;
if (potionTime > 0){
return;
};
_local2 = 16;
_local3 = blockMap.getEntities(((_arg1.xi / 2) - _local2), ((_arg1.yi / 2) - _local2), ((((_arg1.xi / 2) + _arg1.width) - 16) + _local2), (((_arg1.yi / 2) + _arg1.height) + _local2));
_local4 = 0;
while (_local4 < _local3.length) {
GameEntity(_local3[_local4]).calcDepth();
_local4++;
};
_local3.sortOn("depth");
_local5 = 0;
while (_local5 < _local3.length) {
if ((((_local3[_local5] is BomberMan)) || ((_local3[_local5] is DeathAnim)))){
_local3[_local5].render();
};
_local5++;
};
}
public function getFoodValue():int{
return (foodValue);
}
public function activatePotion(_arg1:Player):void{
var _local2:int;
var _local3:Array;
var _local4:int;
camera.shakeMax();
potionTime = 6;
_local2 = 16;
_local3 = blockMap.getEntities((camera.x - _local2), (camera.y - _local2), (((camera.x + camera.width) - 16) + _local2), ((camera.y + camera.height) + _local2));
_local4 = 0;
while (_local4 < _local3.length) {
_local3[_local4].potionActivated(_arg1);
_local4++;
};
}
public function getLevelString(_arg1:int=-1):String{
var _local2:String;
if (_arg1 == -1){
_arg1 = levelNum;
};
_local2 = " LEVEL ";
if (_arg1 < 0){
_local2 = (_local2 + "???");
} else {
if (_arg1 < 10){
_local2 = (_local2 + " ");
};
if (_arg1 < 100){
_local2 = (_local2 + " ");
};
_local2 = (_local2 + _arg1);
};
return (_local2);
}
}
}//package src.level
Section 103
//LevelLoader (src.level.LevelLoader)
package src.level {
import src.*;
public class LevelLoader {
private var bp:BlastPassage;
public function LevelLoader(_arg1:BlastPassage){
this.bp = _arg1;
_arg1.levelsLoaded();
}
public function loadLevel(_arg1:GraphicsContext, _arg2:int, _arg3:String, _arg4:int):Level{
var _local5:Array;
var _local6:int;
var _local7:String;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:Array;
var _local15:int;
var _local16:Level;
var _local17:String;
var _local18:int;
_local5 = _arg3.split("\n");
_local6 = 0;
var _temp1 = _local6;
_local6 = (_local6 + 1);
_local7 = _local5[_temp1];
var _temp2 = _local6;
_local6 = (_local6 + 1);
_local8 = parseInt(_local5[_temp2]);
var _temp3 = _local6;
_local6 = (_local6 + 1);
_local9 = parseInt(_local5[_temp3]);
var _temp4 = _local6;
_local6 = (_local6 + 1);
_local10 = parseInt(_local5[_temp4]);
var _temp5 = _local6;
_local6 = (_local6 + 1);
_local11 = parseInt(_local5[_temp5]);
var _temp6 = _local6;
_local6 = (_local6 + 1);
_local12 = parseInt(_local5[_temp6]);
var _temp7 = _local6;
_local6 = (_local6 + 1);
_local13 = parseInt(_local5[_temp7]);
_local14 = new Array();
_local15 = 0;
while (_local15 < _local13) {
var _temp8 = _local6;
_local6 = (_local6 + 1);
_local17 = _local5[_temp8];
if (_local17 == null){
_local17 = "";
};
_local18 = 0;
while (_local18 < _local12) {
if (_local17.length < _local18){
_local14.push(" ");
} else {
_local14.push(_local17.charAt(_local18));
};
_local18++;
};
_local15++;
};
_local16 = new Level(_local12, _local13, _arg4);
_local16.gr = _arg1;
_local16.xStart = _local8;
_local16.yStart = _local9;
_local16.floorColor = (_local10 % 64);
_local16.wallColor = (_local11 % 64);
_local16.levelNum = _arg2;
_local16.floorType = (int((int(((_arg2 * 423981221) + ((_arg2 * _arg2) * 74872111))) / 0xFFFF)) % 5);
_local16.wallType = (int((int(((_arg2 * 439871221) + ((_arg2 * _arg2) * 74872111))) / 0xFFFF)) % 4);
if (_local16.floorType < 0){
_local16.floorType = (_local16.floorType + 5);
};
if (_local16.wallType < 0){
_local16.wallType = (_local16.wallType + 4);
};
_local16.paintTiles();
_local16.setData(_local14);
return (_local16);
}
}
}//package src.level
Section 104
//MtRandom (src.math.MtRandom)
package src.math {
import flash.utils.*;
public class MtRandom {
private var mti:uint;
private var mt:Array;
public var accesses:int;// = 0
public static var MATRIX_A:uint = 2567483615;
public static var UPPER_MASK:uint = 2147483648;
public static var LOWER_MASK:uint = 2147483647;
public static var M:int = 397;
public static var N:int = 624;
private static var mag01:Array = [uint(0), uint(MATRIX_A)];
public function MtRandom(_arg1:uint=0){
mti = (N + 1);
accesses = 0;
super();
if (_arg1 == 0){
_arg1 = getTimer();
};
mt = new Array(N);
init_genrand(_arg1);
}
private function next(_arg1:uint):uint{
return ((genrand_int32() & ((uint(1) << _arg1) - uint(1))));
}
public function nextDouble():Number{
return ((next(24) / 16777216));
}
public function nextFloat():Number{
return ((next(24) / 16777216));
}
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;
accesses++;
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));
}
public function setSeed(_arg1:uint):void{
init_genrand(_arg1);
}
public function nextInt(_arg1:uint):uint{
return (((genrand_int32() & 2147483647) % _arg1));
}
}
}//package src.math
Section 105
//BombParticle (src.particle.BombParticle)
package src.particle {
import flash.utils.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class BombParticle extends Particle {
private var lifeTime:Number;// = 1
private var yp:Number;
private var ya:Number;
private var floatSpeed:Number;// = 1
private var startTime:uint;
private var xa:Number;
private var xp:Number;
public function BombParticle(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
lifeTime = 1;
floatSpeed = 1;
super();
this.xp = _arg1;
this.yp = _arg2;
_local3 = ((Math.random() * Math.PI) * 2);
_local4 = (((Math.random() + Math.random()) * 32) * 3);
xa = (Math.cos(_local3) * _local4);
ya = ((Math.sin(_local3) * _local4) * 0.8);
x = (x + (xa / 3));
y = (y + (ya / 3));
lifeTime = (((Math.random() * Math.random()) + 0.4) * 0.8);
floatSpeed = ((Math.random() * Math.random()) + 0.4);
rotation = (Math.random() * 360);
startTime = getTimer();
addEventListener(Event.ENTER_FRAME, advanceTime);
advanceTime(null);
gotoAndStop(1);
_local5 = 1;
_local6 = 1;
_local7 = 1;
_local8 = Math.random();
this.cacheAsBitmap = true;
transform.colorTransform = new ColorTransform((_local5 * _local8), (_local6 * _local8), (_local7 * _local8));
blendMode = BlendMode.ADD;
}
public function advanceTime(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = ((getTimer() - startTime) / 1000);
if (_local2 > lifeTime){
removeEventListener(Event.ENTER_FRAME, advanceTime);
parent.removeChild(this);
};
_local3 = Math.sqrt(_local2);
x = (xp + (xa * _local3));
y = ((yp + (ya * _local3)) - ((_local3 * 6) * floatSpeed));
_local4 = (((_local2 / lifeTime) * 2) - 1);
if (_local4 < 0){
_local4 = 0;
};
alpha = ((1 - _local4) * (1 - _local4));
}
}
}//package src.particle
Section 106
//BurnPowerupParticle (src.particle.BurnPowerupParticle)
package src.particle {
import flash.utils.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class BurnPowerupParticle extends Particle {
private var lifeTime:Number;// = 1
private var yp:Number;
private var ya:Number;
private var floatSpeed:Number;// = 1
private var startTime:uint;
private var xa:Number;
private var xp:Number;
public function BurnPowerupParticle(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
lifeTime = 1;
floatSpeed = 1;
super();
this.xp = _arg1;
this.yp = _arg2;
_local3 = ((Math.random() * Math.PI) * 2);
_local4 = ((((Math.random() + Math.random()) * 32) * 3) + 5);
xa = (Math.cos(_local3) * _local4);
ya = ((Math.sin(_local3) * _local4) * 0.8);
x = (x + (xa / 3));
y = (y + (ya / 3));
lifeTime = (((Math.random() * Math.random()) + 0.4) * 0.8);
floatSpeed = ((Math.random() * Math.random()) + 0.4);
scaleX = (scaleY = ((Math.random() * 2) + 1));
rotation = (Math.random() * 360);
startTime = getTimer();
addEventListener(Event.ENTER_FRAME, advanceTime);
advanceTime(null);
gotoAndStop(1);
_local5 = Math.random();
_local6 = (Math.random() * _local5);
_local7 = (Math.random() * _local7);
_local8 = ((Math.random() * 0.5) + 0.5);
this.cacheAsBitmap = true;
transform.colorTransform = new ColorTransform((_local5 * _local8), (_local6 * _local8), (_local7 * _local8));
blendMode = BlendMode.HARDLIGHT;
}
public function advanceTime(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = ((getTimer() - startTime) / 1000);
if (_local2 > lifeTime){
removeEventListener(Event.ENTER_FRAME, advanceTime);
parent.removeChild(this);
};
_local3 = _local2;
x = (xp + (xa * _local3));
y = ((yp + (ya * _local3)) - ((_local3 * 6) * floatSpeed));
_local4 = (((_local2 / lifeTime) * 2) - 1);
if (_local4 < 0){
_local4 = 0;
};
alpha = ((1 - _local4) * (1 - _local4));
}
}
}//package src.particle
Section 107
//EnemyDeathParticle (src.particle.EnemyDeathParticle)
package src.particle {
import flash.utils.*;
import flash.events.*;
import flash.geom.*;
public class EnemyDeathParticle extends Particle {
private var lifeTime:Number;// = 1
private var yp:Number;
private var ya:Number;
private var floatSpeed:Number;// = 1
private var startTime:uint;
private var xa:Number;
private var xp:Number;
public function EnemyDeathParticle(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
lifeTime = 1;
floatSpeed = 1;
super();
this.xp = _arg1;
this.yp = _arg2;
_local3 = ((Math.random() * Math.PI) * 2);
_local4 = ((((Math.random() + Math.random()) * 64) + 1) * 1.2);
xa = (Math.cos(_local3) * _local4);
ya = ((Math.sin(_local3) * _local4) * 0.8);
x = (x + (xa / 5));
y = (y + (ya / 5));
lifeTime = (((Math.random() * Math.random()) + 0.4) * 0.85);
floatSpeed = ((Math.random() * Math.random()) + 0.4);
rotation = (Math.random() * 360);
startTime = getTimer();
addEventListener(Event.ENTER_FRAME, advanceTime);
advanceTime(null);
gotoAndStop(1);
_local5 = 1;
_local6 = 1;
_local7 = 1;
_local8 = (Math.random() * 0.2);
transform.colorTransform = new ColorTransform((_local5 * _local8), (_local6 * _local8), (_local7 * _local8));
}
public function advanceTime(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
_local2 = ((getTimer() - startTime) / 1000);
if (_local2 > lifeTime){
removeEventListener(Event.ENTER_FRAME, advanceTime);
parent.removeChild(this);
};
x = (xp + (xa * Math.sqrt(_local2)));
y = (yp + (ya * Math.sqrt(_local2)));
_local3 = (((_local2 / lifeTime) * 2) - 1);
if (_local3 < 0){
_local3 = 0;
};
alpha = ((1 - _local3) * (1 - _local3));
}
}
}//package src.particle
Section 108
//HouseDeathParticle (src.particle.HouseDeathParticle)
package src.particle {
import flash.utils.*;
import flash.events.*;
import flash.geom.*;
public class HouseDeathParticle extends Particle {
private var lifeTime:Number;// = 1
private var yp:Number;
private var ya:Number;
private var floatSpeed:Number;// = 1
private var startTime:uint;
private var xa:Number;
private var xp:Number;
public function HouseDeathParticle(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
lifeTime = 1;
floatSpeed = 1;
super();
this.xp = ((_arg1 + (Math.random() * 16)) - 8);
this.yp = ((_arg2 + (Math.random() * 16)) - 8);
_local3 = ((Math.random() * Math.PI) * 2);
_local4 = (((((Math.random() + Math.random()) * 64) + 1) * 1.4) / 2);
xa = (Math.cos(_local3) * _local4);
ya = ((Math.sin(_local3) * _local4) * 0.8);
x = (x + (xa / 5));
y = (y + (ya / 5));
scaleX = (scaleY = ((Math.random() * 2) + 1));
lifeTime = ((((Math.random() * Math.random()) + 0.4) * 0.85) * 2);
floatSpeed = ((Math.random() * Math.random()) + 0.4);
rotation = (Math.random() * 360);
startTime = getTimer();
addEventListener(Event.ENTER_FRAME, advanceTime);
advanceTime(null);
gotoAndStop(1);
_local5 = 1;
_local6 = 1;
_local7 = 1;
_local8 = (Math.random() * 0.2);
this.cacheAsBitmap = true;
transform.colorTransform = new ColorTransform((_local5 * _local8), (_local6 * _local8), (_local7 * _local8));
}
public function advanceTime(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
_local2 = ((getTimer() - startTime) / 1000);
if (_local2 > lifeTime){
removeEventListener(Event.ENTER_FRAME, advanceTime);
parent.removeChild(this);
};
x = (xp + (xa * Math.sqrt(_local2)));
y = (yp + (ya * Math.sqrt(_local2)));
_local3 = (((_local2 / lifeTime) * 2) - 1);
if (_local3 < 0){
_local3 = 0;
};
alpha = ((1 - _local3) * (1 - _local3));
}
}
}//package src.particle
Section 109
//HurtPlayerParticle (src.particle.HurtPlayerParticle)
package src.particle {
import flash.utils.*;
import flash.events.*;
import flash.geom.*;
import src.entity.*;
public class HurtPlayerParticle extends Particle {
private var lifeTime:Number;// = 1
private var bomberMan:BomberMan;
private var yp:Number;
private var ya:Number;
private var spinSpeed:Number;// = 0
private var floatSpeed:Number;// = 1
private var startTime:uint;
private var spinOffset:Number;// = 0
private var xa:Number;
private var xp:Number;
public function HurtPlayerParticle(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
lifeTime = 1;
floatSpeed = 1;
spinOffset = 0;
spinSpeed = 0;
super();
this.xp = ((_arg1 + (Math.random() * 32)) - 16);
this.yp = (((_arg2 + (Math.random() * 24)) - 12) - 24);
_local3 = ((Math.random() * Math.PI) * 2);
_local4 = ((Math.random() + Math.random()) * 32);
this.bomberMan = bomberMan;
xa = (Math.cos(_local3) * _local4);
ya = ((Math.sin(_local3) * _local4) * 0.8);
x = (x + (xa / 3));
y = (y + (ya / 3));
lifeTime = (((Math.random() * Math.random()) + 0.4) * 0.8);
floatSpeed = (((Math.random() * Math.random()) + 0.4) * 2);
rotation = (Math.random() * 360);
startTime = getTimer();
addEventListener(Event.ENTER_FRAME, advanceTime);
advanceTime(null);
gotoAndStop(4);
_local5 = 1;
_local6 = 1;
_local7 = 1;
_local8 = ((Math.random() * 0.5) + 0.5);
transform.colorTransform = new ColorTransform((_local5 * _local8), (_local6 * _local8), (_local7 * _local8));
}
public function advanceTime(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
_local2 = ((getTimer() - startTime) / 1000);
if (_local2 > lifeTime){
removeEventListener(Event.ENTER_FRAME, advanceTime);
parent.removeChild(this);
};
x = ((xp + ((xa * Math.sqrt(_local2)) * 0.2)) + (Math.sin((spinOffset + (spinSpeed * _local2))) * 5));
y = ((yp + ((ya * Math.sqrt(_local2)) * 0.2)) - (((_local2 * _local2) * 64) * floatSpeed));
_local3 = (((_local2 / lifeTime) * 2) - 1);
if (_local3 < 0){
_local3 = 0;
};
alpha = (((1 - _local3) * (1 - _local3)) * 0.8);
}
}
}//package src.particle
Section 110
//Particle (src.particle.Particle)
package src.particle {
import flash.display.*;
public class Particle extends MovieClip {
}
}//package src.particle
Section 111
//PickupParticle (src.particle.PickupParticle)
package src.particle {
import flash.utils.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import src.entity.*;
public class PickupParticle extends Particle {
private var lifeTime:Number;// = 1
private var bomberMan:BomberMan;
private var yp:Number;
private var ya:Number;
private var spinSpeed:Number;// = 0
private var floatSpeed:Number;// = 1
private var startTime:uint;
private var spinOffset:Number;// = 0
private var xa:Number;
private var xp:Number;
public function PickupParticle(_arg1:Number, _arg2:Number, _arg3:int, _arg4:BomberMan){
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
lifeTime = 1;
floatSpeed = 1;
spinOffset = 0;
spinSpeed = 0;
super();
this.xp = _arg1;
this.yp = _arg2;
_local5 = ((Math.random() * Math.PI) * 2);
_local6 = ((Math.random() + Math.random()) * 32);
this.bomberMan = _arg4;
xa = (Math.cos(_local5) * _local6);
ya = ((Math.sin(_local5) * _local6) * 0.8);
x = (x + (xa / 3));
y = (y + (ya / 3));
lifeTime = (((Math.random() * Math.random()) + 0.4) * 0.8);
floatSpeed = ((Math.random() * Math.random()) + 0.4);
rotation = (Math.random() * 360);
startTime = getTimer();
addEventListener(Event.ENTER_FRAME, advanceTime);
advanceTime(null);
gotoAndStop(1);
_local7 = 1;
_local8 = 1;
_local9 = 0;
_local10 = ((Math.random() * 0.5) + 0.5);
if (_arg3 > 0){
_local7 = 1;
_local8 = 1;
_local9 = 1;
_local10 = ((Math.random() * 0.1) + 0.9);
rotation = ((Math.random() * 30) - 15);
gotoAndStop((_arg3 + 1));
if (_arg3 == 2){
spinOffset = ((Math.random() * Math.PI) * 2);
spinSpeed = 10;
};
} else {
blendMode = BlendMode.ADD;
};
transform.colorTransform = new ColorTransform((_local7 * _local10), (_local8 * _local10), (_local9 * _local10));
}
public function advanceTime(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
_local2 = ((getTimer() - startTime) / 1000);
if (_local2 > lifeTime){
removeEventListener(Event.ENTER_FRAME, advanceTime);
parent.removeChild(this);
};
x = (xp + (xa * Math.sqrt(_local2)));
y = ((yp + (ya * Math.sqrt(_local2))) - (((_local2 * _local2) * 64) * floatSpeed));
scaleX = Math.cos((spinOffset + (spinSpeed * _local2)));
_local3 = (((_local2 / lifeTime) * 2) - 1);
if (_local3 < 0){
_local3 = 0;
};
alpha = ((1 - _local3) * (1 - _local3));
}
}
}//package src.particle
Section 112
//Controller (src.player.Controller)
package src.player {
public class Controller {
public var buttons:Array;
public var old:Array;
public static var BUTTON_FIRE:int = 4;
public static var BUTTON_SPECIAL:int = 5;
public static var BUTTON_RIGHT:int = 1;
public static var BUTTON_LEFT:int = 3;
public static var BUTTON_DOWN:int = 2;
public static var BUTTON_UP:int = 0;
public function Controller(){
var _local1:int;
buttons = new Array(8);
old = new Array(8);
super();
_local1 = 0;
while (_local1 < 8) {
old[_local1] = (buttons[_local1] = false);
_local1++;
};
}
public function isTyped(_arg1:int):Boolean{
return (((!(old[_arg1])) && (buttons[_arg1])));
}
public function tick():void{
var _local1:int;
_local1 = 0;
while (_local1 < 8) {
old[_local1] = buttons[_local1];
_local1++;
};
}
}
}//package src.player
Section 113
//KeyboardController (src.player.KeyboardController)
package src.player {
import flash.ui.*;
public class KeyboardController extends Controller {
private var keyMappings:Array;
private var isKeyDown:Array;
private var mapList:Array;
public function KeyboardController(){
var _local1:int;
keyMappings = new Array(0x0100);
isKeyDown = new Array(0x0100);
mapList = new Array();
super();
bind(Keyboard.UP, BUTTON_UP);
bind(Keyboard.LEFT, BUTTON_LEFT);
bind(Keyboard.RIGHT, BUTTON_RIGHT);
bind(Keyboard.DOWN, BUTTON_DOWN);
bind(Keyboard.NUMPAD_8, BUTTON_UP);
bind(Keyboard.NUMPAD_4, BUTTON_LEFT);
bind(Keyboard.NUMPAD_6, BUTTON_RIGHT);
bind(Keyboard.NUMPAD_2, BUTTON_DOWN);
bind("W".charCodeAt(0), BUTTON_UP);
bind("A".charCodeAt(0), BUTTON_LEFT);
bind("D".charCodeAt(0), BUTTON_RIGHT);
bind("S".charCodeAt(0), BUTTON_DOWN);
bind(Keyboard.SPACE, BUTTON_FIRE);
bind(Keyboard.ENTER, BUTTON_SPECIAL);
_local1 = 0;
while (_local1 < 0x0100) {
isKeyDown[_local1] = false;
_local1++;
};
}
public function toggleKey(_arg1:uint, _arg2:Boolean):void{
isKeyDown[_arg1] = _arg2;
}
public function bind(_arg1:int, _arg2:int):void{
keyMappings[_arg1] = _arg2;
mapList.push(_arg1);
}
public function releaseAllKeys():void{
var _local1:int;
_local1 = 0;
while (_local1 < 0x0100) {
isKeyDown[_local1] = false;
_local1++;
};
}
override public function tick():void{
var _local1:int;
var _local2:int;
super.tick();
_local1 = 0;
while (_local1 < 8) {
buttons[_local1] = false;
_local1++;
};
_local1 = 0;
while (_local1 < mapList.length) {
_local2 = keyMappings[mapList[_local1]];
buttons[_local2] = ((buttons[_local2]) || (isKeyDown[mapList[_local1]]));
_local1++;
};
}
}
}//package src.player
Section 114
//Player (src.player.Player)
package src.player {
import src.screen.game.*;
import src.entity.*;
import src.*;
import src.math.*;
public class Player {
private var animation:GameEntity;// = null
public var bomberMan:BomberMan;
public var maxBombs:int;
public var score:int;
public var invulnTime:int;
public var controller:Controller;
public var activeBombs:int;// = 0
public var potions:int;// = 0
public var random:MtRandom;
public var exitToLevel:int;// = -1
public var hurtTick:int;
private var health:int;
public var firePower:int;
public var keys:int;// = 0
private var gameScreen:GameScreen;
private static const WARNING_CUTOFF:Number = 100;
public static var MAX_INVENTORY:int = 11;
public static var START_FIRE:int = 2;
public static var START_BOMBS:int = 2;
public static var MAX_HEALTH:int = 1000;
public function Player(_arg1:GameScreen){
controller = new Controller();
keys = 0;
maxBombs = START_BOMBS;
activeBombs = 0;
firePower = START_FIRE;
potions = 0;
animation = null;
exitToLevel = -1;
super();
this.gameScreen = _arg1;
random = _arg1.nextRandom();
health = MAX_HEALTH;
}
public function needsPowerup():Boolean{
return ((random.nextInt(MAX_INVENTORY) > getPowerupCount()));
}
private function getPowerupCount():int{
return (((maxBombs - START_BOMBS) + (firePower - START_FIRE)));
}
public function addPotion():void{
potions++;
}
public function canBomb():Boolean{
if (activeBombs >= maxBombs){
return (false);
};
return (true);
}
public function hurt(_arg1:int, _arg2:Boolean=true):void{
if (health <= 0){
return;
};
if ((((health >= WARNING_CUTOFF)) && (((health - _arg1) < WARNING_CUTOFF)))){
BlastPassage.sound.get("HealthWarning").play();
};
health = (health - _arg1);
if (health <= 0){
health = 0;
bomberMan.die();
} else {
if (_arg2){
};
};
}
public function setExit(_arg1:int):void{
exitToLevel = _arg1;
}
public function canGetPowerup():Boolean{
return (true);
}
public function setController(_arg1:Controller):void{
this.controller = _arg1;
}
public function hitByFire():Boolean{
if (invulnTime == 0){
if (maxBombs > START_BOMBS){
maxBombs--;
};
if (firePower > START_FIRE){
firePower--;
};
bomberMan.hurt(100);
invulnTime = 60;
return (true);
};
return (false);
}
public function canGetKey():Boolean{
return (true);
}
public function tick():void{
if (activeBombs < 0){
activeBombs = 0;
};
controller.tick();
if (animation != null){
if (animation.removed){
animation = null;
} else {
return;
};
};
if (exitToLevel >= 0){
return;
};
if (((((controller.isTyped(Controller.BUTTON_FIRE)) && (!(isAlive())))) && (gameScreen.maySpawnWithinLevel()))){
spawn(false);
controller.old[Controller.BUTTON_FIRE] = true;
};
if (!(isAlive())){
return;
};
if (invulnTime > 0){
invulnTime--;
};
hurtTick++;
if (hurtTick == BlastPassage.TICKS_PER_SECOND){
hurt(1, false);
hurtTick = 0;
};
if (bomberMan.removed){
bomberMan = null;
};
}
public function setAnimation(_arg1:GameEntity):void{
animation = _arg1;
}
public function newLevel():void{
activeBombs = 0;
if (exitToLevel != -1){
exitToLevel = -1;
} else {
if (!(gameScreen.maySpawnWithinLevel())){
};
};
spawn(true);
}
public function isAlive():Boolean{
return (!((bomberMan == null)));
}
public function reset():void{
exitToLevel = -1;
invulnTime = 0;
hurtTick = 0;
health = MAX_HEALTH;
}
public function getHealth():int{
return (health);
}
public function addHealth(_arg1:int):void{
health = (health + _arg1);
if (health > MAX_HEALTH){
health = MAX_HEALTH;
};
}
public function addScore(_arg1:int):void{
score = (score + _arg1);
}
public function getStatus():int{
if (animation != null){
return (0);
};
if (!(isAlive())){
return (-1);
};
return ((exitToLevel + 1));
}
private function spawn(_arg1:Boolean):void{
var _local2:int;
var _local3:BomberMan;
var _local4:int;
var _local5:int;
bomberMan = null;
_local2 = 0;
while ((((_local2 < 16)) && ((bomberMan == null)))) {
_local3 = gameScreen.level.getRandomBomberMan();
if (_local3 == null){
bomberMan = new BomberMan(((gameScreen.level.xStart * 16) + 8), ((gameScreen.level.yStart * 16) + 8), this);
} else {
_local4 = (random.nextInt(32) - 16);
_local5 = (random.nextInt(32) - 16);
bomberMan = new BomberMan((_local3.x + _local4), (_local3.y + _local5), this);
};
if (!(bomberMan.fitsIn(gameScreen.level))){
bomberMan = null;
};
_local2++;
};
if (bomberMan != null){
hurtTick = 0;
if (!(_arg1)){
};
gameScreen.camera.add(bomberMan);
gameScreen.level.addEntity(bomberMan);
};
}
}
}//package src.player
Section 115
//RecorderController (src.player.RecorderController)
package src.player {
public class RecorderController extends Controller {
private var lastKey:int;// = 0
private var run:int;// = 0
private var fullString:String;// = ""
private var controller:Controller;
private var encodedString:String;// = ""
public static const BASE_64_CHARS:String = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
public function RecorderController(_arg1:Controller){
encodedString = "";
fullString = "";
run = 0;
lastKey = 0;
super();
this.controller = _arg1;
buttons = _arg1.buttons;
old = _arg1.old;
}
override public function isTyped(_arg1:int):Boolean{
return (controller.isTyped(_arg1));
}
public function flush():String{
var _local1:String;
_local1 = (encodedString + BASE_64_CHARS.charAt(run));
encodedString = "";
lastKey = 0;
run = 0;
return (_local1);
}
public function flushIfLongerThan(_arg1:int):String{
if (encodedString.length >= _arg1){
return (flush());
};
return (null);
}
override public function tick():void{
var _local1:int;
var _local2:int;
controller.tick();
_local1 = 0;
_local2 = 0;
while (_local2 < 6) {
_local1 = (_local1 + (controller.buttons[_local2] << _local2));
_local2++;
};
fullString = (fullString + BASE_64_CHARS.charAt(_local1));
if ((((_local1 == lastKey)) && ((run < 63)))){
run++;
} else {
encodedString = (encodedString + BASE_64_CHARS.charAt(run));
encodedString = (encodedString + BASE_64_CHARS.charAt(_local1));
lastKey = _local1;
run = 1;
};
}
public static function decode(_arg1:String):String{
var _local2:String;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
_local2 = "";
_local3 = 0;
_local4 = 0;
while (_local4 < _arg1.length) {
var _temp1 = _local4;
_local4 = (_local4 + 1);
_local5 = BASE_64_CHARS.indexOf(_arg1.charAt(_temp1));
_local6 = 0;
while (_local6 < _local5) {
_local2 = (_local2 + BASE_64_CHARS.charAt(_local3));
_local6++;
};
if (_local4 < _arg1.length){
var _temp2 = _local4;
_local4 = (_local4 + 1);
_local3 = BASE_64_CHARS.indexOf(_arg1.charAt(_temp2));
};
};
return (_local2);
}
}
}//package src.player
Section 116
//ReplayController (src.player.ReplayController)
package src.player {
public class ReplayController extends Controller {
private var data:String;
private var dp:int;// = 0
public function ReplayController(_arg1:String){
dp = 0;
super();
this.data = _arg1;
}
override public function tick():void{
var _local1:int;
var _local2:int;
super.tick();
_local1 = RecorderController.BASE_64_CHARS.indexOf(data.charAt(dp++));
_local2 = 0;
while (_local2 < 8) {
buttons[_local2] = (((_local1 >> _local2) & 1) == 1);
_local2++;
};
}
}
}//package src.player
Section 117
//GameScreen (src.screen.game.GameScreen)
package src.screen.game {
import src.*;
import src.level.*;
import src.math.*;
import src.player.*;
import src.screen.*;
public class GameScreen extends Screen {
public var level:Level;
protected var startLevel:int;// = 1
private var gameHasBeenStarted:Boolean;// = false
private var levelData:String;
public var player:Player;
private var levelNum:int;// = 0
public var camera:GameCamera;
public var remainingTicks:int;
private var seed:int;
private var tickCount:int;// = 0
private var doAbort:Boolean;// = false
protected var levelLoader:LevelLoader;// = null
public static var GAME_TIME:int = ((BlastPassage.TICKS_PER_SECOND * 60) * 4);
public function GameScreen(_arg1:LevelLoader, _arg2:int, _arg3:String, _arg4:int){
gameHasBeenStarted = false;
startLevel = 1;
levelLoader = null;
remainingTicks = GAME_TIME;
levelNum = 0;
tickCount = 0;
doAbort = false;
super();
this.levelLoader = _arg1;
this.levelData = _arg3;
this.levelNum = _arg2;
this.seed = _arg4;
}
public function nextRandom():MtRandom{
return (level.nextRandom());
}
override public function init():void{
nextLevel();
blastPassage.getGraphicsContext().fill(0);
}
public function nextLevel():void{
level = null;
if (((BlastPassage.DEBUG_MODE) && (BlastPassage.REPLAY_MODE))){
};
level = levelLoader.loadLevel(gr, levelNum, levelData, seed);
camera = new GameCamera(level, BlastPassage.GAME_AREA_WIDTH, BlastPassage.GAME_AREA_HEIGHT);
level.setCamera(camera);
level.setParticleLayer(blastPassage.particleLayer);
blastPassage.setScreen(new LevelTitleScreen(this));
if (player != null){
player.newLevel();
};
blastPassage.levelStarted(levelNum);
BlastPassage.music.stopAll();
BlastPassage.music.get("GameMusic").loop();
}
public function reset():void{
remainingTicks = GAME_TIME;
player.reset();
doAbort = false;
}
public function maySpawnWithinLevel():Boolean{
return (true);
}
override public function tick():void{
var _local1:Boolean;
var _local2:Boolean;
var _local3:int;
var _local4:int;
if (level == null){
return;
};
if (doAbort){
blastPassage.doAbort();
blastPassage.gameAborted();
};
if (((!((player == null))) && ((player.exitToLevel == -1)))){
remainingTicks--;
if (remainingTicks == (BlastPassage.TICKS_PER_SECOND * 10)){
BlastPassage.sound.get("TimeWarning").play();
};
if (remainingTicks == 0){
blastPassage.outOfTime();
};
};
_local1 = true;
_local2 = true;
_local3 = 9999;
if (player != null){
player.tick();
_local4 = player.getStatus();
if (_local4 >= 0){
_local1 = false;
};
if (_local4 == 0){
_local2 = false;
};
if (_local4 > 0){
if (_local4 < _local3){
_local3 = _local4;
};
};
};
if (!(_local1)){
gameHasBeenStarted = true;
};
if (((_local1) && (gameHasBeenStarted))){
allDead();
};
if (((((_local2) && (gameHasBeenStarted))) && (!(_local1)))){
allCompleted(level.levelNum);
};
camera.tick();
level.tick();
tickCount++;
}
protected function allCompleted(_arg1:int):void{
blastPassage.levelWon();
}
override public function render(_arg1:Number):void{
var _local2:Boolean;
if (level == null){
return;
};
_local2 = (player.getHealth() <= 0);
camera.lerp(_arg1);
blastPassage.particleLayer.x = (-(camera.xi) - BlastPassage.GAME_AREA_WIDTH);
blastPassage.particleLayer.y = (-(camera.yi) - BlastPassage.GAME_AREA_HEIGHT);
level.alpha = _arg1;
if (level.potionTime > 0){
gr.fill(0xFFFFFF);
} else {
gr.prepare(camera.xi, camera.yi);
if (_local2){
gr.fill(0xE0E0E0);
level.renderJustBombermenSprites(camera);
} else {
level.renderSprites(camera);
};
};
renderSidePanel(_arg1);
}
public function abortGame():Boolean{
if (level == null){
return (false);
};
if (doAbort == true){
return (false);
};
doAbort = true;
return (true);
}
protected function allDead():void{
blastPassage.playerDead();
}
public function renderSidePanel(_arg1:Number):void{
}
}
}//package src.screen.game
Section 118
//LevelTitleScreen (src.screen.game.LevelTitleScreen)
package src.screen.game {
import src.screen.*;
public class LevelTitleScreen extends Screen {
private var timeLeft:int;// = 20
private var gameScreen:GameScreen;
public function LevelTitleScreen(_arg1:GameScreen){
timeLeft = (20 * 1);
super();
this.gameScreen = _arg1;
}
override public function shadowTick():void{
gameScreen.shadowTick();
}
override public function tick():void{
gameScreen.shadowTick();
if (--timeLeft <= 0){
blastPassage.setScreen(gameScreen);
};
}
override public function render(_arg1:Number):void{
gameScreen.renderSidePanel(_arg1);
}
}
}//package src.screen.game
Section 119
//Screen (src.screen.Screen)
package src.screen {
import src.*;
public class Screen {
public var gr:GraphicsContext;
protected var skipped:Boolean;// = false
private var initialized:Boolean;// = false
protected var blastPassage:BlastPassage;
public function Screen(){
skipped = false;
initialized = false;
super();
}
public function removed():void{
}
public function shadowTick():void{
}
public function render(_arg1:Number):void{
}
public function init():void{
}
public function setBlastPassage(_arg1:BlastPassage):void{
if (initialized){
return;
};
initialized = true;
this.blastPassage = _arg1;
this.gr = _arg1.getGraphicsContext();
init();
}
public function tick():void{
}
public function skip():void{
skipped = true;
}
}
}//package src.screen
Section 120
//ManagedSound (src.sound.ManagedSound)
package src.sound {
import flash.media.*;
public class ManagedSound {
public var activeSounds:Array;
private var manager:SoundManager;
private var ClassReference:Class;
public function ManagedSound(_arg1:SoundManager, _arg2:Class){
activeSounds = new Array();
super();
this.manager = _arg1;
this.ClassReference = _arg2;
}
public function stop():void{
var _local1:int;
_local1 = 0;
while (_local1 < activeSounds.length) {
activeSounds[_local1].stop();
_local1++;
};
}
public function loop(_arg1:Number=1, _arg2:Number=0):ManagedSoundChannel{
var _local3:SoundChannel;
_local3 = new ClassReference().play(0, 999999999, new SoundTransform(_arg1, _arg2));
return (new ManagedSoundChannel(manager, this, _local3));
}
public function isPlaying():Boolean{
return ((activeSounds.length > 0));
}
public function update():void{
var _local1:int;
_local1 = 0;
while (_local1 < activeSounds.length) {
activeSounds[_local1].update();
_local1++;
};
}
public function fadeToAndStop(_arg1:Number, _arg2:Number):void{
var _local3:int;
_local3 = 0;
while (_local3 < activeSounds.length) {
activeSounds[_local3].fadeToAndStop(_arg1, _arg2);
_local3++;
};
}
public function fadeTo(_arg1:Number, _arg2:Number):void{
var _local3:int;
_local3 = 0;
while (_local3 < activeSounds.length) {
activeSounds[_local3].fadeTo(_arg1, _arg2);
_local3++;
};
}
public function panTo(_arg1:Number, _arg2:Number):void{
var _local3:int;
_local3 = 0;
while (_local3 < activeSounds.length) {
activeSounds[_local3].panTo(_arg1, _arg2);
_local3++;
};
}
public function play(_arg1:Number=1, _arg2:Number=0):ManagedSoundChannel{
var _local3:SoundChannel;
_local3 = new ClassReference().play(0, 0, new SoundTransform(_arg1, _arg2));
return (new ManagedSoundChannel(manager, this, _local3));
}
public function setVolume(_arg1:Number):void{
var _local2:int;
_local2 = 0;
while (_local2 < activeSounds.length) {
activeSounds[_local2].setVolume(_arg1);
_local2++;
};
}
public function setPan(_arg1:Number):void{
var _local2:int;
_local2 = 0;
while (_local2 < activeSounds.length) {
activeSounds[_local2].setPan(_arg1);
_local2++;
};
}
}
}//package src.sound
Section 121
//ManagedSoundChannel (src.sound.ManagedSoundChannel)
package src.sound {
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class ManagedSoundChannel {
private var fadeStartVolume:Number;// = -1
private var channel:SoundChannel;
private var fadeEndVolume:Number;// = -1
private var targetVolume:Number;
private var targetPan:Number;
private var sound:ManagedSound;
private var panEndTime:Number;// = -1
private var fadeEndTime:Number;// = -1
private var manager:SoundManager;
private var stopAfterFade:Boolean;// = false
private var panStartTime:Number;// = -1
private var fadeStartTime:Number;// = -1
private var playing:Boolean;// = true
private var panEndVolume:Number;// = -1
private var panStartVolume:Number;// = -1
public function ManagedSoundChannel(_arg1:SoundManager, _arg2:ManagedSound, _arg3:SoundChannel){
fadeStartTime = -1;
fadeEndTime = -1;
fadeStartVolume = -1;
fadeEndVolume = -1;
panStartTime = -1;
panEndTime = -1;
panStartVolume = -1;
panEndVolume = -1;
stopAfterFade = false;
playing = true;
super();
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 stop():void{
if (!(playing)){
return;
};
if (channel == null){
return;
};
channel.stop();
soundComplete(null);
}
public function update():void{
var _local1:Number;
var _local2:Number;
var _local3: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;
};
};
_local2 = (targetVolume * manager.volume);
_local3 = targetPan;
if (channel == null){
return;
};
if (((!((_local2 == channel.soundTransform.volume))) || (!((_local3 == channel.soundTransform.pan))))){
channel.soundTransform = new SoundTransform(_local2, _local3);
};
}
public function panTo(_arg1:Number, _arg2:Number):void{
if (!(playing)){
return;
};
panStartVolume = targetPan;
panEndVolume = _arg1;
panStartTime = getTimer();
panEndTime = (getTimer() + _arg2);
}
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 setPan(_arg1:Number):void{
if (!(playing)){
return;
};
if (channel == null){
return;
};
channel.soundTransform.pan = _arg1;
panStartTime = -1;
update();
}
public function fadeToAndStop(_arg1:Number, _arg2:Number):void{
if (!(playing)){
return;
};
fadeTo(_arg1, _arg2);
stopAfterFade = true;
}
public function setVolume(_arg1:Number):void{
if (!(playing)){
return;
};
stopAfterFade = false;
this.targetVolume = _arg1;
fadeStartTime = -1;
update();
}
public function soundComplete(_arg1:Event):void{
if (!(playing)){
return;
};
sound.activeSounds.splice(sound.activeSounds.indexOf(this), 1);
playing = false;
}
public function isPlaying():Boolean{
return (playing);
}
}
}//package src.sound
Section 122
//SoundManager (src.sound.SoundManager)
package src.sound {
import flash.utils.*;
public class SoundManager {
private var fadeStartVolume:Number;// = -1
private var managedSounds:Array;
private var lastTime:Number;// = -1
private var managedSoundMap:Object;
public var volume:Number;// = 1
private var fadeEndTime:Number;// = -1
private var fadeEndVolume:Number;// = -1
private var fadeStartTime:Number;// = -1
public function SoundManager(){
managedSoundMap = new Object();
managedSounds = new Array();
lastTime = -1;
volume = 1;
fadeStartTime = -1;
fadeEndTime = -1;
fadeStartVolume = -1;
fadeEndVolume = -1;
super();
}
public function update():void{
var _local1:Number;
var _local2:int;
var _local3:Number;
_local1 = 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;
};
};
_local2 = 0;
while (_local2 < managedSounds.length) {
managedSounds[_local2].update();
_local2++;
};
}
public function get(_arg1:String):ManagedSound{
var _local2:Class;
if (managedSoundMap[_arg1] == null){
_local2 = (getDefinitionByName(("sound." + _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 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;
_local1 = 0;
while (_local1 < managedSounds.length) {
managedSounds[_local1].stop();
_local1++;
};
}
}
}//package src.sound
Section 123
//GameDataParser (src.util.GameDataParser)
package src.util {
import flash.xml.*;
public class GameDataParser {
public var levelNum:int;
public var timeLimit:int;// = 600
public var gameType:String;
public var cardList:String;
public var textMappings:Object;
public var randomSeed:int;
public var gameMode:String;
public var playerType:String;
public var levelData:String;
public function GameDataParser(){
timeLimit = 600;
super();
}
public function parse(_arg1:String):void{
var _local2:XMLDocument;
var _local3:Array;
var _local4:int;
_local2 = new XMLDocument(_arg1);
textMappings = new Object();
_local3 = _local2.firstChild.childNodes;
randomSeed = parseInt(_local2.firstChild.attributes.randomseed);
cardList = new String(_local2.firstChild.attributes.cards);
playerType = new String(_local2.firstChild.attributes.playerType);
gameMode = new String(_local2.firstChild.attributes.mode);
timeLimit = parseInt(_local2.firstChild.attributes.timelimit);
_local4 = 0;
while (_local4 < _local3.length) {
if (_local3[_local4].nodeName == "id"){
};
if (_local3[_local4].nodeName == "levelnum"){
levelNum = parseInt(_local3[_local4].firstChild.nodeValue);
};
if (_local3[_local4].nodeName == "game"){
gameType = new String(_local3[_local4].attributes.type);
};
if (_local3[_local4].nodeName == "text"){
if ((((_local3[_local4].firstChild == null)) || ((_local3[_local4].firstChild == undefined)))){
textMappings[_local3[_local4].attributes.id] = (("[xx" + _local3[_local4].attributes.id) + "xx]");
} else {
textMappings[_local3[_local4].attributes.id] = new String(_local3[_local4].firstChild.nodeValue);
};
TextMappings.set(_local3[_local4].attributes.id, textMappings[_local3[_local4].attributes.id]);
};
if (_local3[_local4].nodeName == "level"){
levelData = (textMappings[_local3[_local4].attributes.id] = new String(_local3[_local4].firstChild.nodeValue));
};
_local4++;
};
}
}
}//package src.util
Section 124
//ReplayData (src.util.ReplayData)
package src.util {
import src.player.*;
public class ReplayData {
public static const data:String = <data>
<entry id="1" time="2009-04-28 16:57:38"><![CDATA[933,_0u2_26038Y0D138r931_1_1_19362u331f392P6r2_g98f2ia68G0x2xi3g3o383=0]]></entry>
<entry id="2" time="2009-04-28 16:57:44"><![CDATA[933,08fa32ia38u0u86931o062f6c436lc3s3o68cc3e62cac8r991f0x2o6Am3g6o383=0]]></entry>
<entry id="3" time="2009-04-28 16:57:51"><![CDATA[933,08ia32ca38i961o0u2l6l26i6o38la62fa38999199383061f0i2f664l662o6cm3=0]]></entry>
<entry id="4" time="2009-04-28 16:58:01"><![CDATA[933,0m3u3o383991f9686oA8u0D8l2_2cg6o68_8f0J2J6um3i323331o9i133G968G23=0]]></entry>
<entry id="5" time="2009-04-28 16:58:14"><![CDATA[933,02o6oi3g61u3fj3h313968Y0A2S664x6i0683o9p3931f9P0Y8ro68M0_0G2_2_23=0]]></entry>
<entry id="6" time="2009-04-28 16:58:23"><![CDATA[933,02S6l436943c94f6ie9u3s3c9s9eccJeVc38c098c961c3f1Sh31i9rb39rb33Gp3=0]]></entry>
<entry id="7" time="2009-04-28 16:58:32"><![CDATA[933,09o8oa629a68Y0_068fc34o632c331fh6p3938_8i0f862l694fk3g6931f938_83=0]]></entry>
<entry id="8" time="2009-04-28 16:58:43"><![CDATA[933,08c0l2o6o2Ai3h31l9V8c0_0f2J6l4x0626331x3o238ic94ccu4cg91l3o2c6Sm3=0]]></entry>
<entry id="9" time="2009-04-28 16:58:53"><![CDATA[933,0m6i623361i3M130D8_89o98cco4Gkc46692r331f3l2f8Po3q62Pic293c1P0P83=0]]></entry>
<entry id="10" time="2009-04-28 16:59:04"><![CDATA[933,08xcV091D064Jg9h31V938P2l6G46cis6k3m3662J36169f1i3l938f0i230o2r63=0]]></entry>
<entry id="11" time="2009-04-28 16:59:13"><![CDATA[933,06o2u664oc38S961f998xc64u6lcx6ce3co4l061i9i8ccAs3o6961c9f8ccDo6p3=0]]></entry>
<entry id="12" time="2009-04-28 16:59:27"><![CDATA[933,0931oh91i9f8_83cP4i0_0c1Y362_2M694rc94_4i061i362l6l2l3c1f9l1_1A03=0]]></entry>
<entry id="13" time="2009-04-28 16:59:47"><![CDATA[933,_0o8_8Pcf4_4_4c0o1D0Y4r0A4i0D4l0_0G4f0u8f0P2x0c8l034V0r2_2_2_2D33=0]]></entry>
<entry id="14" time="2009-04-28 16:59:58"><![CDATA[933,0331_1_1_1u9983998_86cY43692f6r26664xk3g6031u9f8fcf4f632f4A03g6h3=0]]></entry>
<entry id="15" time="2009-04-28 17:00:07"><![CDATA[933,01l9xb3a32u0P2r6r4cci4ucf4i6c2l3f2ra38icr4i06g91u968fcx03g6hc1993=0]]></entry>
<entry id="16" time="2009-04-28 17:00:14"><![CDATA[933,0998A0S2r6946cAe3a32f69496i2303g3h913h913332f6D260c1o094o06gf1933=0]]></entry>
<entry id="17" time="2009-04-28 17:00:25"><![CDATA[933,03c16392r098f0S4cco4f6f26i92i8xo98loc86a92l0r8xo38_860_0u2Ai62ri3=0]]></entry>
<entry id="18" time="2009-04-28 17:00:36"><![CDATA[933,0i3361l9ip3h91l3i1V3l2c3D2l6u4_4o6l4G692Y331Dh616h6j6362o331u0f83=0]]></entry>
<entry id="19" time="2009-04-28 17:00:45"><![CDATA[933,0oc8Aci4P632i6u46c6k643ci8o9c160i4x2D391P3_392f49c689961r332c6x43=0]]></entry>
<entry id="20" time="2009-04-28 17:00:54"><![CDATA[933,04c6l23091S9r83o3p9o6s3ccs3k64fcD860M4f6r29361c3Sbc9rr33xb6a6b333=0]]></entry>
<entry id="21" time="2009-04-28 17:01:03"><![CDATA[933,03c2l6i230r8_8ro3p39fp3o986o38icl0l1l0x4c6Pm96c496c2c368f931D0r43=0]]></entry>
<entry id="22" time="2009-04-28 17:01:11"><![CDATA[933,0466um96l4_4u63m666m669m3i326331J3l0A4lcDsfcle66ref66mc6um669m663=0]]></entry>
<entry id="23" time="2009-04-28 17:01:17"><![CDATA[933,063m96Ae3u3e9u3e6u3s98A0c490c490f1l3fj939j63fj62r3oh6p39fp99c8693=0]]></entry>
<entry id="24" time="2009-04-28 17:01:23"><![CDATA[933,09c1i0i2J69436c4ocl4666eru9e9u6e6692o66cPe3632i=0]]></entry>
<entry id="25" time="2009-04-28 17:01:23"><![CDATA[782,1355=1355]]></entry>
</data>
.toString();
public static var playData:String = "";
public static var startLevel:int = 0;
public static var logData:Array = new Array();
public static function checkLog(_arg1:int, _arg2:String):void{
var _local3:String;
_local3 = logData[_arg1];
if (((!((_local3 == null))) && (!((_local3 == _arg2))))){
trace(("Expected: " + _local3));
trace((" Got: " + _local3));
};
}
public static function parseReplayData():void{
var _local1:Array;
var _local2:int;
var _local3:String;
_local1 = data.split("\n");
_local2 = 0;
while (_local2 < _local1.length) {
_local3 = _local1[_local2];
if (_local3.indexOf("933,") > 0){
_local3 = _local3.substring((_local3.indexOf("933,") + 4));
_local3 = _local3.substring(0, _local3.indexOf("=0"));
trace(_local3);
playData = (playData + RecorderController.decode(_local3));
};
_local2++;
};
}
}
}//package src.util
Section 125
//TextMappings (src.util.TextMappings)
package src.util {
public class TextMappings {
public static var mappings:Object = new Object();
public static function set(_arg1:String, _arg2:String):void{
mappings[_arg1] = _arg2;
}
public static function get(_arg1:String):String{
if (mappings[_arg1] == undefined){
return ((("[" + _arg1) + "]"));
};
return (mappings[_arg1]);
}
}
}//package src.util
Section 126
//BlastPassage (src.BlastPassage)
package src {
import src.sound.*;
import flash.display.*;
import src.util.*;
import src.particle.*;
import src.gui.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import src.player.*;
import src.level.*;
import flash.external.*;
import flash.system.*;
import src.screen.game.*;
import flash.ui.*;
import src.screen.*;
public class BlastPassage extends MovieClip {
protected var outro:Outro;
public var logField:TextField;
public var fpsMeter:TextField;
public var gameHolder:MovieClip;
private var lastMouseUpdateTime:int;// = 0
public var particleLayer:Sprite;
private var screen:Screen;
public var intro:Intro;
private var lastTime:Number;// = -1
private var lastFade:Number;// = -1
private var lastX:Number;// = 0
private var lastY:Number;// = 0
private var frames:int;
private var screenCover:ScreenCover;
private var mouseHidden:Boolean;// = false
protected var levelLoader:LevelLoader;
public var focusNagger:MovieClip;
private var hasSentQuit:Boolean;// = false
private var areLevelsLoaded:Boolean;// = false
protected var deathAnimTicks:int;// = -1
private var fps:int;
private var gr:GraphicsContext;
private var recorderController:RecorderController;
public var gameScreen:GameScreen;
protected var gdp:GameDataParser;
public var gui:Gui;
protected var isIntroOver:Boolean;// = false
private var tickCount:int;// = 0
public var introButtons:IntroButtons;
private var focused:Boolean;// = false
public var controller:KeyboardController;
protected var hasSentGameEnd:Boolean;// = false
public var DEBUG_XML:String;
public static const DEBUG_VERY_VERBOSE:Boolean = false;
public static const DEBUG_MODE:Boolean = false;
public static const REPLAY_MODE:Boolean = false;
public static var GAME_AREA_WIDTH:int = 248;
private static var MAX_TICKS_PER_FRAME:int = 10;
public static var PLAYDATA_CMD_SCORE:int = 782;
public static var PLAYDATA_CMD_DATA:int = 933;
public static var PLAYDATA_CMD_ABORT:int = 799;
public static var GAME_AREA_HEIGHT:int = 232;
public static var sound:SoundManager = new SoundManager();
public static var music:SoundManager = new SoundManager();
public static var TICKS_PER_SECOND:int = 20;
public function BlastPassage(){
var bmp:Bitmap;
DEBUG_XML = <gamedata randomseed="1887208361">
<text id="instructions_1">Björnen styrs med piltagenterna på tangentbordet.
Tangenbordet är framför monitorn.</text>
<text id="total_score">Total score</text>
<text id="click_to_start">Click to start. Game starts in [0] seconds.</text>
<text id="score">Score</text>
<text id="instructions_8">Samla nycklar för att öppna dörrar.
Exit tar dig till nästa bana.</text>
<text id="game_won">GAME WON!</text>
<text id="instructions_9">KLICKA OCH BÖRJA SPELA!</text>
<text id="instructions_6">Man kan samla och använda potions.</text>
<text id="instructions_7">Man kan samla och använda potions.
Trycker man på enter försvinner alla fiender på skärmen.</text>
<text id="bonus_time">Time bonus</text>
<text id="instructions_4">Bomber är farliga för en själv och power ups.
Power up försvinner om den träffas. Björnen tar skada.</text>
<text id="instructions_5">För att hela skada behöver man samla syretuber.
De gula tuberna är syrerikast, men är känsliga för eld.</text>
<text id="instructions_2">Släpp bomber genom att trycka på space.
Fiender dör av bomber.</text>
<text id="instructions_3">Fiender kommer från speciella hus.
Bomba husen och få kanske power ups.</text>
<text id="out_of_time">OUT OF TIME!</text>
<text id="game_over">GAME OVER!</text>
<text id="time">Time</text>
<text id="game_ends_in">The game ends in [0] seconds.</text>
<text id="out_of_oxygen">OUT OF OXYGEN!</text>
<text id="game_quit">GAME QUIT!</text>
<text id="bonus_life">Life bonus</text>
<text id="click_to_focus">Klicka för fokus!</text>
<levelnum>16</levelnum><level>noname
3
16
2
3
32
32
################################
# #b # b#
# 4 # ... - ... #
# #%#%#%#%#%#%# # .K. - .K. #
# %'%5%5%'%5%5%:::# ... - ... #
# #%#%#%#%#%#%#: # d#d #
# %5%£%$%d%£%5%:4 ##---###---##
# #%#%#%#%#%#%# :# d#d #
# %5%d%K%K%$%'%: :# ... - ... #
# #%#%#%#%#%#%#:4:# .K. - .K. #
# %'%£%K%K%£%5%: # ... - ... #
# #%#%#%#%#%#%# #b # b#
# %'%$%d%£%$%5% ##---###---##
# #%#%#%#%#%#%# # #
# %5%'%5%5%'%'% # ::: #
# #%#%#%#%#%#%# - ::: #
# - ::: #
# # ::: #
# # #
###########################---##
#b ># ::::: # ::::: # #
#b # ::::: # ::::: # 1 1 #
# # ####### # ####### # #
# # £# # £# # ... #
# # * # * # * # * # 1.1.#
# # * # * # * # * #.....#
# # # # # # #
# £#£ # £#£ # £# #
# ####### # ####### # ######-###
# ::::: # ::::: # ::::: #
# ::::: # ::::: # ::::: #
################################
</level></gamedata>
.toString();
lastTime = -1;
tickCount = 0;
controller = new KeyboardController();
recorderController = new RecorderController(controller);
gdp = new GameDataParser();
focused = false;
areLevelsLoaded = false;
isIntroOver = false;
deathAnimTicks = -1;
hasSentGameEnd = false;
lastFade = -1;
hasSentQuit = false;
lastMouseUpdateTime = 0;
lastX = 0;
lastY = 0;
mouseHidden = false;
super();
addEventListener(Event.ACTIVATE, getFocus);
addEventListener(Event.DEACTIVATE, loseFocus);
fpsMeter.visible = DEBUG_MODE;
logField.visible = false;
logField.appendText("BlastPassage()\n");
if (((DEBUG_MODE) && (REPLAY_MODE))){
ReplayData.parseReplayData();
};
stage.stageFocusRect = false;
logField.appendText("Parse gamedata\n");
getGameData(gdp);
gui.init(this);
gui.scoreLabel.text = (TextMappings.get("score") + ":");
logField.appendText("Create graphics\n");
gr = new GraphicsContext((GAME_AREA_WIDTH * 2), (GAME_AREA_HEIGHT * 2));
particleLayer = new Sprite();
bmp = new Bitmap(gr.bm);
screenCover = new ScreenCover();
gameHolder.addChild(bmp);
gameHolder.addChild(particleLayer);
gameHolder.addChild(screenCover);
bmp.x = (bmp.x - GAME_AREA_WIDTH);
bmp.y = (bmp.y - GAME_AREA_HEIGHT);
screenCover.x = (screenCover.x - GAME_AREA_WIDTH);
screenCover.y = (screenCover.y - GAME_AREA_HEIGHT);
particleLayer.x = (particleLayer.x - GAME_AREA_WIDTH);
particleLayer.y = (particleLayer.y - GAME_AREA_HEIGHT);
gameHolder.x = (gameHolder.x + GAME_AREA_WIDTH);
gameHolder.y = (gameHolder.y + GAME_AREA_HEIGHT);
lastTime = getTimer();
logField.appendText("Load level \n");
try {
if (((DEBUG_MODE) && (!(REPLAY_MODE)))){
levelLoader = new FileLevelLoader(this);
} else {
levelLoader = new LevelLoader(this);
};
} catch(e) {
logField.appendText(e);
logField.visible = true;
};
particleLayer.mouseChildren = false;
particleLayer.mouseEnabled = false;
gameHolder.mouseChildren = false;
gameHolder.mouseEnabled = false;
focusNagger.text.text = TextMappings.get("click_to_focus");
introButtons = new IntroButtons(this);
introButtons.x = 320;
introButtons.y = 240;
startup();
}
protected function getGameData(_arg1:GameDataParser):void{
var oa:Object;
var gameData:String;
var gdp = _arg1;
try {
oa = ExternalInterface.call("getGameData");
if ((((oa == null)) || (!(oa.success)))){
} else {
gameData = oa.message;
gdp.parse(gameData);
};
} catch(e) {
logField.appendText(e);
logField.visible = true;
};
if (DEBUG_MODE){
gdp.parse(DEBUG_XML);
};
}
public function outOfTime():void{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = gameScreen.player.getHealth();
endGame(Outro.OUT_OF_TIME, _local1, _local2);
}
public function levelsLoaded():void{
areLevelsLoaded = true;
checkStartGame();
}
public function levelStarted(_arg1:int):void{
}
public function addParticle(_arg1:Particle):void{
particleLayer.addChild(_arg1);
}
public function getGraphicsContext():GraphicsContext{
return (gr);
}
public function advanceTime(_arg1:Event):void{
var now:Number;
var msPerTick:Number;
var ticksThisFrame:int;
var alpha:Number;
var str:String;
var aa:Number;
var e = _arg1;
BlastPassage.music.update();
BlastPassage.sound.update();
now = getTimer();
if (lastTime < 0){
lastTime = now;
};
msPerTick = (1000 / TICKS_PER_SECOND);
if (((DEBUG_MODE) && (REPLAY_MODE))){
msPerTick = (msPerTick / 20);
};
ticksThisFrame = 0;
while ((now - lastTime) > msPerTick) {
if (deathAnimTicks >= 0){
deathAnimTicks++;
if ((((deathAnimTicks == (20 + (5 * 20)))) || (((!((outro == null))) && (outro.shouldSkip))))){
sendQuit();
};
};
ticksThisFrame = (ticksThisFrame + 1);
if (ticksThisFrame < MAX_TICKS_PER_FRAME){
if (screen != null){
screen.tick();
};
};
lastTime = (lastTime + msPerTick);
if (isIntroOver){
tickCount++;
};
if ((tickCount % TICKS_PER_SECOND) == 0){
fps = frames;
fpsMeter.text = ("FPS: " + fps);
frames = 0;
};
};
updateMouseVisibility();
alpha = ((now - lastTime) / msPerTick);
if (screen != null){
screen.render(alpha);
};
if (deathAnimTicks >= 0){
updateFade(((deathAnimTicks + alpha) / 18));
if (deathAnimTicks >= 20){
outro.visible = true;
aa = (((deathAnimTicks + alpha) - 20) / 10);
if (aa > 1){
aa = 1;
};
outro.alpha = Math.sqrt(aa);
};
} else {
updateFade(0);
};
frames++;
str = recorderController.flushIfLongerThan(64);
try {
if (str != null){
ExternalInterface.call("playData", (((PLAYDATA_CMD_DATA + ",") + str) + "=0"));
};
} catch(e) {
};
gui.update();
}
protected function startup():void{
showInstructions();
}
public function levelWon():void{
var _local1:int;
var _local2:int;
_local1 = (int(((gameScreen.remainingTicks * 1000) / GameScreen.GAME_TIME)) + 1000);
_local2 = gameScreen.player.getHealth();
endGame(Outro.GAME_WON, _local1, _local2);
}
public function loseFocus(_arg1:Event):void{
focusNagger.visible = true;
controller.releaseAllKeys();
focused = false;
}
public function playerDead():void{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
endGame(Outro.OUT_OF_LIFE, _local1, _local2);
}
public function updateFade(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg1 > 1){
_arg1 = 1;
};
if (_arg1 == lastFade){
return;
};
lastFade = _arg1;
screenCover.visible = !((_arg1 == 0));
screenCover.alpha = (_arg1 * _arg1);
_local2 = 1;
_local3 = (1 - (_arg1 * (_local2 + 1)));
if (_local3 < 0){
_local3 = 0;
};
if (_local3 > 1){
_local3 = 1;
};
_local3 = (((1 - ((1 - _local3) * (1 - _local3))) * 0.995) + 0.005);
_local4 = (1 - ((_arg1 * (_local2 + 1)) - _local2));
if (_local4 < 0){
_local4 = 0;
};
if (_local4 > 1){
_local4 = 1;
};
_local4 = (1 - ((1 - _local4) * (1 - _local4)));
gameHolder.scaleY = _local3;
gameHolder.scaleX = _local4;
}
public function stopGame():void{
removeEventListener(Event.ENTER_FRAME, advanceTime);
Mouse.show();
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyUp);
gameScreen = null;
setScreen(null);
}
public function getFocus(_arg1:Event):void{
focusNagger.visible = false;
focused = true;
}
protected function showInstructions():void{
isIntroOver = false;
intro = new Intro(this);
intro.x = 320;
intro.y = 240;
addChild(intro);
addChild(introButtons);
}
public function abortGame():Boolean{
if (gameScreen != null){
return (gameScreen.abortGame());
};
return (false);
}
public function checkStartGame():void{
if (((!(isIntroOver)) || (!(areLevelsLoaded)))){
return;
};
startGame();
}
public function keyUp(_arg1:KeyboardEvent):void{
controller.toggleKey(_arg1.keyCode, false);
}
public function doAbort():void{
try {
ExternalInterface.call("playData", (((PLAYDATA_CMD_DATA + ",") + recorderController.flush()) + "=0"));
ExternalInterface.call("playData", ((((PLAYDATA_CMD_ABORT + ",") + gameScreen.player.score) + "=") + gameScreen.player.score));
} catch(e) {
};
}
public function endGame(_arg1:int, _arg2:int, _arg3:int):void{
var winType = _arg1;
var timeBonus = _arg2;
var lifeBonus = _arg3;
setScreen(null);
outro = new Outro(this, winType, timeBonus, lifeBonus);
addChild(outro);
outro.visible = false;
deathAnimTicks = 0;
gameScreen.player.score = (gameScreen.player.score + timeBonus);
gameScreen.player.score = (gameScreen.player.score + lifeBonus);
if (!(hasSentGameEnd)){
levelEnded();
try {
fscommand("gameEnd", ("" + gameScreen.player.score));
} catch(e) {
};
hasSentGameEnd = true;
};
}
public function introOver():void{
isIntroOver = true;
removeChild(introButtons);
checkStartGame();
}
public function startGame():void{
try {
fscommand("gameStart");
} catch(e) {
};
addEventListener(Event.ENTER_FRAME, advanceTime);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUp);
gameScreen = new GameScreen(levelLoader, gdp.levelNum, gdp.levelData, gdp.randomSeed);
gui.setScreen(gameScreen);
setScreen(gameScreen);
gameScreen.player = new Player(gameScreen);
if (((REPLAY_MODE) && (DEBUG_MODE))){
gameScreen.player.setController(new ReplayController(ReplayData.playData));
} else {
gameScreen.player.setController(recorderController);
};
gameScreen.player.newLevel();
}
public function gameAborted():void{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
endGame(Outro.GAME_ABORTED, _local1, _local2);
}
public function updateMouseVisibility():void{
var _local1:Boolean;
var _local2:Boolean;
_local1 = (mouseX < ((GAME_AREA_WIDTH * 2) + gameHolder.x));
if (((!((lastX == mouseX))) || (!((lastY == mouseY))))){
lastX = mouseX;
lastY = mouseY;
lastMouseUpdateTime = getTimer();
};
_local2 = ((_local1) && (((getTimer() - lastMouseUpdateTime) > 1000)));
if (((!((_local2 == mouseHidden))) || (((tickCount % 20) == 0)))){
mouseHidden = _local2;
if (_local2){
Mouse.hide();
} else {
Mouse.show();
};
};
}
public function setScreen(_arg1:Screen):void{
if (screen != null){
screen.removed();
};
screen = _arg1;
if (screen != null){
screen.setBlastPassage(this);
};
}
public function levelEnded():void{
try {
ExternalInterface.call("playData", (((PLAYDATA_CMD_DATA + ",") + recorderController.flush()) + "=0"));
ExternalInterface.call("playData", ((((PLAYDATA_CMD_SCORE + ",") + gameScreen.player.score) + "=") + gameScreen.player.score));
} catch(e) {
};
}
public function keyDown(_arg1:KeyboardEvent):void{
controller.toggleKey(_arg1.keyCode, true);
}
public function sendQuit():void{
if (!(hasSentQuit)){
trace("Quit!");
try {
fscommand("gameQuit");
} catch(e) {
};
hasSentQuit = true;
};
}
}
}//package src
Section 127
//GraphicsContext (src.GraphicsContext)
package src {
import flash.display.*;
import art.*;
import flash.geom.*;
public class GraphicsContext {
private var r2:Rectangle;
public var bullet:BitmapData;
private var r3:Rectangle;
public var floor:BitmapData;
public var house0:BitmapData;
public var house1:BitmapData;
public var house2:BitmapData;
public var house3:BitmapData;
private var r4:Rectangle;
private var yCam:int;
public var ghost:BitmapData;
public var teleporter:BitmapData;
public var orgWall1:BitmapData;
public var orgWall2:BitmapData;
public var orgWall3:BitmapData;
public var orgWall4:BitmapData;
public var sorcerer:BitmapData;
public var bomb:BitmapData;
public var deathAnim:BitmapData;
public var background:BitmapData;
public var grunt:BitmapData;
private var rc:Rectangle;
public var fireball:BitmapData;
private var yo:int;
public var special:BitmapData;
public var fire2:BitmapData;
public var door:BitmapData;
private var xCam:int;
private var height:int;
public var fire:BitmapData;
public var bm:BitmapData;
private var width:int;
public var wall:BitmapData;
private var p:Point;
public var player:BitmapData;
public var orgFloors:Array;
public var lobber:BitmapData;
public var death:BitmapData;
private var xo:int;
private var r:Rectangle;
public var demon:BitmapData;
public var pickup:BitmapData;
public function GraphicsContext(_arg1:int, _arg2:int){
var _local3:int;
var _local4:BitmapData;
var _local5:BitmapData;
var _local6:Bitmap;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
orgFloors = [new FloorSheet1(32, 32), new FloorSheet2(32, 32), new FloorSheet3(32, 32), new FloorSheet4(32, 32), new FloorSheet5(32, 32)];
orgWall1 = new WallSheet1(32, 32);
orgWall2 = new WallSheet2(32, 32);
orgWall3 = new WallSheet3(32, 32);
orgWall4 = new WallSheet4(32, 32);
door = new DoorSheet(32, 32);
pickup = new PickupSheet(32, 32);
special = new SpecialSheet(32, 32);
house0 = new HouseSheet0(64, 64);
house1 = new HouseSheet1(64, 64);
house2 = new HouseSheet2(64, 64);
house3 = new HouseSheet3(64, 64);
grunt = new GruntSheet(32, 32);
ghost = new GhostSheet(32, 32);
demon = new DemonSheet(32, 32);
death = new DeathSheet(32, 32);
lobber = new LobberSheet(32, 32);
sorcerer = new SorcererSheet(32, 32);
fireball = new FireballSheet(32, 32);
bullet = new BulletSheet(32, 32);
player = new PlayerSheet(32, 64);
deathAnim = new DeathAnimSheet(32, 64);
bomb = new BombSheet(32, 32);
fire = new FireSheet(32, 32);
fire2 = new FireSheet2(32, 32);
teleporter = new TeleporterSheet(32, 50);
r = new Rectangle(0, 0, 32, 32);
r2 = new Rectangle(0, 0, 32, 64);
r3 = new Rectangle(0, 0, 47, 50);
r4 = new Rectangle(0, 0, 64, 64);
rc = new Rectangle(0, 0, 1, 1);
p = new Point(0, 0);
super();
this.width = _arg1;
this.height = _arg2;
background = new BitmapData((32 * 32), (32 * 32), false, 0);
bm = new BitmapData(_arg1, _arg2, false, 0);
_local3 = 0;
while (_local3 < 5) {
_local4 = orgFloors[_local3];
_local5 = new BitmapData((32 * 32), (32 * 32), false, 0);
_local6 = new Bitmap(_local4);
_local7 = 0;
while (_local7 < ((32 * 32) / _local4.height)) {
_local8 = 0;
while (_local8 < ((32 * 32) / _local4.width)) {
_local9 = (_local8 * _local4.width);
_local10 = (_local7 * _local4.height);
_local11 = 1;
_local12 = 1;
if ((_local8 % 2) == 1){
_local11 = -1;
_local9 = (_local9 + _local6.width);
};
if ((_local7 % 2) == 1){
_local12 = -1;
_local10 = (_local10 + _local6.height);
};
_local5.draw(_local6, new Matrix(_local11, 0, 0, _local12, _local9, _local10));
_local8++;
};
_local7++;
};
orgFloors[_local3] = _local5;
_local3++;
};
}
public function fill(_arg1:int):void{
bm.fillRect(new Rectangle(0, 0, width, height), _arg1);
}
public function drawSprite32x32(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
p.x = (_arg4 - xCam);
p.y = (_arg5 - yCam);
r4.x = (_arg2 * 64);
r4.y = (_arg3 * 64);
bm.copyPixels(_arg1, r4, p);
}
public function prepare(_arg1:int, _arg2:int):void{
this.xCam = _arg1;
this.yCam = _arg2;
xo = -((_arg1 & 31));
yo = -((_arg2 & 31));
bm.copyPixels(background, new Rectangle(_arg1, _arg2, width, height), new Point(0, 0));
}
public function setFloorType(_arg1:int):void{
floor = orgFloors[_arg1];
}
public function drawSprite16x32(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
p.x = (_arg4 - xCam);
p.y = (_arg5 - yCam);
r2.x = (_arg2 * 32);
r2.y = (_arg3 * 64);
bm.copyPixels(_arg1, r2, p);
}
public function drawFloorImageOffs(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):void{
p.x = ((_arg4 * 32) + _arg6);
p.y = ((_arg5 * 32) + _arg7);
r.x = (_arg2 * 32);
r.y = (_arg3 * 32);
background.copyPixels(_arg1, r, p);
}
public function drawFloorImage(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
p.x = (_arg4 * 32);
p.y = (_arg5 * 32);
r.x = (_arg2 * 32);
r.y = (_arg3 * 32);
background.copyPixels(_arg1, r, p);
}
public function drawSprite(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
p.x = (_arg4 - xCam);
p.y = (_arg5 - yCam);
r.x = (_arg2 * 32);
r.y = (_arg3 * 32);
bm.copyPixels(_arg1, r, p);
}
public function drawSprite47x50(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
p.x = ((_arg4 - xCam) - 8);
p.y = ((_arg5 - yCam) + 18);
r3.x = (_arg2 * 47);
r3.y = (_arg3 * 50);
bm.copyPixels(_arg1, r3, p);
}
public function colorize(_arg1:BitmapData, _arg2:BitmapData, _arg3:int):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local4 = ((_arg3 & 3) / 3);
_local5 = (((_arg3 >> 2) & 3) / 3);
_local6 = (((_arg3 >> 4) & 3) / 3);
_local7 = (((_local4 * 0.3) + (_local5 * 0.59)) + (_local6 * 0.1));
_local4 = (_local4 + ((_local7 - _local4) * 0.4));
_local5 = (_local5 + ((_local7 - _local5) * 0.4));
_local6 = (_local6 + ((_local7 - _local6) * 0.4));
_arg1.draw(_arg2, new Matrix(), new ColorTransform(_local4, _local5, _local6, 1, 0, 0, 0, 0));
}
public function setWallType(_arg1:int):void{
if (_arg1 == 0){
wall = orgWall1;
};
if (_arg1 == 1){
wall = orgWall2;
};
if (_arg1 == 2){
wall = orgWall3;
};
if (_arg1 == 3){
wall = orgWall4;
};
}
public function drawCustom(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):void{
rc.width = _arg4;
rc.height = _arg5;
rc.x = _arg2;
rc.y = _arg3;
p.x = (_arg6 - xCam);
p.y = (_arg7 - yCam);
bm.copyPixels(_arg1, rc, p);
}
}
}//package src
Section 128
//Intro (src.Intro)
package src {
import flash.utils.*;
import flash.events.*;
import src.util.*;
import flash.text.*;
import flash.display.*;
public class Intro extends MovieClip {
private var blastPassage:BlastPassage;
private var startTime:int;// = 0
private var lastFrame:int;// = -1
private var hasPlayedNextMusic:Boolean;// = false
public var clickToStartText:TextField;
public var textField:TextField;
private static const INTRO_TIME:int = 59900;
private static const TEXT_FRAMES:Array = [1, 73, 133, 258, 350, 413, 461, 510, 565];
private static const FRAME_COUNT:int = 599;
public function Intro(_arg1:BlastPassage){
lastFrame = -1;
startTime = 0;
hasPlayedNextMusic = false;
super();
this.blastPassage = _arg1;
startTime = getTimer();
addEventListener(Event.ENTER_FRAME, advanceTime);
addEventListener(MouseEvent.MOUSE_DOWN, clicked);
BlastPassage.music.get("IntroMusic").play();
advanceTime(null);
}
public function clicked(_arg1:MouseEvent):void{
close();
}
public function advanceTime(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:String;
BlastPassage.music.update();
BlastPassage.sound.update();
_local2 = int((((getTimer() - startTime) / 1000) * 10));
if (_local2 > FRAME_COUNT){
_local2 = FRAME_COUNT;
};
if (_local2 == lastFrame){
return;
};
_local3 = ((INTRO_TIME - (getTimer() - startTime)) / 1000);
if ((((((INTRO_TIME / 1000) - _local3) > 19)) && (!(hasPlayedNextMusic)))){
BlastPassage.music.get("GameMusic").loop();
hasPlayedNextMusic = true;
};
clickToStartText.visible = ((_local2 % 10) < 6);
clickToStartText.text = TextMappings.get("click_to_start").split("[0]").join(_local3);
lastFrame = _local2;
gotoAndStop((_local2 + 1));
_local4 = 0;
_local5 = 0;
while (_local5 < TEXT_FRAMES.length) {
if (TEXT_FRAMES[_local5] <= (_local2 + 1)){
_local4++;
};
_local5++;
};
_local6 = TextMappings.get(("instructions_" + _local4));
if (_local4 == TEXT_FRAMES.length){
_local6 = ("\r\r\r" + _local6);
};
textField.text = _local6;
if (_local3 == 0){
close();
};
}
public function close():void{
stage.focus = blastPassage;
removeEventListener(Event.ENTER_FRAME, advanceTime);
removeEventListener(MouseEvent.MOUSE_DOWN, clicked);
parent.removeChild(this);
blastPassage.introOver();
}
}
}//package src
Section 129
//IntroButtons (src.IntroButtons)
package src {
import src.gui.*;
import flash.display.*;
public class IntroButtons extends MovieClip implements ButtonListener {
public var soundButton:GuiButton;
private var blastPassage:BlastPassage;
public var quitButton:GuiButton;
public var musicButton:GuiButton;
public function IntroButtons(_arg1:BlastPassage){
this.blastPassage = _arg1;
musicButton.init(this, 0);
soundButton.init(this, 1);
if (quitButton != null){
quitButton.init(this, 2);
};
}
public function buttonToggled(_arg1:int, _arg2:Boolean):Boolean{
if (blastPassage != null){
if (_arg1 == 0){
BlastPassage.music.fadeTo((_arg2) ? 0 : 1, 200);
blastPassage.gui.musicButton.setPressed(_arg2);
return (true);
};
if (_arg1 == 1){
BlastPassage.sound.fadeTo((_arg2) ? 0 : 1, 200);
blastPassage.gui.soundButton.setPressed(_arg2);
return (true);
};
return (false);
};
return (false);
}
}
}//package src
Section 130
//Outro (src.Outro)
package src {
import flash.utils.*;
import flash.events.*;
import src.util.*;
import flash.text.*;
import flash.display.*;
public class Outro extends MovieClip {
public var bonus2:TextField;
public var topTitle:TextField;
public var bonus:TextField;
private var happyEnding:Boolean;// = true
private var blinkTime:int;// = 0
public var outroBear:MovieClip;
private var startTime:int;// = 0
public var totalScoreTitle:TextField;
private var lastTime:int;
public var bonusTitle:TextField;
public var score:TextField;
public var totalScore:TextField;
public var shouldSkip:Boolean;// = false
public var bonusTitle2:TextField;
public var scoreTitle:TextField;
public static var OUT_OF_LIFE:int = 2;
public static var OUT_OF_TIME:int = 1;
public static var GAME_WON:int = 0;
public static var GAME_ABORTED:int = 3;
public function Outro(_arg1:BlastPassage, _arg2:int, _arg3:int, _arg4:int){
blinkTime = 0;
happyEnding = true;
startTime = 0;
shouldSkip = false;
super();
BlastPassage.music.stopAll();
lastTime = getTimer();
advanceTime(null);
addEventListener(Event.ENTER_FRAME, advanceTime);
this.happyEnding = (_arg2 == GAME_WON);
if (happyEnding){
BlastPassage.music.get("HappyEndMusic").play();
} else {
BlastPassage.music.get("HappyEndMusic").play();
};
score.text = ("" + _arg1.gameScreen.player.score);
bonus.text = ("" + _arg3);
bonus2.text = ("" + _arg4);
totalScore.text = ("" + ((_arg1.gameScreen.player.score + _arg3) + _arg4));
scoreTitle.text = (TextMappings.get("score") + ":");
bonusTitle.text = (TextMappings.get("bonus_time") + ":");
bonusTitle2.text = (TextMappings.get("bonus_life") + ":");
totalScoreTitle.text = (TextMappings.get("total_score") + ":");
if (_arg2 == GAME_WON){
topTitle.text = TextMappings.get("game_won");
} else {
if (_arg2 == OUT_OF_TIME){
topTitle.text = TextMappings.get("out_of_time");
} else {
if (_arg2 == OUT_OF_LIFE){
topTitle.text = TextMappings.get("out_of_oxygen");
} else {
if (_arg2 == GAME_ABORTED){
topTitle.text = TextMappings.get("game_quit");
};
};
};
};
addEventListener(MouseEvent.MOUSE_DOWN, clicked);
startTime = getTimer();
}
public function clicked(_arg1:MouseEvent):void{
if ((getTimer() - startTime) > 500){
shouldSkip = true;
};
}
public function advanceTime(_arg1:Event):void{
var _local2:int;
var _local3:int;
_local2 = getTimer();
while ((_local2 - lastTime) >= 0) {
lastTime = (lastTime + 100);
if (blinkTime != 0){
blinkTime++;
if (blinkTime > 3){
blinkTime = -30;
};
};
if ((((blinkTime == 0)) && ((Math.random() < 0.05)))){
blinkTime = 1;
};
_local3 = 0;
if (blinkTime > 0){
_local3 = blinkTime;
if (_local3 == 3){
_local3 = 1;
};
};
outroBear.gotoAndStop((_local3 + (happyEnding) ? 1 : 4));
};
}
}
}//package src
Section 131
//ScreenCover (src.ScreenCover)
package src {
import flash.display.*;
public dynamic class ScreenCover extends MovieClip {
}
}//package src
Section 132
//music (music)
package {
import src.gui.*;
public dynamic class music extends GuiButton {
}
}//package
Section 133
//power (power)
package {
import src.gui.*;
public dynamic class power extends GuiButton {
}
}//package
Section 134
//sound (sound)
package {
import src.gui.*;
public dynamic class sound extends GuiButton {
}
}//package