[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Section 1 (225 B)
//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 (233 B)
//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 (245 B)
//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 (229 B)
//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 (229 B)
//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 (225 B)
//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 (241 B)
//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 (225 B)
//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 (229 B)
//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 (233 B)
//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 (233 B)
//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 (233 B)
//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 (233 B)
//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 (233 B)
//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 (229 B)
//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 (229 B)
//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 (233 B)
//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 (233 B)
//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 (233 B)
//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 (233 B)
//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 (233 B)
//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 (233 B)
//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 (233 B)
//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 (241 B)
//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 (237 B)
//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 (249 B)
//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 (229 B)
//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 (229 B)
//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 (229 B)
//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 (229 B)
//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 (3.31 KiB) ●
//MainTimeline (blast_passage_adventures_fla.MainTimeline)
package blast_passage_adventures_fla {
import flash.display.*;
import flash.events.*;
import com.midasplayer.particle.*;
import com.midasplayer.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.text.*;
import flash.ui.*;
import flash.utils.*;
import flash.xml.*;
import src.*;
public dynamic class MainTimeline extends MovieClip {
public var mochi:String;
public var bg:Sprite;
public var mcKingLoader:DragonLoader;
public var mcLoadLogoBg:MovieClip;
public var bar:Sprite;
public var holder:Sprite;
public var particles:Main;
public var game:BlastPassageStandAlone;
public var game_name:String;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2);
}
public function preload(_arg1:Event):void{
bg = new Sprite();
bg.buttonMode = true;
bg.name = "clickBg";
bg.graphics.beginFill(0, 0);
bg.graphics.lineTo(stage.stageWidth, 0);
bg.graphics.lineTo(stage.stageWidth, stage.stageHeight);
bg.graphics.lineTo(0, stage.stageHeight);
bg.graphics.lineTo(0, 0);
bg.graphics.endFill();
bg.addEventListener(MouseEvent.CLICK, openKingPage);
this.addChildAt(bg, this.getChildIndex(mcLoadLogoBg));
mcLoadLogoBg.x = ((stage.stageWidth / 2) - (mcLoadLogoBg.width / 2));
mcLoadLogoBg.y = ((stage.stageHeight / 2) - (mcLoadLogoBg.height / 2));
bar = new Sprite();
bar.graphics.beginFill(0xFFFFFF, 0);
bar.x = (mcLoadLogoBg.x + 5);
bar.y = (mcLoadLogoBg.y + 34);
bar.graphics.drawRect(0, 0, 96, 5);
bar.graphics.endFill();
this.addChild(bar);
holder = new Sprite();
this.addChild(holder);
holder.x = bar.x;
holder.y = bar.y;
particles = new Main();
particles.setEmitterClip(holder);
this.addChild(particles);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function launchGame(_arg1):void{
mcKingLoader.destroy();
gotoAndStop(3);
}
function frame2(){
mcKingLoader.addEventListener(DragonLoader.LAUNCH_GAME, launchGame);
mcKingLoader.init(game_name, mochi);
}
function frame1(){
stop();
game_name = "blast-adventure";
mochi = "";
stage.scaleMode = StageScaleMode.NO_SCALE;
KingAPI.addEventListener(KingAPI.INITIALIZED_EVENT, preload);
KingAPI.addEventListener(KingAPI.HOST_BANNED_EVENT, preload);
KingAPI.init(game_name, root.loaderInfo.url);
}
public function onEnterFrame(_arg1:Event):void{
holder.x = (bar.x + bar.width);
if (framesLoaded == totalFrames){
particles.kill();
this.removeChild(particles);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
bg.removeEventListener(MouseEvent.CLICK, openKingPage);
this.removeChild(bar);
if (!(KingAPI.isHome)){
gotoAndStop(2);
} else {
gotoAndStop(3);
};
} else {
bar.scaleX = (stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal);
mcLoadLogoBg.bar.scaleX = (1 - (stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal));
};
}
public function openKingPage(_arg1:Event):void{
KingAPI.openLoaderProgressLink();
}
}
}//package blast_passage_adventures_fla
Section 32 (331 B)
//mcFireLogo_5 (blast_passage_adventures_fla.mcFireLogo_5)
package blast_passage_adventures_fla {
import flash.display.*;
public dynamic class mcFireLogo_5 extends MovieClip {
public function mcFireLogo_5(){
addFrameScript(72, frame73);
}
function frame73(){
stop();
}
}
}//package blast_passage_adventures_fla
Section 33 (324 B)
//mcPlayBtn_8 (blast_passage_adventures_fla.mcPlayBtn_8)
package blast_passage_adventures_fla {
import flash.display.*;
public dynamic class mcPlayBtn_8 extends MovieClip {
public function mcPlayBtn_8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package blast_passage_adventures_fla
Section 34 (1.72 KiB) ●
//Main (com.midasplayer.particle.Main)
package com.midasplayer.particle {
import flash.events.*;
import flash.display.*;
public class Main extends Sprite {
private var maxSize:Number;// = 29
private var numParticles:int;// = 20
private var maxXVel:Number;// = 1
private var minYVel:Number;// = -1
private var maxAlpha:Number;// = 0.02
private var maxYVel:Number;// = 1
private var particles:Array;
private var minXVel:Number;// = -1
private var minSize:Number;// = 12
private var minAlpha:Number;// = 0.01
private var emitter;
public function Main(){
particles = new Array();
super();
addEventListener(Event.ENTER_FRAME, enterFrame);
}
public function setEmitterClip(_arg1):void{
emitter = _arg1;
}
public function kill():void{
removeEventListener(Event.ENTER_FRAME, enterFrame);
var _local1:Number = 0;
while (_local1 < particles.length) {
particles[_local1].destroy();
_local1++;
};
}
private function randRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = ((Math.random() * (_arg2 - _arg1)) + _arg1);
return (_local3);
}
private function createNewParticle():void{
var _local1:* = new Particle(spark, emitter, -10, -7, stage.stageWidth, stage.stageHeight);
_local1.setVel(randRange(minXVel, maxXVel), randRange(minYVel, maxYVel));
_local1.setSize(randRange(minSize, maxSize));
particles.push(_local1);
while (particles.length > numParticles) {
_local1 = particles.shift();
_local1.destroy();
};
var _local2:Number = 0;
while (_local2 < particles.length) {
particles[_local2].update();
_local2++;
};
}
private function enterFrame(_arg1:Event){
createNewParticle();
}
}
}//package com.midasplayer.particle
Section 35 (1.29 KiB) ●
//Particle (com.midasplayer.particle.Particle)
package com.midasplayer.particle {
import flash.display.*;
import flash.geom.*;
public class Particle {
private var _yVel:Number;
private var _xVel:Number;
private var _stageWidth:Number;
private var _stageHeight:Number;
private var _alphaDecr:Number;// = 0
private var clip:DisplayObject;
public function Particle(_arg1:Class, _arg2:DisplayObjectContainer, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){
_stageWidth = _arg5;
_stageHeight = _arg6;
clip = new (_arg1);
_arg2.addChild(clip);
clip.x = _arg3;
clip.y = _arg4;
}
public function update(){
clip.x = (clip.x + _xVel);
clip.y = (clip.y + _yVel);
clip.alpha = (clip.alpha - _alphaDecr);
}
public function setSize(_arg1:Number){
clip.width = _arg1;
clip.height = _arg1;
}
public function setColour(_arg1:Number){
var _local2:ColorTransform = new ColorTransform();
_local2.color = _arg1;
clip.transform.colorTransform = _local2;
}
public function setAlphaDecr(_arg1:Number):void{
_alphaDecr = _arg1;
}
public function destroy():void{
clip.parent.removeChild(clip);
clip = null;
}
public function setVel(_arg1:Number, _arg2:Number){
_xVel = _arg1;
_yVel = _arg2;
}
}
}//package com.midasplayer.particle
Section 36 (5.21 KiB) ● ●
//DragonLoader (com.midasplayer.DragonLoader)
package com.midasplayer {
import fl.transitions.easing.*;
import flash.events.*;
import fl.transitions.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
public class DragonLoader extends MovieClip {
public var m_fireLogoClip:MovieClip;
private var oldFrameRate:int;
private var m_glimmerTween:Tween;
public var m_bannedSign:MovieClip;
public var m_dragonClip:MovieClip;
private var m_bg:Sprite;
private var m_playBtnTween:Tween;
public var m_fireLogoTween:Tween;
private var m_glimmer:MovieClip;
public var m_playBtn:MovieClip;
private var m_sndBell:Sound;
public static var LAUNCH_GAME:String = "launchGame";
public function DragonLoader(){
this.x = (this.y = 0);
m_bannedSign.bg.width = stage.stageWidth;
m_bannedSign.bg.height = stage.stageHeight;
m_bannedSign.alpha = 0;
m_bannedSign.addEventListener(MouseEvent.CLICK, onMainMovie);
m_bannedSign.buttonMode = true;
m_fireLogoClip.x = ((m_bannedSign.bg.width - m_fireLogoClip.width) - 90);
m_fireLogoClip.y = (((m_bannedSign.bg.height / 2) - (m_fireLogoClip.height / 2)) - 60);
m_fireLogoClip.visible = false;
m_fireLogoClip.stop();
m_dragonClip.x = (m_bannedSign.bg.width - m_dragonClip.width);
m_dragonClip.y = ((m_bannedSign.bg.height / 2) - (m_dragonClip.height / 2));
m_dragonClip.stop();
m_playBtn.buttonMode = true;
m_playBtn.alpha = 0;
m_sndBell = new sfxBell();
}
public function destroy():void{
m_playBtn.removeEventListener(MouseEvent.ROLL_OVER, btnOver);
m_playBtn.removeEventListener(MouseEvent.ROLL_OUT, btnOut);
m_playBtn.removeEventListener(MouseEvent.MOUSE_DOWN, btnDown);
m_playBtn.removeEventListener(MouseEvent.MOUSE_UP, launchGame);
if (m_fireLogoTween != null){
m_fireLogoTween.removeEventListener(TweenEvent.MOTION_FINISH, logoInPlace);
m_fireLogoTween = null;
};
var _local1:Sprite = (this.parent.getChildByName("clickBg") as Sprite);
this.parent.removeChild(_local1);
this.parent.removeChild(this);
}
public function launchGame(_arg1:Event):void{
root.stage.frameRate = oldFrameRate;
trace(LAUNCH_GAME);
this.dispatchEvent(new Event(LAUNCH_GAME));
}
public function showBannedScreen():void{
m_bannedSign.alpha = 1;
}
public function playLoaderMovie():void{
this.addChild(m_dragonClip);
this.setChildIndex(m_dragonClip, 0);
m_dragonClip.addEventListener(Event.ENTER_FRAME, animationDone);
m_dragonClip.play();
}
private function logoVisible(_arg1:Event):void{
if (m_fireLogoClip.currentFrame == m_fireLogoClip.totalFrames){
m_fireLogoClip.removeEventListener(Event.ENTER_FRAME, logoVisible);
m_playBtnTween = new Tween(m_playBtn, "alpha", None.easeNone, 0, 1, 0.5, true);
m_glimmer = new mcGlimmer();
m_glimmer.x = (m_fireLogoClip.x - m_glimmer.width);
m_glimmer.y = (m_fireLogoClip.y + 112);
this.addChild(m_glimmer);
setTimeout(onGlimmerTmr, 1000, null);
};
}
public function init(_arg1:String, _arg2:String=""):void{
if (_arg2 != ""){
MochiBot.track(this, _arg2);
};
oldFrameRate = root.stage.frameRate;
root.stage.frameRate = 30;
if (KingAPI.banned){
showBannedScreen();
} else {
if (KingAPI.isHome){
launchGame(null);
} else {
playLoaderMovie();
};
};
}
private function btnOut(_arg1:MouseEvent):void{
m_playBtn.gotoAndStop("idle");
}
private function btnDown(_arg1:MouseEvent):void{
m_playBtn.gotoAndStop("down");
}
private function glimmerDone(_arg1:Event):void{
m_glimmerTween.removeEventListener(TweenEvent.MOTION_FINISH, glimmerDone);
this.removeChild(m_glimmer);
}
public function onMainMovie(_arg1:MouseEvent):void{
KingAPI.openLoaderMovieLink();
}
private function btnOver(_arg1:MouseEvent):void{
m_playBtn.gotoAndStop("over");
}
public function animationDone(_arg1:Event):void{
if (m_dragonClip.currentFrame == 80){
m_fireLogoClip.visible = true;
m_fireLogoClip.play();
m_fireLogoTween = new Tween(m_fireLogoClip, "x", Regular.easeOut, m_fireLogoClip.x, (((stage.width / 2) - (m_dragonClip.width / 2)) - 51), 1, true);
m_fireLogoTween.addEventListener(TweenEvent.MOTION_FINISH, logoInPlace);
};
if (m_dragonClip.currentFrame == m_dragonClip.totalFrames){
m_dragonClip.removeEventListener(Event.ENTER_FRAME, animationDone);
m_dragonClip.stop();
m_playBtn.x = ((stage.width / 2) - (m_playBtn.width / 2));
m_playBtn.y = (m_fireLogoClip.y + 210);
m_playBtn.addEventListener(MouseEvent.ROLL_OVER, btnOver);
m_playBtn.addEventListener(MouseEvent.ROLL_OUT, btnOut);
m_playBtn.addEventListener(MouseEvent.MOUSE_DOWN, btnDown);
m_playBtn.addEventListener(MouseEvent.MOUSE_UP, launchGame);
};
}
private function logoInPlace(_arg1:Event):void{
m_fireLogoClip.addEventListener(Event.ENTER_FRAME, logoVisible);
}
private function onGlimmerTmr(_arg1:Event):void{
var _local2:Number = (m_fireLogoClip.x - m_glimmer.width);
var _local3:Number = ((m_fireLogoClip.x + m_fireLogoClip.width) - 80);
m_glimmerTween = new Tween(m_glimmer, "x", None.easeNone, _local2, _local3, 0.5, true);
m_glimmerTween.addEventListener(TweenEvent.MOTION_FINISH, glimmerDone);
m_sndBell.play();
}
}
}//package com.midasplayer
Section 37 (7.53 KiB) ● ●
//KingAPI (com.midasplayer.KingAPI)
package com.midasplayer {
import flash.events.*;
import flash.net.*;
import flash.external.*;
public class KingAPI {
public static const LINK_TYPE_RIGHT_CLICK:String = "rightclick";
public static const LINK_TYPE_MONEY_GAME:String = "money_game";
public static const USER_TYPE_SUBSCRIPTION:int = 3;
public static const LINK_TYPE_HIGHSCORES:String = "highscores";
public static const LINK_TYPE_SIGN:String = "sign";
public static const INITIALIZED_EVENT:String = "initialized";
public static const LINK_TYPE_OTHER_GAMES:String = "other_games";
public static const USER_TYPE_REGISTERED:int = 1;
private static const SAK:String = "ggfd7sday923mdsfd8csfds34";
private static const loadHomeParametersURL:String = "http://www.king.com/servlet/FreeGameServlet?action=load";
public static const LINK_TYPE_LOADER_MOVIE:String = "loader_movie";
private static const bounceURL:String = "http://www.mygame.com/king/bounce.jsp";
public static const LINK_TYPE_PROTECT:String = "protect";
public static const LINK_TYPE_ADD_GAME:String = "add_game";
public static const USER_TYPE_GOLD:int = 2;
public static const USER_TYPE_UNREGISTERED:int = 0;
public static const HOST_BANNED_EVENT:String = "hostBanned";
private static const SK:String = "vf78hxcsjak77cxzhjkwad87s";
private static const loadCountURL:String = "http://www.mygame.com/king/loadcount.jsp";
public static const LINK_TYPE_LOADER_PROGRESS:String = "loader_progress";
private static var check:String = null;
public static var gameName:String;
public static var banned:Boolean = false;
protected static var dispatcher:EventDispatcher;
public static var isHome:Boolean = false;
private static var sessionID:String;
private static var iscore:int = 123;
public static var fromURL:String;
private static var SSK:String = "ng43ui54hy35tdsnd6f54rews";
private static function loadUrlErrorHandler(_arg1:Event):void{
trace(("Unable to load url: " + _arg1));
}
public static function resetScore():void{
iscore = 123;
check = null;
}
public static function openOfflineProtectionLink():void{
openKingPage(LINK_TYPE_PROTECT);
}
public static function init(_arg1:String, _arg2:String):void{
var so:SharedObject;
var rnd1:Number;
var rnd2:Number;
var name = _arg1;
var from = _arg2;
gameName = name;
fromURL = from;
var loadCounter:URLLoader = new URLLoader();
var reqvars:URLVariables = new URLVariables();
reqvars.game = gameName;
reqvars.from = fromURL;
try {
so = SharedObject.getLocal("sessionId");
if (so.data.sessionID == null){
rnd1 = Math.abs(Math.floor((Math.random() * 4294967295)));
rnd2 = Math.abs(Math.floor((Math.random() * 4294967295)));
so.data.sessionID = (rnd1.toString(16) + rnd2.toString(16));
so.flush();
};
sessionID = so.data.sessionID;
} catch(e:Error) {
sessionID = "error";
};
reqvars.session = sessionID;
var request:URLRequest = new URLRequest(((loadCountURL + "?") + reqvars.toString()));
loadCounter.addEventListener(Event.COMPLETE, loadCountHandler);
loadCounter.addEventListener(IOErrorEvent.IO_ERROR, loadUrlErrorHandler);
loadCounter.addEventListener(SecurityErrorEvent.SECURITY_ERROR, loadUrlErrorHandler);
try {
loadCounter.load(request);
} catch(error:Error) {
trace(("Unable to load loadcount url: " + loadCountURL));
trace(error.message);
};
}
private static function loadHomeParametersHandler(_arg1:Event):void{
var _local2:URLLoader = URLLoader(_arg1.target);
trace(("loadCounter.data" + _local2.data));
}
public static function submitInternalScore():void{
checkScore();
var _local1:int = ((iscore - 123) / 2);
submitScore(_local1);
}
public static function openOtherGamesLink():void{
openKingPage(LINK_TYPE_OTHER_GAMES);
}
public static function openKingPage(_arg1:String, _arg2:String=null):void{
var _local3:URLVariables = new URLVariables();
_local3.game = gameName;
_local3.from = fromURL;
_local3.type = _arg1;
_local3.session = sessionID;
if (_arg2 != null){
_local3.redirect = _arg2;
};
var _local4:String = "_blank";
if (isHome){
_local4 = "_top";
};
navigateToURL(new URLRequest(((bounceURL + "?") + _local3.toString())), _local4);
}
private static function loadCountHandler(_arg1:Event):void{
var vars:URLVariables;
var event = _arg1;
var loadCounter:URLLoader = URLLoader(event.target);
trace(("loadCounter.data :" + loadCounter.data));
try {
vars = new URLVariables(loadCounter.data);
if (vars.h == "true"){
isHome = true;
};
if (vars.b == "true"){
banned = true;
dispatcher.dispatchEvent(new Event(HOST_BANNED_EVENT));
} else {
dispatcher.dispatchEvent(new Event(INITIALIZED_EVENT));
};
trace((("::" + vars.h) + "::"));
trace((("::" + vars.b) + "::"));
} catch(e:Error) {
trace(("Error reading data from loadcount url: " + e));
};
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
if (dispatcher == null){
dispatcher = new EventDispatcher();
};
dispatcher.addEventListener(_arg1, _arg2);
}
public static function openLoaderMovieLink():void{
openKingPage(LINK_TYPE_LOADER_MOVIE);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
if (dispatcher == null){
return;
};
dispatcher.removeEventListener(_arg1, _arg2);
}
public static function submitScore(_arg1:int):void{
var score = _arg1;
var hash:String = md5.encrypt(((((score + ":") + gameName) + ":") + SSK));
try {
if (isHome){
ExternalInterface.call("submitScore", score, hash);
} else {
openKingPage(LINK_TYPE_HIGHSCORES, ((((("game/" + gameName) + "/submit/") + score) + ":") + hash));
};
} catch(e:Error) {
trace(e);
};
}
public static function submitLevel(_arg1:int):void{
var level = _arg1;
var hash:String = md5.encrypt(((((level + ":") + gameName) + ":") + SSK));
try {
if (isHome){
ExternalInterface.call("submitLevel", level, hash);
};
} catch(e:Error) {
trace(e);
};
}
public static function openMoneyLink(_arg1:String):void{
openKingPage(LINK_TYPE_MONEY_GAME, ("game/" + _arg1));
}
public static function openHighscoresLink():void{
openKingPage(LINK_TYPE_HIGHSCORES, (("game/" + gameName) + "/highscores"));
}
public static function openSignLink():void{
if (!(isHome)){
openKingPage(LINK_TYPE_SIGN);
};
}
public static function openRightClickLink():void{
openKingPage(LINK_TYPE_RIGHT_CLICK);
}
private static function checkScore():void{
if (check != null){
if (check != md5.encrypt(((((iscore + ":") + gameName) + ":") + SK))){
SSK = "ng41ui54hy35tdsnd6f54rews";
};
};
}
public static function addScore(_arg1:int):int{
checkScore();
var _local2:int = ((iscore - 123) / 2);
_local2 = (_local2 + _arg1);
iscore = ((_local2 * 2) + 123);
check = md5.encrypt(((((iscore + ":") + gameName) + ":") + SK));
return (_local2);
}
public static function openLoaderProgressLink():void{
openKingPage(LINK_TYPE_LOADER_PROGRESS);
}
public static function openAddToWebsiteLink():void{
openKingPage(LINK_TYPE_ADD_GAME, "website_content.jsp");
}
public static function submitAchievement(_arg1:String):void{
var achievement = _arg1;
var hash:String = md5.encrypt(((((achievement + ":") + gameName) + ":") + SAK));
try {
if (isHome){
ExternalInterface.call("submitAchievement", achievement, hash);
};
} catch(e:Error) {
trace(e);
};
}
}
}//package com.midasplayer
Section 38 (15.98 KiB) ● ● ●
//md5 (com.midasplayer.md5)
package com.midasplayer {
public class md5 {
public static const HEX_FORMAT_LOWERCASE:uint = 0;
public static const HEX_FORMAT_UPPERCASE:uint = 1;
public static const BASE64_PAD_CHARACTER_DEFAULT_COMPLIANCE:String = "";
public static const BASE64_PAD_CHARACTER_RFC_COMPLIANCE:String = "=";
public static var hexcase:uint = 0;
public static var b64pad:String = "";
public static function md5_gg(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg4) | (_arg3 & ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function md5_cmn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
return (safe_add(bit_rol(safe_add(safe_add(_arg2, _arg1), safe_add(_arg4, _arg6)), _arg5), _arg3));
}
public static function binl_md5(_arg1:Array, _arg2:Number):Array{
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_arg1[(_arg2 >> 5)] = (_arg1[(_arg2 >> 5)] | (128 << (_arg2 % 32)));
_arg1[((((_arg2 + 64) >>> 9) << 4) + 14)] = _arg2;
var _local3:Number = 1732584193;
var _local4:Number = -271733879;
var _local5:Number = -1732584194;
var _local6:Number = 271733878;
var _local7:Number = 0;
while (_local7 < _arg1.length) {
_local8 = _local3;
_local9 = _local4;
_local10 = _local5;
_local11 = _local6;
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 7, -680876936);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 1)], 12, -389564586);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 17, 606105819);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 3)], 22, -1044525330);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 7, -176418897);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 5)], 12, 1200080426);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 17, -1473231341);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 7)], 22, -45705983);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 7, 1770035416);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 9)], 12, -1958414417);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 17, -42063);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 11)], 22, -1990404162);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 7, 1804603682);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 13)], 12, -40341101);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 17, -1502002290);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 15)], 22, 1236535329);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 5, -165796510);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 6)], 9, -1069501632);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 14, 643717713);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 0)], 20, -373897302);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 5, -701558691);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 10)], 9, 38016083);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 14, -660478335);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 4)], 20, -405537848);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 5, 568446438);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 14)], 9, -1019803690);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 14, -187363961);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 8)], 20, 1163531501);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 5, -1444681467);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 2)], 9, -51403784);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 14, 1735328473);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 12)], 20, -1926607734);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 4, -378558);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 8)], 11, -2022574463);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 16, 1839030562);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 14)], 23, -35309556);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 4, -1530992060);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 4)], 11, 1272893353);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 16, -155497632);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 10)], 23, -1094730640);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 4, 681279174);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 0)], 11, -358537222);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 16, -722521979);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 6)], 23, 76029189);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 4, -640364487);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 12)], 11, -421815835);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 16, 530742520);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 2)], 23, -995338651);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 6, -198630844);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 7)], 10, 1126891415);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 15, -1416354905);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 5)], 21, -57434055);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 6, 1700485571);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 3)], 10, -1894986606);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 15, -1051523);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 1)], 21, -2054922799);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 6, 1873313359);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 15)], 10, -30611744);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 15, -1560198380);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 13)], 21, 1309151649);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 6, -145523070);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 11)], 10, -1120210379);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 15, 718787259);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 9)], 21, -343485551);
_local3 = safe_add(_local3, _local8);
_local4 = safe_add(_local4, _local9);
_local5 = safe_add(_local5, _local10);
_local6 = safe_add(_local6, _local11);
_local7 = (_local7 + 16);
};
return ([_local3, _local4, _local5, _local6]);
}
public static function str2rstr_utf16le(_arg1:String):String{
var _local2:String = "";
var _local3:Number = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode((_arg1.charCodeAt(_local3) & 0xFF), ((_arg1.charCodeAt(_local3) >>> 8) & 0xFF)));
_local3++;
};
return (_local2);
}
public static function hex_hmac_md5(_arg1:String, _arg2:String):String{
return (rstr2hex(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2))));
}
public static function binl2rstr(_arg1:Array):String{
var _local2:String = "";
var _local3:Number = 0;
while (_local3 < (_arg1.length * 32)) {
_local2 = (_local2 + String.fromCharCode(((_arg1[(_local3 >> 5)] >>> (_local3 % 32)) & 0xFF)));
_local3 = (_local3 + 8);
};
return (_local2);
}
public static function md5_ff(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg3) | (~(_arg2) & _arg4)), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function md5_ii(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn((_arg3 ^ (_arg2 | ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function rstr2binl(_arg1:String):Array{
var _local2:Number = 0;
var _local3:Array = new Array((_arg1.length >> 2));
_local2 = 0;
while (_local2 < _local3.length) {
_local3[_local2] = 0;
_local2++;
};
_local2 = 0;
while (_local2 < (_arg1.length * 8)) {
_local3[(_local2 >> 5)] = (_local3[(_local2 >> 5)] | ((_arg1.charCodeAt((_local2 / 8)) & 0xFF) << (_local2 % 32)));
_local2 = (_local2 + 8);
};
return (_local3);
}
public static function md5_vm_test():Boolean{
return ((hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"));
}
public static function b64_md5(_arg1:String):String{
return (rstr2b64(rstr_md5(str2rstr_utf8(_arg1))));
}
public static function any_hmac_md5(_arg1:String, _arg2:String, _arg3:String):String{
return (rstr2any(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2)), _arg3));
}
public static function hex_md5(_arg1:String):String{
return (rstr2hex(rstr_md5(str2rstr_utf8(_arg1))));
}
public static function bit_rol(_arg1:Number, _arg2:Number):Number{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
public static function encrypt(_arg1:String):String{
return (hex_md5(_arg1));
}
public static function md5_hh(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 ^ _arg3) ^ _arg4), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function rstr2hex(_arg1:String):String{
var _local4:Number;
var _local2:String = (hexcase) ? "0123456789ABCDEF" : "0123456789abcdef";
var _local3:String = "";
var _local5:Number = 0;
while (_local5 < _arg1.length) {
_local4 = _arg1.charCodeAt(_local5);
_local3 = (_local3 + (_local2.charAt(((_local4 >>> 4) & 15)) + _local2.charAt((_local4 & 15))));
_local5++;
};
return (_local3);
}
public static function any_md5(_arg1:String, _arg2:String):String{
return (rstr2any(rstr_md5(str2rstr_utf8(_arg1)), _arg2));
}
public static function b64_hmac_md5(_arg1:String, _arg2:String):String{
return (rstr2b64(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2))));
}
public static function rstr2b64(_arg1:String):String{
var _local6:Number;
var _local7:Number;
var _local2:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var _local3:String = "";
var _local4:Number = _arg1.length;
var _local5:Number = 0;
while (_local5 < _local4) {
_local6 = (((_arg1.charCodeAt(_local5) << 16) | (((_local5 + 1) < _local4)) ? (_arg1.charCodeAt((_local5 + 1)) << 8) : 0) | (((_local5 + 2) < _local4)) ? _arg1.charCodeAt((_local5 + 2)) : 0);
_local7 = 0;
while (_local7 < 4) {
if (((_local5 * 8) + (_local7 * 6)) > (_arg1.length * 8)){
_local3 = (_local3 + b64pad);
} else {
_local3 = (_local3 + _local2.charAt(((_local6 >>> (6 * (3 - _local7))) & 63)));
};
_local7++;
};
_local5 = (_local5 + 3);
};
return (_local3);
}
public static function safe_add(_arg1:Number, _arg2:Number):Number{
var _local3:Number = ((_arg1 & 0xFFFF) + (_arg2 & 0xFFFF));
var _local4:Number = (((_arg1 >> 16) + (_arg2 >> 16)) + (_local3 >> 16));
return (((_local4 << 16) | (_local3 & 0xFFFF)));
}
public static function str2rstr_utf8(_arg1:String):String{
var _local4:Number;
var _local5:Number;
var _local2:String = "";
var _local3:Number = -1;
while (++_local3 < _arg1.length) {
_local4 = _arg1.charCodeAt(_local3);
_local5 = (((_local3 + 1) < _arg1.length)) ? _arg1.charCodeAt((_local3 + 1)) : 0;
if ((((((((0xD800 <= _local4)) && ((_local4 <= 56319)))) && ((0xDC00 <= _local5)))) && ((_local5 <= 57343)))){
_local4 = ((65536 + ((_local4 & 1023) << 10)) + (_local5 & 1023));
_local3++;
};
if (_local4 <= 127){
_local2 = (_local2 + String.fromCharCode(_local4));
} else {
if (_local4 <= 2047){
_local2 = (_local2 + String.fromCharCode((192 | ((_local4 >>> 6) & 31)), (128 | (_local4 & 63))));
} else {
if (_local4 <= 0xFFFF){
_local2 = (_local2 + String.fromCharCode((224 | ((_local4 >>> 12) & 15)), (128 | ((_local4 >>> 6) & 63)), (128 | (_local4 & 63))));
} else {
if (_local4 <= 2097151){
_local2 = (_local2 + String.fromCharCode((240 | ((_local4 >>> 18) & 7)), (128 | ((_local4 >>> 12) & 63)), (128 | ((_local4 >>> 6) & 63)), (128 | (_local4 & 63))));
};
};
};
};
};
return (_local2);
}
public static function rstr_hmac_md5(_arg1:String, _arg2:String):String{
var _local3:Array = rstr2binl(_arg1);
if (_local3.length > 16){
_local3 = binl_md5(_local3, (_arg1.length * 8));
};
var _local4:Array = new Array(16);
var _local5:Array = new Array(16);
var _local6:Number = 0;
while (_local6 < 16) {
_local4[_local6] = (_local3[_local6] ^ 909522486);
_local5[_local6] = (_local3[_local6] ^ 1549556828);
_local6++;
};
var _local7:Array = binl_md5(_local4.concat(rstr2binl(_arg2)), (0x0200 + (_arg2.length * 8)));
return (binl2rstr(binl_md5(_local5.concat(_local7), (0x0200 + 128))));
}
public static function str2rstr_utf16be(_arg1:String):String{
var _local2:String = "";
var _local3:Number = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(((_arg1.charCodeAt(_local3) >>> 8) & 0xFF), (_arg1.charCodeAt(_local3) & 0xFF)));
_local3++;
};
return (_local2);
}
public static function rstr2any(_arg1:String, _arg2:String):String{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
var _local3:Number = _arg2.length;
var _local4:Array = [];
var _local9:Array = ((_arg1.length / 2) as Array);
_local5 = 0;
while (_local5 < _local9.length) {
_local9[_local5] = ((_arg1.charCodeAt((_local5 * 2)) << 8) | _arg1.charCodeAt(((_local5 * 2) + 1)));
_local5++;
};
while (_local9.length > 0) {
_local8 = [];
_local7 = 0;
_local5 = 0;
while (_local5 < _local9.length) {
_local7 = ((_local7 << 16) + _local9[_local5]);
_local6 = Math.floor((_local7 / _local3));
_local7 = (_local7 - (_local6 * _local3));
if ((((_local8.length > 0)) || ((_local6 > 0)))){
_local8[_local8.length] = _local6;
};
_local5++;
};
_local4[_local4.length] = _local7;
_local9 = _local8;
};
var _local10:String = "";
_local5 = (_local4.length - 1);
while (_local5 >= 0) {
_local10 = (_local10 + _arg2.charAt(_local4[_local5]));
_local5--;
};
return (_local10);
}
public static function rstr_md5(_arg1:String):String{
return (binl2rstr(binl_md5(rstr2binl(_arg1), (_arg1.length * 8))));
}
}
}//package com.midasplayer
Section 39 (730 B)
//None (fl.transitions.easing.None)
package fl.transitions.easing {
public class None {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package fl.transitions.easing
Section 40 (804 B)
//Regular (fl.transitions.easing.Regular)
package fl.transitions.easing {
public class Regular {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package fl.transitions.easing
Section 41 (5.65 KiB) ● ●
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var begin:Number;// = NAN
private var _finish:Number;// = NAN
public var change:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
this.func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
super();
if (!(arguments.length)){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!(isNaN(_arg2))){
this.duration = _arg2;
};
this.start();
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!(this.useSeconds)){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 42 (932 B)
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var position:Number;// = NAN
public var time:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 43 (145 B)
//BombExplode (sound.BombExplode)
package sound {
import flash.media.*;
public dynamic class BombExplode extends Sound {
}
}//package sound
Section 44 (139 B)
//DemonFire (sound.DemonFire)
package sound {
import flash.media.*;
public dynamic class DemonFire extends Sound {
}
}//package sound
Section 45 (139 B)
//GameMusic (sound.GameMusic)
package sound {
import flash.media.*;
public dynamic class GameMusic extends Sound {
}
}//package sound
Section 46 (151 B)
//HappyEndMusic (sound.HappyEndMusic)
package sound {
import flash.media.*;
public dynamic class HappyEndMusic extends Sound {
}
}//package sound
Section 47 (151 B)
//HealthWarning (sound.HealthWarning)
package sound {
import flash.media.*;
public dynamic class HealthWarning extends Sound {
}
}//package sound
Section 48 (136 B)
//HurtFire (sound.HurtFire)
package sound {
import flash.media.*;
public dynamic class HurtFire extends Sound {
}
}//package sound
Section 49 (145 B)
//HurtMonster (sound.HurtMonster)
package sound {
import flash.media.*;
public dynamic class HurtMonster extends Sound {
}
}//package sound
Section 50 (142 B)
//IntroMusic (sound.IntroMusic)
package sound {
import flash.media.*;
public dynamic class IntroMusic extends Sound {
}
}//package sound
Section 51 (136 B)
//KickBomb (sound.KickBomb)
package sound {
import flash.media.*;
public dynamic class KickBomb extends Sound {
}
}//package sound
Section 52 (142 B)
//LobberToss (sound.LobberToss)
package sound {
import flash.media.*;
public dynamic class LobberToss extends Sound {
}
}//package sound
Section 53 (148 B)
//MonsterDeath (sound.MonsterDeath)
package sound {
import flash.media.*;
public dynamic class MonsterDeath extends Sound {
}
}//package sound
Section 54 (148 B)
//MonsterSpawn (sound.MonsterSpawn)
package sound {
import flash.media.*;
public dynamic class MonsterSpawn extends Sound {
}
}//package sound
Section 55 (142 B)
//OpenSecret (sound.OpenSecret)
package sound {
import flash.media.*;
public dynamic class OpenSecret extends Sound {
}
}//package sound
Section 56 (139 B)
//PlantBomb (sound.PlantBomb)
package sound {
import flash.media.*;
public dynamic class PlantBomb extends Sound {
}
}//package sound
Section 57 (139 B)
//TakeFood1 (sound.TakeFood1)
package sound {
import flash.media.*;
public dynamic class TakeFood1 extends Sound {
}
}//package sound
Section 58 (139 B)
//TakeFood2 (sound.TakeFood2)
package sound {
import flash.media.*;
public dynamic class TakeFood2 extends Sound {
}
}//package sound
Section 59 (139 B)
//TakeFood3 (sound.TakeFood3)
package sound {
import flash.media.*;
public dynamic class TakeFood3 extends Sound {
}
}//package sound
Section 60 (139 B)
//TakeFood4 (sound.TakeFood4)
package sound {
import flash.media.*;
public dynamic class TakeFood4 extends Sound {
}
}//package sound
Section 61 (133 B)
//TakeKey (sound.TakeKey)
package sound {
import flash.media.*;
public dynamic class TakeKey extends Sound {
}
}//package sound
Section 62 (145 B)
//TakePowerup (sound.TakePowerup)
package sound {
import flash.media.*;
public dynamic class TakePowerup extends Sound {
}
}//package sound
Section 63 (151 B)
//TakeTreasure1 (sound.TakeTreasure1)
package sound {
import flash.media.*;
public dynamic class TakeTreasure1 extends Sound {
}
}//package sound
Section 64 (151 B)
//TakeTreasure2 (sound.TakeTreasure2)
package sound {
import flash.media.*;
public dynamic class TakeTreasure2 extends Sound {
}
}//package sound
Section 65 (136 B)
//Teleport (sound.Teleport)
package sound {
import flash.media.*;
public dynamic class Teleport extends Sound {
}
}//package sound
Section 66 (145 B)
//TimeWarning (sound.TimeWarning)
package sound {
import flash.media.*;
public dynamic class TimeWarning extends Sound {
}
}//package sound
Section 67 (151 B)
//TreasureDeath (sound.TreasureDeath)
package sound {
import flash.media.*;
public dynamic class TreasureDeath extends Sound {
}
}//package sound
Section 68 (130 B)
//UseKey (sound.UseKey)
package sound {
import flash.media.*;
public dynamic class UseKey extends Sound {
}
}//package sound
Section 69 (139 B)
//UsePotion (sound.UsePotion)
package sound {
import flash.media.*;
public dynamic class UsePotion extends Sound {
}
}//package sound
Section 70 (136 B)
//WinLevel (sound.WinLevel)
package sound {
import flash.media.*;
public dynamic class WinLevel extends Sound {
}
}//package sound
Section 71 (2.04 KiB) ●
//Bomb (src.entity.bomb.Bomb)
package src.entity.bomb {
import src.player.*;
import flash.utils.*;
import src.entity.*;
public class Bomb extends Mob {
public var player:Player;
private var ya:int;// = 0
private var xa:int;// = 0
private var lifeTime:int;// = 30
private var step:int;// = 0
private var lastKickTime:int;// = 0
private static var KICK_SPEED:int = 6;
public function Bomb(_arg1:Player, _arg2:int, _arg3:int){
super(_arg2, _arg3);
this.player = _arg1;
this.x = _arg2;
this.y = _arg3;
slide = false;
}
override public function render():void{
var _local1:int = ((((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 blocks(_arg1:GameEntity):Boolean{
if ((_arg1 is BomberMan)){
melee(BomberMan(_arg1));
return (true);
};
return (true);
}
public function blowUp():void{
playSound("BombExplode");
player.activeBombs--;
level.addEntity(new BombExplosion(this));
remove();
}
override public function blocksBomb(_arg1:Bomb):Boolean{
return (true);
}
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);
}
override public function init():void{
player.activeBombs++;
setAlwaysTick();
}
override public function initialBurn(_arg1:Fire):Boolean{
blowUp();
return (true);
}
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();
};
}
public function getPlayer():Player{
return (player);
}
}
}//package src.entity.bomb
Section 72 (1.39 KiB) ●
//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){
this.bomb = _arg1;
this.x = _arg1.x;
this.y = _arg1.y;
}
override public function init():void{
setAlwaysTick();
}
override public function render():void{
var _local1:int = ((((step + level.alpha) * 3) / 8) + 3);
drawImage(gr.bomb, _local1, 0, -8, (-8 - 2));
}
override public function blocksBomb(_arg1:Bomb):Boolean{
return (true);
}
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();
};
}
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 73 (3.91 KiB) ●
//Fire (src.entity.bomb.Fire)
package src.entity.bomb {
import src.entity.*;
import src.player.*;
public class Fire extends GameEntity {
private var hurtTime:int;
public var explosion:BombExplosion;
private var power:int;
private var step:int;// = 0
private var dir:int;
private var speed:Number;
private var blowDelay:int;// = 1
private var slidePower:Number;
private var life:int;// = 16
public function Fire(_arg1:BombExplosion, _arg2:int, _arg3:int, _arg4:int, _arg5:int){
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 blocksBomb(_arg1:Bomb):Boolean{
return ((step < hurtTime));
}
override public function init():void{
setAlwaysTick();
}
private function attemptFire(_arg1:Fire):Boolean{
var _local4:GameEntity;
var _local2:Array = level.blockMap.getIntersectingEntity(_arg1);
var _local3:int;
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;
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;
};
};
var _local2:Number = 0;
var _local3:Number = 0;
if (dir == 0){
_local3 = -1;
};
if (dir == 1){
_local2 = -1;
};
if (dir == 2){
_local3 = 1;
};
if (dir == 3){
_local2 = 1;
};
var _local4:int = int(((((step * speed) * 18) / life) + 1));
var _local5:Number = (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)));
};
}
public function getPlayer():Player{
return (explosion.getPlayer());
}
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();
};
}
}
}//package src.entity.bomb
Section 74 (763 B)
//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 renderStatic():void{
drawStatic(gr.special, 0, 0);
}
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 render():void{
}
}
}//package src.entity.level
Section 75 (2.17 KiB) ●
//Teleporter (src.entity.level.Teleporter)
package src.entity.level {
import src.entity.*;
public class Teleporter extends GameEntity {
var frames:Array;
public var activateTime:int;// = 0
public var step:int;// = 0
public function Teleporter(_arg1:int, _arg2:int){
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 76 (869 B)
//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){
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 = frames[((int(((step + level.alpha) * 3)) >> 3) % frames.length)];
if (_local1 >= 0){
drawImage(gr.special, _local1, 1, -8, -8);
};
}
}
}//package src.entity.level
Section 77 (1.29 KiB) ●
//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 xo:int;
public var yt:int;// = 0
public var xt:int;// = 0
public static var BULLET_DURATION:int = 15;
public function Bullet(_arg1:int, _arg2:int, _arg3:int, _arg4:int){
this.xo = (this.x = _arg1);
this.yo = (this.y = _arg2);
this.xt = _arg3;
this.yt = _arg4;
}
override public function render():void{
var _local1:int = ((tickCount * 8) / BULLET_DURATION);
if (_local1 > 3){
_local1 = (3 - (_local1 - 4));
};
drawImage(gr.bullet, _local1, 0, -8, -14);
}
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();
};
}
}
}//package src.entity.monster
Section 78 (729 B)
//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){
super(_arg1, _arg2);
meleeDamage = 1;
meleeInterval = 0;
}
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);
}
override public function init():void{
super.init();
sheet = gr.death;
scoreOnPotion = 10;
}
}
}//package src.entity.monster
Section 79 (819 B)
//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 80 (1.66 KiB) ●
//FireBall (src.entity.monster.FireBall)
package src.entity.monster {
import src.entity.*;
public class FireBall extends Mob {
public var ya:int;// = 0
public var xa:int;// = 0
private var dir:int;
private var tickCount:int;// = 0
public function FireBall(_arg1:int, _arg2:int, _arg3:int){
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 melee(_arg1:BomberMan):Boolean{
if (((!(alive)) || (removed))){
return (false);
};
return (meleed(_arg1));
}
override public function render():void{
var _local1:int = 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 init():void{
slide = false;
setAlwaysTick();
}
override public function tick():void{
var _local1:int;
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);
}
}
}//package src.entity.monster
Section 81 (721 B)
//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 melee(_arg1:BomberMan):Boolean{
if (((!(alive)) || (removed))){
return (false);
};
super.melee(_arg1);
remove();
return (false);
}
override public function meleed(_arg1:BomberMan):Boolean{
if (((!(alive)) || (removed))){
return (false);
};
super.melee(_arg1);
remove();
return (false);
}
}
}//package src.entity.monster
Section 82 (309 B)
//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 83 (3.47 KiB) ●
//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 xSlice:int;// = 0
private var ySliceSize:int;// = 0
private var ySlice:int;// = 0
private var xSliceSize:int;// = 0
private var spawnInterval:int;// = 60
private var ySliceOffs:int;// = 0
private var spawnTime:int;// = 0
private var damage:int;// = 0
private var bmd:BitmapData;
private var type:int;// = 0
private var xSliceOffs:int;// = 0
public function House(_arg1:int, _arg2:int, _arg3:int){
this.type = _arg3;
this.x = _arg1;
this.y = _arg2;
layer = 0;
}
override public function initialBurn(_arg1:Fire):Boolean{
level.monsterInteracted();
damage = (damage + 2);
var _local2:int;
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 remove():void{
super.remove();
clearStatic();
}
override public function potionActivated(_arg1:Player):void{
damage = (damage + 2);
if (damage >= 3){
remove();
};
}
override public function blocks(_arg1:GameEntity):Boolean{
if (_arg1 == this){
return (false);
};
return (true);
}
override public function render():void{
xSlice = damage;
gr.drawCustom(bmd, (xSlice * xSliceSize), (ySlice * ySliceSize), xSliceSize, ySliceSize, ((x * 2) + xSliceOffs), ((y * 2) + ySliceOffs));
}
override public function init():void{
xSlice = 0;
ySlice = 0;
var _local1:int = 3;
var _local2:int = 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;
};
}
private function attemptSpawn():void{
var _local1:int = ((random.nextInt(3) * 12) - 12);
var _local2:int = ((random.nextInt(3) * 12) - 12);
var _local3:Monster;
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);
};
}
}
}//package src.entity.monster
Section 84 (1.24 KiB) ●
//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 85 (4.51 KiB) ●
//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 speed:int;// = 3
protected var stationaryDistance:int;// = 0
protected var step:int;// = 0
protected var dir:int;// = 0
private var move:Boolean;// = true
protected var meleeInterval:int;// = 10
protected var wanderTime:int;// = 0
protected var blocksFire:Boolean;// = false
protected var hurtOnMeleed:Boolean;// = false
protected var sheet:BitmapData;
protected var ss:int;// = 0
protected var meleeDelay:int;// = 0
protected var killValue:int;// = 5
protected var fleeDistance:int;// = 0
public static var firstMonster:Monster = null;
public function Monster(_arg1:int, _arg2:int){
super(_arg1, _arg2);
xRadius = (yRadius = 6);
if (firstMonster == null){
firstMonster = this;
};
}
override public function potionActivated(_arg1:Player):void{
if (scoreOnPotion > 0){
_arg1.addScore(scoreOnPotion);
};
remove();
}
override public function remove():void{
playSound("MonsterDeath");
var _local1:int;
while (_local1 < 20) {
level.addParticle(new EnemyDeathParticle((x * 2), (y * 2)));
_local1++;
};
level.monsterInteracted();
super.remove();
}
override public function burn(_arg1:Fire):Boolean{
_arg1.getPlayer().addScore(killValue);
remove();
return (blocksFire);
}
override public function init():void{
step = random.nextInt(16);
dir = random.nextInt(8);
}
override public function render():void{
var _local1:int = ((int(((step + level.alpha) * 3)) / 8) & 1);
drawImage(sheet, (((dir % 2) * 2) + _local1), (dir / 2), -8, -9);
}
override public function melee(_arg1:BomberMan):Boolean{
if (meleeDelay > 0){
return (true);
};
meleeDelay = meleeInterval;
_arg1.hurt(meleeDamage);
level.monsterInteracted();
return (true);
}
override public function tick():void{
ss = (ss + 3);
while ((((ss >= speed)) && (!(removed)))) {
ss = (ss - 3);
performTick();
};
}
private function performTick():void{
var _local4:int;
var _local5:int;
if (meleeDelay > 0){
meleeDelay--;
};
var _local1:BomberMan = 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;
};
};
};
var _local2:int;
var _local3:int;
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 meleed(_arg1:BomberMan):Boolean{
level.monsterInteracted();
if (hurtOnMeleed){
return (melee(_arg1));
};
return (true);
}
}
}//package src.entity.monster
Section 86 (1.22 KiB) ●
//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){
super(_arg1, _arg2);
}
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 = ((int(((step + level.alpha) * 3)) / 8) & 1);
drawImage(sheet, _local1, (blink) ? 1 : 0, -8, -8);
}
override public function init():void{
super.init();
blinkTime = random.nextInt(BLINK_INTERVAL);
sheet = gr.sorcerer;
speed = 4;
}
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 87 (798 B)
//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 getParticleType():int{
return (1);
}
override public function take(_arg1:BomberMan):Boolean{
_arg1.getPlayer().addHealth(getValue(level));
playSound(("TakeFood" + (value + 1)), 0.7);
return (true);
}
public function getValue(_arg1:Level):int{
return (((value + 1) * _arg1.getFoodValue()));
}
override protected function burned(_arg1:Fire):void{
}
}
}//package src.entity.pickup
Section 88 (456 B)
//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 89 (1.73 KiB) ●
//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 blockFire:Boolean;// = true
public var yImage:int;
public var xImage:int;
public var blowUp:Boolean;// = true
public function Pickup(_arg1:int, _arg2:int){
this.x = _arg1;
this.y = _arg2;
layer = -2;
}
public function take(_arg1:BomberMan):Boolean{
return (true);
}
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);
}
protected function burned(_arg1:Fire):void{
}
override public function remove():void{
super.remove();
clearStatic();
}
override public function blocks(_arg1:GameEntity):Boolean{
if (_arg1 == this){
return (false);
};
if ((_arg1 is BomberMan)){
melee(BomberMan(_arg1));
return (false);
};
return (blockPassage);
}
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);
}
override public function renderStatic():void{
drawStatic(gr.pickup, xImage, yImage);
}
override public function render():void{
}
}
}//package src.entity.pickup
Section 90 (657 B)
//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 protected function burned(_arg1:Fire):void{
level.activatePotion(_arg1.getPlayer());
}
override public function take(_arg1:BomberMan):Boolean{
if (!(_arg1.getPlayer().canGetPowerup())){
return (false);
};
playSound("TakePowerup");
_arg1.getPlayer().addPotion();
return (true);
}
}
}//package src.entity.pickup
Section 91 (799 B)
//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 protected function burned(_arg1:Fire):void{
super.burned(_arg1);
}
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);
}
}
}//package src.entity.pickup
Section 92 (669 B)
//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;
}
public function getValue():int{
return (((value + 1) * 50));
}
override public function getParticleType():int{
return (2);
}
override public function take(_arg1:BomberMan):Boolean{
playSound(("TakeTreasure" + (value + 1)), 0.5);
_arg1.getPlayer().addScore(getValue());
return (true);
}
}
}//package src.entity.pickup
Section 93 (7.37 KiB) ● ●
//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 yya:int;
public var animation:TeleportAnimation;
public var ya:int;
private var step:int;// = 0
private var dir:int;// = 0
private var player:Player;
public var color:int;// = 0
public var xxa:int;
public var xa:int;
private var lastHurtTime:int;// = 0
private static var ALLOW_DIAGONAL_MOVEMENT:Boolean = true;
public function BomberMan(_arg1:int, _arg2:int, _arg3:Player){
super(_arg1, _arg2);
this.player = _arg3;
this.color = color;
}
public function die():void{
var _local1:DeathAnim = new DeathAnim(this, player);
level.addEntity(_local1);
level.camera.add(_local1);
remove();
}
private function attemptBomb(_arg1:int, _arg2:int):Boolean{
var _local6:GameEntity;
if (!(level.isFree((_arg1 >> 4), (_arg2 >> 4)))){
return (false);
};
var _local3:Bomb = new Bomb(player, (((_arg1 >> 4) * 16) + 8), (((_arg2 >> 4) * 16) + 8));
var _local4:Array = level.blockMap.getIntersectingEntity(_local3);
var _local5:int;
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 blocks(_arg1:GameEntity):Boolean{
if (animation != null){
return (false);
};
_arg1.melee(this);
return (true);
}
override public function render():void{
if (animation != null){
animation.render();
return;
};
var _local1:int = ((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;
while (_local1 < 3) {
performTick();
if (_local1 > 0){
player.controller.tick();
};
_local1++;
};
}
override public function burn(_arg1:Fire):Boolean{
if (player.hitByFire()){
playSound("HurtFire");
};
return (false);
}
private function performTick():void{
if (animation != null){
animation.tick();
return;
};
var _local1:Boolean;
var _local2:Boolean = player.controller.buttons[Controller.BUTTON_DOWN];
var _local3:Boolean = player.controller.buttons[Controller.BUTTON_RIGHT];
var _local4:Boolean = player.controller.buttons[Controller.BUTTON_UP];
var _local5:Boolean = player.controller.buttons[Controller.BUTTON_LEFT];
var _local6:Boolean = player.controller.old[Controller.BUTTON_DOWN];
var _local7:Boolean = player.controller.old[Controller.BUTTON_RIGHT];
var _local8:Boolean = player.controller.old[Controller.BUTTON_UP];
var _local9:Boolean = 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 getPlayer():Player{
return (player);
}
public function hurt(_arg1:int):void{
if ((((_arg1 < 100)) && (((getTimer() - lastHurtTime) > 200)))){
lastHurtTime = getTimer();
playSound("HurtMonster");
};
var _local2:int;
while (_local2 < _arg1) {
level.addParticle(new HurtPlayerParticle((x * 2), (y * 2)));
_local2 = (_local2 + 50);
};
player.hurt(_arg1);
}
public function teleport(_arg1:int, _arg2:int):void{
animation = new TeleportAnimation(this, _arg1, _arg2);
}
public function hasKey():Boolean{
return ((player.keys > 0));
}
public function exit(_arg1:Exit):void{
var _local2:ExitAnim = new ExitAnim(this, player, _arg1.x, _arg1.y);
level.addEntity(_local2);
level.camera.add(_local2);
player.setExit(_arg1.toLevel);
remove();
}
public function removeKey():void{
player.keys--;
}
public function addKey():void{
player.keys++;
}
override public function monsterFireDamage(_arg1:Bullet, _arg2:int):void{
hurt(_arg2);
level.monsterInteracted();
}
}
}//package src.entity
Section 94 (987 B)
//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){
_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 _local2:int;
var _local3:int;
var _local1:int = (((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 95 (1.02 KiB) ●
//ExitAnim (src.entity.ExitAnim)
package src.entity {
import src.player.*;
public class ExitAnim extends GameEntity {
private var xTarget:int;
private var xStart:int;
private var exitTime:int;// = 0
var frame:Array;
private var yStart:int;
private var yTarget:int;
public function ExitAnim(_arg1:BomberMan, _arg2:Player, _arg3:int, _arg4:int){
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 render():void{
var _local1:int = int((((exitTime + level.alpha) * 3) / 2));
var _local2:int = (_local1 % 8);
drawImage47x50(gr.player, (((_local2 % 2) * 3) + 0), (_local2 / 2), -8, ((-16 - 8) - 4));
}
override public function tick():void{
exitTime++;
x = (xStart + (((xTarget - xStart) * exitTime) / 64));
y = (yStart + (((yTarget - yStart) * exitTime) / 64));
if (exitTime == 21){
remove();
};
}
}
}//package src.entity
Section 96 (5.08 KiB) ● ●
//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 xOld:int;
public var id: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++;
super();
}
public function drawImage32x32(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:Number, _arg5:Number):void{
var _local6:int = int((((xPrev * 2) + (((x - xPrev) * 2) * level.alpha)) + (_arg4 * 2)));
var _local7:int = int((((yPrev * 2) + (((y - yPrev) * 2) * level.alpha)) + (_arg5 * 2)));
gr.drawSprite32x32(_arg1, _arg2, _arg3, _local6, _local7);
}
public function potionActivated(_arg1:Player):void{
}
public function remove():void{
if (removed){
return;
};
removed = true;
level.blockMap.remove(this);
level.removeEntity(this);
}
public function init():void{
}
public function meleed(_arg1:BomberMan):Boolean{
return (true);
}
public function blocks(_arg1:GameEntity):Boolean{
return (false);
}
public function render():void{
}
public function drawImage47x50(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
var _local6:int = int(((xPrev * 2) + (((x - xPrev) * 2) * level.alpha)));
var _local7:int = 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 = (x >> 4);
var _local2:int = (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 = (x - (level.camera.x + (level.camera.width / 2)));
var _local4:Number = (_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 = int(((xPrev * 2) + (((x - xPrev) * 2) * level.alpha)));
var _local9:int = 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 = (x >> 4);
var _local5:int = (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 = int(((xPrev * 2) + (((x - xPrev) * 2) * level.alpha)));
var _local7:int = 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 = int(((xPrev * 2) + (((x - xPrev) * 2) * level.alpha)));
var _local7:int = 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 = int((x * 2));
var _local7:int = int((y * 2));
gr.drawSprite(_arg1, _arg2, _arg3, _local6, _local7);
}
}
}//package src.entity
Section 97 (2.83 KiB) ●
//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){
this.x = _arg1;
this.y = _arg2;
}
override public function blocks(_arg1:GameEntity):Boolean{
if (_arg1 == this){
return (false);
};
var _local2:Boolean = true;
if ((_arg1 is BomberMan)){
_local2 = meleed(BomberMan(_arg1));
};
return (_local2);
}
public function fitsIn(_arg1:Level):Boolean{
this.level = _arg1;
if (!(_arg1.isFree(x, y, this))){
return (false);
};
if (!(canMoveTo(x, y))){
return (false);
};
var _local2:Array = _arg1.blockMap.getIntersecting(x, y, xRadius, yRadius);
return ((_local2.length == 0));
}
protected function couldMove(_arg1:int, _arg2:int):Boolean{
var _local5:GameEntity;
if (!(level.isFree((x + _arg1), (y + _arg2), this))){
return (false);
};
if (!(canMoveTo((x + _arg1), (y + _arg2)))){
return (false);
};
var _local3:Array = level.blockMap.getIntersecting((x + _arg1), (y + _arg2), xRadius, yRadius);
var _local4:int;
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 canMoveTo(_arg1:int, _arg2:int):Boolean{
return (true);
}
public function attemptMove(_arg1:int, _arg2:int):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);
};
var _local3:Boolean;
_local3 = ((_local3) || (_attemptMove(_arg1, 0)));
_local3 = ((_local3) || (_attemptMove(0, _arg2)));
return (_local3);
}
private function _attemptMove(_arg1:int, _arg2:int):Boolean{
if (!(couldMove(_arg1, _arg2))){
return (false);
};
x = (x + _arg1);
y = (y + _arg2);
return (true);
}
}
}//package src.entity
Section 98 (1.25 KiB) ●
//TeleportAnimation (src.entity.TeleportAnimation)
package src.entity {
public class TeleportAnimation {
private var bomberMan:BomberMan;
public var time:int;// = 0
var frame:Array;
private var yo:int;
private var xo:int;
private var yt:int;
private var xt:int;
private static var ANIM_DURATION:Number = 40;
public function TeleportAnimation(_arg1:BomberMan, _arg2:int, _arg3:int){
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 = (time / 2);
var _local2:int = (_local1 % 8);
bomberMan.drawImage47x50(bomberMan.gr.player, (((_local2 % 2) * 3) + 0), (_local2 / 2), -8, ((-16 - 8) - 4));
}
public function tick():void{
time++;
var _local1:Number = (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 99 (200 B)
//AirTube (src.gui.AirTube)
package src.gui {
import flash.display.*;
public class AirTube extends MovieClip {
public var airTube:MovieClip;
public var light:MovieClip;
}
}//package src.gui
Section 100 (180 B)
//ButtonListener (src.gui.ButtonListener)
package src.gui {
public interface ButtonListener {
function buttonToggled(_arg1:int, _arg2:Boolean):Boolean;
}
}//package src.gui
Section 101 (4.86 KiB) ●
//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 {
public var scoreLabel:TextField;
private var lBombs:int;// = 0
private var lScore:int;// = 0
private var lKeys:int;// = 0
public var bombs:TextField;
public var score:TextField;
private var lHealth:int;// = 0
private var lWarn:int;// = -1
public var soundButton:GuiButton;
private var lPotions:int;// = 0
private var blastPassage:BlastPassage;
public var musicButton:GuiButton;
public var oxygenLabel:TextField;
public var timeMeter:MovieClip;
public var potions:TextField;
public var pauseButton:GuiButton;
private var lRot:Number;// = 0
public var time:TextField;
private var lAirFrame:int;// = -999
private var lFire:int;// = 0
public var airMeter:MovieClip;
public var quitButton:GuiButton;
private var lSeconds:Number;// = 0
public var keys:TextField;
public var fires:TextField;
private var gameScreen:GameScreen;
public function Gui(){
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);
pauseButton.init(this, 3);
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());
};
if (_arg1 == 3){
if (_arg2){
blastPassage.pauseGame();
} else {
blastPassage.unpauseGame();
};
return (true);
};
return (false);
};
return (false);
}
public function init(_arg1:BlastPassage):void{
this.blastPassage = _arg1;
}
public function animateLight():void{
var _local2:Number;
var _local1:int;
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 reset():void{
pauseButton.setPressed(false);
quitButton.setPressed(false);
}
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();
};
}
public function setScreen(_arg1:GameScreen):void{
this.gameScreen = _arg1;
}
}
}//package src.gui
Section 102 (1.67 KiB) ●
//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 animPos:Number;// = 0
private var lastTime:int;// = 0
private var animDir:int;// = -1
private var gui:ButtonListener;
private var animating:Boolean;// = false
public function GuiButton(){
gotoAndStop(1);
addEventListener(MouseEvent.MOUSE_DOWN, click);
mouseEnabled = true;
useHandCursor = true;
buttonMode = true;
tabEnabled = false;
}
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 = getTimer();
var _local3:int = (_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)));
}
public function click(_arg1:MouseEvent):void{
toggle();
}
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;
};
}
}
}//package src.gui
Section 103 (646 B)
//IntroButton (src.gui.IntroButton)
package src.gui {
import flash.events.*;
import flash.display.*;
public class IntroButton extends MovieClip {
private var gui:ButtonListener;
private var id:int;
public function IntroButton(){
addEventListener(MouseEvent.MOUSE_DOWN, click);
mouseEnabled = true;
useHandCursor = true;
buttonMode = true;
tabEnabled = false;
alpha = 0;
}
public function init(_arg1:ButtonListener, _arg2:int):void{
this.gui = _arg1;
this.id = _arg2;
}
public function click(_arg1:MouseEvent):void{
if (gui != null){
gui.buttonToggled(id, true);
};
}
}
}//package src.gui
Section 104 (147 B)
//IntroMusicButton (src.gui.IntroMusicButton)
package src.gui {
public dynamic class IntroMusicButton extends GuiButton {
}
}//package src.gui
Section 105 (141 B)
//IntroOffButton (src.gui.IntroOffButton)
package src.gui {
public dynamic class IntroOffButton extends GuiButton {
}
}//package src.gui
Section 106 (147 B)
//IntroSoundButton (src.gui.IntroSoundButton)
package src.gui {
public dynamic class IntroSoundButton extends GuiButton {
}
}//package src.gui
Section 107 (1.7 KiB) ●
//LevelButton (src.gui.LevelButton)
package src.gui {
import flash.display.*;
public class LevelButton {
public var bestScore:int;// = 0
public var exits:Array;
public var mc:MovieClip;
public var id:int;
public var won:Boolean;// = false
public var exitsRevealed:Array;
public var dirTo:Array;
public var revealed:Boolean;// = false
public var paths:Array;
public function LevelButton(_arg1:int, _arg2:MovieClip){
exits = new Array(4);
exitsRevealed = new Array(4);
paths = new Array(4);
dirTo = new Array(32);
super();
this.id = _arg1;
this.mc = _arg2;
_arg2.gotoAndStop(2);
var _local3:int;
while (_local3 < 4) {
exitsRevealed[_local3] = false;
_local3++;
};
}
public function hide():void{
mc.visible = false;
revealed = false;
}
public function reveal():void{
mc.visible = true;
revealed = true;
}
public function reset():void{
mc.gotoAndStop(2);
var _local1:int;
while (_local1 < 4) {
exitsRevealed[_local1] = false;
_local1++;
};
won = false;
revealed = false;
bestScore = 0;
}
public function newScore(_arg1:int):void{
if (_arg1 > bestScore){
bestScore = _arg1;
};
}
public function setExit(_arg1:int, _arg2:LevelButton):void{
exits[_arg1] = _arg2;
dirTo[_arg2.id] = _arg1;
}
public function win():void{
reveal();
won = true;
mc.gotoAndStop(1);
var _local1:int;
while (_local1 < 4) {
if (exits[_local1] != null){
paths[_local1].visible = true;
exitsRevealed[_local1] = true;
exits[_local1].reveal();
};
_local1++;
};
}
public function setPath(_arg1:int, _arg2:MovieClip):void{
paths[_arg1] = _arg2;
}
}
}//package src.gui
Section 108 (9.64 KiB) ● ●
//LevelChooser (src.gui.LevelChooser)
package src.gui {
import flash.display.*;
import com.midasplayer.*;
import src.*;
import flash.events.*;
import flash.ui.*;
import src.player.*;
import flash.utils.*;
import flash.text.*;
public class LevelChooser extends MovieClip implements ButtonListener {
private var walkStartTime:int;// = 0
private var lives:int;// = 5
private var currentLevel:LevelButton;
private var lastLevel:LevelButton;
private var score:int;// = 0
public var playAgainShower:MovieClip;
public var planet:MovieClip;
public var kingButton:IntroButton;
public var bear:MovieClip;
private var gameLost:Boolean;// = false
public var highscoreShower:MovieClip;
private var walkXFirst:Boolean;// = false
private var gameWon:Boolean;// = false
private var bp:BlastPassageStandAlone;
private var animStart:int;// = -1
public var livesText:TextField;
private var levelButtons:Array;
public var scoreText:TextField;
private var paths:Array;
public var spaceToPlay:TextField;
public var menuButton:IntroButton;
private var walking:Boolean;// = false
private static const DOWN:int = 1;
private static const LEFT:int = 2;
private static const STARTING_LIVES:int = 5;
private static const UP:int = 0;
private static const RIGHT:int = 3;
public function LevelChooser(){
levelButtons = new Array(13);
paths = new Array(14);
super();
var _local1:int;
while (_local1 < 13) {
levelButtons[_local1] = new LevelButton(_local1, planet[("lvl" + _local1)]);
_local1++;
};
_local1 = 0;
while (_local1 < 14) {
paths[_local1] = planet[("p" + _local1)];
_local1++;
};
bear = planet.bear;
addPath(4, LEFT, 6, UP, 5);
addPath(5, DOWN, 7, UP, 6);
addPath(6, DOWN, 8, UP, 7);
addPath(7, LEFT, 9, RIGHT, 9);
addPath(7, DOWN, 10, UP, 10);
addPath(10, LEFT, 11, RIGHT, 12);
addPath(0, DOWN, 2, UP, 0);
addPath(2, LEFT, 1, RIGHT, 1);
addPath(2, RIGHT, 3, LEFT, 2);
addPath(1, DOWN, 4, UP, 3);
addPath(3, DOWN, 5, UP, 4);
addPath(4, DOWN, 6, RIGHT, 5);
addPath(5, RIGHT, 7, UP, 6);
addPath(6, DOWN, 8, LEFT, 7);
addPath(7, LEFT, 9, UP, 9);
addPath(7, DOWN, 10, RIGHT, 10);
addPath(8, DOWN, 11, LEFT, 11);
addPath(8, RIGHT, 9, LEFT, 8);
addPath(10, DOWN, 11, RIGHT, 12);
addPath(11, DOWN, 12, UP, 13);
visible = false;
menuButton.init(this, 0);
kingButton.init(this, 1);
highscoreShower.button.init(this, 2);
playAgainShower.button.init(this, 3);
reset();
}
public function checkMove(_arg1:int):Boolean{
if (currentLevel.exits[_arg1] == null){
return (false);
};
if (!(currentLevel.paths[_arg1].visible)){
return (false);
};
lastLevel = currentLevel;
currentLevel = currentLevel.exits[_arg1];
walking = true;
walkStartTime = getTimer();
var _local2:int = lastLevel.dirTo[currentLevel.id];
walkXFirst = (((_local2 == LEFT)) || ((_local2 == RIGHT)));
return (true);
}
public function levelWon(_arg1:int):void{
spaceToPlay.visible = false;
currentLevel.win();
currentLevel.newScore(bp.gameScreen.player.score);
recalcScore();
if (currentLevel == levelButtons[(levelButtons.length - 1)]){
gameWon = true;
};
}
public function checkPlayLevel():void{
bp.playLevel(currentLevel.id);
}
private function animateLose():void{
if (animStart < 0){
animStart = getTimer();
};
var _local1:Number = (((getTimer() - animStart) / 1000) - 0.4);
var _local2:int = int(((_local1 * 24) + 26));
if (_local2 > 33){
_local2 = 33;
};
if (_local2 < 26){
_local2 = 25;
};
if (_local2 >= 25){
playAgainShower.visible = true;
};
bear.gotoAndStop(_local2);
}
private function animateWin():void{
if (animStart < 0){
animStart = getTimer();
};
var _local1:Number = ((getTimer() - animStart) / 1000);
var _local2:Number = ((_local1 - 0.3) / 4);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 > 1){
_local2 = 1;
};
if (_local2 >= 0.8){
highscoreShower.visible = true;
playAgainShower.visible = true;
};
_local2 = (0.5 - (Math.cos((_local2 * Math.PI)) * 0.5));
planet.rotation = (_local2 * 180);
bear.rotation = -(planet.rotation);
planet.y = (235 + (_local2 * 260));
var _local3:int = int((((_local1 * 24) % 16) + 10));
bear.gotoAndStop(_local3);
}
public function hide():void{
removeEventListener(Event.ENTER_FRAME, advanceTime);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, bp.keyDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, bp.keyUp);
visible = false;
bp.removeChild(bp.introButtons);
bp.introButtons.y = (bp.introButtons.y + 284);
}
public function levelLost():void{
lives--;
if (lives == 0){
gameLost = true;
};
livesText.text = ("" + lives);
}
public function reveal(_arg1:int):void{
levelButtons[_arg1].reveal();
}
public function reset():void{
score = 0;
spaceToPlay.visible = true;
var _local1:int;
while (_local1 < 13) {
levelButtons[_local1].reset();
levelButtons[_local1].hide();
_local1++;
};
_local1 = 0;
while (_local1 < 14) {
paths[_local1].visible = false;
_local1++;
};
bear.gotoAndStop(1);
reveal(0);
currentLevel = levelButtons[0];
bear.x = currentLevel.mc.x;
bear.y = currentLevel.mc.y;
lives = LevelChooser.STARTING_LIVES;
recalcScore();
livesText.text = ("" + lives);
gameWon = false;
gameLost = false;
animStart = -1;
planet.rotation = (0 * 180);
bear.rotation = -(planet.rotation);
planet.y = (235 + (0 * 260));
highscoreShower.visible = false;
playAgainShower.visible = false;
}
public function win(_arg1:int):void{
levelButtons[_arg1].win();
}
private function addPath(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
levelButtons[_arg1].setExit(_arg2, levelButtons[_arg3]);
levelButtons[_arg3].setExit(_arg4, levelButtons[_arg1]);
levelButtons[_arg1].setPath(_arg2, paths[_arg5]);
levelButtons[_arg3].setPath(_arg4, paths[_arg5]);
}
public function recalcScore():void{
score = 0;
var _local1:int;
while (_local1 < 13) {
score = (score + levelButtons[_local1].bestScore);
_local1++;
};
scoreText.text = ("" + score);
highscoreShower.scoreText.text = ("" + score);
}
public function advanceTime(_arg1:Event):void{
bp.controller.tick();
BlastPassage.music.update();
BlastPassage.sound.update();
if (gameWon){
animateWin();
return;
};
if (gameLost){
animateLose();
return;
};
if (walking){
updateWalkAnim();
return;
};
if (bp.controller.isTyped(Controller.BUTTON_UP)){
checkMove(UP);
};
if (bp.controller.isTyped(Controller.BUTTON_DOWN)){
checkMove(DOWN);
};
if (bp.controller.isTyped(Controller.BUTTON_LEFT)){
checkMove(LEFT);
};
if (bp.controller.isTyped(Controller.BUTTON_RIGHT)){
checkMove(RIGHT);
};
if (((bp.controller.isTyped(Controller.BUTTON_FIRE)) || (bp.controller.isTyped(Controller.BUTTON_SPECIAL)))){
checkPlayLevel();
};
}
public function updateWalkAnim():void{
var _local1:int = (lastLevel.mc.x - currentLevel.mc.x);
var _local2:int = (lastLevel.mc.y - currentLevel.mc.y);
var _local3:int = (getTimer() - walkStartTime);
var _local4:int = (int((_local3 / 100)) % 2);
var _local5:Number = (_local3 / 5);
var _local6:Boolean;
var _local7:int;
if (walkXFirst){
if ((((_local5 < Math.abs(_local1))) && (!((_local1 == 0))))){
_local5 = (_local5 / Math.abs(_local1));
bear.x = (lastLevel.mc.x - (_local1 * _local5));
bear.y = lastLevel.mc.y;
_local7 = ((_local1 < 0)) ? RIGHT : LEFT;
} else {
_local5 = ((_local5 - Math.abs(_local1)) / Math.abs(_local2));
if ((((_local5 >= 1)) || ((_local2 == 0)))){
_local6 = true;
};
bear.x = currentLevel.mc.x;
bear.y = (lastLevel.mc.y - (_local2 * _local5));
_local7 = ((_local2 < 0)) ? DOWN : UP;
};
} else {
if ((((_local5 < Math.abs(_local2))) && (!((_local2 == 0))))){
_local5 = (_local5 / Math.abs(_local2));
bear.x = lastLevel.mc.x;
bear.y = (lastLevel.mc.y - (_local2 * _local5));
_local7 = ((_local2 < 0)) ? DOWN : UP;
} else {
_local5 = ((_local5 - Math.abs(_local2)) / Math.abs(_local1));
if ((((_local5 >= 1)) || ((_local1 == 0)))){
_local6 = true;
};
bear.x = (lastLevel.mc.x - (_local1 * _local5));
bear.y = currentLevel.mc.y;
_local7 = ((_local1 < 0)) ? RIGHT : LEFT;
};
};
if (_local7 == DOWN){
_local4 = (_local4 + 2);
};
if (_local7 == LEFT){
_local4 = (_local4 + 4);
};
if (_local7 == UP){
_local4 = (_local4 + 6);
};
if (_local7 == RIGHT){
_local4 = (_local4 + 8);
};
bear.gotoAndStop(_local4);
if (_local6){
bear.gotoAndStop(1);
bear.x = currentLevel.mc.x;
bear.y = currentLevel.mc.y;
walking = false;
};
}
public function show(_arg1:BlastPassageStandAlone):void{
BlastPassage.music.stopAll();
this.bp = _arg1;
addEventListener(Event.ENTER_FRAME, advanceTime);
visible = true;
stage.addEventListener(KeyboardEvent.KEY_DOWN, _arg1.keyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, _arg1.keyUp);
stage.focus = _arg1;
Mouse.show();
_arg1.addChild(_arg1.introButtons);
_arg1.introButtons.y = (_arg1.introButtons.y - 284);
}
public function buttonToggled(_arg1:int, _arg2:Boolean):Boolean{
if (_arg1 == 0){
bp.backToMainMenu();
};
if (_arg1 == 1){
KingAPI.openHighscoresLink();
};
if (_arg1 == 2){
KingAPI.submitScore(score);
};
if (_arg1 == 3){
bp.backToMainMenu();
};
return (true);
}
}
}//package src.gui
Section 109 (4.4 KiB) ●
//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 _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);
var _local3:int;
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 _local2:int;
var _local1:int;
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 _local12:Array;
var _local13:int;
var _local14:int;
var _local15:GameEntity;
var _local5:int = (_arg1 - _arg3);
var _local6:int = (_arg2 - _arg4);
var _local7:int = (_arg1 + _arg3);
var _local8:int = (_arg2 + _arg4);
var _local9:Array = new Array();
var _local10:BlockSlot = slot.init((_local5 - 16), (_local6 - 16));
var _local11:BlockSlot = 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 _local9:int;
var _local10:Array;
var _local11:int;
var _local12:int;
var _local13:GameEntity;
if (_arg5 == null){
_arg5 = new Array();
};
var _local6:BlockSlot = slot.init(_arg1, _arg2);
var _local7:BlockSlot = slot2.init(_arg3, _arg4);
lx0 = _local6.xSlot;
ly0 = _local6.ySlot;
lx1 = _local7.xSlot;
ly1 = _local7.ySlot;
var _local8:int = _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 = slot.init(_arg1.xOld, _arg1.yOld);
var _local3:BlockSlot = 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 110 (1.16 KiB) ●
//BlockSlot (src.level.BlockSlot)
package src.level {
import src.entity.*;
public class BlockSlot {
public var xSlot:int;
public var ySlot:int;
public var blockMap:BlockMap;
public function BlockSlot(_arg1:BlockMap){
this.blockMap = _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 add(_arg1:GameEntity):void{
if ((((xSlot >= 0)) && ((ySlot >= 0)))){
blockMap.entityGrid[xSlot][ySlot].push(_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 equals(_arg1:BlockSlot):Boolean{
return ((((_arg1.xSlot == xSlot)) && ((_arg1.ySlot == ySlot))));
}
}
}//package src.level
Section 111 (511 B)
//DownloadLevelLoader (src.level.DownloadLevelLoader)
package src.level {
import src.*;
public class DownloadLevelLoader extends LevelLoader {
private var levelDatas:LevelData;
public function DownloadLevelLoader(_arg1:BlastPassage){
levelDatas = new LevelData();
super(_arg1);
}
override public function loadLevel(_arg1:GraphicsContext, _arg2:int, _arg3:String, _arg4:int):Level{
return (super.loadLevel(_arg1, _arg2, levelDatas.levels[(_arg2 - 1)], _arg4));
}
}
}//package src.level
Section 112 (828 B)
//FileLevelLoader (src.level.FileLevelLoader)
package src.level {
import flash.net.*;
import src.*;
import flash.events.*;
public class FileLevelLoader extends LevelLoader {
private var levelData:String;
private var bp:BlastPassage;
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);
}
override public function loadLevel(_arg1:GraphicsContext, _arg2:int, _arg3:String, _arg4:int):Level{
return (super.loadLevel(_arg1, _arg2, this.levelData, _arg4));
}
function levelLoaded(_arg1:Event):void{
var _local2:String = String(myLoader.data);
this.levelData = _local2;
bp.levelsLoaded();
}
}
}//package src.level
Section 113 (3.81 KiB) ●
//GameCamera (src.level.GameCamera)
package src.level {
import src.entity.*;
public class GameCamera {
private var entities:Array;
private var level:Level;
public var width:int;
public var xx:Number;
public var yi:int;
public var yyLast:Number;
private var shakeLevel:int;// = 0
public var yy:Number;
public var height:int;
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();
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 tick():void{
xxLast = xx;
yyLast = yy;
var _local1:int;
while (_local1 < 3) {
performTick();
_local1++;
};
}
public function add(_arg1:GameEntity):void{
entities.push(_arg1);
}
public function performTick():void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:GameEntity;
if (shakeLevel > 0){
shakeLevel--;
};
var _local1:int;
var _local2:int;
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 114 (21.02 KiB) ● ● ●
//Level (src.level.Level)
package src.level {
import src.math.*;
import src.particle.*;
import src.entity.*;
import src.entity.monster.*;
import src.entity.level.*;
import src.entity.pickup.*;
import flash.display.*;
import src.player.*;
import src.*;
public class Level {
public var potionTime:int;// = 0
private var particleLayer:Sprite;
private var bomberMen:Array;
public var blockMap:BlockMap;
private var totalTreasure:int;// = 0
private var noMoveTime:int;// = 0
public var wallType:int;// = 2
public var camera:GameCamera;
private var toAdd:Array;
public var height:int;
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;
public var yStart:int;
public var gr:GraphicsContext;
public var floorType:int;// = 2
private var seed:int;
private var noMonsterInteractionTime:int;// = 0
public var levelNum:int;// = 1
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);
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 _local5:BomberMan;
var _local6:int;
var _local7:int;
var _local8:int;
var _local2:BomberMan;
var _local3:int;
var _local4:int;
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 removeEntity(_arg1:GameEntity):void{
if ((_arg1 is BomberMan)){
bomberMen.splice(bomberMen.indexOf(_arg1), 1);
};
_arg1.alive = false;
toRemove.push(_arg1);
}
public function hasPlayer():Boolean{
return ((bomberMen.length > 0));
}
public function tick():void{
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--;
};
var _local1:Array = blockMap.getEntities(camera.x, camera.y, (camera.x + camera.width), (camera.y + camera.height));
var _local2:int;
while (_local2 < alwaysTick.length) {
_local4 = _local1.indexOf(alwaysTick[_local2]);
if (_local4 >= 0){
_local1.splice(_local4, 1);
};
_local1.push(alwaysTick[_local2]);
_local2++;
};
var _local3:int;
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 _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);
};
var _local8:int = _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 _local2:int;
var _local1:int;
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 setParticleLayer(_arg1:Sprite):void{
this.particleLayer = _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 _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;
var _local2:int;
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);
}
public function nextRandom():MtRandom{
randomAccesses++;
return (random);
}
private function setTile(_arg1:int, _arg2:int, _arg3:String):void{
if ((((((((_arg1 < 0)) || ((_arg2 < 0)))) || ((_arg1 >= width)))) || ((_arg2 >= height)))){
return;
};
map[(_arg1 + (_arg2 * width))] = _arg3;
updateImages((_arg1 - 1), (_arg2 - 1), (_arg1 + 1), (_arg2 + 1));
var _local4:Array = blockMap.getEntities(((_arg1 * 16) - 16), ((_arg2 * 16) - 16), ((_arg1 * 16) + 32), ((_arg2 * 16) + 32));
var _local5:int;
while (_local5 < _local4.length) {
GameEntity(_local4[_local5]).renderStatic();
_local5++;
};
}
public function getVisibleEntities():Array{
var _local1:int;
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 _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"))));
};
var _local4:int = ((_arg1 - 4) >> 4);
var _local5:int = ((_arg2 + 4) >> 4);
var _local6:int = ((_arg2 - 4) >> 4);
var _local7:int = ((_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);
};
var _local8:int = _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 _local2:int;
var _local1:int;
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 monsterInteracted():void{
noMonsterInteractionTime = 0;
}
public function trigger(_arg1:int, _arg2:int):void{
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local3:int = -1;
var _local4:int = -1;
var _local5:int;
var _local6:int;
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{
if (potionTime > 0){
return;
};
var _local2:int = 16;
var _local3:Array = blockMap.getEntities(((_arg1.xi / 2) - _local2), ((_arg1.yi / 2) - _local2), ((((_arg1.xi / 2) + _arg1.width) - 16) + _local2), (((_arg1.yi / 2) + _arg1.height) + _local2));
var _local4:int;
while (_local4 < _local3.length) {
GameEntity(_local3[_local4]).calcDepth();
_local4++;
};
_local3.sortOn("depth");
var _local5:int;
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;
while (_local2 < entities.length) {
if (entities[_local2].id == _arg1){
return (entities[_local2]);
};
_local2++;
};
return (null);
}
public function fireTo(_arg1:int, _arg2:int):Boolean{
if ((((((((_arg1 < 0)) || ((_arg2 < 0)))) || ((_arg1 >= width)))) || ((_arg2 >= height)))){
return (false);
};
var _local3:String = 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;
while (_local1 < bomberMen.length) {
if (bomberMen[_local1].hasKey()){
return (true);
};
_local1++;
};
return (false);
}
public function renderJustBombermenSprites(_arg1:GameCamera):void{
if (potionTime > 0){
return;
};
var _local2:int = 16;
var _local3:Array = blockMap.getEntities(((_arg1.xi / 2) - _local2), ((_arg1.yi / 2) - _local2), ((((_arg1.xi / 2) + _arg1.width) - 16) + _local2), (((_arg1.yi / 2) + _arg1.height) + _local2));
var _local4:int;
while (_local4 < _local3.length) {
GameEntity(_local3[_local4]).calcDepth();
_local4++;
};
_local3.sortOn("depth");
var _local5:int;
while (_local5 < _local3.length) {
if ((((_local3[_local5] is BomberMan)) || ((_local3[_local5] is DeathAnim)))){
_local3[_local5].render();
};
_local5++;
};
}
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 calcTreasure():int{
return (totalTreasure);
}
public function getFoodValue():int{
return (foodValue);
}
public function activatePotion(_arg1:Player):void{
camera.shakeMax();
potionTime = 6;
var _local2:int = 16;
var _local3:Array = blockMap.getEntities((camera.x - _local2), (camera.y - _local2), (((camera.x + camera.width) - 16) + _local2), ((camera.y + camera.height) + _local2));
var _local4:int;
while (_local4 < _local3.length) {
_local3[_local4].potionActivated(_arg1);
_local4++;
};
}
public function getLevelString(_arg1:int=-1):String{
if (_arg1 == -1){
_arg1 = levelNum;
};
var _local2:String = " 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 115 (17.94 KiB) ● ● ●
//LevelData (src.level.LevelData)
package src.level {
public class LevelData {
public var levels:Array;
public function LevelData(){
levels = new Array(13);
super();
levels[0] = ((((((((((((((((((((((((((((((((((((((("noname\n" + "8\n") + "1\n") + "58\n") + "52\n") + "32\n") + "32\n") + "################################\n") + "#$$ #$ c c - .!.d#\n") + "#$ # - ....#\n") + "# # d # .£.$#\n") + "# . # ; #....#\n") + "# # ; ; #£ #\n") + "# 1 # 2 ####### ;3 #£ #\n") + "#. . # #$ $# #a#\n") + "# #$ # # 5 ; ##\n") + "# # # d # #\n") + "# # #$ 2 # 3 ; #\n") + "# b # c # # ;; #\n") + "# # #c #### 2 # #\n") + "# # #$ $# # K #\n") + "# # # $$ # 2 # #\n") + "# # # $'.$ # $# #\n") + "# #$ # $*.$ # # c#\n") + "# # 4 # $$ # # #\n") + "# # :: #$ $# # #\n") + "# # 4: #### # c # b #\n") + "# . # c# # #\n") + "# . # 4 $# # #\n") + "# # : d # # #\n") + "## ..1 . # # : :$# #\n") + "#a# . #$ cc $# :: #,,,,#\n") + "# £# 1 ####### :4 # ,2 #\n") + "# £# # ,, #\n") + "#;;;;# : # #\n") + "#$;£; # d : # #\n") + "#;;;; - # $#\n") + "#d;!; - K $#> $$#\n") + "################################\n") + "");
levels[1] = ((((((((((((((((((((((((((((((((((((((("noname\n" + "3\n") + "15\n") + "18\n") + "38\n") + "32\n") + "32\n") + "################################\n") + "# #K £d#\n") + "# ££ .1. # . . . £#\n") + "# ££ 1.. #$$ . . a#\n") + "# #'$ . . Ka#\n") + "###### ######## £#\n") + "#.... #%c% % ## £?#\n") + "#%%%%# % # %*% % #########\n") + "# 1# #% %!%#%# #$ $ bb#\n") + "# ##### #%#% %c# # ,b#\n") + "# c# %*% %#%# #$ , #\n") + "# ## ## %*% % # , #\n") + "# £# % % % ## ####%## #\n") + "# £# #####%#£ #£ #*£# #\n") + "# a#* #£ # *% # a#\n") + "# $# # #######-- #\n") + "# $#* # # %a# - #\n") + "# a# # , 2 , %a# % - #\n") + "# £# ## #######-- ,#\n") + "# £# #£ 2 , 2 #* #* # #\n") + "# ## ## #£ % £# #\n") + "# c# #d ,,,,, #####%# , #\n") + "# ##### ############ ,a#\n") + "# 1# # ,,,,#c #\n") + "#%%%%# # 2 ,,,,#c , , #\n") + "#.... # ,,,,# #\n") + "######## # 2 ,,,,- #\n") + "# # ,,,,- , , #\n") + "# ££ 1.. # ,,,,# #\n") + "# ££ .1. # > ,,,,#c #\n") + "# # ,,,,#c c c #\n") + "################################\n") + "");
levels[2] = ((((((((((((((((((((((((((((((((((((((("noname\n" + "16\n") + "20\n") + "17\n") + "51\n") + "32\n") + "32\n") + "################################\n") + "#££££££#. ...'.. - #\n") + "#£ b£#.########## .... - ..c#\n") + "#£b £#.#.. .. - .... - .. #\n") + "#£ b £# #.####.# - ..K- ...#\n") + "#££££££#...... .# ---- .. - ...#\n") + "#%%%%%%########## - .. - ..K#\n") + "# : : ::: ::: - . - c#\n") + "# a # :&&&&#&&&: - ---- #\n") + "# : :&c c& : - - #\n") + "# 4 &= =&: - - #\n") + "# # 4 ::& & #-- -----###\n") + "# a :&c c&: - c - bb#\n") + "# : &&&$ &&& --#-- .... #\n") + "# 4* : & $& : # .... #\n") + "# #$ & : # . #\n") + "# # 4 # $# # K---#\n") + "# 4 % a #--###########---- .#\n") + "# # #; # . ..#\n") + "# # # # #;K # .# . #\n") + "# a # #££# #;; # #K--#\n") + "# * a #;;# #3; #--##- #\n") + "# # % * #;;#b b#;; 3# -''- #\n") + "# #;;######; # ---- #\n") + "# # * #;;; 3 #b b#\n") + "# % K # # ; 3 # . .. #\n") + "#%% % # # .... #\n") + "# # # * # d ###### . . #\n") + "# #%%## # 1..... #\n") + "# % # # > .1......#\n") + "#? % d# $ $ $ # .1......#\n") + "################################\n") + "");
levels[3] = ((((((((((((((((((((((((((((((((((((((("noname\n" + "27\n") + "1\n") + "6\n") + "27\n") + "32\n") + "32\n") + "################################\n") + "#£ £ #$££ £$#c d#\n") + "# : 4 :: # . ! $# #\n") + "# K # £# #\n") + "# : 4 # 1 # #\n") + "# # .. # = #\n") + "#££££########### 1 #a a#\n") + "# # # . . ##&&&&&##\n") + "#4 : # 4 # # ..... #\n") + "# # # . # ..... #\n") + "# # # # # ..... #\n") + "# : # # & # #\n") + "# # : # ::::& # $ #\n") + "# # :&&&&&&###### #\n") + "# 4 # :&$$ $ #\n") + "# : # :&$ 1 #\n") + "# # :& $ 1 #\n") + "##########&&& = 1 #\n") + "# - :& 1 #\n") + "# 2 - :&$ #\n") + "# - :&$$ #\n") + "# , - :&&&&&&##############\n") + "# , - ::::& a d #\n") + "# 2 , - & a 2 2 #\n") + "# ------#aab d 2 #\n") + "# $ , # #\n") + "#$ ,, # 2 d2 d 2 #\n") + "# > 2 2 # 2 #\n") + "# $ ,, # d 2 d#\n") + "# $ # 2 d 2 #\n") + "# $ # #\n") + "################################\n") + "");
levels[4] = ((((((((((((((((((((((((((((((((((((((("noname\n" + "6\n") + "3\n") + "36\n") + "11\n") + "32\n") + "32\n") + "################################\n") + "#> #d# ;;;; #* K#\n") + "# -d# #*#*# #\n") + "#---d# #*# #! #\n") + "# # £# £# # # #*####\n") + "#----# ; #*# * *#\n") + "# # # ; 3 ; # #### #\n") + "#----# £ ; ;; #* * **#\n") + "# # ;;########\n") + "# £ ' ;;#£ ; #\n") + "# ; d# ;; #\n") + "# # £ ;; ;;;; ; #\n") + "# ; £ # 3 ; #\n") + "# ; £# 3 #\n") + "# ; ;; # £# #\n") + "# ; ;; £# d #\n") + "# #£ ; ;; ;;;;; ;; #\n") + "# ; #£ ' ;; 3 #\n") + "# ;; 3 £ #\n") + "# 3 £ 3 # #\n") + "# £ ; d # ### #\n") + "# # ;; # #:&=$#\n") + "# ; 3 ;;;;; 3c#:& #\n") + "# ; 3 cc#:&$=#\n") + "# 3 3 £# ' c###:& #\n") + "# # cc#:::&=$#\n") + "# #£ ; £ #####:&&& #\n") + "##%%# ;;;; #:::::& = #\n") + "# ' % ;; #&&&&&& =#\n") + "#'''% = $ = = #\n") + "#K' # $ = $ =K#\n") + "################################\n") + "");
levels[5] = ((((((((((((((((((((((((((((((((((((((("noname\n" + "6\n") + "26\n") + "49\n") + "59\n") + "32\n") + "32\n") + "################################\n") + "# a £ £ a £ a £ #\n") + "#£ .. #### #\n") + "# #### .. ##b ## . 1 £#\n") + "#£ ##::## .. 1 # / # . £#\n") + "# #:4c:# .. & # .. #\n") + "# #:c4:& $ ..&& ## 1 . #\n") + "# ##::&& ..&&&# .£#\n") + "# ##&& &&## . #\n") + "# 1 = &&,,## #### . #\n") + "#a... &,K2,# = ## /## . #\n") + "# . 1 #,2c,# #= b# #\n") + "#£ ##,,## $ #----# $ #\n") + "# $ #### ## >## #\n") + "# .. ...= #### a#\n") + "#a #### .. .. . 1 #\n") + "# ##b ## .. $ ... .. #\n") + "# # 3;;# . &&&# .. . #\n") + "#£# ;; & &&''## 1 . a#\n") + "# ##; && &'cc'# #\n") + "#a ###& 1 #'cc'# . #\n") + "# = .. ##''## &&## . #\n") + "# .. ####= &&::## . #\n") + "# .. .. &:c4:# .£#\n") + "#£ . &&## . 1 $&:4c:# £#\n") + "# . && ## .. ##::## £#\n") + "# & # $ . #### #\n") + "# # =# 1... .. #\n") + "#£ ## ## .... 1.. #\n") + "# #### #\n") + "# £ £ a £ a ££ a £ #\n") + "################################\n") + "");
levels[6] = ((((((((((((((((((((((((((((((((((((((("noname\n" + "2\n") + "2\n") + "49\n") + "56\n") + "32\n") + "32\n") + "################################\n") + "# #c . 1 $$$£ a#\n") + "# , . #\n") + "# # . 1 #\n") + "########## ########## ####### #\n") + "#......... , ,,2# #\n") + "#......... , # #\n") + "##### ########## #########a,#, #\n") + "#b$ #b ,, . . .. .. # # #\n") + "#c #K , . . ..a # ,#, #\n") + "# ################# # ,#\n") + "# , --# #c 1# # #$ #\n") + "# - . £ , #c # # #$ #\n") + "# .- # #. # # # # # #$ #\n") + "# - ,. .. # # # #b #\n") + "#1 - # , $ .. . # # # #\n") + "# - . .. # # # # #\n") + "# . - # #. # # # ,# #1 #\n") + "# - . c # $ # # # #\n") + "# --# $$£# #$$# # #\n") + "# $$############ , #£$# # #\n") + "# #####1 # #$$#b # .#\n") + "# .£#-----2 . ## ####### #..#\n") + "#c #$£ - ,,, # # .#\n") + "#### ##$$> - ,,, # #. #\n") + "# #$£ - ,,,. . # # .#\n") + "# . , #-----2 , # K # #\n") + "# #####1 cb#b £#. #\n") + "# ####################### #\n") + "#b2 . ,,,,, # $#\n") + "#ac # , c$ 1 ,,,,,, a#\n") + "################################\n") + "");
levels[7] = ((((((((((((((((((((((((((((((((((((((("noname\n" + "15\n") + "15\n") + "58\n") + "52\n") + "32\n") + "32\n") + "################################\n") + "#d ! £ /#aK#/ % ,,, % 4#\n") + "# 2 K #1.# % ,,, % #\n") + "# #..# % %a #\n") + "#---------- £#..#%%%%%%%%%%%%%#\n") + "# ........- #..#$ % % #\n") + "# 1 .d ..- #££#;; % £ % ;;#\n") + "# . . .. .- d# #;; % d % ;;#\n") + "#------.$.- # #;; % K % ;;#\n") + "# ,,,- ..- # #$ % % #\n") + "# ,d,-. .- # #%%%%%%%%%----#\n") + "# ,,,- 1.- 2 # # a% - #\n") + "# -. .- # # % ,,, - #\n") + "#/ - - 5# #4 % ,,, - /#\n") + "############### ###############\n") + "#/....£ £...1a#\n") + "# 1...£ £....K#\n") + "############### ###############\n") + "#> - ,,, % 4# #2 - - /#\n") + "# - ,,, % # # - - #\n") + "# - %a # # 1 - 3 -,,, #\n") + "#----%%%%%%%%%# # -; -,d, #\n") + "# % % $# # -;;;-,,, #\n") + "#;; % £ % ;;# # -;d ------#\n") + "#;; % ' % ;;# #d -;;; ; #\n") + "#;; % K % ;;#££# -; ;$;;3 #\n") + "# % % $#..# - ;;;;; #\n") + "#%%%%%%%%%%%%%#..#£ ----------#\n") + "# a% % #..# #\n") + "# % ,,, % #.1# 1 #\n") + "#4 % ,,, % /#Ka#/ £ ! d#\n") + "################################\n") + "");
levels[8] = ((((((((((((((((((((((((((((((((((((((("noname\n" + "3\n") + "10\n") + "41\n") + "8\n") + "32\n") + "32\n") + "################################\n") + "# .. .. # c 1 c :: £#\n") + "# . c ..& 1 1 : :#\n") + "# .. & = 1 : b: :#\n") + "# c.. ..& 1 1 #: #\n") + "# c..# c 1 c $#$: #\n") + "# . . . ################ ###::#\n") + "# /# ---- $#$: #\n") + "######### ---- -''- ---- #:: #\n") + "# #c# -''- -''- -''- :b: :#\n") + "# - -''- ---- -''- : #\n") + "# #c# ---- ---- : £#\n") + "# ##########################\n") + "# #/ #:: £ , #:: £ # #\n") + "# # #:: £ 2, #:: £ #dK!Kd#\n") + "# # #:::#,,,,#:::# # #\n") + "## ## # ::#,,2,# ::# # #\n") + "#, , ,# £ ::# ,, £ ::# # * * #\n") + "# , , # £ # , £ # /#*5*5*#\n") + "#, , ,####################5 5 5#\n") + "# , , $$$ $ $$$ $ #\n") + "# , #\n") + "# , , 2 2 #\n") + "# , 2 2 #########\n") + "# ,,, ,,,, #/ a*a #\n") + "# , ,,,,,,,,,,,,,, # a*a #\n") + "# ,,,, ,,, #aaa*$ #\n") + "# 2 2 #****$ #\n") + "# 2 2 #aa$$$ #\n") + "# # > #\n") + "# $$ $ $$ $ $$ # #\n") + "################################\n") + "");
levels[9] = ((((((((((((((((((((((((((((((((((((((("noname\n" + "2\n") + "28\n") + "57\n") + "63\n") + "32\n") + "32\n") + "################################\n") + "#£->>-£# # #\n") + "#£->>-£# d%d%d%d% % 2 ,,,, 2 #\n") + "# ---- # # , ,,, , #\n") + "# ############ ,,, ,,,, #\n") + "# # , #** # 2 , #\n") + "# ---- #, , % *# #\n") + "#£-' -£# $$ ##%###########%###\n") + "#£- '-£# $$ # # #\n") + "###%#### , , # ,,,,,,, % $$ #\n") + "# % # # $ $ #\n") + "# 1 ################## $ $ #\n") + "# 1 # #* * # $$ #\n") + "# # ! ; # # #\n") + "# 1 # 3 3 % ** ####%###\n") + "# # ## ; # # #\n") + "####%### ;;# ##%### #\n") + "# .... # ;; ;# #b b# ,, #\n") + "# .... # ## ; # b # ,,, #\n") + "# .... # 3 3 #b % ,,, #\n") + "# .... # ! # bb # #\n") + "# K K # #b b# #\n") + "############################--##\n") + "#$..$..$..$..$..$..$..$..$#,,,,#\n") + "#.........................#,,,,#\n") + "###&&&&&&&&&&&&&&&&&&&&&###,,,,#\n") + "#c 1 £ 1 =K#,, #\n") + "# £ 1 £ =# #\n") + "# ################# #\n") + "# & , ,2, ,, , 2 #\n") + "#c & , , , ,2 , ,,, d#\n") + "################################\n") + "");
levels[10] = ((((((((((((((((((((((((((((((((((((((("noname\n" + "3\n") + "16\n") + "2\n") + "3\n") + "32\n") + "32\n") + "################################\n") + "# #b # b#\n") + "# 4 # ... - ... #\n") + "# #%#%#%#%#%#%# # .K. - .K. #\n") + "# %'%5%5%'%5%5%:::# ... - ... #\n") + "# #%#%#%#%#%#%#: # d#d #\n") + "# %5%£%$%d%£%5%:4 ##---###---##\n") + "# #%#%#%#%#%#%# :# d#d #\n") + "# %5%d%K%K%$%'%: :# ... - ... #\n") + "# #%#%#%#%#%#%#:4:# .K. - .K. #\n") + "# %'%£%K%K%£%5%: # ... - ... #\n") + "# #%#%#%#%#%#%# #b # b#\n") + "# %'%$%d%£%$%5% ##---###---##\n") + "# #%#%#%#%#%#%# # #\n") + "# %5%'%5%5%'%'% # ::: #\n") + "# #%#%#%#%#%#%# - ::: #\n") + "# - ::: #\n") + "# # ::: #\n") + "# # #\n") + "###########################---##\n") + "# ># ::::: b# ::::: # #\n") + "# # ::::: # ::::: # 1 1 #\n") + "# # ####### # ####### # #\n") + "# # £# # £# # ... #\n") + "# # * # * # * # * # 1.1.#\n") + "# # * # * # * # * #.....#\n") + "# # # # # # #\n") + "# £#£ # £#£ # £# #\n") + "# ####### # ####### # ######-###\n") + "# ::::: # ::::: # ::::: #\n") + "# ::::: # ::::: b# ::::: #\n") + "################################\n") + "");
levels[11] = ((((((((((((((((((((((((((((((((((((((("noname\n" + "2\n") + "2\n") + "48\n") + "7\n") + "32\n") + "32\n") + "################################\n") + "# , bb#;;;% % ££#\n") + "# 2 #;3;% % c££#\n") + "# 2 , 2 #;;;% % ££#\n") + "# , ##### ######\n") + "###### # ;;; ;;; #\n") + "# # ##### ##### ;3; ;3; #\n") + "# . - # % % # ;;; ;;; #\n") + "# # #;;;% % $ #%%%%%%%%%%#\n") + "# 1 ### ##;3;% % £b #\n") + "#. #'# #;;;% % $ #%%%%%%%%%%#\n") + "# # # % % # #\n") + "# $ # # ##### ##### $ c #\n") + "#! . # # # # £££c #\n") + "# £ # # # , ############\n") + "#d. # #d , # #\n") + "# . # # b#c . 1 . #\n") + "# £ # # # # #\n") + "# . # # # ## ## ## ##\n") + "#d $ # # ##### ##### # .# #\n") + "# # # % % # # # #\n") + "# 1 .#'# #£ % %;;;# 1 # # 1 #\n") + "# ### ##£b % %;3;# # # #\n") + "# . # #$ % %;;;# # # #\n") + "# - # % % #. . . #\n") + "# # ##### ##### . #\n") + "###### # #\n") + "# # . #\n") + "# 3 - K £ £ K #\n") + "# > 1 c # 1 c 1 #\n") + "# # $ $ dd#\n") + "################################\n") + "");
levels[12] = ((((((((((((((((((((((((((((((((((((((("noname\n" + "23\n") + "17\n") + "48\n") + "7\n") + "32\n") + "32\n") + "################################\n") + "# ; 33 # #,,,,# #£d**** #\n") + "# ;# > #,2,,- ####### #\n") + "#a£# #$a#33# #,,,,# #\n") + "#### #### #####,,,,##### # # #\n") + "# ;# #bbbb# # # # #\n") + "# ; ; # K / # # #*#\n") + "# # # #### #££££# # # # #\n") + "#$a# #a£#33#####,,,,#####%% # #\n") + "#### #### 3 ;#,,2,#aK . # # #\n") + "#; #,,,,#££ .# #-#\n") + "# ; ################c# #\n") + "# # # # #. *#;;;# / # ### #\n") + "#a£# #$a#; # K$#;3;# # #\n") + "#### #### # . #;;;#' # #####\n") + "# ; # ####&&&##-## #'''#\n") + "# 3 # = # # #'K'#\n") + "# ; #####%%#### # # #'''#\n") + "###### ' %: a a# ###### #%# #\n") + "#$,,,##### 4: # b#$$.1 ;. #'#\n") + "#b,,, # : #######!£;.;.; # #\n") + "##,,,### # ####'# #d£ ; 3 .#'#\n") + "# , # # # ##########-#\n") + "# /, '########## # #3.;1 # #\n") + "# , ,#K. a - # 5 #.;..$ #\n") + "#' 2 ########## # K*#;1.# ##\n") + "# 2$ #K. . - #*a #..$ $.#\n") + "# a, ########## # 5 #.# #;.#\n") + "# , - # *#c $;.1#\n") + "# a$/ ####### ## ## #..3 #\n") + "# ' #a a a#\n") + "################################\n") + "");
}
}
}//package src.level
Section 116 (2.31 KiB) ●
//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 _local17:String;
var _local18:int;
var _local5:Array = _arg3.split("\n");
var _local6:int;
var _temp1 = _local6;
_local6 = (_local6 + 1);
var _local7:String = _local5[_temp1];
var _temp2 = _local6;
_local6 = (_local6 + 1);
var _local8:int = parseInt(_local5[_temp2]);
var _temp3 = _local6;
_local6 = (_local6 + 1);
var _local9:int = parseInt(_local5[_temp3]);
var _temp4 = _local6;
_local6 = (_local6 + 1);
var _local10:int = parseInt(_local5[_temp4]);
var _temp5 = _local6;
_local6 = (_local6 + 1);
var _local11:int = parseInt(_local5[_temp5]);
var _temp6 = _local6;
_local6 = (_local6 + 1);
var _local12:int = parseInt(_local5[_temp6]);
var _temp7 = _local6;
_local6 = (_local6 + 1);
var _local13:int = parseInt(_local5[_temp7]);
var _local14:Array = new Array();
var _local15:int;
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++;
};
var _local16:Level = 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 117 (2.6 KiB) ●
//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);
super();
if (_arg1 == 0){
_arg1 = getTimer();
};
mt = new Array(N);
init_genrand(_arg1);
}
public function nextInt(_arg1:uint):uint{
return (((genrand_int32() & 2147483647) % _arg1));
}
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++;
};
}
public function nextFloat():Number{
return ((next(24) / 16777216));
}
public function nextDouble():Number{
return ((next(24) / 16777216));
}
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);
}
private function next(_arg1:uint):uint{
return ((genrand_int32() & ((uint(1) << _arg1) - uint(1))));
}
}
}//package src.math
Section 118 (1.87 KiB) ●
//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 xa:Number;
private var ya:Number;
private var lifeTime:Number;// = 1
private var floatSpeed:Number;// = 1
private var startTime:uint;
private var yp:Number;
private var xp:Number;
public function BombParticle(_arg1:Number, _arg2:Number){
this.xp = _arg1;
this.yp = _arg2;
var _local3:Number = ((Math.random() * Math.PI) * 2);
var _local4:Number = (((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);
var _local5:Number = 1;
var _local6:Number = 1;
var _local7:Number = 1;
var _local8:Number = 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;
_local2 = ((getTimer() - startTime) / 1000);
if (_local2 > lifeTime){
removeEventListener(Event.ENTER_FRAME, advanceTime);
parent.removeChild(this);
};
var _local3:Number = Math.sqrt(_local2);
x = (xp + (xa * _local3));
y = ((yp + (ya * _local3)) - ((_local3 * 6) * floatSpeed));
var _local4:Number = (((_local2 / lifeTime) * 2) - 1);
if (_local4 < 0){
_local4 = 0;
};
alpha = ((1 - _local4) * (1 - _local4));
}
}
}//package src.particle
Section 119 (2.04 KiB) ●
//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 xa:Number;
private var ya:Number;
private var lifeTime:Number;// = 1
private var floatSpeed:Number;// = 1
private var startTime:uint;
private var yp:Number;
private var xp:Number;
public function BurnPowerupParticle(_arg1:Number, _arg2:Number){
var _local7:Number;
super();
this.xp = _arg1;
this.yp = _arg2;
var _local3:Number = ((Math.random() * Math.PI) * 2);
var _local4:Number = ((((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);
var _local5:Number = Math.random();
var _local6:Number = (Math.random() * _local5);
_local7 = (Math.random() * _local7);
var _local8:Number = ((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;
_local2 = ((getTimer() - startTime) / 1000);
if (_local2 > lifeTime){
removeEventListener(Event.ENTER_FRAME, advanceTime);
parent.removeChild(this);
};
var _local3:Number = _local2;
x = (xp + (xa * _local3));
y = ((yp + (ya * _local3)) - ((_local3 * 6) * floatSpeed));
var _local4:Number = (((_local2 / lifeTime) * 2) - 1);
if (_local4 < 0){
_local4 = 0;
};
alpha = ((1 - _local4) * (1 - _local4));
}
}
}//package src.particle
Section 120 (1.76 KiB) ●
//EnemyDeathParticle (src.particle.EnemyDeathParticle)
package src.particle {
import flash.utils.*;
import flash.events.*;
import flash.geom.*;
public class EnemyDeathParticle extends Particle {
private var xa:Number;
private var ya:Number;
private var lifeTime:Number;// = 1
private var floatSpeed:Number;// = 1
private var startTime:uint;
private var yp:Number;
private var xp:Number;
public function EnemyDeathParticle(_arg1:Number, _arg2:Number){
this.xp = _arg1;
this.yp = _arg2;
var _local3:Number = ((Math.random() * Math.PI) * 2);
var _local4:Number = ((((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);
var _local5:Number = 1;
var _local6:Number = 1;
var _local7:Number = 1;
var _local8:Number = (Math.random() * 0.2);
transform.colorTransform = new ColorTransform((_local5 * _local8), (_local6 * _local8), (_local7 * _local8));
}
public function advanceTime(_arg1:Event):void{
var _local2:Number = ((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)));
var _local3:Number = (((_local2 / lifeTime) * 2) - 1);
if (_local3 < 0){
_local3 = 0;
};
alpha = ((1 - _local3) * (1 - _local3));
}
}
}//package src.particle
Section 121 (1.91 KiB) ●
//HouseDeathParticle (src.particle.HouseDeathParticle)
package src.particle {
import flash.utils.*;
import flash.events.*;
import flash.geom.*;
public class HouseDeathParticle extends Particle {
private var xa:Number;
private var ya:Number;
private var lifeTime:Number;// = 1
private var floatSpeed:Number;// = 1
private var startTime:uint;
private var yp:Number;
private var xp:Number;
public function HouseDeathParticle(_arg1:Number, _arg2:Number){
this.xp = ((_arg1 + (Math.random() * 16)) - 8);
this.yp = ((_arg2 + (Math.random() * 16)) - 8);
var _local3:Number = ((Math.random() * Math.PI) * 2);
var _local4:Number = (((((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);
var _local5:Number = 1;
var _local6:Number = 1;
var _local7:Number = 1;
var _local8:Number = (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 = ((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)));
var _local3:Number = (((_local2 / lifeTime) * 2) - 1);
if (_local3 < 0){
_local3 = 0;
};
alpha = ((1 - _local3) * (1 - _local3));
}
}
}//package src.particle
Section 122 (2.11 KiB) ●
//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 xa:Number;
private var spinSpeed:Number;// = 0
private var ya:Number;
private var lifeTime:Number;// = 1
private var floatSpeed:Number;// = 1
private var startTime:uint;
private var spinOffset:Number;// = 0
private var yp:Number;
private var xp:Number;
private var bomberMan:BomberMan;
public function HurtPlayerParticle(_arg1:Number, _arg2:Number){
this.xp = ((_arg1 + (Math.random() * 32)) - 16);
this.yp = (((_arg2 + (Math.random() * 24)) - 12) - 24);
var _local3:Number = ((Math.random() * Math.PI) * 2);
var _local4:Number = ((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);
var _local5:Number = 1;
var _local6:Number = 1;
var _local7:Number = 1;
var _local8:Number = ((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 = ((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));
var _local3:Number = (((_local2 / lifeTime) * 2) - 1);
if (_local3 < 0){
_local3 = 0;
};
alpha = (((1 - _local3) * (1 - _local3)) * 0.8);
}
}
}//package src.particle
Section 123 (155 B)
//Particle (src.particle.Particle)
package src.particle {
import flash.display.*;
public class Particle extends MovieClip {
}
}//package src.particle
Section 124 (2.39 KiB) ●
//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 xa:Number;
private var spinSpeed:Number;// = 0
private var ya:Number;
private var lifeTime:Number;// = 1
private var floatSpeed:Number;// = 1
private var startTime:uint;
private var spinOffset:Number;// = 0
private var yp:Number;
private var xp:Number;
private var bomberMan:BomberMan;
public function PickupParticle(_arg1:Number, _arg2:Number, _arg3:int, _arg4:BomberMan){
this.xp = _arg1;
this.yp = _arg2;
var _local5:Number = ((Math.random() * Math.PI) * 2);
var _local6:Number = ((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);
var _local7:Number = 1;
var _local8:Number = 1;
var _local9:Number = 0;
var _local10:Number = ((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 = ((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)));
var _local3:Number = (((_local2 / lifeTime) * 2) - 1);
if (_local3 < 0){
_local3 = 0;
};
alpha = ((1 - _local3) * (1 - _local3));
}
}
}//package src.particle
Section 125 (879 B)
//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(){
buttons = new Array(8);
old = new Array(8);
super();
var _local1:int;
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;
while (_local1 < 8) {
old[_local1] = buttons[_local1];
_local1++;
};
}
}
}//package src.player
Section 126 (1.77 KiB) ●
//KeyboardController (src.player.KeyboardController)
package src.player {
import flash.ui.*;
public class KeyboardController extends Controller {
private var isKeyDown:Array;
private var mapList:Array;
private var keyMappings:Array;
public function KeyboardController(){
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);
var _local1:int;
while (_local1 < 0x0100) {
isKeyDown[_local1] = false;
_local1++;
};
}
public function toggleKey(_arg1:uint, _arg2:Boolean):void{
isKeyDown[_arg1] = _arg2;
}
public function releaseAllKeys():void{
var _local1:int;
while (_local1 < 0x0100) {
isKeyDown[_local1] = false;
_local1++;
};
}
override public function tick():void{
var _local2:int;
super.tick();
var _local1:int;
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++;
};
}
public function bind(_arg1:int, _arg2:int):void{
keyMappings[_arg1] = _arg2;
mapList.push(_arg1);
}
}
}//package src.player
Section 127 (4.87 KiB) ●
//Player (src.player.Player)
package src.player {
import src.screen.game.*;
import src.entity.*;
import src.*;
import src.math.*;
public class Player {
public var potions:int;// = 0
public var random:MtRandom;
private var animation:GameEntity;// = null
public var bomberMan:BomberMan;
public var hurtTick:int;
public var maxBombs:int;
public var score:int;
public var invulnTime:int;
public var controller:Controller;
private var health:int;
public var activeBombs:int;// = 0
public var exitToLevel:int;// = -1
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();
maxBombs = START_BOMBS;
firePower = START_FIRE;
super();
this.gameScreen = _arg1;
random = _arg1.nextRandom();
health = MAX_HEALTH;
}
public function setAnimation(_arg1:GameEntity):void{
animation = _arg1;
}
private function getPowerupCount():int{
return (((maxBombs - START_BOMBS) + (firePower - START_FIRE)));
}
public function isAlive():Boolean{
return (!((bomberMan == null)));
}
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 addPotion():void{
potions++;
}
public function reset():void{
exitToLevel = -1;
invulnTime = 0;
hurtTick = 0;
health = MAX_HEALTH;
}
public function canBomb():Boolean{
if (activeBombs >= maxBombs){
return (false);
};
return (true);
}
public function needsPowerup():Boolean{
return ((random.nextInt(MAX_INVENTORY) > getPowerupCount()));
}
public function canGetKey():Boolean{
return (true);
}
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 canGetPowerup():Boolean{
return (true);
}
public function setExit(_arg1:int):void{
exitToLevel = _arg1;
}
public function getHealth():int{
return (health);
}
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 addScore(_arg1:int):void{
score = (score + _arg1);
}
public function addHealth(_arg1:int):void{
health = (health + _arg1);
if (health > MAX_HEALTH){
health = MAX_HEALTH;
};
}
public function setController(_arg1:Controller):void{
this.controller = _arg1;
}
public function getStatus():int{
if (animation != null){
return (0);
};
if (!(isAlive())){
return (-1);
};
return ((exitToLevel + 1));
}
private function spawn(_arg1:Boolean):void{
var _local3:BomberMan;
var _local4:int;
var _local5:int;
bomberMan = null;
var _local2:int;
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);
};
}
public function newLevel():void{
activeBombs = 0;
if (exitToLevel != -1){
exitToLevel = -1;
} else {
if (!(gameScreen.maySpawnWithinLevel())){
};
};
spawn(true);
}
}
}//package src.player
Section 128 (2.15 KiB) ●
//RecorderController (src.player.RecorderController)
package src.player {
public class RecorderController extends Controller {
private var fullString:String;// = ""
private var lastKey:int;// = 0
private var run:int;// = 0
private var controller:Controller;
private var encodedString:String;// = ""
public static const BASE_64_CHARS:String = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
public function RecorderController(_arg1:Controller){
this.controller = _arg1;
buttons = _arg1.buttons;
old = _arg1.old;
}
public function flush():String{
var _local1:String = (encodedString + BASE_64_CHARS.charAt(run));
encodedString = "";
lastKey = 0;
run = 0;
return (_local1);
}
override public function isTyped(_arg1:int):Boolean{
return (controller.isTyped(_arg1));
}
public function flushIfLongerThan(_arg1:int):String{
if (encodedString.length >= _arg1){
return (flush());
};
return (null);
}
override public function tick():void{
controller.tick();
var _local1:int;
var _local2:int;
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 _local5:int;
var _local6:int;
var _local2:String = "";
var _local3:int;
var _local4:int;
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 129 (562 B)
//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){
this.data = _arg1;
}
override public function tick():void{
super.tick();
var _local1:int = RecorderController.BASE_64_CHARS.indexOf(data.charAt(dp++));
var _local2:int;
while (_local2 < 8) {
buttons[_local2] = (((_local1 >> _local2) & 1) == 1);
_local2++;
};
}
}
}//package src.player
Section 130 (4.06 KiB) ●
//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 remainingTicks:int;
public var player:Player;
public var camera:GameCamera;
private var levelNum:int;// = 0
private var doAbort:Boolean;// = false
private var seed:int;
private var tickCount:int;// = 0
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){
remainingTicks = GAME_TIME;
super();
this.levelLoader = _arg1;
this.levelData = _arg3;
this.levelNum = _arg2;
this.seed = _arg4;
}
public function reset():void{
remainingTicks = GAME_TIME;
player.reset();
doAbort = false;
}
override public function init():void{
nextLevel();
blastPassage.getGraphicsContext().fill(0);
}
override public function render(_arg1:Number):void{
if (level == null){
return;
};
var _local2:Boolean = (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 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();
}
override public function tick():void{
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();
};
};
var _local1:Boolean = true;
var _local2:Boolean = true;
var _local3:int = 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++;
}
public function maySpawnWithinLevel():Boolean{
return (true);
}
protected function allCompleted(_arg1:int):void{
blastPassage.levelWon();
}
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 nextRandom():MtRandom{
return (level.nextRandom());
}
public function renderSidePanel(_arg1:Number):void{
}
}
}//package src.screen.game
Section 131 (662 B)
//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){
this.gameScreen = _arg1;
}
override public function shadowTick():void{
gameScreen.shadowTick();
}
override public function render(_arg1:Number):void{
gameScreen.renderSidePanel(_arg1);
}
override public function tick():void{
gameScreen.shadowTick();
if (--timeLeft <= 0){
blastPassage.setScreen(gameScreen);
};
}
}
}//package src.screen.game
Section 132 (741 B)
//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 shadowTick():void{
}
public function removed():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 133 (2.21 KiB) ●
//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;
while (_local1 < activeSounds.length) {
activeSounds[_local1].stop();
_local1++;
};
}
public function play(_arg1:Number=1, _arg2:Number=0):ManagedSoundChannel{
var _local3:SoundChannel = new ClassReference().play(0, 0, new SoundTransform(_arg1, _arg2));
return (new ManagedSoundChannel(manager, this, _local3));
}
public function loop(_arg1:Number=1, _arg2:Number=0):ManagedSoundChannel{
var _local3:SoundChannel = new ClassReference().play(0, 999999999, new SoundTransform(_arg1, _arg2));
return (new ManagedSoundChannel(manager, this, _local3));
}
public function fadeToAndStop(_arg1:Number, _arg2:Number):void{
var _local3:int;
while (_local3 < activeSounds.length) {
activeSounds[_local3].fadeToAndStop(_arg1, _arg2);
_local3++;
};
}
public function isPlaying():Boolean{
return ((activeSounds.length > 0));
}
public function update():void{
var _local1:int;
while (_local1 < activeSounds.length) {
activeSounds[_local1].update();
_local1++;
};
}
public function fadeTo(_arg1:Number, _arg2:Number):void{
var _local3:int;
while (_local3 < activeSounds.length) {
activeSounds[_local3].fadeTo(_arg1, _arg2);
_local3++;
};
}
public function panTo(_arg1:Number, _arg2:Number):void{
var _local3:int;
while (_local3 < activeSounds.length) {
activeSounds[_local3].panTo(_arg1, _arg2);
_local3++;
};
}
public function setPan(_arg1:Number):void{
var _local2:int;
while (_local2 < activeSounds.length) {
activeSounds[_local2].setPan(_arg1);
_local2++;
};
}
public function setVolume(_arg1:Number):void{
var _local2:int;
while (_local2 < activeSounds.length) {
activeSounds[_local2].setVolume(_arg1);
_local2++;
};
}
}
}//package src.sound
Section 134 (3.85 KiB) ●
//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 stopAfterFade:Boolean;// = false
private var panEndTime:Number;// = -1
private var fadeEndTime:Number;// = -1
private var manager:SoundManager;
private var playing:Boolean;// = true
private var panStartTime:Number;// = -1
private var fadeStartTime:Number;// = -1
private var panEndVolume:Number;// = -1
private var panStartVolume:Number;// = -1
public function ManagedSoundChannel(_arg1:SoundManager, _arg2:ManagedSound, _arg3:SoundChannel){
this.manager = _arg1;
this.sound = _arg2;
this.channel = _arg3;
_arg2.activeSounds.push(this);
if (_arg3 == null){
soundComplete(null);
return;
};
_arg3.addEventListener(Event.SOUND_COMPLETE, soundComplete);
targetVolume = _arg3.soundTransform.volume;
targetPan = _arg3.soundTransform.pan;
update();
}
public function stop():void{
if (!(playing)){
return;
};
if (channel == null){
return;
};
channel.stop();
soundComplete(null);
}
public function update():void{
var _local1:Number;
if (!(playing)){
return;
};
if (fadeStartTime >= 0){
_local1 = ((getTimer() - fadeStartTime) / (fadeEndTime - fadeStartTime));
if (_local1 < 0){
_local1 = 0;
};
if (_local1 > 1){
_local1 = 1;
};
targetVolume = (fadeStartVolume + ((fadeEndVolume - fadeStartVolume) * _local1));
targetVolume = (targetVolume * targetVolume);
if (_local1 == 1){
fadeStartTime = -1;
};
if ((((_local1 == 1)) && (stopAfterFade))){
stop();
};
};
if (panStartTime >= 0){
_local1 = ((getTimer() - panStartTime) / (panEndTime - panStartTime));
if (_local1 < 0){
_local1 = 0;
};
if (_local1 > 1){
_local1 = 1;
};
targetPan = (panStartVolume + ((panEndVolume - panStartVolume) * _local1));
if (_local1 == 1){
panStartTime = -1;
};
};
var _local2:Number = (targetVolume * manager.volume);
var _local3:Number = targetPan;
if (channel == null){
return;
};
if (((!((_local2 == channel.soundTransform.volume))) || (!((_local3 == channel.soundTransform.pan))))){
channel.soundTransform = new SoundTransform(_local2, _local3);
};
}
public function 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 135 (2.08 KiB) ●
//SoundManager (src.sound.SoundManager)
package src.sound {
import flash.utils.*;
public class SoundManager {
private var fadeStartVolume:Number;// = -1
private var lastTime:Number;// = -1
private var managedSounds:Array;
private var fadeEndTime:Number;// = -1
private var fadeStartTime:Number;// = -1
private var fadeEndVolume:Number;// = -1
public var volume:Number;// = 1
private var managedSoundMap:Object;
public function SoundManager(){
managedSoundMap = new Object();
managedSounds = new Array();
super();
}
public function update():void{
var _local3:Number;
var _local1:Number = getTimer();
if (lastTime < 0){
lastTime = _local1;
};
if (fadeStartTime >= 0){
_local3 = ((getTimer() - fadeStartTime) / (fadeEndTime - fadeStartTime));
if (_local3 < 0){
_local3 = 0;
};
if (_local3 > 1){
_local3 = 1;
};
volume = (fadeStartVolume + ((fadeEndVolume - fadeStartVolume) * _local3));
volume = (volume * volume);
if (_local3 == 1){
fadeStartTime = -1;
};
};
var _local2:int;
while (_local2 < managedSounds.length) {
managedSounds[_local2].update();
_local2++;
};
}
public function stopAll():void{
var _local1:int;
while (_local1 < managedSounds.length) {
managedSounds[_local1].stop();
_local1++;
};
}
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;
}
}
}//package src.sound
Section 136 (1.92 KiB) ●
//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 parse(_arg1:String):void{
var _local2:XMLDocument = new XMLDocument(_arg1);
textMappings = new Object();
var _local3:Array = _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);
var _local4:int;
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 137 (4.75 KiB) ●
//ReplayData (src.util.ReplayData)
package src.util {
import src.player.*;
public class ReplayData {
public static const data:String = <data>
<entry id="1" time="2009-05-13 13:41:16"><![CDATA[933,_0o291l8Pc34cc38fo983o686a32ii6j63316332i6c4l0u1o938rcDeocie6u6s3=0]]></entry>
<entry id="2" time="2009-05-13 13:41:24"><![CDATA[933,0s3ecu6el6x2c0A498_89a6bo9lr6b693b699b696p3r3bc9f8u9cb3362r1l0943=0]]></entry>
<entry id="3" time="2009-05-13 13:41:31"><![CDATA[933,04u6lm669m96xm66cefc38M961r3lj3h61399p919h616991Y0G4rc6s3c6s94663=0]]></entry>
<entry id="4" time="2009-05-13 13:41:39"><![CDATA[933,06_6l260l1u93p3o6cc4cc9o9839c1oh6p399p696p693199616061l230_0o4i63=0]]></entry>
<entry id="5" time="2009-05-13 13:41:46"><![CDATA[933,06626632c6um3i32l361c96b32c6i0fgc4lcf6S2r664i2l391G93p39683occcs3=0]]></entry>
<entry id="6" time="2009-05-13 13:41:53"><![CDATA[933,0s3cG89c943cf632f664u038393199fp9bfj633296cm66f4uc9460S2c331_1993=0]]></entry>
<entry id="7" time="2009-05-13 13:42:03"><![CDATA[933,083oc8i99p699p399p393b32u1o0_064rcu4ocl8_8x931_1f332c694M2M331c93=0]]></entry>
<entry id="8" time="2009-05-13 13:42:10"><![CDATA[933,0899_99b33f139ibi9i890r2l3xb39383oc86a3e6c6s9o386ci436i4i6f4icr63=0]]></entry>
<entry id="9" time="2009-05-13 13:42:22"><![CDATA[933,0692V0l8_931r3ij31M3329031i0M83098P9f1333296rm666m66Y2Y331_168u93=0]]></entry>
<entry id="10" time="2009-05-13 13:42:31"><![CDATA[933,09i1l998cco83g6h61f3cj93J230_0c4u0f8i938Acu8i93p6o389oc8rcr4fcfs3=0]]></entry>
<entry id="11" time="2009-05-13 13:42:41"><![CDATA[933,0s3cS8r0G163cb3p6968399p3o983c_cr436_6D4666k346c6s9c_c6890A2o3Sb3=0]]></entry>
<entry id="12" time="2009-05-13 13:42:47"><![CDATA[933,0bor6j339j3i626i92A3r1c9lb32i331u9o8393pcbfp99i89968lcc869c13h633=0]]></entry>
<entry id="13" time="2009-05-13 13:42:56"><![CDATA[933,03xj9h993b336j3h6163J0_034lcVs6cAs6c9s6ccs6c64J6D4f692l3f938fc343=0]]></entry>
<entry id="14" time="2009-05-13 13:43:06"><![CDATA[933,04u6Vs68lcr4l0Y1o3r2c6f4A6f2i3613968l9i1i9ubir3p6968ici8f9fp99983=0]]></entry>
<entry id="15" time="2009-05-13 13:43:12"><![CDATA[933,08i9fb33D2ia39op699b63c2636hc1c33238o9lbfa68ro9p39Ab336j939j62r33=0]]></entry>
<entry id="16" time="2009-05-13 13:43:21"><![CDATA[933,033j3i6296Y4i09cJ6icce3u3s6cre6u3s3cMec6x066f038x9Ab93cj61l9ip693=0]]></entry>
<entry id="17" time="2009-05-13 13:43:27"><![CDATA[933,09lblr39ob93ijf39b6r3j333b93r2l6P460c43cis6c9s6899Ap3h91ih9j33i23=0]]></entry>
<entry id="18" time="2009-05-13 13:43:39"><![CDATA[933,02S0r4ccG869ip69Mbx392i361P9c8ic_c3e329931_392o6om666e3cAe36Aco43=0]]></entry>
<entry id="19" time="2009-05-13 13:43:49"><![CDATA[933,06c4i632V3x296f2c3_339Jb336ic2V3c29i6236Mefu6ecu6e6u6ei4ucl8P9f13=0]]></entry>
<entry id="20" time="2009-05-13 13:43:59"><![CDATA[933,01i3Aj63_36j636j9362_26634_4ucPs38fo986o6899c1r392G169c1c29664Ms3=0]]></entry>
<entry id="21" time="2009-05-13 13:44:06"><![CDATA[933,0s64r6l293r296946cM436lm669m963e96f46c366230_0l46cM43662f36h3p393=0]]></entry>
<entry id="22" time="2009-05-13 13:44:19"><![CDATA[933,0998lci86931J9A8ccle62ri3j33f1_1i0J2c634M0_0Y1l8ocAe36i2o6_6Ye6u3=0]]></entry>
<entry id="23" time="2009-05-13 13:44:31"><![CDATA[933,0e9u9e6u9e666eru9ec6f2P33bir6bir6b6961_1_1S0_0c13332A6V4lcl4lc_c3=0]]></entry>
<entry id="24" time="2009-05-13 13:44:41"><![CDATA[933,0cus3k349k643k94663m36_230u8V9cp696p999362f6_0l8_8693p98ioc8x0d=0]]></entry>
<entry id="25" time="2009-05-13 13:44:41"><![CDATA[782,5034=5034]]></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 = logData[_arg1];
if (((!((_local3 == null))) && (!((_local3 == _arg2))))){
trace(("Expected: " + _local3));
trace((" Got: " + _local3));
};
}
public static function parseReplayData():void{
var _local3:String;
var _local1:Array = data.split("\n");
var _local2:int;
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 138 (425 B)
//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 139 (16.01 KiB) ● ● ●
//BlastPassage (src.BlastPassage)
package src {
import src.sound.*;
import src.util.*;
import src.particle.*;
import src.gui.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import src.player.*;
import src.level.*;
import flash.external.*;
import flash.ui.*;
import flash.system.*;
import src.screen.game.*;
import src.screen.*;
public class BlastPassage extends MovieClip {
private var recorderController:RecorderController;
private var lastTime:Number;// = -1
private var lastX:Number;// = 0
public var pauseWithoutFocus:Boolean;// = false
protected var outro:Outro;
public var logField:TextField;
public var controller:KeyboardController;
public var fpsMeter:TextField;
private var frames:int;
protected var isIntroOver:Boolean;// = false
private var screenCover:ScreenCover;
private var paused:Boolean;// = false
private var mouseHidden:Boolean;// = false
private var lastY:Number;// = 0
protected var gdp:GameDataParser;
protected var levelLoader:LevelLoader;
public var gui:Gui;
public var gameHolder:MovieClip;
public var focusNagger:MovieClip;
private var lastFade:Number;// = -1
private var lastMouseUpdateTime:int;// = 0
private var areLevelsLoaded:Boolean;// = false
private var hasSentQuit:Boolean;// = false
protected var deathAnimTicks:int;// = -1
protected var hasSentGameEnd:Boolean;// = false
private var fps:int;
private var gr:GraphicsContext;
private var screen:Screen;
public var DEBUG_XML:String;
public var intro:Intro;
public var introButtons:IntroButtons;
private var focused:Boolean;// = false
private var tickCount:int;// = 0
public var particleLayer:Sprite;
public var gameScreen:GameScreen;
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(){
DEBUG_XML = <gamedata randomseed="742908561">
<text id="instructions_1">Styr BomBjörn med piltangenterna.</text>
<text id="click_to_focus">Klicka för att spela!</text>
<text id="total_score">Totalpoäng</text>
<text id="click_to_start">Klicka för att starta. Spelet startar om [0] sekunder.</text>
<text id="score">Poäng</text>
<text id="instructions_8">Samla nycklar för att öppna dörrar, och använd utgången för att klara nivån.</text>
<text id="game_won">DU KLARADE DET!</text>
<text id="instructions_9">KLICKA FÖR ATT BÖRJA SPELA!</text>
<text id="instructions_6">Plocka upp trolldryck när du kan.</text>
<text id="instructions_7">Använd trolldryck med Enter, den förstör alla fiender på skärmen.</text>
<text id="bonus_time">Tidsbonus</text>
<text id="instructions_4">Bomber kan skada dig och förstöra specialföremål.</text>
<text id="instructions_5">Syre är hälsa. Samla syrgastuber för att fylla på ditt förråd.</text>
<text id="instructions_2">Släpp bomber med mellanslagstangenten.</text>
<text id="instructions_3">Spräng fiendernas hus för att få specialföremål.</text>
<text id="out_of_time">SLUT PÅ TID!</text>
<text id="game_over">SPELET ÄR SLUT!</text>
<text id="time">Tid</text>
<text id="game_ends_in">Spelet slutar om [0] sekunder.</text>
<text id="out_of_oxygen">SLUT PÅ SYRE!</text>
<text id="game_quit">DU AVSLUTADE SPELET</text>
<text id="bonus_life">Syrebonus</text>
<levelnum>3</levelnum><level>noname
16
20
17
51
32
32
################################
#££££££#. ...'.. - #
#£ b£#.########## .... - ..c#
#£b £#.#.. .. - .... - .. #
#£ b £# #.####.# - ..K- ...#
#££££££#...... .# ---- .. - ...#
#%%%%%%########## - .. - ..K#
# : : ::: ::: - . - c#
# a # :&&&&#&&&: - ---- #
# : :& & : - - #
# 4 &= =&: - - #
# # 4 ::& & #-- -----###
# a :& &: - c - bb#
# : &&&$ &&& --#-- .... #
# 4* : & $& : # .... #
# #$ & : # . #
# # 4 # $# # K---#
# 4 % a #--###########---- .#
# # #; # . ..#
# # # # #;K # .# . #
# a # #££# #;; # #K--#
# * a #;;# #3; #--##- #
# # % * #;;#b b#;; 3# -''- #
# #;;######; # ---- #
# # * #;;; 3 #b b#
# % K # # ; 3 # . .. #
#%% % # # .... #
# # # * # d ###### . . #
# #%%## # 1..... #
# % # # > .1......#
#? % d# $ $ $ # .1......#
################################
</level></gamedata>
.toString();
controller = new KeyboardController();
recorderController = new RecorderController(controller);
gdp = new GameDataParser();
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();
var bmp:Bitmap = 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();
}
public function gameAborted():void{
var _local1:int;
var _local2:int;
endGame(Outro.GAME_ABORTED, _local1, _local2);
}
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 pauseGame(_arg1:Event=null):void{
controller.releaseAllKeys();
Mouse.show();
paused = true;
}
public function levelWon():void{
var _local1:int = (int(((gameScreen.remainingTicks * 1000) / GameScreen.GAME_TIME)) + 1000);
var _local2:int = gameScreen.player.getHealth();
endGame(Outro.GAME_WON, _local1, _local2);
}
public function updateFade(_arg1:Number):void{
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg1 > 1){
_arg1 = 1;
};
if (_arg1 == lastFade){
return;
};
lastFade = _arg1;
screenCover.visible = !((_arg1 == 0));
screenCover.alpha = (_arg1 * _arg1);
var _local2:Number = 1;
var _local3:Number = (1 - (_arg1 * (_local2 + 1)));
if (_local3 < 0){
_local3 = 0;
};
if (_local3 > 1){
_local3 = 1;
};
_local3 = (((1 - ((1 - _local3) * (1 - _local3))) * 0.995) + 0.005);
var _local4:Number = (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 unpauseGame(_arg1:Event=null):void{
paused = false;
}
public function togglePauseGame(_arg1:Event=null):void{
if (!(paused)){
pauseGame(_arg1);
} else {
unpauseGame(_arg1);
};
}
public function sendQuit():void{
if (!(hasSentQuit)){
trace("Quit!");
try {
fscommand("gameQuit");
} catch(e) {
};
hasSentQuit = true;
};
}
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 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 playerDead():void{
var _local1:int;
var _local2:int;
endGame(Outro.OUT_OF_LIFE, _local1, _local2);
}
public function keyDown(_arg1:KeyboardEvent):void{
controller.toggleKey(_arg1.keyCode, true);
}
public function getFocus(_arg1:Event):void{
focusNagger.visible = false;
focused = true;
}
public function setScreen(_arg1:Screen):void{
if (screen != null){
screen.removed();
};
screen = _arg1;
if (screen != null){
screen.setBlastPassage(this);
};
}
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 getGraphicsContext():GraphicsContext{
return (gr);
}
public function outOfTime():void{
var _local1:int;
var _local2:int = gameScreen.player.getHealth();
endGame(Outro.OUT_OF_TIME, _local1, _local2);
}
protected function showInstructions():void{
isIntroOver = false;
intro = new Intro(this);
intro.x = 320;
intro.y = 240;
addChild(intro);
addChild(introButtons);
}
public function loseFocus(_arg1:Event):void{
focusNagger.visible = true;
controller.releaseAllKeys();
focused = false;
}
public function addParticle(_arg1:Particle):void{
particleLayer.addChild(_arg1);
}
public function abortGame():Boolean{
if (gameScreen != null){
if (paused){
unpauseGame();
};
return (gameScreen.abortGame());
};
return (false);
}
public function checkStartGame():void{
if (((!(isIntroOver)) || (!(areLevelsLoaded)))){
return;
};
startGame();
}
public function levelsLoaded():void{
areLevelsLoaded = true;
checkStartGame();
}
public function keyUp(_arg1:KeyboardEvent):void{
controller.toggleKey(_arg1.keyCode, false);
}
public function introOver():void{
isIntroOver = true;
removeChild(introButtons);
checkStartGame();
}
public function updateMouseVisibility():void{
var _local1:Boolean = (mouseX < ((GAME_AREA_WIDTH * 2) + gameHolder.x));
if (((!((lastX == mouseX))) || (!((lastY == mouseY))))){
lastX = mouseX;
lastY = mouseY;
lastMouseUpdateTime = getTimer();
};
var _local2:Boolean = ((_local1) && (((getTimer() - lastMouseUpdateTime) > 1000)));
if (((!((_local2 == mouseHidden))) || (((tickCount % 20) == 0)))){
mouseHidden = _local2;
if (_local2){
Mouse.hide();
} else {
Mouse.show();
};
};
}
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 advanceTime(_arg1:Event):void{
var aa:Number;
var e = _arg1;
BlastPassage.music.update();
BlastPassage.sound.update();
var now:Number = getTimer();
if (lastTime < 0){
lastTime = now;
};
var msPerTick:Number = (1000 / TICKS_PER_SECOND);
if (((DEBUG_MODE) && (REPLAY_MODE))){
msPerTick = (msPerTick / 20);
};
var ticksThisFrame:int;
while ((now - lastTime) > msPerTick) {
if (((!(paused)) && (((focused) || (!(pauseWithoutFocus)))))){
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();
};
};
if (isIntroOver){
tickCount++;
};
if ((tickCount % TICKS_PER_SECOND) == 0){
fps = frames;
fpsMeter.text = ("FPS: " + fps);
frames = 0;
};
};
lastTime = (lastTime + msPerTick);
};
updateMouseVisibility();
var alpha:Number = ((now - lastTime) / msPerTick);
if (((((!(focused)) && (pauseWithoutFocus))) || (paused))){
alpha = 1;
};
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++;
var str:String = recorderController.flushIfLongerThan(64);
try {
if (str != null){
ExternalInterface.call("playData", (((PLAYDATA_CMD_DATA + ",") + str) + "=0"));
};
} catch(e) {
};
gui.update();
}
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();
}
protected function startup():void{
showInstructions();
}
public function levelStarted(_arg1:int):void{
}
}
}//package src
Section 140 (3.72 KiB) ●
//BlastPassageStandAlone (src.BlastPassageStandAlone)
package src {
import src.level.*;
import src.util.*;
import com.midasplayer.*;
import src.gui.*;
import flash.display.*;
public class BlastPassageStandAlone extends BlastPassage implements ButtonListener {
public var levelPicker:LevelChooser;
public var TEXT_MAPPINGS:String;
public var introScreen:MovieClip;
public function BlastPassageStandAlone(){
TEXT_MAPPINGS = <gamedata randomseed="1887208361">
<text id="out_of_oxygen">Oxygen is out! </text>
<text id="out_of_time">Time is out! </text>
<text id="score">Score</text>
<text id="time">Time</text>
<text id="total_score">Total score</text>
<text id="instructions_1">Use the arrow keys to control the Space Bear. </text>
<text id="instructions_2">Press the space bar to throw bombs. \n</text>
<text id="instructions_3">Bomb enemy nests for power-ups\n</text>
<text id="instructions_4">Bombs will damage you and destroy power-ups. </text>
<text id="instructions_5">Oxygen equals health. Collect tubes to replenish your supply. \n</text>
<text id="instructions_6">Collect potions as much as possible. \n</text>
<text id="instructions_7">Use potions with the Enter key and destroy all enemies on the screen. </text>
<text id="instructions_8">Collect keys to open doors and exit to complete the level. \n</text>
<text id="instructions_9">Click to start the game! </text>
<text id="out_of_oxygen">Out of oxygen! </text>
<text id="out_of_time">Out of time! </text>
<text id="score">Score</text>
<text id="time">Time</text>
<text id="total_score">Total score</text>
</gamedata>
;
super();
levelLoader = new DownloadLevelLoader(this);
pauseWithoutFocus = true;
}
override public function introOver():void{
isIntroOver = true;
removeChild(introButtons);
levelPicker.show(this);
}
override public function sendQuit():void{
removeChild(outro);
outro = null;
deathAnimTicks = -1;
gui.reset();
stopGame();
levelPicker.show(this);
stage.focus = this;
}
override public function endGame(_arg1:int, _arg2:int, _arg3:int):void{
super.endGame(_arg1, _arg2, _arg3);
if (_arg1 == Outro.GAME_WON){
levelPicker.levelWon((_arg2 + _arg3));
} else {
levelPicker.levelLost();
};
}
override public function startGame():void{
removeChild(introScreen);
isIntroOver = false;
showInstructions();
}
override protected function getGameData(_arg1:GameDataParser):void{
_arg1.parse(TEXT_MAPPINGS);
}
public function backToMainMenu():void{
levelPicker.hide();
addChild(introScreen);
levelPicker.reset();
}
override protected function startup():void{
introScreen.highscoreButton.init(this, 1000);
introScreen.moneyButton.init(this, 1001);
introScreen.homepageButton.init(this, 1002);
introScreen.moreGamesButton.init(this, 1003);
introScreen.startButton.init(this, 1);
introScreen.kingButton.init(this, 1004);
}
public function buttonToggled(_arg1:int, _arg2:Boolean):Boolean{
if (_arg1 == 1000){
KingAPI.openHighscoresLink();
};
if (_arg1 == 1001){
KingAPI.openMoneyLink("blast-passage");
};
if (_arg1 == 1002){
KingAPI.openAddToWebsiteLink();
};
if (_arg1 == 1003){
KingAPI.openOtherGamesLink();
};
if (_arg1 == 1004){
KingAPI.openSignLink();
};
getFocus(null);
if (_arg1 == 1){
startGame();
};
return (true);
}
public function playLevel(_arg1:int):void{
gdp.levelNum = (_arg1 + 1);
levelPicker.hide();
super.startGame();
}
}
}//package src
Section 141 (6.86 KiB) ● ●
//GraphicsContext (src.GraphicsContext)
package src {
import flash.display.*;
import art.*;
import flash.geom.*;
public class GraphicsContext {
private var r2:Rectangle;
private var r3:Rectangle;
public var bullet:BitmapData;
private var p:Point;
public var floor:BitmapData;
public var ghost: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 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;
public var fire: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 bm:BitmapData;
private var width:int;
public var wall:BitmapData;
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 _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);
var _local3:int;
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 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 colorize(_arg1:BitmapData, _arg2:BitmapData, _arg3:int):void{
var _local4:Number = ((_arg3 & 3) / 3);
var _local5:Number = (((_arg3 >> 2) & 3) / 3);
var _local6:Number = (((_arg3 >> 4) & 3) / 3);
var _local7:Number = (((_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 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 142 (2.31 KiB) ●
//Intro (src.Intro)
package src {
import flash.utils.*;
import flash.events.*;
import src.util.*;
import flash.display.*;
import flash.text.*;
public class Intro extends MovieClip {
private var hasPlayedNextMusic:Boolean;// = false
public var textField:TextField;
private var startTime:int;// = 0
public var clickToStartText:TextField;
private var blastPassage:BlastPassage;
private var lastFrame:int;// = -1
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){
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{
BlastPassage.music.update();
BlastPassage.sound.update();
var _local2:int = int((((getTimer() - startTime) / 1000) * 10));
if (_local2 > FRAME_COUNT){
_local2 = FRAME_COUNT;
};
if (_local2 == lastFrame){
return;
};
var _local3:int = ((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));
var _local4:int;
var _local5:int;
while (_local5 < TEXT_FRAMES.length) {
if (TEXT_FRAMES[_local5] <= (_local2 + 1)){
_local4++;
};
_local5++;
};
var _local6:String = 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 143 (0.98 KiB)
//IntroButtons (src.IntroButtons)
package src {
import src.gui.*;
import flash.display.*;
public class IntroButtons extends MovieClip implements ButtonListener {
public var quitButton:GuiButton;
private var blastPassage:BlastPassage;
public var musicButton:GuiButton;
public var soundButton: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 144 (2.87 KiB) ●
//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 topTitle:TextField;
private var blinkTime:int;// = 0
public var totalScoreTitle:TextField;
private var startTime:int;// = 0
public var bonusTitle2:TextField;
private var lastTime:int;
public var bonus:TextField;
public var score:TextField;
public var scoreTitle:TextField;
private var happyEnding:Boolean;// = true
public var shouldSkip:Boolean;// = false
public var outroBear:MovieClip;
public var bonus2:TextField;
public var totalScore:TextField;
public var bonusTitle: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){
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 advanceTime(_arg1:Event):void{
var _local3:int;
var _local2:int = 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));
};
}
public function clicked(_arg1:MouseEvent):void{
if ((getTimer() - startTime) > 500){
shouldSkip = true;
};
}
}
}//package src
Section 145 (145 B)
//ScreenCover (src.ScreenCover)
package src {
import flash.display.*;
public dynamic class ScreenCover extends MovieClip {
}
}//package src
Section 146 (121 B)
//libGlow (libGlow)
package {
import flash.display.*;
public dynamic class libGlow extends MovieClip {
}
}//package
Section 147 (127 B)
//mcGlimmer (mcGlimmer)
package {
import flash.display.*;
public dynamic class mcGlimmer extends MovieClip {
}
}//package
Section 148 (1.17 KiB) ●
//MochiBot (MochiBot)
package {
import flash.system.*;
import flash.net.*;
import flash.display.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4:String = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 149 (109 B)
//music (music)
package {
import src.gui.*;
public dynamic class music extends GuiButton {
}
}//package
Section 150 (109 B)
//pause (pause)
package {
import src.gui.*;
public dynamic class pause extends GuiButton {
}
}//package
Section 151 (109 B)
//power (power)
package {
import src.gui.*;
public dynamic class power extends GuiButton {
}
}//package
Section 152 (115 B)
//sfxBell (sfxBell)
package {
import flash.media.*;
public dynamic class sfxBell extends Sound {
}
}//package
Section 153 (109 B)
//sound (sound)
package {
import src.gui.*;
public dynamic class sound extends GuiButton {
}
}//package
Section 154 (228 B)
//spark (spark)
package {
import flash.display.*;
public dynamic class spark extends MovieClip {
public function spark(){
addFrameScript(22, frame23);
}
function frame23(){
gotoAndStop("loop");
}
}
}//package