commit 4db96b0bae806c6c839be781c1d66aab3145eac7 Author: bionickatana Date: Sat Oct 10 15:50:17 2026 -0600 initial commit, kind of working. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b31aca0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +venv/ +__pycache__/ +*.py[cod] +*.egg-info/ +.pytest_cache/ +.mypy_cache/ +.ruff_cache/ +build/ +dist/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..3fb386e --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# Diamond Hollow II Pygame Preservation Port + +This repository is being converted from the decompiled Adobe Flash/Flixel game material into a clean Python/Pygame-CE preservation-style rewrite. + +## Decisions + +- Preserve the main gameplay and original look. +- Use the extracted original assets from the Flash game. +- Do not port external tracking, ads, site locking, Mochi, Playtomic, Newgrounds, or Kongregate integrations. +- Use a new local save format later; Flash save compatibility is not required. +- Build a plain runnable Pygame-CE app, not a packaged executable. +- Start with a visually faithful main menu, then Chapter 1 gameplay. +- Preserve mouse aiming/shooting early; keyboard aiming can be omitted unless needed. +- Use idiomatic Pygame-CE plus a small game-specific helper layer inspired by Flixel concepts. + +## Layout + +- `src/dhii/`: Python source for the Pygame port. +- `assets/`: curated runtime assets copied from the extracted Flash material. +- `research/`: original SWF and decompiled/extracted reference material. +- `venv/`: local virtual environment, not part of the app. + +## Running + +Install the package into the local virtual environment, then run the module: + +```bash +venv/bin/python -m pip install -e . +venv/bin/python -m dhii +``` + +The game renders internally at `360x240` and scales to a `720x480` window, matching the Flash version. diff --git a/assets/images/boss_door.png b/assets/images/boss_door.png new file mode 100644 index 0000000..ae30c73 Binary files /dev/null and b/assets/images/boss_door.png differ diff --git a/assets/images/bullet_prime.png b/assets/images/bullet_prime.png new file mode 100644 index 0000000..04f46be Binary files /dev/null and b/assets/images/bullet_prime.png differ diff --git a/assets/images/button_boss_locked.png b/assets/images/button_boss_locked.png new file mode 100644 index 0000000..89d644c Binary files /dev/null and b/assets/images/button_boss_locked.png differ diff --git a/assets/images/button_credits.png b/assets/images/button_credits.png new file mode 100644 index 0000000..fa28c6e Binary files /dev/null and b/assets/images/button_credits.png differ diff --git a/assets/images/button_escape_locked.png b/assets/images/button_escape_locked.png new file mode 100644 index 0000000..09d93de Binary files /dev/null and b/assets/images/button_escape_locked.png differ diff --git a/assets/images/button_help.png b/assets/images/button_help.png new file mode 100644 index 0000000..44c6029 Binary files /dev/null and b/assets/images/button_help.png differ diff --git a/assets/images/button_host.png b/assets/images/button_host.png new file mode 100644 index 0000000..4e86466 Binary files /dev/null and b/assets/images/button_host.png differ diff --git a/assets/images/button_minigame.png b/assets/images/button_minigame.png new file mode 100644 index 0000000..19ab67e Binary files /dev/null and b/assets/images/button_minigame.png differ diff --git a/assets/images/button_more_games.png b/assets/images/button_more_games.png new file mode 100644 index 0000000..61c7261 Binary files /dev/null and b/assets/images/button_more_games.png differ diff --git a/assets/images/button_options.png b/assets/images/button_options.png new file mode 100644 index 0000000..b5f17e1 Binary files /dev/null and b/assets/images/button_options.png differ diff --git a/assets/images/button_pegas.png b/assets/images/button_pegas.png new file mode 100644 index 0000000..4529c55 Binary files /dev/null and b/assets/images/button_pegas.png differ diff --git a/assets/images/button_story.png b/assets/images/button_story.png new file mode 100644 index 0000000..8601500 Binary files /dev/null and b/assets/images/button_story.png differ diff --git a/assets/images/ch1_bg1.png b/assets/images/ch1_bg1.png new file mode 100644 index 0000000..e232c55 Binary files /dev/null and b/assets/images/ch1_bg1.png differ diff --git a/assets/images/ch1_bg2.png b/assets/images/ch1_bg2.png new file mode 100644 index 0000000..f9845b0 Binary files /dev/null and b/assets/images/ch1_bg2.png differ diff --git a/assets/images/ch1_bg3.png b/assets/images/ch1_bg3.png new file mode 100644 index 0000000..247e43e Binary files /dev/null and b/assets/images/ch1_bg3.png differ diff --git a/assets/images/ch1_map.png b/assets/images/ch1_map.png new file mode 100644 index 0000000..9ecefda Binary files /dev/null and b/assets/images/ch1_map.png differ diff --git a/assets/images/ch1_overlay.png b/assets/images/ch1_overlay.png new file mode 100644 index 0000000..540cfa7 Binary files /dev/null and b/assets/images/ch1_overlay.png differ diff --git a/assets/images/ch1_tiles.png b/assets/images/ch1_tiles.png new file mode 100644 index 0000000..ec343da Binary files /dev/null and b/assets/images/ch1_tiles.png differ diff --git a/assets/images/checkpoint.png b/assets/images/checkpoint.png new file mode 100644 index 0000000..096c3f3 Binary files /dev/null and b/assets/images/checkpoint.png differ diff --git a/assets/images/checkpoint_red.png b/assets/images/checkpoint_red.png new file mode 100644 index 0000000..e4134eb Binary files /dev/null and b/assets/images/checkpoint_red.png differ diff --git a/assets/images/diamond.png b/assets/images/diamond.png new file mode 100644 index 0000000..1d68bfd Binary files /dev/null and b/assets/images/diamond.png differ diff --git a/assets/images/enemy_bird.png b/assets/images/enemy_bird.png new file mode 100644 index 0000000..179cfeb Binary files /dev/null and b/assets/images/enemy_bird.png differ diff --git a/assets/images/enemy_bouncing_slime.png b/assets/images/enemy_bouncing_slime.png new file mode 100644 index 0000000..eed3bbc Binary files /dev/null and b/assets/images/enemy_bouncing_slime.png differ diff --git a/assets/images/enemy_ceiling_plant.png b/assets/images/enemy_ceiling_plant.png new file mode 100644 index 0000000..66e3e06 Binary files /dev/null and b/assets/images/enemy_ceiling_plant.png differ diff --git a/assets/images/enemy_plant.png b/assets/images/enemy_plant.png new file mode 100644 index 0000000..c822a5a Binary files /dev/null and b/assets/images/enemy_plant.png differ diff --git a/assets/images/enemy_seed.png b/assets/images/enemy_seed.png new file mode 100644 index 0000000..dc24cf3 Binary files /dev/null and b/assets/images/enemy_seed.png differ diff --git a/assets/images/enemy_slime.png b/assets/images/enemy_slime.png new file mode 100644 index 0000000..d407832 Binary files /dev/null and b/assets/images/enemy_slime.png differ diff --git a/assets/images/enemy_slime_king.png b/assets/images/enemy_slime_king.png new file mode 100644 index 0000000..dea15e5 Binary files /dev/null and b/assets/images/enemy_slime_king.png differ diff --git a/assets/images/enemy_spider.png b/assets/images/enemy_spider.png new file mode 100644 index 0000000..05570cc Binary files /dev/null and b/assets/images/enemy_spider.png differ diff --git a/assets/images/enemy_spike.png b/assets/images/enemy_spike.png new file mode 100644 index 0000000..11030c1 Binary files /dev/null and b/assets/images/enemy_spike.png differ diff --git a/assets/images/heart_crystal.png b/assets/images/heart_crystal.png new file mode 100644 index 0000000..2d5e83f Binary files /dev/null and b/assets/images/heart_crystal.png differ diff --git a/assets/images/heart_empty.png b/assets/images/heart_empty.png new file mode 100644 index 0000000..b330390 Binary files /dev/null and b/assets/images/heart_empty.png differ diff --git a/assets/images/heart_full.png b/assets/images/heart_full.png new file mode 100644 index 0000000..3b314bc Binary files /dev/null and b/assets/images/heart_full.png differ diff --git a/assets/images/main_menu_background_1.png b/assets/images/main_menu_background_1.png new file mode 100644 index 0000000..e232c55 Binary files /dev/null and b/assets/images/main_menu_background_1.png differ diff --git a/assets/images/main_menu_background_2.png b/assets/images/main_menu_background_2.png new file mode 100644 index 0000000..f9845b0 Binary files /dev/null and b/assets/images/main_menu_background_2.png differ diff --git a/assets/images/main_menu_background_3.png b/assets/images/main_menu_background_3.png new file mode 100644 index 0000000..247e43e Binary files /dev/null and b/assets/images/main_menu_background_3.png differ diff --git a/assets/images/main_menu_title.png b/assets/images/main_menu_title.png new file mode 100644 index 0000000..39a7465 Binary files /dev/null and b/assets/images/main_menu_title.png differ diff --git a/assets/images/main_menu_title_glow.png b/assets/images/main_menu_title_glow.png new file mode 100644 index 0000000..42dfd95 Binary files /dev/null and b/assets/images/main_menu_title_glow.png differ diff --git a/assets/images/mouse_cursor.png b/assets/images/mouse_cursor.png new file mode 100644 index 0000000..d9a11dd Binary files /dev/null and b/assets/images/mouse_cursor.png differ diff --git a/assets/images/player.png b/assets/images/player.png new file mode 100644 index 0000000..1cc01dd Binary files /dev/null and b/assets/images/player.png differ diff --git a/assets/images/player_dot.png b/assets/images/player_dot.png new file mode 100644 index 0000000..2e2845f Binary files /dev/null and b/assets/images/player_dot.png differ diff --git a/assets/images/player_gun_down.png b/assets/images/player_gun_down.png new file mode 100644 index 0000000..030aa42 Binary files /dev/null and b/assets/images/player_gun_down.png differ diff --git a/assets/images/player_gun_right.png b/assets/images/player_gun_right.png new file mode 100644 index 0000000..40983e2 Binary files /dev/null and b/assets/images/player_gun_right.png differ diff --git a/assets/images/player_gun_up.png b/assets/images/player_gun_up.png new file mode 100644 index 0000000..9bd6c39 Binary files /dev/null and b/assets/images/player_gun_up.png differ diff --git a/assets/images/player_shield.png b/assets/images/player_shield.png new file mode 100644 index 0000000..b5c0226 Binary files /dev/null and b/assets/images/player_shield.png differ diff --git a/assets/images/powerup_equipment.png b/assets/images/powerup_equipment.png new file mode 100644 index 0000000..71e3c43 Binary files /dev/null and b/assets/images/powerup_equipment.png differ diff --git a/assets/images/powerup_equipment_border.png b/assets/images/powerup_equipment_border.png new file mode 100644 index 0000000..09bc740 Binary files /dev/null and b/assets/images/powerup_equipment_border.png differ diff --git a/assets/images/powerup_fire.png b/assets/images/powerup_fire.png new file mode 100644 index 0000000..562ac1f Binary files /dev/null and b/assets/images/powerup_fire.png differ diff --git a/assets/images/powerup_magnet.png b/assets/images/powerup_magnet.png new file mode 100644 index 0000000..f569bd7 Binary files /dev/null and b/assets/images/powerup_magnet.png differ diff --git a/assets/images/powerup_shield.png b/assets/images/powerup_shield.png new file mode 100644 index 0000000..4aab370 Binary files /dev/null and b/assets/images/powerup_shield.png differ diff --git a/assets/images/red_diamond.png b/assets/images/red_diamond.png new file mode 100644 index 0000000..c163f67 Binary files /dev/null and b/assets/images/red_diamond.png differ diff --git a/assets/images/steel_crate.png b/assets/images/steel_crate.png new file mode 100644 index 0000000..8848826 Binary files /dev/null and b/assets/images/steel_crate.png differ diff --git a/assets/images/ui_diamonds.png b/assets/images/ui_diamonds.png new file mode 100644 index 0000000..7749e79 Binary files /dev/null and b/assets/images/ui_diamonds.png differ diff --git a/assets/images/wooden_crate.png b/assets/images/wooden_crate.png new file mode 100644 index 0000000..ae19940 Binary files /dev/null and b/assets/images/wooden_crate.png differ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f9e6ae0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,19 @@ +[build-system] +requires = ["setuptools>=68"] +build-backend = "setuptools.build_meta" + +[project] +name = "dhii" +version = "0.1.0" +description = "Diamond Hollow II preservation-style Pygame-CE port" +requires-python = ">=3.11" +dependencies = ["pygame-ce>=2.5"] + +[project.scripts] +dhii = "dhii.main:main" + +[tool.setuptools] +package-dir = {"" = "src"} + +[tool.setuptools.packages.find] +where = ["src"] diff --git a/research/580507_DiamondHollowII.swf b/research/580507_DiamondHollowII.swf new file mode 100644 index 0000000..1bdcb44 Binary files /dev/null and b/research/580507_DiamondHollowII.swf differ diff --git a/research/decompiled/binaryData/6_mochicrypt.ConfigData.bin b/research/decompiled/binaryData/6_mochicrypt.ConfigData.bin new file mode 100644 index 0000000..f1fd735 Binary files /dev/null and b/research/decompiled/binaryData/6_mochicrypt.ConfigData.bin differ diff --git a/research/decompiled/binaryData/7_mochicrypt.Payload.bin b/research/decompiled/binaryData/7_mochicrypt.Payload.bin new file mode 100644 index 0000000..0cc2ba6 Binary files /dev/null and b/research/decompiled/binaryData/7_mochicrypt.Payload.bin differ diff --git a/research/decompiled/frames/1.png b/research/decompiled/frames/1.png new file mode 100644 index 0000000..243c1c3 Binary files /dev/null and b/research/decompiled/frames/1.png differ diff --git a/research/decompiled/frames/2.png b/research/decompiled/frames/2.png new file mode 100644 index 0000000..243c1c3 Binary files /dev/null and b/research/decompiled/frames/2.png differ diff --git a/research/decompiled/images/5_mochicrypt.Background.png b/research/decompiled/images/5_mochicrypt.Background.png new file mode 100644 index 0000000..173d898 Binary files /dev/null and b/research/decompiled/images/5_mochicrypt.Background.png differ diff --git a/research/decompiled/scripts/mochicrypt/Background.as b/research/decompiled/scripts/mochicrypt/Background.as new file mode 100644 index 0000000..209f61d --- /dev/null +++ b/research/decompiled/scripts/mochicrypt/Background.as @@ -0,0 +1,15 @@ +package mochicrypt +{ + import flash.display.Bitmap; + + [Embed(source="/_assets/5_mochicrypt.Background.png")] + public class Background extends Bitmap + { + + public function Background() + { + super(); + } + } +} + diff --git a/research/decompiled/scripts/mochicrypt/Config.as b/research/decompiled/scripts/mochicrypt/Config.as new file mode 100644 index 0000000..0235661 --- /dev/null +++ b/research/decompiled/scripts/mochicrypt/Config.as @@ -0,0 +1,29 @@ +package mochicrypt +{ + internal class Config + { + + private static const data:Object = new ConfigData().readObject(); + + public function Config() + { + super(); + } + + public static function getBool(param1:String, param2:Boolean) : Boolean + { + return data[param1] is Boolean ? Boolean(data[param1]) : param2; + } + + public static function getInt(param1:String, param2:int) : int + { + return data[param1] is int ? int(data[param1]) : param2; + } + + public static function getString(param1:String, param2:String) : String + { + return data[param1] is String ? data[param1] : param2; + } + } +} + diff --git a/research/decompiled/scripts/mochicrypt/ConfigData.as b/research/decompiled/scripts/mochicrypt/ConfigData.as new file mode 100644 index 0000000..3f8df8a --- /dev/null +++ b/research/decompiled/scripts/mochicrypt/ConfigData.as @@ -0,0 +1,15 @@ +package mochicrypt +{ + import flash.utils.ByteArray; + + [Embed(source="/_assets/6_mochicrypt.ConfigData.bin", mimeType="application/octet-stream")] + public class ConfigData extends ByteArray + { + + public function ConfigData() + { + super(); + } + } +} + diff --git a/research/decompiled/scripts/mochicrypt/LockIcon.as b/research/decompiled/scripts/mochicrypt/LockIcon.as new file mode 100644 index 0000000..d2325cd --- /dev/null +++ b/research/decompiled/scripts/mochicrypt/LockIcon.as @@ -0,0 +1,15 @@ +package mochicrypt +{ + import flash.display.MovieClip; + + [Embed(source="/_assets/assets.swf", symbol="symbol4")] + public class LockIcon extends MovieClip + { + + public function LockIcon() + { + super(); + } + } +} + diff --git a/research/decompiled/scripts/mochicrypt/Payload.as b/research/decompiled/scripts/mochicrypt/Payload.as new file mode 100644 index 0000000..3792af9 --- /dev/null +++ b/research/decompiled/scripts/mochicrypt/Payload.as @@ -0,0 +1,15 @@ +package mochicrypt +{ + import flash.utils.ByteArray; + + [Embed(source="/_assets/7_mochicrypt.Payload.bin", mimeType="application/octet-stream")] + public class Payload extends ByteArray + { + + public function Payload() + { + super(); + } + } +} + diff --git a/research/decompiled/scripts/mochicrypt/Preloader.as b/research/decompiled/scripts/mochicrypt/Preloader.as new file mode 100644 index 0000000..494191e --- /dev/null +++ b/research/decompiled/scripts/mochicrypt/Preloader.as @@ -0,0 +1,403 @@ +package mochicrypt +{ + import flash.display.*; + import flash.events.*; + import flash.net.*; + import flash.system.*; + import flash.utils.*; + import mochicrypt.as3.MochiAd; + + [SWF(width="720", height="480", backgroundColor="#333333", frameRate="60")] + public dynamic class Preloader extends MovieClip + { + + private static const VERSION:String = "3.2c"; + + private static const PAYLOAD_NAME:String = "mochicrypt.Payload"; + + private static const PATCH_URL:String = Config.getString("patchURL","http://cdn.mochiads.com/patch.swf"); + + private var payloadLoader:Loader; + + private var patchProgress:Number = 0; + + private var payloadProgress:Number = 0; + + private var payloadDoneTime:Number = -1; + + private var lastProgress:Number = 0; + + private var patchTimeoutMsec:Number = 5000; + + private var patchFailed:Boolean = false; + + public var background:Background; + + private var payloadDone:Boolean = false; + + private var patchDone:Boolean = false; + + public var icon:LockIcon; + + private var patchLoader:Loader = new Loader(); + + public function Preloader() + { + super(); + loaderInfo.addEventListener(ProgressEvent.PROGRESS,this.progressHandler); + loaderInfo.addEventListener(Event.INIT,this.initHandler); + loaderInfo.addEventListener(Event.COMPLETE,this.completeHandler); + loaderInfo.addEventListener(IOErrorEvent.IO_ERROR,this.ioErrorHandler); + } + + public function parse_vsn(param1:String) : Number + { + var _loc2_:Array = param1.split(" ")[1].split(","); + var _loc3_:Number = parseInt(_loc2_[0]); + if(_loc3_ < 10) + { + return _loc3_; + } + if(_loc3_ === 10) + { + return _loc3_ + Math.max(0,parseInt(_loc2_[1]) - 1); + } + return _loc3_ + 2; + } + + public function ad_finished() : void + { + this.finish(); + } + + public function ad_progress(param1:Number) : void + { + } + + private function completeHandler(param1:Event) : void + { + if(this.payloadDone) + { + return; + } + this.payloadDone = true; + nextFrame(); + } + + private function finish() : void + { + var payloadClass:Class; + var data:ByteArray; + var S:ByteArray = null; + var i:uint = 0; + var j:uint = 0; + var k:uint = 0; + var n:uint = 0; + var u:uint = 0; + var v:uint = 0; + var btn:Button = null; + if(this.payloadLoader) + { + return; + } + if(Config.getBool("showLock",true) && Boolean(this.icon)) + { + removeChild(this.icon); + } + removeChild(this.background); + payloadClass = Class(getDefinitionByName(PAYLOAD_NAME)); + data = ByteArray(new payloadClass()); + if(data.length > 0) + { + S = new ByteArray(); + n = data.length - 32; + i = 0; + while(i < 256) + { + S.writeByte(i); + i++; + } + j = 0; + i = 0; + while(i < 256) + { + j = uint(j + S[i] + data[n + (i & 0x1F)] & 0xFF); + u = uint(S[i]); + S[i] = S[j]; + S[j] = u; + i++; + } + if(n > 131072) + { + n = 131072; + } + i = j = 0; + k = 0; + while(k < n) + { + i = uint(i + 1 & 0xFF); + u = uint(S[i]); + j = uint(j + u & 0xFF); + v = uint(S[j]); + S[i] = v; + S[j] = u; + data[k] ^= S[u + v & 0xFF]; + k++; + } + data.uncompress(); + } + if(!this.patchFailed) + { + try + { + data = this.patchLoader.content["patch"](data); + } + catch(error:Error) + { + } + } + if(data[3] > this.parse_vsn(Capabilities.version)) + { + btn = new Button(); + btn.x = (loaderInfo.width - btn.width) / 2; + btn.y = (loaderInfo.height - btn.height) / 2; + addChild(btn); + } + else if(data.length > 0) + { + this.payloadLoader = new Loader(); + addChild(this.payloadLoader); + this.payloadLoader.loadBytes(data); + } + this.patchLoader.unload(); + loaderInfo.removeEventListener(ProgressEvent.PROGRESS,this.progressHandler); + loaderInfo.removeEventListener(Event.INIT,this.initHandler); + loaderInfo.removeEventListener(Event.COMPLETE,this.completeHandler); + loaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,this.ioErrorHandler); + this.patchLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,this.patchIOErrorHandler); + this.patchLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,this.patchProgressHandler); + this.patchLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,this.patchCompleteHandler); + if(this.icon) + { + this.icon.removeEventListener(MouseEvent.CLICK,this.lockClicked); + } + this.patchLoader = null; + } + + private function update_progress() : void + { + var _loc1_:Number = NaN; + if(this.payloadDone) + { + this.payloadProgress = 1; + if(this.payloadDoneTime < 0) + { + this.payloadDoneTime = getTimer(); + } + } + if(this.patchDone) + { + this.patchProgress = 1; + } + else if(this.payloadDone) + { + if(this.patchProgress > this.lastProgress) + { + this.payloadDoneTime = getTimer(); + } + else if(getTimer() - this.payloadDoneTime >= this.patchTimeoutMsec) + { + this.patchDone = true; + this.patchFailed = true; + } + } + this.lastProgress = Math.max(this.lastProgress,Math.min(this.payloadProgress,this.patchProgress)); + } + + public function ad_failed() : void + { + } + + private function initHandler(param1:Event) : void + { + var event:Event = param1; + var options:Object = { + "mochicrypt_version":VERSION, + "id":Config.getString("id","test"), + "res":"" + loaderInfo.width + "x" + loaderInfo.height, + "no_bg":!Config.getBool("adBackground",false), + "color":Config.getInt("barForeColor",16747008), + "background":Config.getInt("barBackColor",16777161), + "outline":Config.getInt("barOutlineColor",13994812), + "bar_offset":(Config.getBool("showLock",true) ? 20 : 0), + "show_lock":Config.getBool("showLock",true), + "no_branding":Config.getBool("noBranding",false), + "clip":this, + "progress_override":this.progress_override, + "ad_started":this.ad_started, + "ad_finished":this.ad_finished, + "ad_loaded":this.ad_loaded, + "ad_failed":this.ad_failed, + "ad_skipped":this.ad_skipped, + "ad_progress":this.ad_progress + }; + this.patchLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,this.patchIOErrorHandler); + this.patchLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,this.patchProgressHandler); + this.patchLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,this.patchCompleteHandler); + try + { + this.patchLoader.load(new URLRequest(PATCH_URL)); + } + catch(error:Error) + { + patchDone = true; + patchFailed = true; + } + this.background = new Background(); + addChild(this.background); + MochiAd.showPreGameAd(options); + if(Config.getBool("showLock",true)) + { + this.icon = new LockIcon(); + this.icon.addFrameScript(49,this.icon.stop); + this.icon.x = 10; + this.icon.y = loaderInfo.height - 20; + this.icon.buttonMode = true; + this.icon.useHandCursor = true; + this.icon.addEventListener(MouseEvent.CLICK,this.lockClicked); + addChild(this.icon); + } + if(Boolean(loaderInfo.bytesTotal) && loaderInfo.bytesLoaded == loaderInfo.bytesTotal) + { + this.completeHandler(event); + } + } + + public function progress_override(param1:Object) : Number + { + this.update_progress(); + return this.lastProgress; + } + + public function ad_loaded(param1:Number, param2:Number) : void + { + } + + private function ioErrorHandler(param1:IOErrorEvent) : void + { + } + + private function patchCompleteHandler(param1:Event) : void + { + if(this.patchDone) + { + return; + } + this.patchDone = true; + this.update_progress(); + } + + public function ad_skipped() : void + { + } + + public function ad_started() : void + { + } + + private function patchProgressHandler(param1:ProgressEvent) : void + { + if(param1.bytesLoaded == param1.bytesTotal) + { + this.patchProgress = 1; + this.patchDone = true; + } + else + { + this.patchProgress = Number(param1.bytesLoaded) / param1.bytesTotal; + } + this.update_progress(); + } + + private function patchIOErrorHandler(param1:IOErrorEvent) : void + { + this.patchDone = true; + this.patchFailed = true; + this.update_progress(); + } + + private function lockClicked(param1:Event) : void + { + navigateToURL(new URLRequest("https://www.mochimedia.com/r/g/" + Config.getString("slug","example-flash_api-test") + "?d=l")); + } + + private function progressHandler(param1:ProgressEvent) : void + { + if(param1.bytesLoaded == param1.bytesTotal) + { + this.payloadProgress = 0; + } + else + { + this.payloadProgress = Number(param1.bytesLoaded) / param1.bytesTotal; + } + this.update_progress(); + } + } +} + +import flash.display.Graphics; +import flash.display.SimpleButton; +import flash.display.Sprite; +import flash.events.Event; +import flash.events.MouseEvent; +import flash.net.URLRequest; +import flash.net.navigateToURL; +import flash.text.TextField; +import flash.text.TextFormat; +import flash.text.TextFormatAlign; + +class Button extends SimpleButton +{ + + public function Button() + { + super(); + var _loc1_:String = "Download the latest\nAdobe Flash Player"; + upState = new State(16777215,_loc1_); + downState = new State(13421772,_loc1_); + hitTestState = upState; + overState = upState; + addEventListener(MouseEvent.CLICK,this.buttonClicked); + width = upState.width; + height = upState.height; + } + + public function buttonClicked(param1:Event) : void + { + navigateToURL(new URLRequest("http://get.adobe.com/flashplayer/")); + } +} + +class State extends Sprite +{ + + public function State(param1:uint, param2:String) + { + super(); + var _loc3_:TextFormat = new TextFormat("Verdana"); + _loc3_.align = TextFormatAlign.CENTER; + var _loc4_:TextField = new TextField(); + _loc4_.text = param2; + _loc4_.multiline = true; + _loc4_.x = _loc4_.y = 2; + _loc4_.setTextFormat(_loc3_); + _loc4_.width = _loc4_.textWidth + 4; + _loc4_.height = _loc4_.textHeight + 4; + addChild(_loc4_); + var _loc5_:Graphics = graphics; + _loc5_.beginFill(param1); + _loc5_.lineStyle(1,0); + _loc5_.drawRoundRect(0,0,_loc4_.width + 4,_loc4_.height + 4,4); + } +} diff --git a/research/decompiled/scripts/mochicrypt/as3/MochiAd.as b/research/decompiled/scripts/mochicrypt/as3/MochiAd.as new file mode 100644 index 0000000..08689ec --- /dev/null +++ b/research/decompiled/scripts/mochicrypt/as3/MochiAd.as @@ -0,0 +1,1032 @@ +package mochicrypt.as3 +{ + import flash.display.DisplayObject; + import flash.display.DisplayObjectContainer; + import flash.display.Loader; + import flash.display.MovieClip; + import flash.events.Event; + import flash.events.IOErrorEvent; + import flash.net.LocalConnection; + import flash.net.URLRequest; + import flash.net.URLRequestMethod; + import flash.net.URLVariables; + import flash.system.Security; + import flash.utils.getTimer; + import flash.utils.setTimeout; + + public class MochiAd + { + + public function MochiAd() + { + super(); + } + + public static function getVersion() : String + { + return MochiServices.getVersion(); + } + + public static function showClickAwayAd(param1:Object) : void + { + var h:Number; + var wh:Array; + var w:Number; + var sendHostProgress:Boolean; + var clip:Object = null; + var mc:MovieClip = null; + var chk:MovieClip = null; + var options:Object = param1; + var DEFAULTS:Object = { + "ad_timeout":2000, + "regpt":"o", + "method":"showClickAwayAd", + "res":"300x250", + "no_bg":true, + "ad_started":function():void + { + }, + "ad_finished":function():void + { + }, + "ad_loaded":function(param1:Number, param2:Number):void + { + }, + "ad_failed":function():void + { + trace("[MochiAd] Couldn\'t load an ad, make sure your game\'s local security sandbox is configured for Access Network Only and that you are not using ad blocking software"); + }, + "ad_skipped":function():void + { + } + }; + options = MochiAd._parseOptions(options,DEFAULTS); + clip = options.clip; + var ad_timeout:Number = Number(options.ad_timeout); + delete options.ad_timeout; + if(!MochiAd.load(options)) + { + options.ad_failed(); + options.ad_finished(); + return; + } + options.ad_started(); + mc = clip._mochiad; + mc["onUnload"] = function():void + { + MochiAd._cleanup(mc); + options.ad_finished(); + }; + wh = MochiAd._getRes(options,clip); + w = Number(wh[0]); + h = Number(wh[1]); + mc.x = w * 0.5; + mc.y = h * 0.5; + chk = createEmptyMovieClip(mc,"_mochiad_wait",3); + chk.ad_timeout = ad_timeout; + chk.started = getTimer(); + chk.showing = false; + mc.unloadAd = function():void + { + MochiAd.unload(clip); + }; + mc.adLoaded = options.ad_loaded; + mc.adSkipped = options.ad_skipped; + mc.rpc = function(param1:Number, param2:Object):void + { + MochiAd.rpc(clip,param1,param2); + }; + sendHostProgress = false; + mc.regContLC = function(param1:String):void + { + mc._containerLCName = param1; + }; + chk["onEnterFrame"] = function():void + { + var _loc4_:Number = NaN; + if(!this.parent) + { + delete this.onEnterFrame; + return; + } + var _loc1_:Object = this.parent._mochiad_ctr; + var _loc2_:Number = getTimer() - this.started; + var _loc3_:Boolean = false; + if(!chk.showing) + { + _loc4_ = Number(this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal); + if(_loc4_ > 0) + { + chk.showing = true; + _loc3_ = true; + chk.started = getTimer(); + } + else if(_loc2_ > chk.ad_timeout) + { + options.ad_failed(); + _loc3_ = true; + } + } + if(this.root == null) + { + _loc3_ = true; + } + if(_loc3_) + { + delete this.onEnterFrame; + } + }; + doOnEnterFrame(chk); + } + + public static function _isNetworkAvailable() : Boolean + { + return Security.sandboxType != "localWithFile"; + } + + public static function _allowDomains(param1:String) : String + { + var _loc2_:String = param1.split("/")[2].split(":")[0]; + if(Security.sandboxType == "application") + { + return _loc2_; + } + Security.allowDomain("*"); + Security.allowDomain(_loc2_); + Security.allowInsecureDomain("*"); + Security.allowInsecureDomain(_loc2_); + return _loc2_; + } + + public static function unload(param1:Object) : Boolean + { + if(Boolean(param1.clip) && Boolean(param1.clip._mochiad)) + { + param1 = param1.clip; + } + if(param1.origFrameRate != undefined) + { + param1.stage.frameRate = param1.origFrameRate; + } + if(!param1._mochiad) + { + return false; + } + if(param1._mochiad._containerLCName != undefined) + { + param1._mochiad.lc.send(param1._mochiad._containerLCName,"notify",{"id":"unload"}); + } + if(param1._mochiad.onUnload) + { + param1._mochiad.onUnload(); + } + delete param1._mochiad_loaded; + delete param1._mochiad; + return true; + } + + public static function showInterLevelAd(param1:Object) : void + { + var h:Number; + var wh:Array; + var w:Number; + var fadeout_time:Number; + var clip:Object = null; + var mc:MovieClip = null; + var chk:MovieClip = null; + var options:Object = param1; + var DEFAULTS:Object = { + "ad_timeout":2000, + "fadeout_time":250, + "regpt":"o", + "method":"showTimedAd", + "ad_started":function():void + { + if(this.clip is MovieClip) + { + this.clip.stop(); + return; + } + throw new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."); + }, + "ad_finished":function():void + { + if(this.clip is MovieClip) + { + this.clip.play(); + return; + } + throw new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."); + }, + "ad_loaded":function(param1:Number, param2:Number):void + { + }, + "ad_failed":function():void + { + trace("[MochiAd] Couldn\'t load an ad, make sure your game\'s local security sandbox is configured for Access Network Only and that you are not using ad blocking software"); + }, + "ad_skipped":function():void + { + } + }; + options = MochiAd._parseOptions(options,DEFAULTS); + clip = options.clip; + var ad_msec:Number = 11000; + var ad_timeout:Number = Number(options.ad_timeout); + delete options.ad_timeout; + fadeout_time = Number(options.fadeout_time); + delete options.fadeout_time; + if(!MochiAd.load(options)) + { + options.ad_failed(); + options.ad_finished(); + return; + } + options.ad_started(); + mc = clip._mochiad; + mc["onUnload"] = function():void + { + MochiAd._cleanup(mc); + options.ad_finished(); + }; + wh = MochiAd._getRes(options,clip); + w = Number(wh[0]); + h = Number(wh[1]); + mc.x = w * 0.5; + mc.y = h * 0.5; + chk = createEmptyMovieClip(mc,"_mochiad_wait",3); + chk.ad_msec = ad_msec; + chk.ad_timeout = ad_timeout; + chk.started = getTimer(); + chk.showing = false; + chk.fadeout_time = fadeout_time; + chk.fadeFunction = function():void + { + if(!this.parent) + { + delete this.onEnterFrame; + delete this.fadeFunction; + return; + } + var _loc1_:Number = 100 * (1 - (getTimer() - this.fadeout_start) / this.fadeout_time); + if(_loc1_ > 0) + { + this.parent.alpha = _loc1_ * 0.01; + } + else + { + MochiAd.unload(clip); + delete this["onEnterFrame"]; + } + }; + mc.unloadAd = function():void + { + MochiAd.unload(clip); + }; + mc.adLoaded = options.ad_loaded; + mc.adSkipped = options.ad_skipped; + mc.adjustProgress = function(param1:Number):void + { + var _loc2_:Object = mc._mochiad_wait; + _loc2_.server_control = true; + _loc2_.showing = true; + _loc2_.started = getTimer(); + _loc2_.ad_msec = param1 - 250; + }; + mc.rpc = function(param1:Number, param2:Object):void + { + MochiAd.rpc(clip,param1,param2); + }; + chk["onEnterFrame"] = function():void + { + var _loc4_:Number = NaN; + if(!this.parent) + { + delete this.onEnterFrame; + delete this.fadeFunction; + return; + } + var _loc1_:Object = this.parent._mochiad_ctr; + var _loc2_:Number = getTimer() - this.started; + var _loc3_:Boolean = false; + if(!chk.showing) + { + _loc4_ = Number(this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal); + if(_loc4_ > 0) + { + chk.showing = true; + chk.started = getTimer(); + MochiAd.adShowing(clip); + } + else if(_loc2_ > chk.ad_timeout) + { + options.ad_failed(); + _loc3_ = true; + } + } + if(_loc2_ > chk.ad_msec) + { + _loc3_ = true; + } + if(_loc3_) + { + if(this.server_control) + { + delete this.onEnterFrame; + } + else + { + this.fadeout_start = getTimer(); + this.onEnterFrame = this.fadeFunction; + } + } + }; + doOnEnterFrame(chk); + } + + public static function _parseOptions(param1:Object, param2:Object) : Object + { + var _loc4_:String = null; + var _loc5_:Array = null; + var _loc6_:Number = NaN; + var _loc7_:Array = null; + var _loc3_:Object = {}; + for(_loc4_ in param2) + { + _loc3_[_loc4_] = param2[_loc4_]; + } + if(param1) + { + for(_loc4_ in param1) + { + _loc3_[_loc4_] = param1[_loc4_]; + } + } + if(_loc3_.clip == undefined) + { + throw new Error("MochiAd is missing the \'clip\' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."); + } + param1 = _loc3_.clip.loaderInfo.parameters.mochiad_options; + if(param1) + { + _loc5_ = param1.split("&"); + _loc6_ = 0; + while(_loc6_ < _loc5_.length) + { + _loc7_ = _loc5_[_loc6_].split("="); + _loc3_[unescape(_loc7_[0])] = unescape(_loc7_[1]); + _loc6_++; + } + } + if(_loc3_.id == "test") + { + trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!"); + } + return _loc3_; + } + + public static function _cleanup(param1:Object) : void + { + var idx:Number; + var k:String = null; + var lc:LocalConnection = null; + var f:Function = null; + var mc:Object = param1; + if("lc" in mc) + { + lc = mc.lc; + f = function():void + { + try + { + lc.client = null; + lc.close(); + } + catch(e:Error) + { + } + }; + setTimeout(f,0); + } + idx = DisplayObjectContainer(mc).numChildren; + while(idx > 0) + { + idx--; + DisplayObjectContainer(mc).removeChildAt(idx); + } + for(k in mc) + { + delete mc[k]; + } + } + + public static function load(param1:Object) : MovieClip + { + var depth:Number; + var lv:URLVariables; + var wh:Array; + var mc:MovieClip; + var clip:Object = null; + var k:String = null; + var server:String = null; + var hostname:String = null; + var lc:LocalConnection = null; + var name:String = null; + var loader:Loader = null; + var g:Function = null; + var req:URLRequest = null; + var v:Object = null; + var options:Object = param1; + var DEFAULTS:Object = { + "server":"http://x.mochiads.com/srv/1/", + "method":"load", + "depth":10333, + "id":"_UNKNOWN_" + }; + options = MochiAd._parseOptions(options,DEFAULTS); + options.swfv = 9; + options.mav = MochiAd.getVersion(); + clip = options.clip; + if(!(clip is DisplayObject)) + { + trace("Warning: Object passed as container clip not a descendant of the DisplayObject type"); + return null; + } + if(MovieClip(clip).stage == null) + { + trace("Warning: Container clip for ad is not attached to the stage"); + return null; + } + if(!MochiAd._isNetworkAvailable()) + { + return null; + } + try + { + if(clip._mochiad_loaded) + { + return null; + } + } + catch(e:Error) + { + throw new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."); + } + depth = Number(options.depth); + delete options.depth; + mc = createEmptyMovieClip(clip,"_mochiad",depth); + wh = MochiAd._getRes(options,clip); + options.res = wh[0] + "x" + wh[1]; + options.server += options.id; + delete options.id; + clip._mochiad_loaded = true; + if(clip.loaderInfo.loaderURL.indexOf("http") == 0) + { + options.as3_swf = clip.loaderInfo.loaderURL; + } + else + { + trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal"); + } + lv = new URLVariables(); + for(k in options) + { + v = options[k]; + if(!(v is Function)) + { + lv[k] = v; + } + } + server = lv.server; + delete lv.server; + hostname = _allowDomains(server); + lc = new LocalConnection(); + lc.client = mc; + name = ["",Math.floor(new Date().getTime()),Math.floor(Math.random() * 999999)].join("_"); + lc.allowDomain("*","localhost"); + lc.allowInsecureDomain("*","localhost"); + lc.connect(name); + mc.lc = lc; + mc.lcName = name; + lv.lc = name; + lv.st = getTimer(); + loader = new Loader(); + g = function(param1:Object):void + { + param1.target.removeEventListener(param1.type,arguments.callee); + MochiAd.unload(clip); + }; + loader.contentLoaderInfo.addEventListener(Event.UNLOAD,g); + req = new URLRequest(server + ".swf?cacheBust=" + new Date().getTime()); + req.contentType = "application/x-www-form-urlencoded"; + req.method = URLRequestMethod.POST; + req.data = lv; + loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,function(param1:IOErrorEvent):void + { + trace("[MochiAds] Blocked URL"); + }); + if(!options.skip) + { + loader.load(req); + } + mc.addChild(loader); + mc._mochiad_ctr = loader; + return mc; + } + + public static function runMethod(param1:Object, param2:String, param3:Array) : Object + { + var _loc4_:Array = param2.split("."); + var _loc5_:Number = 0; + while(_loc5_ < _loc4_.length - 1) + { + if(param1[_loc4_[_loc5_]] == undefined || param1[_loc4_[_loc5_]] == null) + { + return undefined; + } + param1 = param1[_loc4_[_loc5_]]; + _loc5_++; + } + if(typeof param1[_loc4_[_loc5_]] == "function") + { + return param1[_loc4_[_loc5_]].apply(param1,param3); + } + return undefined; + } + + public static function createEmptyMovieClip(param1:Object, param2:String, param3:Number) : MovieClip + { + var _loc4_:MovieClip = new MovieClip(); + if(false && Boolean(param3)) + { + param1.addChildAt(_loc4_,param3); + } + else + { + param1.addChild(_loc4_); + } + param1[param2] = _loc4_; + _loc4_["_name"] = param2; + return _loc4_; + } + + public static function _getRes(param1:Object, param2:Object) : Array + { + var _loc6_:Array = null; + var _loc3_:Object = param2.getBounds(param2.root); + var _loc4_:Number = 0; + var _loc5_:Number = 0; + if(typeof param1.res != "undefined") + { + _loc6_ = param1.res.split("x"); + _loc4_ = parseFloat(_loc6_[0]); + _loc5_ = parseFloat(_loc6_[1]); + } + else + { + _loc4_ = _loc3_.xMax - _loc3_.xMin; + _loc5_ = _loc3_.yMax - _loc3_.yMin; + } + if(_loc4_ == 0 || _loc5_ == 0) + { + _loc4_ = Number(param2.stage.stageWidth); + _loc5_ = Number(param2.stage.stageHeight); + } + return [_loc4_,_loc5_]; + } + + public static function adShowing(param1:Object) : void + { + param1.origFrameRate = param1.stage.frameRate; + param1.stage.frameRate = 30; + } + + public static function getValue(param1:Object, param2:String) : Object + { + var _loc3_:Array = param2.split("."); + var _loc4_:Number = 0; + while(_loc4_ < _loc3_.length - 1) + { + if(param1[_loc3_[_loc4_]] == undefined || param1[_loc3_[_loc4_]] == null) + { + return undefined; + } + param1 = param1[_loc3_[_loc4_]]; + _loc4_++; + } + return param1[_loc3_[_loc4_]]; + } + + public static function rpc(param1:Object, param2:Number, param3:Object) : void + { + var _loc4_:Object = null; + var _loc5_:Object = null; + switch(param3.id) + { + case "setValue": + MochiAd.setValue(param1,param3.objectName,param3.value); + break; + case "getValue": + _loc4_ = MochiAd.getValue(param1,param3.objectName); + param1._mochiad.lc.send(param1._mochiad._containerLCName,"rpcResult",param2,_loc4_); + break; + case "runMethod": + _loc5_ = MochiAd.runMethod(param1,param3.method,param3.args); + param1._mochiad.lc.send(param1._mochiad._containerLCName,"rpcResult",param2,_loc5_); + break; + default: + trace("[mochiads rpc] unknown rpc id: " + param3.id); + } + } + + public static function setValue(param1:Object, param2:String, param3:Object) : void + { + var _loc4_:Array = param2.split("."); + var _loc5_:Number = 0; + while(_loc5_ < _loc4_.length - 1) + { + if(param1[_loc4_[_loc5_]] == undefined || param1[_loc4_[_loc5_]] == null) + { + return; + } + param1 = param1[_loc4_[_loc5_]]; + _loc5_++; + } + param1[_loc4_[_loc5_]] = param3; + } + + public static function showPreGameAd(param1:Object) : void + { + var bar:MovieClip; + var fadeout_time:Number; + var backing:Object; + var bar_outline:Number; + var progress:Number; + var outline_mc:MovieClip; + var bar_color:Number; + var inside_mc:MovieClip; + var backing_mc:MovieClip; + var outline:Object; + var ad_timeout:Number; + var bar_w:Number; + var wh:Array; + var bar_background:Number; + var ad_msec:Number; + var h:Number; + var f:Function; + var w:Number; + var inside:Object; + var clip:Object = null; + var mc:MovieClip = null; + var chk:MovieClip = null; + var complete:Boolean = false; + var unloaded:Boolean = false; + var sendHostProgress:Boolean = false; + var fn:Function = null; + var r:MovieClip = null; + var options:Object = param1; + var DEFAULTS:Object = { + "ad_timeout":3000, + "fadeout_time":250, + "regpt":"o", + "method":"showPreloaderAd", + "color":16747008, + "background":16777161, + "outline":13994812, + "no_progress_bar":false, + "ad_started":function():void + { + if(this.clip is MovieClip) + { + this.clip.stop(); + return; + } + throw new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."); + }, + "ad_finished":function():void + { + if(this.clip is MovieClip) + { + this.clip.play(); + return; + } + throw new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."); + }, + "ad_loaded":function(param1:Number, param2:Number):void + { + }, + "ad_failed":function():void + { + trace("[MochiAd] Couldn\'t load an ad, make sure your game\'s local security sandbox is configured for Access Network Only and that you are not using ad blocking software"); + }, + "ad_skipped":function():void + { + }, + "ad_progress":function(param1:Number):void + { + }, + "progress_override":function(param1:Object):Number + { + return NaN; + }, + "bar_offset":0 + }; + options = MochiAd._parseOptions(options,DEFAULTS); + if("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") + { + options.ad_started(); + fn = function():void + { + options.ad_finished(); + }; + setTimeout(fn,100); + return; + } + clip = options.clip; + ad_msec = 11000; + ad_timeout = Number(options.ad_timeout); + if(options.skip) + { + ad_timeout = 0; + } + delete options.ad_timeout; + fadeout_time = Number(options.fadeout_time); + delete options.fadeout_time; + if(!MochiAd.load(options)) + { + options.ad_failed(); + options.ad_finished(); + return; + } + options.ad_started(); + mc = clip._mochiad; + mc["onUnload"] = function():void + { + var fn:Function; + MochiAd._cleanup(mc); + fn = function():void + { + options.ad_finished(); + }; + setTimeout(fn,100); + }; + wh = MochiAd._getRes(options,clip); + w = Number(wh[0]); + h = Number(wh[1]); + mc.x = w * 0.5; + mc.y = h * 0.5; + chk = createEmptyMovieClip(mc,"_mochiad_wait",3); + chk.x = w * -0.5; + chk.y = h * -0.5; + bar = createEmptyMovieClip(chk,"_mochiad_bar",4); + if(options.no_progress_bar) + { + bar.visible = false; + delete options.no_progress_bar; + } + else + { + bar.x = 10 + options.bar_offset; + bar.y = h - 20; + } + bar_w = w - bar.x - 10; + bar_color = Number(options.color); + delete options.color; + bar_background = Number(options.background); + delete options.background; + bar_outline = Number(options.outline); + delete options.outline; + backing_mc = createEmptyMovieClip(bar,"_outline",1); + backing = backing_mc.graphics; + backing.beginFill(bar_background); + backing.moveTo(0,0); + backing.lineTo(bar_w,0); + backing.lineTo(bar_w,10); + backing.lineTo(0,10); + backing.lineTo(0,0); + backing.endFill(); + inside_mc = createEmptyMovieClip(bar,"_inside",2); + inside = inside_mc.graphics; + inside.beginFill(bar_color); + inside.moveTo(0,0); + inside.lineTo(bar_w,0); + inside.lineTo(bar_w,10); + inside.lineTo(0,10); + inside.lineTo(0,0); + inside.endFill(); + inside_mc.scaleX = 0; + outline_mc = createEmptyMovieClip(bar,"_outline",3); + outline = outline_mc.graphics; + outline.lineStyle(0,bar_outline,100); + outline.moveTo(0,0); + outline.lineTo(bar_w,0); + outline.lineTo(bar_w,10); + outline.lineTo(0,10); + outline.lineTo(0,0); + chk.ad_msec = ad_msec; + chk.ad_timeout = ad_timeout; + chk.started = getTimer(); + chk.showing = false; + chk.last_pcnt = 0; + chk.fadeout_time = fadeout_time; + chk.fadeFunction = function():void + { + var _loc1_:Number = 100 * (1 - (getTimer() - this.fadeout_start) / this.fadeout_time); + if(_loc1_ > 0) + { + this.parent.alpha = _loc1_ * 0.01; + } + else + { + MochiAd.unload(clip); + delete this["onEnterFrame"]; + } + }; + complete = false; + unloaded = false; + progress = Math.min(1,options.progress_override(clip)); + f = function(param1:Event):void + { + param1.target.removeEventListener(param1.type,arguments.callee); + complete = true; + if(unloaded) + { + MochiAd.unload(clip); + } + }; + if(!isNaN(progress)) + { + complete = progress == 1; + } + else if(clip.loaderInfo.bytesLoaded == clip.loaderInfo.bytesTotal) + { + complete = true; + } + else if(clip.root is MovieClip) + { + r = clip.root as MovieClip; + if(r.framesLoaded >= r.totalFrames) + { + complete = true; + } + else + { + clip.loaderInfo.addEventListener(Event.COMPLETE,f); + } + } + else + { + clip.loaderInfo.addEventListener(Event.COMPLETE,f); + } + mc.unloadAd = function():void + { + unloaded = true; + if(complete) + { + MochiAd.unload(clip); + } + }; + mc.adLoaded = options.ad_loaded; + mc.adSkipped = options.ad_skipped; + mc.adjustProgress = function(param1:Number):void + { + var _loc2_:Object = mc._mochiad_wait; + _loc2_.server_control = true; + _loc2_.showing = true; + _loc2_.started = getTimer(); + _loc2_.ad_msec = param1; + }; + mc.rpc = function(param1:Number, param2:Object):void + { + MochiAd.rpc(clip,param1,param2); + }; + mc.rpcTestFn = function(param1:String):Object + { + trace("[MOCHIAD rpcTestFn] " + param1); + return param1; + }; + mc.regContLC = function(param1:String):void + { + mc._containerLCName = param1; + }; + sendHostProgress = false; + mc.sendHostLoadProgress = function(param1:String):void + { + sendHostProgress = true; + }; + chk["onEnterFrame"] = function():void + { + var _loc12_:Number = NaN; + if(!this.parent || !this.parent.parent) + { + delete this["onEnterFrame"]; + return; + } + var _loc1_:Object = this.parent.parent.root; + var _loc2_:Object = this.parent._mochiad_ctr; + var _loc3_:Number = getTimer() - this.started; + var _loc4_:Boolean = false; + var _loc5_:Number = Number(_loc1_.loaderInfo.bytesTotal); + var _loc6_:Number = Number(_loc1_.loaderInfo.bytesLoaded); + var _loc7_:Number = Math.min(1,options.progress_override(_loc1_)); + if(_loc7_ == 1) + { + complete = true; + } + if(complete) + { + _loc5_ = _loc6_ = Math.max(1,_loc6_); + } + var _loc8_:Number = 100 * _loc6_ / _loc5_; + if(!isNaN(_loc7_)) + { + _loc8_ = 100 * _loc7_; + } + var _loc9_:Number = 100 * _loc3_ / chk.ad_msec; + var _loc10_:Object = this._mochiad_bar._inside; + var _loc11_:Number = Math.min(100,Math.min(_loc8_ || 0,_loc9_)); + _loc11_ = Math.max(this.last_pcnt,_loc11_); + this.last_pcnt = _loc11_; + _loc10_.scaleX = _loc11_ * 0.01; + options.ad_progress(_loc11_); + if(sendHostProgress) + { + clip._mochiad.lc.send(clip._mochiad._containerLCName,"notify",{ + "id":"hostLoadPcnt", + "pcnt":_loc8_ + }); + if(_loc8_ >= 100) + { + sendHostProgress = false; + } + } + if(!chk.showing) + { + _loc12_ = Number(this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal); + if(_loc12_ > 0) + { + chk.showing = true; + chk.started = getTimer(); + MochiAd.adShowing(clip); + } + else if(_loc3_ > chk.ad_timeout && _loc8_ == 100) + { + options.ad_failed(); + _loc4_ = true; + } + } + if(_loc3_ > chk.ad_msec) + { + _loc4_ = true; + } + if(complete && _loc4_) + { + if(unloaded) + { + MochiAd.unload(_loc1_); + } + else if(this.server_control) + { + delete this.onEnterFrame; + } + else + { + this.fadeout_start = getTimer(); + this.onEnterFrame = chk.fadeFunction; + } + } + }; + doOnEnterFrame(chk); + } + + public static function showPreloaderAd(param1:Object) : void + { + trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0"); + MochiAd.showPreGameAd(param1); + } + + public static function showTimedAd(param1:Object) : void + { + trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0"); + MochiAd.showInterLevelAd(param1); + } + + public static function doOnEnterFrame(param1:MovieClip) : void + { + var mc:MovieClip = param1; + var f:Function = function(param1:Object):void + { + if("onEnterFrame" in mc && Boolean(mc.onEnterFrame)) + { + mc.onEnterFrame(); + } + else + { + param1.target.removeEventListener(param1.type,arguments.callee); + } + }; + mc.addEventListener(Event.ENTER_FRAME,f); + } + } +} + diff --git a/research/decompiled/scripts/mochicrypt/as3/MochiCoins.as b/research/decompiled/scripts/mochicrypt/as3/MochiCoins.as new file mode 100644 index 0000000..bd09022 --- /dev/null +++ b/research/decompiled/scripts/mochicrypt/as3/MochiCoins.as @@ -0,0 +1,155 @@ +package mochicrypt.as3 +{ + public class MochiCoins + { + + public static const LOGGED_IN:String = "LoggedIn"; + + public static const LOGGED_OUT:String = "LoggedOut"; + + public static const LOGIN_SHOW:String = "LoginShow"; + + public static const LOGIN_HIDE:String = "LoginHide"; + + public static const STORE_SHOW:String = "StoreShow"; + + public static const STORE_HIDE:String = "StoreHide"; + + public static const LOGIN_SHOWN:String = "LoginShown"; + + public static const PROFILE_SHOW:String = "ProfileShow"; + + public static const PROFILE_HIDE:String = "ProfileHide"; + + public static const PROPERTIES_SAVED:String = "PropertySaved"; + + public static const WIDGET_LOADED:String = "WidgetLoaded"; + + public static const ITEM_OWNED:String = "ItemOwned"; + + public static const ITEM_NEW:String = "ItemNew"; + + public static const STORE_ITEMS:String = "StoreItems"; + + public static const USER_INFO:String = "UserInfo"; + + public static const ERROR:String = "Error"; + + public static const IO_ERROR:String = "IOError"; + + public static const NO_USER:String = "NoUser"; + + public static const PROPERTIES_SIZE:String = "PropertiesSize"; + + private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher(); + + public static var _user_info:Object = null; + + public function MochiCoins() + { + super(); + } + + public static function getUserInfo() : void + { + MochiServices.send("coins_getUserInfo"); + } + + public static function showItem(param1:Object = null) : void + { + if(!param1 || typeof param1.item != "string") + { + trace("ERROR: showItem call must pass an Object with an item key"); + return; + } + MochiServices.bringToTop(); + MochiServices.send("coins_showItem",{"options":param1},null,null); + } + + public static function getVersion() : String + { + return MochiServices.getVersion(); + } + + public static function saveUserProperties(param1:Object) : void + { + MochiServices.send("coins_saveUserProperties",param1); + } + + public static function triggerEvent(param1:String, param2:Object) : void + { + if(param1 == LOGGED_IN) + { + _user_info = param2; + } + else if(param1 == LOGGED_OUT) + { + _user_info = null; + } + _dispatcher.triggerEvent(param1,param2); + } + + public static function removeEventListener(param1:String, param2:Function) : void + { + _dispatcher.removeEventListener(param1,param2); + } + + public static function getStoreItems() : void + { + MochiServices.send("coins_getStoreItems"); + } + + public static function showLoginWidget(param1:Object = null) : void + { + MochiServices.setContainer(); + MochiServices.bringToTop(); + MochiServices.send("coins_showLoginWidget",{"options":param1}); + } + + public static function addEventListener(param1:String, param2:Function) : void + { + _dispatcher.addEventListener(param1,param2); + } + + public static function showStore(param1:Object = null) : void + { + MochiServices.bringToTop(); + MochiServices.send("coins_showStore",{"options":param1},null,null); + } + + public static function hideLoginWidget() : void + { + MochiServices.send("coins_hideLoginWidget"); + } + + public static function getAPIURL() : String + { + if(!_user_info) + { + return null; + } + return _user_info.api_url; + } + + public static function getAPIToken() : String + { + if(!_user_info) + { + return null; + } + return _user_info.api_token; + } + + public static function showVideo(param1:Object = null) : void + { + if(!param1 || typeof param1.item != "string") + { + trace("ERROR: showVideo call must pass an Object with an item key"); + return; + } + MochiServices.bringToTop(); + MochiServices.send("coins_showVideo",{"options":param1},null,null); + } + } +} + diff --git a/research/decompiled/scripts/mochicrypt/as3/MochiEventDispatcher.as b/research/decompiled/scripts/mochicrypt/as3/MochiEventDispatcher.as new file mode 100644 index 0000000..7ef8dc3 --- /dev/null +++ b/research/decompiled/scripts/mochicrypt/as3/MochiEventDispatcher.as @@ -0,0 +1,51 @@ +package mochicrypt.as3 +{ + public class MochiEventDispatcher + { + + private var eventTable:Object; + + public function MochiEventDispatcher() + { + super(); + this.eventTable = {}; + } + + public function triggerEvent(param1:String, param2:Object) : void + { + var _loc3_:Object = null; + if(this.eventTable[param1] == undefined) + { + return; + } + for(_loc3_ in this.eventTable[param1]) + { + this.eventTable[param1][_loc3_](param2); + } + } + + public function removeEventListener(param1:String, param2:Function) : void + { + var _loc3_:Object = null; + if(this.eventTable[param1] == undefined) + { + this.eventTable[param1] = []; + return; + } + for(_loc3_ in this.eventTable[param1]) + { + if(this.eventTable[param1][_loc3_] == param2) + { + this.eventTable[param1].splice(Number(_loc3_),1); + } + } + } + + public function addEventListener(param1:String, param2:Function) : void + { + this.removeEventListener(param1,param2); + this.eventTable[param1].push(param2); + } + } +} + diff --git a/research/decompiled/scripts/mochicrypt/as3/MochiEvents.as b/research/decompiled/scripts/mochicrypt/as3/MochiEvents.as new file mode 100644 index 0000000..a1efcff --- /dev/null +++ b/research/decompiled/scripts/mochicrypt/as3/MochiEvents.as @@ -0,0 +1,119 @@ +package mochicrypt.as3 +{ + import flash.display.MovieClip; + + public class MochiEvents + { + + private static var gameStart:Number; + + private static var levelStart:Number; + + public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived"; + + public static const ALIGN_TOP_LEFT:String = "ALIGN_TL"; + + public static const ALIGN_TOP:String = "ALIGN_T"; + + public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR"; + + public static const ALIGN_LEFT:String = "ALIGN_L"; + + public static const ALIGN_CENTER:String = "ALIGN_C"; + + public static const ALIGN_RIGHT:String = "ALIGN_R"; + + public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL"; + + public static const ALIGN_BOTTOM:String = "ALIGN_B"; + + public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR"; + + public static const FORMAT_SHORT:String = "ShortForm"; + + public static const FORMAT_LONG:String = "LongForm"; + + private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher(); + + public function MochiEvents() + { + super(); + } + + public static function addEventListener(param1:String, param2:Function) : void + { + _dispatcher.addEventListener(param1,param2); + } + + public static function removeEventListener(param1:String, param2:Function) : void + { + _dispatcher.removeEventListener(param1,param2); + } + + public static function startSession(param1:String) : void + { + MochiServices.send("events_beginSession",{"achievementID":param1},null,null); + } + + public static function triggerEvent(param1:String, param2:Object) : void + { + _dispatcher.triggerEvent(param1,param2); + } + + public static function setNotifications(param1:MovieClip, param2:Object) : void + { + var _loc4_:Object = null; + var _loc3_:Object = {}; + for(_loc4_ in param2) + { + _loc3_[_loc4_] = param2[_loc4_]; + } + _loc3_.clip = param1; + MochiServices.send("events_setNotifications",_loc3_,null,null); + } + + public static function endGame() : void + { + var _loc1_:Number = new Date().time - gameStart; + trigger("end_game",{"time":_loc1_}); + } + + public static function startGame() : void + { + gameStart = new Date().time; + trigger("start_game"); + } + + public static function trigger(param1:String, param2:Object = null) : void + { + if(param2 == null) + { + param2 = {}; + } + else if(param2["kind"] != undefined) + { + trace("WARNING: optional arguments package contains key \'id\', it will be overwritten"); + param2["kind"] = param1; + } + MochiServices.send("events_triggerEvent",{"eventObject":param2},null,null); + } + + public static function getVersion() : String + { + return MochiServices.getVersion(); + } + + public static function startLevel() : void + { + levelStart = new Date().time; + trigger("start_level"); + } + + public static function endLevel() : void + { + var _loc1_:Number = new Date().time - levelStart; + trigger("end_level",{"time":_loc1_}); + } + } +} + diff --git a/research/decompiled/scripts/mochicrypt/as3/MochiServices.as b/research/decompiled/scripts/mochicrypt/as3/MochiServices.as new file mode 100644 index 0000000..0609e7b --- /dev/null +++ b/research/decompiled/scripts/mochicrypt/as3/MochiServices.as @@ -0,0 +1,819 @@ +package mochicrypt.as3 +{ + import flash.display.DisplayObject; + import flash.display.DisplayObjectContainer; + import flash.display.Loader; + import flash.display.MovieClip; + import flash.display.Sprite; + import flash.events.Event; + import flash.events.IOErrorEvent; + import flash.events.TimerEvent; + import flash.geom.Rectangle; + import flash.net.LocalConnection; + import flash.net.URLRequest; + import flash.net.URLVariables; + import flash.system.Capabilities; + import flash.system.Security; + import flash.utils.ByteArray; + import flash.utils.Endian; + import flash.utils.Timer; + + public class MochiServices + { + + private static var _container:Object; + + private static var _swfVersion:String; + + private static var _preserved:Object; + + private static var _sendChannel:LocalConnection; + + private static var _clip:MovieClip; + + private static var _id:String; + + private static var _timer:Timer; + + private static var _sendChannelName:String; + + private static var _loader:Loader; + + private static var _mochiLocalConnection:MovieClip; + + public static var onError:Object; + + private static var _servURL:String = "http://www.mochiads.com/static/lib/services/"; + + private static var _services:String = "services.swf"; + + private static var _mochiLC:String = "MochiLC.swf"; + + private static var _listenChannelName:String = "__ms_"; + + private static var _connecting:Boolean = false; + + private static var _connected:Boolean = false; + + public static var netup:Boolean = true; + + public static var netupAttempted:Boolean = false; + + public static var widget:Boolean = false; + + public static var servicesSync:MochiSync = new MochiSync(); + + public function MochiServices() + { + super(); + } + + public static function isNetworkAvailable() : Boolean + { + return Security.sandboxType != "localWithFile"; + } + + public static function get connected() : Boolean + { + return _connected; + } + + private static function onReceive(param1:Object) : void + { + var method:*; + var obj:Object; + var methodName:String = null; + var pkg:Object = param1; + var cb:String = pkg.callbackID; + var cblst:Object = _clip._callbacks[cb]; + if(!cblst) + { + return; + } + method = cblst.callbackMethod; + methodName = ""; + obj = cblst.callbackObject; + if(Boolean(obj) && typeof method == "string") + { + methodName = method; + if(obj[method] != null) + { + method = obj[method]; + } + else + { + trace("Error: Method " + method + " does not exist."); + } + } + if(method != undefined) + { + try + { + method.apply(obj,pkg.args); + } + catch(error:Error) + { + trace("Error invoking callback method \'" + methodName + "\': " + error.toString()); + } + } + else if(obj != null) + { + try + { + obj(pkg.args); + } + catch(error:Error) + { + trace("Error invoking method on object: " + error.toString()); + } + } + delete _clip._callbacks[cb]; + } + + public static function get childClip() : Object + { + return _clip; + } + + public static function send(param1:String, param2:Object = null, param3:Object = null, param4:Object = null) : void + { + if(_connected) + { + _mochiLocalConnection.send(_sendChannelName,"onReceive",{ + "methodName":param1, + "args":param2, + "callbackID":_clip._nextcallbackID + }); + } + else + { + if(_clip == null || !_connecting) + { + trace("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + param1); + handleError(param2,param3,param4); + flush(true); + return; + } + _clip._queue.push({ + "methodName":param1, + "args":param2, + "callbackID":_clip._nextcallbackID + }); + } + if(_clip != null) + { + if(_clip._callbacks != null && _clip._nextcallbackID != null) + { + _clip._callbacks[_clip._nextcallbackID] = { + "callbackObject":param3, + "callbackMethod":param4 + }; + ++_clip._nextcallbackID; + } + } + } + + private static function init(param1:String, param2:Object) : void + { + _id = param1; + if(param2 != null) + { + _container = param2; + loadCommunicator(param1,_container); + } + } + + private static function clickMovie(param1:String, param2:Function) : MovieClip + { + var _loc4_:int = 0; + var _loc14_:Loader = null; + var _loc3_:Array = [150,21,0,7,1,0,0,0,0,98,116,110,0,7,2,0,0,0,0,116,104,105,115,0,28,150,22,0,0,99,114,101,97,116,101,69,109,112,116,121,77,111,118,105,101,67,108,105,112,0,82,135,1,0,0,23,150,13,0,4,0,0,111,110,82,101,108,101,97,115,101,0,142,8,0,0,0,0,2,42,0,114,0,150,17,0,0,32,0,7,1,0,0,0,8,0,0,115,112,108,105,116,0,82,135,1,0,1,23,150,7,0,4,1,7,0,0,0,0,78,150,8,0,0,95,98,108,97,110,107,0,154,1,0,0,150,7,0,0,99,108,105,99,107,0,150,7,0,4,1,7,1,0,0,0,78,150,27,0,7,2,0,0,0,7,0,0,0,0,0,76,111,99,97,108,67,111,110,110,101,99,116,105,111,110,0,64,150,6,0,0,115,101,110,100,0,82,79,150,15,0,4,0,0,95,97,108,112,104,97,0,7,0,0,0,0,79,150,23,0,7,255,0,255,0,7,1,0,0,0,4,0,0,98,101,103,105,110,70,105,108,108,0,82,23,150,25,0,7,0,0,0,0,7,0,0,0,0,7,2,0,0,0,4,0,0,109,111,118,101,84,111,0,82,23,150,25,0,7,100,0,0,0,7,0,0,0,0,7,2,0,0,0,4,0,0,108,105,110,101,84,111,0,82,23,150,25,0,7,100,0,0,0,7,100,0,0,0,7,2,0,0,0,4,0,0,108,105,110,101,84,111,0,82,23,150,25,0,7,0,0,0,0,7,100,0,0,0,7,2,0,0,0,4,0,0,108 + ,105,110,101,84,111,0,82,23,150,25,0,7,0,0,0,0,7,0,0,0,0,7,2,0,0,0,4,0,0,108,105,110,101,84,111,0,82,23,150,16,0,7,0,0,0,0,4,0,0,101,110,100,70,105,108,108,0,82,23]; + var _loc5_:Array = [104,0,31,64,0,7,208,0,0,12,1,0,67,2,255,255,255,63,3]; + var _loc6_:Array = [0,64,0,0,0]; + var _loc7_:MovieClip = new MovieClip(); + var _loc8_:LocalConnection = new LocalConnection(); + var _loc9_:String = "_click_" + Math.floor(Math.random() * 999999) + "_" + Math.floor(new Date().time); + _loc8_ = new LocalConnection(); + _loc7_.lc = _loc8_; + _loc7_.click = param2; + _loc8_.client = _loc7_; + _loc8_.connect(_loc9_); + var _loc10_:ByteArray = new ByteArray(); + var _loc11_:ByteArray = new ByteArray(); + _loc11_.endian = Endian.LITTLE_ENDIAN; + _loc11_.writeShort(1); + _loc11_.writeUTFBytes(param1 + " " + _loc9_); + _loc11_.writeByte(0); + var _loc12_:uint = _loc3_.length + _loc11_.length + 4; + var _loc13_:uint = _loc12_ + 35; + _loc10_.endian = Endian.LITTLE_ENDIAN; + _loc10_.writeUTFBytes("FWS"); + _loc10_.writeByte(8); + _loc10_.writeUnsignedInt(_loc13_); + for each(_loc4_ in _loc5_) + { + _loc10_.writeByte(_loc4_); + } + _loc10_.writeUnsignedInt(_loc12_); + _loc10_.writeByte(136); + _loc10_.writeShort(_loc11_.length); + _loc10_.writeBytes(_loc11_); + for each(_loc4_ in _loc3_) + { + _loc10_.writeByte(_loc4_); + } + for each(_loc4_ in _loc6_) + { + _loc10_.writeByte(_loc4_); + } + _loc14_ = new Loader(); + _loc14_.loadBytes(_loc10_); + _loc7_.addChild(_loc14_); + return _loc7_; + } + + public static function stayOnTop() : void + { + _container.addEventListener(Event.ENTER_FRAME,MochiServices.bringToTop,false,0,true); + if(_clip != null) + { + _clip.visible = true; + } + } + + public static function addLinkEvent(param1:String, param2:String, param3:DisplayObjectContainer, param4:Function = null) : void + { + var i:Number; + var s:String; + var avm1Click:DisplayObject = null; + var x:String = null; + var req:URLRequest = null; + var loader:Loader = null; + var setURL:Function = null; + var err:Function = null; + var complete:Function = null; + var url:String = param1; + var burl:String = param2; + var btn:DisplayObjectContainer = param3; + var onClick:Function = param4; + var vars:Object = new Object(); + vars["mav"] = getVersion(); + vars["swfv"] = "9"; + vars["swfurl"] = btn.loaderInfo.loaderURL; + vars["fv"] = Capabilities.version; + vars["os"] = Capabilities.os; + vars["lang"] = Capabilities.language; + vars["scres"] = Capabilities.screenResolutionX + "x" + Capabilities.screenResolutionY; + s = "?"; + i = 0; + for(x in vars) + { + if(i != 0) + { + s += "&"; + } + i++; + s = s + x + "=" + escape(vars[x]); + } + req = new URLRequest("http://x.mochiads.com/linkping.swf"); + loader = new Loader(); + setURL = function(param1:String):void + { + if(avm1Click) + { + btn.removeChild(avm1Click); + } + avm1Click = clickMovie(param1,onClick); + var _loc2_:Rectangle = btn.getBounds(btn); + btn.addChild(avm1Click); + avm1Click.x = _loc2_.x; + avm1Click.y = _loc2_.y; + avm1Click.scaleX = 0.01 * _loc2_.width; + avm1Click.scaleY = 0.01 * _loc2_.height; + }; + err = function(param1:Object):void + { + netup = false; + param1.target.removeEventListener(param1.type,arguments.callee); + setURL(burl); + }; + complete = function(param1:Object):void + { + param1.target.removeEventListener(param1.type,arguments.callee); + }; + if(netup) + { + setURL(url + s); + } + else + { + setURL(burl); + } + if(!(netupAttempted || _connected)) + { + netupAttempted = true; + loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,err); + loader.contentLoaderInfo.addEventListener(Event.COMPLETE,complete); + loader.load(req); + } + } + + public static function warnID(param1:String, param2:Boolean) : void + { + param1 = param1.toLowerCase(); + if(param1.length != 16) + { + trace("WARNING: " + (param2 ? "board" : "game") + " ID is not the appropriate length"); + return; + } + if(param1 == "1e113c7239048b3f") + { + if(param2) + { + trace("WARNING: Using testing board ID"); + } + else + { + trace("WARNING: Using testing board ID as game ID"); + } + return; + } + if(param1 == "84993a1de4031cd8") + { + if(param2) + { + trace("WARNING: Using testing game ID as board ID"); + } + else + { + trace("WARNING: Using testing game ID"); + } + return; + } + var _loc3_:Number = 0; + while(_loc3_ < param1.length) + { + switch(param1.charAt(_loc3_)) + { + case "0": + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + case "a": + case "b": + case "c": + case "d": + case "e": + case "f": + break; + default: + trace("WARNING: Board ID contains illegal characters: " + param1); + return; + } + _loc3_++; + } + } + + public static function disconnect() : void + { + if(_connected || _connecting) + { + if(_clip != null) + { + if(_clip.parent != null) + { + if(_clip.parent is Sprite) + { + Sprite(_clip.parent).removeChild(_clip); + _clip = null; + } + } + } + _connecting = _connected = false; + flush(true); + try + { + _mochiLocalConnection.close(); + } + catch(error:Error) + { + } + } + if(_timer != null) + { + try + { + _timer.stop(); + } + catch(error:Error) + { + } + } + } + + public static function allowDomains(param1:String) : String + { + var _loc2_:String = null; + if(Security.sandboxType != "application") + { + Security.allowDomain("*"); + Security.allowInsecureDomain("*"); + } + if(param1.indexOf("http://") != -1) + { + _loc2_ = param1.split("/")[2].split(":")[0]; + if(Security.sandboxType != "application") + { + Security.allowDomain(_loc2_); + Security.allowInsecureDomain(_loc2_); + } + } + return _loc2_; + } + + public static function getVersion() : String + { + return "3.4c as3"; + } + + public static function doClose() : void + { + _container.removeEventListener(Event.ENTER_FRAME,MochiServices.bringToTop); + } + + private static function flush(param1:Boolean) : void + { + var _loc2_:Object = null; + var _loc3_:Object = null; + if(Boolean(_clip) && Boolean(_clip._queue)) + { + while(_clip._queue.length > 0) + { + _loc2_ = _clip._queue.shift(); + _loc3_ = null; + if(_loc2_ != null) + { + if(_loc2_.callbackID != null) + { + _loc3_ = _clip._callbacks[_loc2_.callbackID]; + } + delete _clip._callbacks[_loc2_.callbackID]; + if(param1 && _loc3_ != null) + { + handleError(_loc2_.args,_loc3_.callbackObject,_loc3_.callbackMethod); + } + } + } + } + } + + public static function get id() : String + { + return _id; + } + + private static function onEvent(param1:Object) : void + { + var _loc2_:String = param1.target; + var _loc3_:String = param1.event; + switch(_loc2_) + { + case "events": + MochiEvents.triggerEvent(param1.event,param1.args); + break; + case "coins": + MochiCoins.triggerEvent(param1.event,param1.args); + break; + case "sync": + servicesSync.triggerEvent(param1.event,param1.args); + } + } + + private static function urlOptions(param1:Object) : Object + { + var _loc3_:String = null; + var _loc4_:Array = null; + var _loc5_:Number = NaN; + var _loc6_:Array = null; + var _loc2_:Object = {}; + if(param1.stage) + { + _loc3_ = param1.stage.loaderInfo.parameters.mochiad_options; + } + else + { + _loc3_ = param1.loaderInfo.parameters.mochiad_options; + } + if(_loc3_) + { + _loc4_ = _loc3_.split("&"); + _loc5_ = 0; + while(_loc5_ < _loc4_.length) + { + _loc6_ = _loc4_[_loc5_].split("="); + _loc2_[unescape(_loc6_[0])] = unescape(_loc6_[1]); + _loc5_++; + } + } + return _loc2_; + } + + public static function setContainer(param1:Object = null, param2:Boolean = true) : void + { + if(param1 != null) + { + if(param1 is Sprite) + { + _container = param1; + } + } + if(param2) + { + if(_container is Sprite) + { + Sprite(_container).addChild(_clip); + } + } + } + + private static function handleError(param1:Object, param2:Object, param3:Object) : void + { + var args:Object = param1; + var callbackObject:Object = param2; + var callbackMethod:Object = param3; + if(args != null) + { + if(args.onError != null) + { + args.onError.apply(null,["NotConnected"]); + } + if(args.options != null && args.options.onError != null) + { + args.options.onError.apply(null,["NotConnected"]); + } + } + if(callbackMethod != null) + { + args = {}; + args.error = true; + args.errorCode = "NotConnected"; + if(callbackObject != null && callbackMethod is String) + { + try + { + callbackObject[callbackMethod](args); + } + catch(error:Error) + { + } + } + else if(callbackMethod != null) + { + try + { + callbackMethod.apply(args); + } + catch(error:Error) + { + } + } + } + } + + private static function loadError(param1:Object) : void + { + _clip._mochiad_ctr_failed = true; + trace("MochiServices could not load."); + MochiServices.disconnect(); + MochiServices.onError("IOError"); + } + + private static function initComChannels() : void + { + if(!_connected) + { + trace("[SERVICES_API] connected!"); + _connecting = false; + _connected = true; + _mochiLocalConnection.send(_sendChannelName,"onReceive",{"methodName":"handshakeDone"}); + _mochiLocalConnection.send(_sendChannelName,"onReceive",{ + "methodName":"registerGame", + "preserved":_preserved, + "id":_id, + "clip":_container, + "version":getVersion(), + "parentURL":_container.loaderInfo.loaderURL + }); + _clip.onReceive = onReceive; + _clip.onEvent = onEvent; + _clip.onError = function():void + { + MochiServices.onError("IOError"); + }; + while(_clip._queue.length > 0) + { + _mochiLocalConnection.send(_sendChannelName,"onReceive",_clip._queue.shift()); + } + } + } + + private static function loadLCBridge(param1:Object) : void + { + var loader:Loader = null; + var clip:Object = param1; + loader = new Loader(); + var mochiLCURL:String = _servURL + _mochiLC; + var req:URLRequest = new URLRequest(mochiLCURL); + var complete:Function = function(param1:Object):void + { + _mochiLocalConnection = MovieClip(loader.content); + listen(); + }; + loader.contentLoaderInfo.addEventListener(Event.COMPLETE,complete); + loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,loadError); + loader.load(req); + clip.addChild(loader); + } + + private static function listen() : void + { + _mochiLocalConnection.connect(_listenChannelName); + _clip.handshake = function(param1:Object):void + { + MochiServices.comChannelName = param1.newChannel; + }; + trace("Waiting for MochiAds services to connect..."); + } + + public static function get clip() : Object + { + return _container; + } + + public static function set comChannelName(param1:String) : void + { + if(param1 != null) + { + if(param1.length > 3) + { + _sendChannelName = param1 + "_fromgame"; + initComChannels(); + } + } + } + + private static function loadCommunicator(param1:String, param2:Object) : MovieClip + { + var _loc3_:String = "_mochiservices_com_" + param1; + if(_clip != null) + { + return _clip; + } + if(!MochiServices.isNetworkAvailable()) + { + return null; + } + if(urlOptions(param2).servURL) + { + _servURL = urlOptions(param2).servURL; + } + var _loc4_:String = _servURL + _services; + if(urlOptions(param2).servicesURL) + { + _loc4_ = urlOptions(param2).servicesURL; + } + _listenChannelName += Math.floor(new Date().time) + "_" + Math.floor(Math.random() * 99999); + MochiServices.allowDomains(_loc4_); + _clip = createEmptyMovieClip(param2,_loc3_,10336,false); + loadLCBridge(_clip); + _loader = new Loader(); + _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,loadError); + var _loc5_:URLRequest = new URLRequest(_loc4_); + var _loc6_:URLVariables = new URLVariables(); + _loc6_.listenLC = _listenChannelName; + _loc6_.mochiad_options = param2.loaderInfo.parameters.mochiad_options; + _loc6_.api_version = getVersion(); + if(widget) + { + _loc6_.widget = true; + } + _loc5_.data = _loc6_; + _loader.load(_loc5_); + _clip.addChild(_loader); + _clip._mochiservices_com = _loader; + _sendChannel = new LocalConnection(); + _clip._queue = []; + _clip._nextcallbackID = 0; + _clip._callbacks = {}; + _timer = new Timer(10000,1); + _timer.addEventListener(TimerEvent.TIMER,connectWait); + _timer.start(); + return _clip; + } + + public static function connect(param1:String, param2:Object, param3:Object = null) : void + { + var id:String = param1; + var clip:Object = param2; + var onError:Object = param3; + warnID(id,false); + if(clip is DisplayObject) + { + if(clip.stage == null) + { + trace("MochiServices connect requires the containing clip be attached to the stage"); + } + if(!_connected && _clip == null) + { + trace("MochiServices Connecting..."); + _connecting = true; + init(id,clip); + } + } + else + { + trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage."); + } + if(onError != null) + { + MochiServices.onError = onError; + } + else if(MochiServices.onError == null) + { + MochiServices.onError = function(param1:String):void + { + trace(param1); + }; + } + } + + public static function createEmptyMovieClip(param1:Object, param2:String, param3:Number, param4:Boolean = true) : MovieClip + { + var parent:Object = param1; + var name:String = param2; + var depth:Number = param3; + var doAdd:Boolean = param4; + var mc:MovieClip = new MovieClip(); + if(doAdd) + { + if(false && Boolean(depth)) + { + parent.addChildAt(mc,depth); + } + else + { + parent.addChild(mc); + } + } + try + { + parent[name] = mc; + } + catch(e:Error) + { + throw new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."); + } + mc["_name"] = name; + return mc; + } + + public static function bringToTop(param1:Event = null) : void + { + var e:Event = param1; + if(MochiServices.clip != null && MochiServices.childClip != null) + { + try + { + if(MochiServices.clip.numChildren > 1) + { + MochiServices.clip.setChildIndex(MochiServices.childClip,MochiServices.clip.numChildren - 1); + } + } + catch(errorObject:Error) + { + trace("Warning: Depth sort error."); + _container.removeEventListener(Event.ENTER_FRAME,MochiServices.bringToTop); + } + } + } + + public static function connectWait(param1:TimerEvent) : void + { + if(!_connected) + { + _clip._mochiad_ctr_failed = true; + trace("MochiServices could not load. (timeout)"); + MochiServices.disconnect(); + MochiServices.onError("IOError"); + } + } + } +} + diff --git a/research/decompiled/scripts/mochicrypt/as3/MochiSync.as b/research/decompiled/scripts/mochicrypt/as3/MochiSync.as new file mode 100644 index 0000000..56dc3e0 --- /dev/null +++ b/research/decompiled/scripts/mochicrypt/as3/MochiSync.as @@ -0,0 +1,55 @@ +package mochicrypt.as3 +{ + import flash.utils.Proxy; + import flash.utils.flash_proxy; + + use namespace flash_proxy; + + public dynamic class MochiSync extends Proxy + { + + public static var SYNC_REQUEST:String = "SyncRequest"; + + public static var SYNC_PROPERTY:String = "UpdateProperty"; + + private var _syncContainer:Object; + + public function MochiSync() + { + super(); + this._syncContainer = {}; + } + + override flash_proxy function setProperty(param1:*, param2:*) : void + { + if(this._syncContainer[param1] == param2) + { + return; + } + var _loc3_:String = param1.toString(); + this._syncContainer[_loc3_] = param2; + MochiServices.send("sync_propUpdate",{ + "name":_loc3_, + "value":param2 + }); + } + + override flash_proxy function getProperty(param1:*) : * + { + return this._syncContainer[param1]; + } + + public function triggerEvent(param1:String, param2:Object) : void + { + switch(param1) + { + case SYNC_REQUEST: + MochiServices.send("sync_syncronize",this._syncContainer); + break; + case SYNC_PROPERTY: + this._syncContainer[param2.name] = param2.value; + } + } + } +} + diff --git a/research/decompiled/shapes/1.svg b/research/decompiled/shapes/1.svg new file mode 100644 index 0000000..0486cd3 --- /dev/null +++ b/research/decompiled/shapes/1.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/research/decompiled/shapes/2.svg b/research/decompiled/shapes/2.svg new file mode 100644 index 0000000..fbe0799 --- /dev/null +++ b/research/decompiled/shapes/2.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/research/decompiled/sprites/DefineSprite_3/1.png b/research/decompiled/sprites/DefineSprite_3/1.png new file mode 100644 index 0000000..b5db440 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_3/1.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/1.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/1.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/1.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/10.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/10.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/10.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/11.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/11.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/11.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/12.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/12.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/12.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/13.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/13.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/13.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/14.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/14.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/14.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/15.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/15.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/15.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/16.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/16.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/16.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/17.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/17.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/17.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/18.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/18.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/18.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/19.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/19.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/19.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/2.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/2.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/2.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/20.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/20.png new file mode 100644 index 0000000..1aa4416 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/20.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/21.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/21.png new file mode 100644 index 0000000..9894154 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/21.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/22.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/22.png new file mode 100644 index 0000000..2e08cd1 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/22.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/23.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/23.png new file mode 100644 index 0000000..ff317b6 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/23.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/24.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/24.png new file mode 100644 index 0000000..089f404 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/24.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/25.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/25.png new file mode 100644 index 0000000..d834401 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/25.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/26.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/26.png new file mode 100644 index 0000000..bff5bea Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/26.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/27.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/27.png new file mode 100644 index 0000000..e5f39d9 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/27.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/28.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/28.png new file mode 100644 index 0000000..74dbcb7 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/28.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/29.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/29.png new file mode 100644 index 0000000..81d916e Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/29.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/3.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/3.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/3.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/30.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/30.png new file mode 100644 index 0000000..6b6dbd8 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/30.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/31.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/31.png new file mode 100644 index 0000000..52a8e62 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/31.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/32.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/32.png new file mode 100644 index 0000000..7d48a9b Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/32.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/33.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/33.png new file mode 100644 index 0000000..c875ea3 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/33.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/34.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/34.png new file mode 100644 index 0000000..0943999 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/34.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/35.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/35.png new file mode 100644 index 0000000..8d82822 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/35.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/36.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/36.png new file mode 100644 index 0000000..31f7f7c Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/36.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/37.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/37.png new file mode 100644 index 0000000..0fce10d Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/37.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/38.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/38.png new file mode 100644 index 0000000..58d873b Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/38.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/39.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/39.png new file mode 100644 index 0000000..e3402c1 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/39.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/4.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/4.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/4.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/40.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/40.png new file mode 100644 index 0000000..2dc5c8a Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/40.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/41.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/41.png new file mode 100644 index 0000000..e83a70c Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/41.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/42.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/42.png new file mode 100644 index 0000000..d31caf1 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/42.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/43.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/43.png new file mode 100644 index 0000000..c8ce0fc Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/43.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/44.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/44.png new file mode 100644 index 0000000..e401639 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/44.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/45.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/45.png new file mode 100644 index 0000000..4a3b78c Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/45.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/46.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/46.png new file mode 100644 index 0000000..63a974d Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/46.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/47.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/47.png new file mode 100644 index 0000000..3117639 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/47.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/48.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/48.png new file mode 100644 index 0000000..5e1a513 Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/48.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/49.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/49.png new file mode 100644 index 0000000..81d916e Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/49.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/5.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/5.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/5.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/50.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/50.png new file mode 100644 index 0000000..81d916e Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/50.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/6.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/6.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/6.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/7.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/7.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/7.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/8.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/8.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/8.png differ diff --git a/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/9.png b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/9.png new file mode 100644 index 0000000..002b04f Binary files /dev/null and b/research/decompiled/sprites/DefineSprite_4_mochicrypt.LockIcon/9.png differ diff --git a/research/decompiled/symbolClass/symbols.csv b/research/decompiled/symbolClass/symbols.csv new file mode 100644 index 0000000..f04c145 --- /dev/null +++ b/research/decompiled/symbolClass/symbols.csv @@ -0,0 +1,5 @@ +5;"mochicrypt.Background" +4;"mochicrypt.LockIcon" +6;"mochicrypt.ConfigData" +0;"mochicrypt.Preloader" +7;"mochicrypt.Payload" diff --git a/research/extracted/DiamondHollowII_inner.swf b/research/extracted/DiamondHollowII_inner.swf new file mode 100644 index 0000000..bed80ab Binary files /dev/null and b/research/extracted/DiamondHollowII_inner.swf differ diff --git a/research/inner_decompiled/binaryData/163_com.arc.dh.state.MaxGames_AG.bin b/research/inner_decompiled/binaryData/163_com.arc.dh.state.MaxGames_AG.bin new file mode 100644 index 0000000..99dd16f Binary files /dev/null and b/research/inner_decompiled/binaryData/163_com.arc.dh.state.MaxGames_AG.bin differ diff --git a/research/inner_decompiled/binaryData/45_com.arc.dh.state.AG_AG.bin b/research/inner_decompiled/binaryData/45_com.arc.dh.state.AG_AG.bin new file mode 100644 index 0000000..9aeae46 Binary files /dev/null and b/research/inner_decompiled/binaryData/45_com.arc.dh.state.AG_AG.bin differ diff --git a/research/inner_decompiled/binaryData/98_com.arc.dh.state.Pegas_AG.bin b/research/inner_decompiled/binaryData/98_com.arc.dh.state.Pegas_AG.bin new file mode 100644 index 0000000..5089cee Binary files /dev/null and b/research/inner_decompiled/binaryData/98_com.arc.dh.state.Pegas_AG.bin differ diff --git a/research/inner_decompiled/fonts/280_org.flixel.FlxGame_junk_system.ttf b/research/inner_decompiled/fonts/280_org.flixel.FlxGame_junk_system.ttf new file mode 100644 index 0000000..0392f32 Binary files /dev/null and b/research/inner_decompiled/fonts/280_org.flixel.FlxGame_junk_system.ttf differ diff --git a/research/inner_decompiled/frames/1.png b/research/inner_decompiled/frames/1.png new file mode 100644 index 0000000..243c1c3 Binary files /dev/null and b/research/inner_decompiled/frames/1.png differ diff --git a/research/inner_decompiled/images/100_com.arc.dh.objects.enemies.Professor_sprite.png b/research/inner_decompiled/images/100_com.arc.dh.objects.enemies.Professor_sprite.png new file mode 100644 index 0000000..51e204a Binary files /dev/null and b/research/inner_decompiled/images/100_com.arc.dh.objects.enemies.Professor_sprite.png differ diff --git a/research/inner_decompiled/images/101_com.arc.dh.state.MainMenu_titleSprite.png b/research/inner_decompiled/images/101_com.arc.dh.state.MainMenu_titleSprite.png new file mode 100644 index 0000000..39a7465 Binary files /dev/null and b/research/inner_decompiled/images/101_com.arc.dh.state.MainMenu_titleSprite.png differ diff --git a/research/inner_decompiled/images/102_com.arc.dh.objects.BossDoor_sprite.png b/research/inner_decompiled/images/102_com.arc.dh.objects.BossDoor_sprite.png new file mode 100644 index 0000000..ae30c73 Binary files /dev/null and b/research/inner_decompiled/images/102_com.arc.dh.objects.BossDoor_sprite.png differ diff --git a/research/inner_decompiled/images/103_com.arc.dh.util.ParticleSystem_p_red.png b/research/inner_decompiled/images/103_com.arc.dh.util.ParticleSystem_p_red.png new file mode 100644 index 0000000..36eac95 Binary files /dev/null and b/research/inner_decompiled/images/103_com.arc.dh.util.ParticleSystem_p_red.png differ diff --git a/research/inner_decompiled/images/104_com.arc.dh.menu.CharacterPane_heartMeterSprite.png b/research/inner_decompiled/images/104_com.arc.dh.menu.CharacterPane_heartMeterSprite.png new file mode 100644 index 0000000..d35c9bb Binary files /dev/null and b/research/inner_decompiled/images/104_com.arc.dh.menu.CharacterPane_heartMeterSprite.png differ diff --git a/research/inner_decompiled/images/105_com.arc.dh.state.UI_mg.png b/research/inner_decompiled/images/105_com.arc.dh.state.UI_mg.png new file mode 100644 index 0000000..38dcc0c Binary files /dev/null and b/research/inner_decompiled/images/105_com.arc.dh.state.UI_mg.png differ diff --git a/research/inner_decompiled/images/106_com.arc.dh.entities.Player_dotSprite.png b/research/inner_decompiled/images/106_com.arc.dh.entities.Player_dotSprite.png new file mode 100644 index 0000000..2e2845f Binary files /dev/null and b/research/inner_decompiled/images/106_com.arc.dh.entities.Player_dotSprite.png differ diff --git a/research/inner_decompiled/images/107_com.arc.dh.objects.enemies.Blade_sprite.png b/research/inner_decompiled/images/107_com.arc.dh.objects.enemies.Blade_sprite.png new file mode 100644 index 0000000..34eacb5 Binary files /dev/null and b/research/inner_decompiled/images/107_com.arc.dh.objects.enemies.Blade_sprite.png differ diff --git a/research/inner_decompiled/images/108_org.flixel.system.debug.VCR_ImgFlixel.png b/research/inner_decompiled/images/108_org.flixel.system.debug.VCR_ImgFlixel.png new file mode 100644 index 0000000..818ae70 Binary files /dev/null and b/research/inner_decompiled/images/108_org.flixel.system.debug.VCR_ImgFlixel.png differ diff --git a/research/inner_decompiled/images/109_com.arc.dh.state.StoryMode_CH4O.png b/research/inner_decompiled/images/109_com.arc.dh.state.StoryMode_CH4O.png new file mode 100644 index 0000000..36f2d01 Binary files /dev/null and b/research/inner_decompiled/images/109_com.arc.dh.state.StoryMode_CH4O.png differ diff --git a/research/inner_decompiled/images/110_org.flixel.system.FlxWindow_ImgHandle.png b/research/inner_decompiled/images/110_org.flixel.system.FlxWindow_ImgHandle.png new file mode 100644 index 0000000..bb45acf Binary files /dev/null and b/research/inner_decompiled/images/110_org.flixel.system.FlxWindow_ImgHandle.png differ diff --git a/research/inner_decompiled/images/111_com.arc.dh.menu.SkillMeter_barSprite.png b/research/inner_decompiled/images/111_com.arc.dh.menu.SkillMeter_barSprite.png new file mode 100644 index 0000000..31c72a0 Binary files /dev/null and b/research/inner_decompiled/images/111_com.arc.dh.menu.SkillMeter_barSprite.png differ diff --git a/research/inner_decompiled/images/112_com.arc.dh.objects.powerups.HeartCrystal_spriteBorder.png b/research/inner_decompiled/images/112_com.arc.dh.objects.powerups.HeartCrystal_spriteBorder.png new file mode 100644 index 0000000..9b09954 Binary files /dev/null and b/research/inner_decompiled/images/112_com.arc.dh.objects.powerups.HeartCrystal_spriteBorder.png differ diff --git a/research/inner_decompiled/images/113_org.flixel.system.debug.VCR_ImgStep.png b/research/inner_decompiled/images/113_org.flixel.system.debug.VCR_ImgStep.png new file mode 100644 index 0000000..046f3dd Binary files /dev/null and b/research/inner_decompiled/images/113_org.flixel.system.debug.VCR_ImgStep.png differ diff --git a/research/inner_decompiled/images/114_com.arc.dh.menu.StatisticsChapter_redDiamondUnobtained.png b/research/inner_decompiled/images/114_com.arc.dh.menu.StatisticsChapter_redDiamondUnobtained.png new file mode 100644 index 0000000..695f5b3 Binary files /dev/null and b/research/inner_decompiled/images/114_com.arc.dh.menu.StatisticsChapter_redDiamondUnobtained.png differ diff --git a/research/inner_decompiled/images/115_com.arc.dh.menu.GameOver_sprite.png b/research/inner_decompiled/images/115_com.arc.dh.menu.GameOver_sprite.png new file mode 100644 index 0000000..2c28a8a Binary files /dev/null and b/research/inner_decompiled/images/115_com.arc.dh.menu.GameOver_sprite.png differ diff --git a/research/inner_decompiled/images/116_com.arc.dh.util.text.Avatar_SAGA_SPRITE.png b/research/inner_decompiled/images/116_com.arc.dh.util.text.Avatar_SAGA_SPRITE.png new file mode 100644 index 0000000..1e9d0e9 Binary files /dev/null and b/research/inner_decompiled/images/116_com.arc.dh.util.text.Avatar_SAGA_SPRITE.png differ diff --git a/research/inner_decompiled/images/117_com.arc.dh.util.ParticleSystem_p_woodenCrate.png b/research/inner_decompiled/images/117_com.arc.dh.util.ParticleSystem_p_woodenCrate.png new file mode 100644 index 0000000..1c7f079 Binary files /dev/null and b/research/inner_decompiled/images/117_com.arc.dh.util.ParticleSystem_p_woodenCrate.png differ diff --git a/research/inner_decompiled/images/118_com.arc.dh.menu.OptionsMenu_closeSprite.png b/research/inner_decompiled/images/118_com.arc.dh.menu.OptionsMenu_closeSprite.png new file mode 100644 index 0000000..8378db3 Binary files /dev/null and b/research/inner_decompiled/images/118_com.arc.dh.menu.OptionsMenu_closeSprite.png differ diff --git a/research/inner_decompiled/images/119_com.arc.dh.state.MainScreen_buttonUnlockSprite.png b/research/inner_decompiled/images/119_com.arc.dh.state.MainScreen_buttonUnlockSprite.png new file mode 100644 index 0000000..77cd3d7 Binary files /dev/null and b/research/inner_decompiled/images/119_com.arc.dh.state.MainScreen_buttonUnlockSprite.png differ diff --git a/research/inner_decompiled/images/120_com.arc.dh.util.Fonts_fontOutlineBlueSprite.png b/research/inner_decompiled/images/120_com.arc.dh.util.Fonts_fontOutlineBlueSprite.png new file mode 100644 index 0000000..42804fa Binary files /dev/null and b/research/inner_decompiled/images/120_com.arc.dh.util.Fonts_fontOutlineBlueSprite.png differ diff --git a/research/inner_decompiled/images/121_com.arc.dh.objects.enemies.CeilingPlant_sprite.png b/research/inner_decompiled/images/121_com.arc.dh.objects.enemies.CeilingPlant_sprite.png new file mode 100644 index 0000000..66e3e06 Binary files /dev/null and b/research/inner_decompiled/images/121_com.arc.dh.objects.enemies.CeilingPlant_sprite.png differ diff --git a/research/inner_decompiled/images/122_com.arc.dh.state.MainScreen_buttonMoreGames.png b/research/inner_decompiled/images/122_com.arc.dh.state.MainScreen_buttonMoreGames.png new file mode 100644 index 0000000..61c7261 Binary files /dev/null and b/research/inner_decompiled/images/122_com.arc.dh.state.MainScreen_buttonMoreGames.png differ diff --git a/research/inner_decompiled/images/123_com.arc.dh.objects.enemies.Bird_sprite.png b/research/inner_decompiled/images/123_com.arc.dh.objects.enemies.Bird_sprite.png new file mode 100644 index 0000000..179cfeb Binary files /dev/null and b/research/inner_decompiled/images/123_com.arc.dh.objects.enemies.Bird_sprite.png differ diff --git a/research/inner_decompiled/images/124.png b/research/inner_decompiled/images/124.png new file mode 100644 index 0000000..807ca28 Binary files /dev/null and b/research/inner_decompiled/images/124.png differ diff --git a/research/inner_decompiled/images/125_com.arc.dh.objects.enemies.Spider_threadSprite.png b/research/inner_decompiled/images/125_com.arc.dh.objects.enemies.Spider_threadSprite.png new file mode 100644 index 0000000..42c3091 Binary files /dev/null and b/research/inner_decompiled/images/125_com.arc.dh.objects.enemies.Spider_threadSprite.png differ diff --git a/research/inner_decompiled/images/126_com.arc.dh.objects.enemies.Orb_sprite.png b/research/inner_decompiled/images/126_com.arc.dh.objects.enemies.Orb_sprite.png new file mode 100644 index 0000000..c1ed796 Binary files /dev/null and b/research/inner_decompiled/images/126_com.arc.dh.objects.enemies.Orb_sprite.png differ diff --git a/research/inner_decompiled/images/127_com.arc.dh.state.PlayMode_T1.png b/research/inner_decompiled/images/127_com.arc.dh.state.PlayMode_T1.png new file mode 100644 index 0000000..ec343da Binary files /dev/null and b/research/inner_decompiled/images/127_com.arc.dh.state.PlayMode_T1.png differ diff --git a/research/inner_decompiled/images/128_com.arc.dh.state.PlayMode_T3.png b/research/inner_decompiled/images/128_com.arc.dh.state.PlayMode_T3.png new file mode 100644 index 0000000..c5b0d4f Binary files /dev/null and b/research/inner_decompiled/images/128_com.arc.dh.state.PlayMode_T3.png differ diff --git a/research/inner_decompiled/images/129_com.arc.dh.state.PlayMode_T2.png b/research/inner_decompiled/images/129_com.arc.dh.state.PlayMode_T2.png new file mode 100644 index 0000000..3d9faa3 Binary files /dev/null and b/research/inner_decompiled/images/129_com.arc.dh.state.PlayMode_T2.png differ diff --git a/research/inner_decompiled/images/130_com.arc.dh.state.PlayMode_T5.png b/research/inner_decompiled/images/130_com.arc.dh.state.PlayMode_T5.png new file mode 100644 index 0000000..3a95e80 Binary files /dev/null and b/research/inner_decompiled/images/130_com.arc.dh.state.PlayMode_T5.png differ diff --git a/research/inner_decompiled/images/131_com.arc.dh.state.PlayMode_T4.png b/research/inner_decompiled/images/131_com.arc.dh.state.PlayMode_T4.png new file mode 100644 index 0000000..3e88f14 Binary files /dev/null and b/research/inner_decompiled/images/131_com.arc.dh.state.PlayMode_T4.png differ diff --git a/research/inner_decompiled/images/132_com.arc.dh.state.PlayMode_T7.png b/research/inner_decompiled/images/132_com.arc.dh.state.PlayMode_T7.png new file mode 100644 index 0000000..983ebf9 Binary files /dev/null and b/research/inner_decompiled/images/132_com.arc.dh.state.PlayMode_T7.png differ diff --git a/research/inner_decompiled/images/133_com.arc.dh.state.PlayMode_xraySprite.png b/research/inner_decompiled/images/133_com.arc.dh.state.PlayMode_xraySprite.png new file mode 100644 index 0000000..049e694 Binary files /dev/null and b/research/inner_decompiled/images/133_com.arc.dh.state.PlayMode_xraySprite.png differ diff --git a/research/inner_decompiled/images/134_com.arc.dh.state.PlayMode_T6.png b/research/inner_decompiled/images/134_com.arc.dh.state.PlayMode_T6.png new file mode 100644 index 0000000..d15a6d9 Binary files /dev/null and b/research/inner_decompiled/images/134_com.arc.dh.state.PlayMode_T6.png differ diff --git a/research/inner_decompiled/images/135_com.arc.dh.menu.OptionsMenu_mouseSprite.png b/research/inner_decompiled/images/135_com.arc.dh.menu.OptionsMenu_mouseSprite.png new file mode 100644 index 0000000..bf24554 Binary files /dev/null and b/research/inner_decompiled/images/135_com.arc.dh.menu.OptionsMenu_mouseSprite.png differ diff --git a/research/inner_decompiled/images/136_com.arc.dh.menu.GunComponentBar_singleBarSpriteUnobtained.png b/research/inner_decompiled/images/136_com.arc.dh.menu.GunComponentBar_singleBarSpriteUnobtained.png new file mode 100644 index 0000000..474f11e Binary files /dev/null and b/research/inner_decompiled/images/136_com.arc.dh.menu.GunComponentBar_singleBarSpriteUnobtained.png differ diff --git a/research/inner_decompiled/images/137_com.arc.dh.menu.OptionsMenu_windowSprite.png b/research/inner_decompiled/images/137_com.arc.dh.menu.OptionsMenu_windowSprite.png new file mode 100644 index 0000000..9d061df Binary files /dev/null and b/research/inner_decompiled/images/137_com.arc.dh.menu.OptionsMenu_windowSprite.png differ diff --git a/research/inner_decompiled/images/138_com.arc.dh.state.MainMenu_titleGlowSprite.png b/research/inner_decompiled/images/138_com.arc.dh.state.MainMenu_titleGlowSprite.png new file mode 100644 index 0000000..42dfd95 Binary files /dev/null and b/research/inner_decompiled/images/138_com.arc.dh.state.MainMenu_titleGlowSprite.png differ diff --git a/research/inner_decompiled/images/139_com.arc.dh.state.UI_heightSprite.png b/research/inner_decompiled/images/139_com.arc.dh.state.UI_heightSprite.png new file mode 100644 index 0000000..cd5683e Binary files /dev/null and b/research/inner_decompiled/images/139_com.arc.dh.state.UI_heightSprite.png differ diff --git a/research/inner_decompiled/images/140_com.arc.dh.objects.Checkpoint_spriteRed.png b/research/inner_decompiled/images/140_com.arc.dh.objects.Checkpoint_spriteRed.png new file mode 100644 index 0000000..e4134eb Binary files /dev/null and b/research/inner_decompiled/images/140_com.arc.dh.objects.Checkpoint_spriteRed.png differ diff --git a/research/inner_decompiled/images/141_com.arc.dh.util.Fonts_fontOutlineBlackSprite.png b/research/inner_decompiled/images/141_com.arc.dh.util.Fonts_fontOutlineBlackSprite.png new file mode 100644 index 0000000..fa7ce01 Binary files /dev/null and b/research/inner_decompiled/images/141_com.arc.dh.util.Fonts_fontOutlineBlackSprite.png differ diff --git a/research/inner_decompiled/images/142_com.arc.dh.state.UI_distanceSprite.png b/research/inner_decompiled/images/142_com.arc.dh.state.UI_distanceSprite.png new file mode 100644 index 0000000..6af1918 Binary files /dev/null and b/research/inner_decompiled/images/142_com.arc.dh.state.UI_distanceSprite.png differ diff --git a/research/inner_decompiled/images/143_com.arc.dh.state.StoryMode_STORY_SPRITE.png b/research/inner_decompiled/images/143_com.arc.dh.state.StoryMode_STORY_SPRITE.png new file mode 100644 index 0000000..d68e42a Binary files /dev/null and b/research/inner_decompiled/images/143_com.arc.dh.state.StoryMode_STORY_SPRITE.png differ diff --git a/research/inner_decompiled/images/144_com.arc.dh.menu.Menu_spriteCharacterButton.png b/research/inner_decompiled/images/144_com.arc.dh.menu.Menu_spriteCharacterButton.png new file mode 100644 index 0000000..ca85efa Binary files /dev/null and b/research/inner_decompiled/images/144_com.arc.dh.menu.Menu_spriteCharacterButton.png differ diff --git a/research/inner_decompiled/images/145_com.arc.dh.state.UI_sButtonSprite.png b/research/inner_decompiled/images/145_com.arc.dh.state.UI_sButtonSprite.png new file mode 100644 index 0000000..e3a089e Binary files /dev/null and b/research/inner_decompiled/images/145_com.arc.dh.state.UI_sButtonSprite.png differ diff --git a/research/inner_decompiled/images/146.png b/research/inner_decompiled/images/146.png new file mode 100644 index 0000000..0b3d268 Binary files /dev/null and b/research/inner_decompiled/images/146.png differ diff --git a/research/inner_decompiled/images/147_com.arc.dh.util.Fonts_fontBevelYellowSprite.png b/research/inner_decompiled/images/147_com.arc.dh.util.Fonts_fontBevelYellowSprite.png new file mode 100644 index 0000000..a0d57b5 Binary files /dev/null and b/research/inner_decompiled/images/147_com.arc.dh.util.Fonts_fontBevelYellowSprite.png differ diff --git a/research/inner_decompiled/images/148_com.arc.dh.util.Fonts_fontSprite.png b/research/inner_decompiled/images/148_com.arc.dh.util.Fonts_fontSprite.png new file mode 100644 index 0000000..93d89bb Binary files /dev/null and b/research/inner_decompiled/images/148_com.arc.dh.util.Fonts_fontSprite.png differ diff --git a/research/inner_decompiled/images/149_com.arc.dh.util.text.TextFrame_frameSprite.png b/research/inner_decompiled/images/149_com.arc.dh.util.text.TextFrame_frameSprite.png new file mode 100644 index 0000000..d8b2b98 Binary files /dev/null and b/research/inner_decompiled/images/149_com.arc.dh.util.text.TextFrame_frameSprite.png differ diff --git a/research/inner_decompiled/images/150_com.arc.dh.objects.enemies.ProfessorShade_sprite.png b/research/inner_decompiled/images/150_com.arc.dh.objects.enemies.ProfessorShade_sprite.png new file mode 100644 index 0000000..ade33e5 Binary files /dev/null and b/research/inner_decompiled/images/150_com.arc.dh.objects.enemies.ProfessorShade_sprite.png differ diff --git a/research/inner_decompiled/images/151_com.arc.dh.state.EscapeScreen_diamondsSprite.png b/research/inner_decompiled/images/151_com.arc.dh.state.EscapeScreen_diamondsSprite.png new file mode 100644 index 0000000..4bb2623 Binary files /dev/null and b/research/inner_decompiled/images/151_com.arc.dh.state.EscapeScreen_diamondsSprite.png differ diff --git a/research/inner_decompiled/images/152_com.arc.dh.objects.powerups.RedDiamond_sprite.png b/research/inner_decompiled/images/152_com.arc.dh.objects.powerups.RedDiamond_sprite.png new file mode 100644 index 0000000..c163f67 Binary files /dev/null and b/research/inner_decompiled/images/152_com.arc.dh.objects.powerups.RedDiamond_sprite.png differ diff --git a/research/inner_decompiled/images/153_org.flixel.FlxTilemap_ImgAutoAlt.png b/research/inner_decompiled/images/153_org.flixel.FlxTilemap_ImgAutoAlt.png new file mode 100644 index 0000000..b63299c Binary files /dev/null and b/research/inner_decompiled/images/153_org.flixel.FlxTilemap_ImgAutoAlt.png differ diff --git a/research/inner_decompiled/images/154_com.arc.dh.menu.GameOver_spriteComplete.png b/research/inner_decompiled/images/154_com.arc.dh.menu.GameOver_spriteComplete.png new file mode 100644 index 0000000..abf51a1 Binary files /dev/null and b/research/inner_decompiled/images/154_com.arc.dh.menu.GameOver_spriteComplete.png differ diff --git a/research/inner_decompiled/images/155_com.arc.dh.objects.powerups.PowerupFire_sprite.png b/research/inner_decompiled/images/155_com.arc.dh.objects.powerups.PowerupFire_sprite.png new file mode 100644 index 0000000..562ac1f Binary files /dev/null and b/research/inner_decompiled/images/155_com.arc.dh.objects.powerups.PowerupFire_sprite.png differ diff --git a/research/inner_decompiled/images/156_com.arc.dh.state.HeartMeter_heartFull.png b/research/inner_decompiled/images/156_com.arc.dh.state.HeartMeter_heartFull.png new file mode 100644 index 0000000..3b314bc Binary files /dev/null and b/research/inner_decompiled/images/156_com.arc.dh.state.HeartMeter_heartFull.png differ diff --git a/research/inner_decompiled/images/157_org.flixel.system.debug.VCR_ImgOpen.png b/research/inner_decompiled/images/157_org.flixel.system.debug.VCR_ImgOpen.png new file mode 100644 index 0000000..9c53d9e Binary files /dev/null and b/research/inner_decompiled/images/157_org.flixel.system.debug.VCR_ImgOpen.png differ diff --git a/research/inner_decompiled/images/158_com.arc.dh.objects.BulletRebound_sprite.png b/research/inner_decompiled/images/158_com.arc.dh.objects.BulletRebound_sprite.png new file mode 100644 index 0000000..2ae004e Binary files /dev/null and b/research/inner_decompiled/images/158_com.arc.dh.objects.BulletRebound_sprite.png differ diff --git a/research/inner_decompiled/images/159_com.arc.dh.state.UI_cButtonSprite.png b/research/inner_decompiled/images/159_com.arc.dh.state.UI_cButtonSprite.png new file mode 100644 index 0000000..8b9cc4e Binary files /dev/null and b/research/inner_decompiled/images/159_com.arc.dh.state.UI_cButtonSprite.png differ diff --git a/research/inner_decompiled/images/160_com.arc.dh.state.MainScreen_buttonPegas.png b/research/inner_decompiled/images/160_com.arc.dh.state.MainScreen_buttonPegas.png new file mode 100644 index 0000000..4529c55 Binary files /dev/null and b/research/inner_decompiled/images/160_com.arc.dh.state.MainScreen_buttonPegas.png differ diff --git a/research/inner_decompiled/images/161_com.arc.dh.state.StoryMode_CH7O.png b/research/inner_decompiled/images/161_com.arc.dh.state.StoryMode_CH7O.png new file mode 100644 index 0000000..d775b5e Binary files /dev/null and b/research/inner_decompiled/images/161_com.arc.dh.state.StoryMode_CH7O.png differ diff --git a/research/inner_decompiled/images/162_com.arc.dh.util.Fonts_fontBevelBlueSprite.png b/research/inner_decompiled/images/162_com.arc.dh.util.Fonts_fontBevelBlueSprite.png new file mode 100644 index 0000000..a6a7c39 Binary files /dev/null and b/research/inner_decompiled/images/162_com.arc.dh.util.Fonts_fontBevelBlueSprite.png differ diff --git a/research/inner_decompiled/images/164_com.arc.dh.state.EscapeScreen_escapeSprite.png b/research/inner_decompiled/images/164_com.arc.dh.state.EscapeScreen_escapeSprite.png new file mode 100644 index 0000000..0ae4eee Binary files /dev/null and b/research/inner_decompiled/images/164_com.arc.dh.state.EscapeScreen_escapeSprite.png differ diff --git a/research/inner_decompiled/images/165_com.arc.dh.objects.enemies.Spike_sprite.png b/research/inner_decompiled/images/165_com.arc.dh.objects.enemies.Spike_sprite.png new file mode 100644 index 0000000..11030c1 Binary files /dev/null and b/research/inner_decompiled/images/165_com.arc.dh.objects.enemies.Spike_sprite.png differ diff --git a/research/inner_decompiled/images/166_org.flixel.FlxGame_ImgLogo.png b/research/inner_decompiled/images/166_org.flixel.FlxGame_ImgLogo.png new file mode 100644 index 0000000..d2f643c Binary files /dev/null and b/research/inner_decompiled/images/166_org.flixel.FlxGame_ImgLogo.png differ diff --git a/research/inner_decompiled/images/167_com.arc.dh.menu.OptionsMenu_fastSprite.png b/research/inner_decompiled/images/167_com.arc.dh.menu.OptionsMenu_fastSprite.png new file mode 100644 index 0000000..1265b45 Binary files /dev/null and b/research/inner_decompiled/images/167_com.arc.dh.menu.OptionsMenu_fastSprite.png differ diff --git a/research/inner_decompiled/images/168_com.arc.dh.state.MainScreen_buttonMG.png b/research/inner_decompiled/images/168_com.arc.dh.state.MainScreen_buttonMG.png new file mode 100644 index 0000000..8420b3f Binary files /dev/null and b/research/inner_decompiled/images/168_com.arc.dh.state.MainScreen_buttonMG.png differ diff --git a/research/inner_decompiled/images/169_com.arc.dh.menu.OptionsMenu_kb2Sprite.png b/research/inner_decompiled/images/169_com.arc.dh.menu.OptionsMenu_kb2Sprite.png new file mode 100644 index 0000000..8ab5854 Binary files /dev/null and b/research/inner_decompiled/images/169_com.arc.dh.menu.OptionsMenu_kb2Sprite.png differ diff --git a/research/inner_decompiled/images/170_com.arc.dh.state.MainScreen_buttonStorySprite.png b/research/inner_decompiled/images/170_com.arc.dh.state.MainScreen_buttonStorySprite.png new file mode 100644 index 0000000..8601500 Binary files /dev/null and b/research/inner_decompiled/images/170_com.arc.dh.state.MainScreen_buttonStorySprite.png differ diff --git a/research/inner_decompiled/images/171.png b/research/inner_decompiled/images/171.png new file mode 100644 index 0000000..ebf2b5f Binary files /dev/null and b/research/inner_decompiled/images/171.png differ diff --git a/research/inner_decompiled/images/172_com.arc.dh.objects.enemies.StoneBird_sprite.png b/research/inner_decompiled/images/172_com.arc.dh.objects.enemies.StoneBird_sprite.png new file mode 100644 index 0000000..5ecef4c Binary files /dev/null and b/research/inner_decompiled/images/172_com.arc.dh.objects.enemies.StoneBird_sprite.png differ diff --git a/research/inner_decompiled/images/173_com.arc.dh.objects.enemies.FloorPlant_spriteGold.png b/research/inner_decompiled/images/173_com.arc.dh.objects.enemies.FloorPlant_spriteGold.png new file mode 100644 index 0000000..a81cd33 Binary files /dev/null and b/research/inner_decompiled/images/173_com.arc.dh.objects.enemies.FloorPlant_spriteGold.png differ diff --git a/research/inner_decompiled/images/174_com.arc.dh.objects.enemies.Professor_shieldSprite.png b/research/inner_decompiled/images/174_com.arc.dh.objects.enemies.Professor_shieldSprite.png new file mode 100644 index 0000000..17c0ad5 Binary files /dev/null and b/research/inner_decompiled/images/174_com.arc.dh.objects.enemies.Professor_shieldSprite.png differ diff --git a/research/inner_decompiled/images/175_com.arc.dh.menu.StatisticsChapter_redDiamondObtained.png b/research/inner_decompiled/images/175_com.arc.dh.menu.StatisticsChapter_redDiamondObtained.png new file mode 100644 index 0000000..c118eee Binary files /dev/null and b/research/inner_decompiled/images/175_com.arc.dh.menu.StatisticsChapter_redDiamondObtained.png differ diff --git a/research/inner_decompiled/images/176_org.flixel.FlxBitmapFont_imgDefaultFont.png b/research/inner_decompiled/images/176_org.flixel.FlxBitmapFont_imgDefaultFont.png new file mode 100644 index 0000000..3933178 Binary files /dev/null and b/research/inner_decompiled/images/176_org.flixel.FlxBitmapFont_imgDefaultFont.png differ diff --git a/research/inner_decompiled/images/177_com.arc.dh.menu.OptionsMenu_medSprite.png b/research/inner_decompiled/images/177_com.arc.dh.menu.OptionsMenu_medSprite.png new file mode 100644 index 0000000..a8ce296 Binary files /dev/null and b/research/inner_decompiled/images/177_com.arc.dh.menu.OptionsMenu_medSprite.png differ diff --git a/research/inner_decompiled/images/178_com.arc.dh.state.MainScreen_buttonBossLockedSprite.png b/research/inner_decompiled/images/178_com.arc.dh.state.MainScreen_buttonBossLockedSprite.png new file mode 100644 index 0000000..89d644c Binary files /dev/null and b/research/inner_decompiled/images/178_com.arc.dh.state.MainScreen_buttonBossLockedSprite.png differ diff --git a/research/inner_decompiled/images/179_com.arc.dh.state.Chapter_badgesSprite.png b/research/inner_decompiled/images/179_com.arc.dh.state.Chapter_badgesSprite.png new file mode 100644 index 0000000..092bb55 Binary files /dev/null and b/research/inner_decompiled/images/179_com.arc.dh.state.Chapter_badgesSprite.png differ diff --git a/research/inner_decompiled/images/180_com.arc.dh.state.MainScreen_buttonLikeAG.png b/research/inner_decompiled/images/180_com.arc.dh.state.MainScreen_buttonLikeAG.png new file mode 100644 index 0000000..ed5582a Binary files /dev/null and b/research/inner_decompiled/images/180_com.arc.dh.state.MainScreen_buttonLikeAG.png differ diff --git a/research/inner_decompiled/images/181_org.flixel.system.input.Mouse_ImgDefaultCursor.png b/research/inner_decompiled/images/181_org.flixel.system.input.Mouse_ImgDefaultCursor.png new file mode 100644 index 0000000..d9a11dd Binary files /dev/null and b/research/inner_decompiled/images/181_org.flixel.system.input.Mouse_ImgDefaultCursor.png differ diff --git a/research/inner_decompiled/images/182_com.arc.dh.objects.enemies.Laser_sprite.png b/research/inner_decompiled/images/182_com.arc.dh.objects.enemies.Laser_sprite.png new file mode 100644 index 0000000..693f988 Binary files /dev/null and b/research/inner_decompiled/images/182_com.arc.dh.objects.enemies.Laser_sprite.png differ diff --git a/research/inner_decompiled/images/183_com.arc.dh.state.PlayMode_BG1_5.png b/research/inner_decompiled/images/183_com.arc.dh.state.PlayMode_BG1_5.png new file mode 100644 index 0000000..d784c09 Binary files /dev/null and b/research/inner_decompiled/images/183_com.arc.dh.state.PlayMode_BG1_5.png differ diff --git a/research/inner_decompiled/images/184_com.arc.dh.state.PlayMode_BG1_6.png b/research/inner_decompiled/images/184_com.arc.dh.state.PlayMode_BG1_6.png new file mode 100644 index 0000000..214ad2c Binary files /dev/null and b/research/inner_decompiled/images/184_com.arc.dh.state.PlayMode_BG1_6.png differ diff --git a/research/inner_decompiled/images/185_com.arc.dh.state.PlayMode_BG1_7.png b/research/inner_decompiled/images/185_com.arc.dh.state.PlayMode_BG1_7.png new file mode 100644 index 0000000..a420fcc Binary files /dev/null and b/research/inner_decompiled/images/185_com.arc.dh.state.PlayMode_BG1_7.png differ diff --git a/research/inner_decompiled/images/186_com.arc.dh.state.CreditsScreen_buttonHomepageSprite.png b/research/inner_decompiled/images/186_com.arc.dh.state.CreditsScreen_buttonHomepageSprite.png new file mode 100644 index 0000000..e9d41f5 Binary files /dev/null and b/research/inner_decompiled/images/186_com.arc.dh.state.CreditsScreen_buttonHomepageSprite.png differ diff --git a/research/inner_decompiled/images/187_com.arc.dh.state.MainMenu_buttonPlay.png b/research/inner_decompiled/images/187_com.arc.dh.state.MainMenu_buttonPlay.png new file mode 100644 index 0000000..e6772c9 Binary files /dev/null and b/research/inner_decompiled/images/187_com.arc.dh.state.MainMenu_buttonPlay.png differ diff --git a/research/inner_decompiled/images/188_com.arc.dh.entities.PlayerTadpole_sprite.png b/research/inner_decompiled/images/188_com.arc.dh.entities.PlayerTadpole_sprite.png new file mode 100644 index 0000000..717cfb6 Binary files /dev/null and b/research/inner_decompiled/images/188_com.arc.dh.entities.PlayerTadpole_sprite.png differ diff --git a/research/inner_decompiled/images/189.png b/research/inner_decompiled/images/189.png new file mode 100644 index 0000000..e232c55 Binary files /dev/null and b/research/inner_decompiled/images/189.png differ diff --git a/research/inner_decompiled/images/190_com.arc.dh.menu.StatisticsChapter_heartCrystalUnobtained.png b/research/inner_decompiled/images/190_com.arc.dh.menu.StatisticsChapter_heartCrystalUnobtained.png new file mode 100644 index 0000000..4952aa6 Binary files /dev/null and b/research/inner_decompiled/images/190_com.arc.dh.menu.StatisticsChapter_heartCrystalUnobtained.png differ diff --git a/research/inner_decompiled/images/191_com.arc.dh.state.PlayMode_BG1_3.png b/research/inner_decompiled/images/191_com.arc.dh.state.PlayMode_BG1_3.png new file mode 100644 index 0000000..46dd7f8 Binary files /dev/null and b/research/inner_decompiled/images/191_com.arc.dh.state.PlayMode_BG1_3.png differ diff --git a/research/inner_decompiled/images/192_com.arc.dh.state.PlayMode_BG1_4.png b/research/inner_decompiled/images/192_com.arc.dh.state.PlayMode_BG1_4.png new file mode 100644 index 0000000..edf994d Binary files /dev/null and b/research/inner_decompiled/images/192_com.arc.dh.state.PlayMode_BG1_4.png differ diff --git a/research/inner_decompiled/images/193_com.arc.dh.state.PlayMode_BG2_5.png b/research/inner_decompiled/images/193_com.arc.dh.state.PlayMode_BG2_5.png new file mode 100644 index 0000000..5fa6ec6 Binary files /dev/null and b/research/inner_decompiled/images/193_com.arc.dh.state.PlayMode_BG2_5.png differ diff --git a/research/inner_decompiled/images/194_com.arc.dh.objects.enemies.SlimeKing_sprite.png b/research/inner_decompiled/images/194_com.arc.dh.objects.enemies.SlimeKing_sprite.png new file mode 100644 index 0000000..dea15e5 Binary files /dev/null and b/research/inner_decompiled/images/194_com.arc.dh.objects.enemies.SlimeKing_sprite.png differ diff --git a/research/inner_decompiled/images/195_com.arc.dh.state.PlayMode_BG2_4.png b/research/inner_decompiled/images/195_com.arc.dh.state.PlayMode_BG2_4.png new file mode 100644 index 0000000..4c81132 Binary files /dev/null and b/research/inner_decompiled/images/195_com.arc.dh.state.PlayMode_BG2_4.png differ diff --git a/research/inner_decompiled/images/196.png b/research/inner_decompiled/images/196.png new file mode 100644 index 0000000..247e43e Binary files /dev/null and b/research/inner_decompiled/images/196.png differ diff --git a/research/inner_decompiled/images/197_com.arc.dh.state.PlayMode_BG2_7.png b/research/inner_decompiled/images/197_com.arc.dh.state.PlayMode_BG2_7.png new file mode 100644 index 0000000..ce0fad4 Binary files /dev/null and b/research/inner_decompiled/images/197_com.arc.dh.state.PlayMode_BG2_7.png differ diff --git a/research/inner_decompiled/images/198_com.arc.dh.state.PlayMode_BG2_6.png b/research/inner_decompiled/images/198_com.arc.dh.state.PlayMode_BG2_6.png new file mode 100644 index 0000000..0d061d6 Binary files /dev/null and b/research/inner_decompiled/images/198_com.arc.dh.state.PlayMode_BG2_6.png differ diff --git a/research/inner_decompiled/images/199.png b/research/inner_decompiled/images/199.png new file mode 100644 index 0000000..f9845b0 Binary files /dev/null and b/research/inner_decompiled/images/199.png differ diff --git a/research/inner_decompiled/images/200_com.arc.dh.state.PlayMode_BG3_4.png b/research/inner_decompiled/images/200_com.arc.dh.state.PlayMode_BG3_4.png new file mode 100644 index 0000000..9da64bb Binary files /dev/null and b/research/inner_decompiled/images/200_com.arc.dh.state.PlayMode_BG3_4.png differ diff --git a/research/inner_decompiled/images/201_com.arc.dh.objects.SteelCrate_sprite.png b/research/inner_decompiled/images/201_com.arc.dh.objects.SteelCrate_sprite.png new file mode 100644 index 0000000..8848826 Binary files /dev/null and b/research/inner_decompiled/images/201_com.arc.dh.objects.SteelCrate_sprite.png differ diff --git a/research/inner_decompiled/images/202.png b/research/inner_decompiled/images/202.png new file mode 100644 index 0000000..44c6029 Binary files /dev/null and b/research/inner_decompiled/images/202.png differ diff --git a/research/inner_decompiled/images/203_com.arc.dh.state.PlayMode_BG3_3.png b/research/inner_decompiled/images/203_com.arc.dh.state.PlayMode_BG3_3.png new file mode 100644 index 0000000..3472217 Binary files /dev/null and b/research/inner_decompiled/images/203_com.arc.dh.state.PlayMode_BG3_3.png differ diff --git a/research/inner_decompiled/images/204_com.arc.dh.state.PlayMode_BG2_3.png b/research/inner_decompiled/images/204_com.arc.dh.state.PlayMode_BG2_3.png new file mode 100644 index 0000000..15e147c Binary files /dev/null and b/research/inner_decompiled/images/204_com.arc.dh.state.PlayMode_BG2_3.png differ diff --git a/research/inner_decompiled/images/205_com.arc.dh.state.PlayMode_BG3_6.png b/research/inner_decompiled/images/205_com.arc.dh.state.PlayMode_BG3_6.png new file mode 100644 index 0000000..6bcb0c0 Binary files /dev/null and b/research/inner_decompiled/images/205_com.arc.dh.state.PlayMode_BG3_6.png differ diff --git a/research/inner_decompiled/images/206_com.arc.dh.state.PlayMode_BG3_5.png b/research/inner_decompiled/images/206_com.arc.dh.state.PlayMode_BG3_5.png new file mode 100644 index 0000000..0ed45aa Binary files /dev/null and b/research/inner_decompiled/images/206_com.arc.dh.state.PlayMode_BG3_5.png differ diff --git a/research/inner_decompiled/images/207_com.arc.dh.objects.Healthbar_barSprite.png b/research/inner_decompiled/images/207_com.arc.dh.objects.Healthbar_barSprite.png new file mode 100644 index 0000000..b9fb87e Binary files /dev/null and b/research/inner_decompiled/images/207_com.arc.dh.objects.Healthbar_barSprite.png differ diff --git a/research/inner_decompiled/images/208_com.arc.dh.util.Fonts_fontBevelGraySprite.png b/research/inner_decompiled/images/208_com.arc.dh.util.Fonts_fontBevelGraySprite.png new file mode 100644 index 0000000..cb5ebb2 Binary files /dev/null and b/research/inner_decompiled/images/208_com.arc.dh.util.Fonts_fontBevelGraySprite.png differ diff --git a/research/inner_decompiled/images/209_com.arc.dh.state.PlayMode_BG3_7.png b/research/inner_decompiled/images/209_com.arc.dh.state.PlayMode_BG3_7.png new file mode 100644 index 0000000..0bdff24 Binary files /dev/null and b/research/inner_decompiled/images/209_com.arc.dh.state.PlayMode_BG3_7.png differ diff --git a/research/inner_decompiled/images/210_com.arc.dh.state.StoryMode_STORY_OVERLAY_SPRITE.png b/research/inner_decompiled/images/210_com.arc.dh.state.StoryMode_STORY_OVERLAY_SPRITE.png new file mode 100644 index 0000000..7d9543b Binary files /dev/null and b/research/inner_decompiled/images/210_com.arc.dh.state.StoryMode_STORY_OVERLAY_SPRITE.png differ diff --git a/research/inner_decompiled/images/211_com.arc.dh.objects.enemies.Plant_sprite.png b/research/inner_decompiled/images/211_com.arc.dh.objects.enemies.Plant_sprite.png new file mode 100644 index 0000000..c822a5a Binary files /dev/null and b/research/inner_decompiled/images/211_com.arc.dh.objects.enemies.Plant_sprite.png differ diff --git a/research/inner_decompiled/images/212_com.arc.dh.objects.BulletSpreader_spriteGreen.png b/research/inner_decompiled/images/212_com.arc.dh.objects.BulletSpreader_spriteGreen.png new file mode 100644 index 0000000..be4fc6c Binary files /dev/null and b/research/inner_decompiled/images/212_com.arc.dh.objects.BulletSpreader_spriteGreen.png differ diff --git a/research/inner_decompiled/images/213_com.arc.dh.objects.enemies.Blob_sprite.png b/research/inner_decompiled/images/213_com.arc.dh.objects.enemies.Blob_sprite.png new file mode 100644 index 0000000..7326c08 Binary files /dev/null and b/research/inner_decompiled/images/213_com.arc.dh.objects.enemies.Blob_sprite.png differ diff --git a/research/inner_decompiled/images/214_com.arc.dh.state.MainScreen_buttonCreditsSprite.png b/research/inner_decompiled/images/214_com.arc.dh.state.MainScreen_buttonCreditsSprite.png new file mode 100644 index 0000000..fa28c6e Binary files /dev/null and b/research/inner_decompiled/images/214_com.arc.dh.state.MainScreen_buttonCreditsSprite.png differ diff --git a/research/inner_decompiled/images/215.png b/research/inner_decompiled/images/215.png new file mode 100644 index 0000000..71e3c43 Binary files /dev/null and b/research/inner_decompiled/images/215.png differ diff --git a/research/inner_decompiled/images/216_com.arc.dh.objects.enemies.Tadpole_redSprite.png b/research/inner_decompiled/images/216_com.arc.dh.objects.enemies.Tadpole_redSprite.png new file mode 100644 index 0000000..2f3ee3d Binary files /dev/null and b/research/inner_decompiled/images/216_com.arc.dh.objects.enemies.Tadpole_redSprite.png differ diff --git a/research/inner_decompiled/images/217_com.arc.dh.objects.powerups.PowerupMagnet_sprite.png b/research/inner_decompiled/images/217_com.arc.dh.objects.powerups.PowerupMagnet_sprite.png new file mode 100644 index 0000000..f569bd7 Binary files /dev/null and b/research/inner_decompiled/images/217_com.arc.dh.objects.powerups.PowerupMagnet_sprite.png differ diff --git a/research/inner_decompiled/images/218_com.arc.dh.menu.MessageLogPane_sprite.png b/research/inner_decompiled/images/218_com.arc.dh.menu.MessageLogPane_sprite.png new file mode 100644 index 0000000..67f7eb2 Binary files /dev/null and b/research/inner_decompiled/images/218_com.arc.dh.menu.MessageLogPane_sprite.png differ diff --git a/research/inner_decompiled/images/219_com.arc.dh.state.UI_mButtonSprite.png b/research/inner_decompiled/images/219_com.arc.dh.state.UI_mButtonSprite.png new file mode 100644 index 0000000..83d6d23 Binary files /dev/null and b/research/inner_decompiled/images/219_com.arc.dh.state.UI_mButtonSprite.png differ diff --git a/research/inner_decompiled/images/220_com.arc.dh.util.ParticleSystem_p_green.png b/research/inner_decompiled/images/220_com.arc.dh.util.ParticleSystem_p_green.png new file mode 100644 index 0000000..2b58dee Binary files /dev/null and b/research/inner_decompiled/images/220_com.arc.dh.util.ParticleSystem_p_green.png differ diff --git a/research/inner_decompiled/images/221_com.arc.dh.objects.powerups.PowerupEquipment_spriteBorder.png b/research/inner_decompiled/images/221_com.arc.dh.objects.powerups.PowerupEquipment_spriteBorder.png new file mode 100644 index 0000000..09bc740 Binary files /dev/null and b/research/inner_decompiled/images/221_com.arc.dh.objects.powerups.PowerupEquipment_spriteBorder.png differ diff --git a/research/inner_decompiled/images/222_org.flixel.system.debug.Vis_ImgBounds.png b/research/inner_decompiled/images/222_org.flixel.system.debug.Vis_ImgBounds.png new file mode 100644 index 0000000..f4485c7 Binary files /dev/null and b/research/inner_decompiled/images/222_org.flixel.system.debug.Vis_ImgBounds.png differ diff --git a/research/inner_decompiled/images/223_com.arc.dh.menu.StatisticsPane_refreshSprite.png b/research/inner_decompiled/images/223_com.arc.dh.menu.StatisticsPane_refreshSprite.png new file mode 100644 index 0000000..745b05b Binary files /dev/null and b/research/inner_decompiled/images/223_com.arc.dh.menu.StatisticsPane_refreshSprite.png differ diff --git a/research/inner_decompiled/images/224_com.arc.dh.objects.enemies.CeilingPlant_spriteGold.png b/research/inner_decompiled/images/224_com.arc.dh.objects.enemies.CeilingPlant_spriteGold.png new file mode 100644 index 0000000..6084e51 Binary files /dev/null and b/research/inner_decompiled/images/224_com.arc.dh.objects.enemies.CeilingPlant_spriteGold.png differ diff --git a/research/inner_decompiled/images/225_com.arc.dh.objects.enemies.Spider_sprite.png b/research/inner_decompiled/images/225_com.arc.dh.objects.enemies.Spider_sprite.png new file mode 100644 index 0000000..05570cc Binary files /dev/null and b/research/inner_decompiled/images/225_com.arc.dh.objects.enemies.Spider_sprite.png differ diff --git a/research/inner_decompiled/images/226_com.arc.dh.menu.GunComponentBar_singleBarSprite.png b/research/inner_decompiled/images/226_com.arc.dh.menu.GunComponentBar_singleBarSprite.png new file mode 100644 index 0000000..6567bf6 Binary files /dev/null and b/research/inner_decompiled/images/226_com.arc.dh.menu.GunComponentBar_singleBarSprite.png differ diff --git a/research/inner_decompiled/images/227_com.arc.dh.util.ParticleSystem_p_yellow.png b/research/inner_decompiled/images/227_com.arc.dh.util.ParticleSystem_p_yellow.png new file mode 100644 index 0000000..2663c69 Binary files /dev/null and b/research/inner_decompiled/images/227_com.arc.dh.util.ParticleSystem_p_yellow.png differ diff --git a/research/inner_decompiled/images/228_com.arc.dh.util.AchievementWindow_sprite.png b/research/inner_decompiled/images/228_com.arc.dh.util.AchievementWindow_sprite.png new file mode 100644 index 0000000..15f096d Binary files /dev/null and b/research/inner_decompiled/images/228_com.arc.dh.util.AchievementWindow_sprite.png differ diff --git a/research/inner_decompiled/images/229_com.arc.dh.menu.StatisticsPane_pegasSprite.png b/research/inner_decompiled/images/229_com.arc.dh.menu.StatisticsPane_pegasSprite.png new file mode 100644 index 0000000..bd1945e Binary files /dev/null and b/research/inner_decompiled/images/229_com.arc.dh.menu.StatisticsPane_pegasSprite.png differ diff --git a/research/inner_decompiled/images/230_com.arc.dh.objects.Healthbar_backgroundSprite.png b/research/inner_decompiled/images/230_com.arc.dh.objects.Healthbar_backgroundSprite.png new file mode 100644 index 0000000..11f7587 Binary files /dev/null and b/research/inner_decompiled/images/230_com.arc.dh.objects.Healthbar_backgroundSprite.png differ diff --git a/research/inner_decompiled/images/231_com.arc.dh.objects.powerups.PowerupShield_sprite.png b/research/inner_decompiled/images/231_com.arc.dh.objects.powerups.PowerupShield_sprite.png new file mode 100644 index 0000000..4aab370 Binary files /dev/null and b/research/inner_decompiled/images/231_com.arc.dh.objects.powerups.PowerupShield_sprite.png differ diff --git a/research/inner_decompiled/images/232_com.arc.dh.menu.CompleteWindow_sprite.png b/research/inner_decompiled/images/232_com.arc.dh.menu.CompleteWindow_sprite.png new file mode 100644 index 0000000..a46bf16 Binary files /dev/null and b/research/inner_decompiled/images/232_com.arc.dh.menu.CompleteWindow_sprite.png differ diff --git a/research/inner_decompiled/images/233_com.arc.dh.objects.BulletPrime_sprite.png b/research/inner_decompiled/images/233_com.arc.dh.objects.BulletPrime_sprite.png new file mode 100644 index 0000000..04f46be Binary files /dev/null and b/research/inner_decompiled/images/233_com.arc.dh.objects.BulletPrime_sprite.png differ diff --git a/research/inner_decompiled/images/234_com.arc.dh.util.Fonts_fontOutlineGradientSprite.png b/research/inner_decompiled/images/234_com.arc.dh.util.Fonts_fontOutlineGradientSprite.png new file mode 100644 index 0000000..dc7b6f6 Binary files /dev/null and b/research/inner_decompiled/images/234_com.arc.dh.util.Fonts_fontOutlineGradientSprite.png differ diff --git a/research/inner_decompiled/images/235_com.arc.dh.state.PlayMode_MENU_TIP_SPRITE.png b/research/inner_decompiled/images/235_com.arc.dh.state.PlayMode_MENU_TIP_SPRITE.png new file mode 100644 index 0000000..8daf5ec Binary files /dev/null and b/research/inner_decompiled/images/235_com.arc.dh.state.PlayMode_MENU_TIP_SPRITE.png differ diff --git a/research/inner_decompiled/images/236_com.arc.dh.objects.WoodenCrate_sprite.png b/research/inner_decompiled/images/236_com.arc.dh.objects.WoodenCrate_sprite.png new file mode 100644 index 0000000..ae19940 Binary files /dev/null and b/research/inner_decompiled/images/236_com.arc.dh.objects.WoodenCrate_sprite.png differ diff --git a/research/inner_decompiled/images/237_com.arc.dh.util.Fonts_fontOutlineBlueSSprite.png b/research/inner_decompiled/images/237_com.arc.dh.util.Fonts_fontOutlineBlueSSprite.png new file mode 100644 index 0000000..ffe63c5 Binary files /dev/null and b/research/inner_decompiled/images/237_com.arc.dh.util.Fonts_fontOutlineBlueSSprite.png differ diff --git a/research/inner_decompiled/images/238_com.arc.dh.util.ParticleSystem_p_white.png b/research/inner_decompiled/images/238_com.arc.dh.util.ParticleSystem_p_white.png new file mode 100644 index 0000000..fbec3c5 Binary files /dev/null and b/research/inner_decompiled/images/238_com.arc.dh.util.ParticleSystem_p_white.png differ diff --git a/research/inner_decompiled/images/239_com.arc.dh.util.ParticleSystem_p_prime.png b/research/inner_decompiled/images/239_com.arc.dh.util.ParticleSystem_p_prime.png new file mode 100644 index 0000000..d8a0504 Binary files /dev/null and b/research/inner_decompiled/images/239_com.arc.dh.util.ParticleSystem_p_prime.png differ diff --git a/research/inner_decompiled/images/240_com.arc.dh.objects.powerups.PowerupHeart_spriteBorder.png b/research/inner_decompiled/images/240_com.arc.dh.objects.powerups.PowerupHeart_spriteBorder.png new file mode 100644 index 0000000..0c09005 Binary files /dev/null and b/research/inner_decompiled/images/240_com.arc.dh.objects.powerups.PowerupHeart_spriteBorder.png differ diff --git a/research/inner_decompiled/images/241_com.arc.dh.menu.Menu_backButton.png b/research/inner_decompiled/images/241_com.arc.dh.menu.Menu_backButton.png new file mode 100644 index 0000000..6e6bbe2 Binary files /dev/null and b/research/inner_decompiled/images/241_com.arc.dh.menu.Menu_backButton.png differ diff --git a/research/inner_decompiled/images/242_com.arc.dh.menu.GameOver_spriteRetry.png b/research/inner_decompiled/images/242_com.arc.dh.menu.GameOver_spriteRetry.png new file mode 100644 index 0000000..8d03ba0 Binary files /dev/null and b/research/inner_decompiled/images/242_com.arc.dh.menu.GameOver_spriteRetry.png differ diff --git a/research/inner_decompiled/images/243_com.arc.dh.entities.Player_sprite.png b/research/inner_decompiled/images/243_com.arc.dh.entities.Player_sprite.png new file mode 100644 index 0000000..1cc01dd Binary files /dev/null and b/research/inner_decompiled/images/243_com.arc.dh.entities.Player_sprite.png differ diff --git a/research/inner_decompiled/images/244_com.arc.dh.state.HeartMeter_heartEmpty.png b/research/inner_decompiled/images/244_com.arc.dh.state.HeartMeter_heartEmpty.png new file mode 100644 index 0000000..b330390 Binary files /dev/null and b/research/inner_decompiled/images/244_com.arc.dh.state.HeartMeter_heartEmpty.png differ diff --git a/research/inner_decompiled/images/245_org.flixel.FlxTilemap_ImgAuto.png b/research/inner_decompiled/images/245_org.flixel.FlxTilemap_ImgAuto.png new file mode 100644 index 0000000..a88abb6 Binary files /dev/null and b/research/inner_decompiled/images/245_org.flixel.FlxTilemap_ImgAuto.png differ diff --git a/research/inner_decompiled/images/246_com.arc.dh.state.MainScreen_buttonAG.png b/research/inner_decompiled/images/246_com.arc.dh.state.MainScreen_buttonAG.png new file mode 100644 index 0000000..03b386b Binary files /dev/null and b/research/inner_decompiled/images/246_com.arc.dh.state.MainScreen_buttonAG.png differ diff --git a/research/inner_decompiled/images/247_com.arc.dh.menu.StatisticsPane_sprite.png b/research/inner_decompiled/images/247_com.arc.dh.menu.StatisticsPane_sprite.png new file mode 100644 index 0000000..b105768 Binary files /dev/null and b/research/inner_decompiled/images/247_com.arc.dh.menu.StatisticsPane_sprite.png differ diff --git a/research/inner_decompiled/images/248_com.arc.dh.menu.OptionsMenu_slowSprite.png b/research/inner_decompiled/images/248_com.arc.dh.menu.OptionsMenu_slowSprite.png new file mode 100644 index 0000000..b9edb53 Binary files /dev/null and b/research/inner_decompiled/images/248_com.arc.dh.menu.OptionsMenu_slowSprite.png differ diff --git a/research/inner_decompiled/images/249_com.arc.dh.objects.enemies.Professor_endingSprite.png b/research/inner_decompiled/images/249_com.arc.dh.objects.enemies.Professor_endingSprite.png new file mode 100644 index 0000000..ccb43ad Binary files /dev/null and b/research/inner_decompiled/images/249_com.arc.dh.objects.enemies.Professor_endingSprite.png differ diff --git a/research/inner_decompiled/images/250_com.arc.dh.menu.CharacterPane_sprite.png b/research/inner_decompiled/images/250_com.arc.dh.menu.CharacterPane_sprite.png new file mode 100644 index 0000000..2f5f057 Binary files /dev/null and b/research/inner_decompiled/images/250_com.arc.dh.menu.CharacterPane_sprite.png differ diff --git a/research/inner_decompiled/images/251_org.flixel.system.debug.VCR_ImgPause.png b/research/inner_decompiled/images/251_org.flixel.system.debug.VCR_ImgPause.png new file mode 100644 index 0000000..a6d220b Binary files /dev/null and b/research/inner_decompiled/images/251_org.flixel.system.debug.VCR_ImgPause.png differ diff --git a/research/inner_decompiled/images/252_com.arc.dh.menu.ConfirmationMenu_window.png b/research/inner_decompiled/images/252_com.arc.dh.menu.ConfirmationMenu_window.png new file mode 100644 index 0000000..6392ee5 Binary files /dev/null and b/research/inner_decompiled/images/252_com.arc.dh.menu.ConfirmationMenu_window.png differ diff --git a/research/inner_decompiled/images/253_com.arc.dh.objects.BulletFragment_sprite.png b/research/inner_decompiled/images/253_com.arc.dh.objects.BulletFragment_sprite.png new file mode 100644 index 0000000..47419e1 Binary files /dev/null and b/research/inner_decompiled/images/253_com.arc.dh.objects.BulletFragment_sprite.png differ diff --git a/research/inner_decompiled/images/254_com.arc.dh.menu.ConfirmationMenu_cancel.png b/research/inner_decompiled/images/254_com.arc.dh.menu.ConfirmationMenu_cancel.png new file mode 100644 index 0000000..88af85d Binary files /dev/null and b/research/inner_decompiled/images/254_com.arc.dh.menu.ConfirmationMenu_cancel.png differ diff --git a/research/inner_decompiled/images/255_com.arc.dh.state.MainScreen_buttonEscapeSprite.png b/research/inner_decompiled/images/255_com.arc.dh.state.MainScreen_buttonEscapeSprite.png new file mode 100644 index 0000000..fc7b24a Binary files /dev/null and b/research/inner_decompiled/images/255_com.arc.dh.state.MainScreen_buttonEscapeSprite.png differ diff --git a/research/inner_decompiled/images/256_com.arc.dh.state.StoryMode_CH1O.png b/research/inner_decompiled/images/256_com.arc.dh.state.StoryMode_CH1O.png new file mode 100644 index 0000000..540cfa7 Binary files /dev/null and b/research/inner_decompiled/images/256_com.arc.dh.state.StoryMode_CH1O.png differ diff --git a/research/inner_decompiled/images/257_com.arc.dh.menu.ConfirmationMenu_quit.png b/research/inner_decompiled/images/257_com.arc.dh.menu.ConfirmationMenu_quit.png new file mode 100644 index 0000000..30a1021 Binary files /dev/null and b/research/inner_decompiled/images/257_com.arc.dh.menu.ConfirmationMenu_quit.png differ diff --git a/research/inner_decompiled/images/258_com.arc.dh.state.MainScreen_buttonMinigameSprite.png b/research/inner_decompiled/images/258_com.arc.dh.state.MainScreen_buttonMinigameSprite.png new file mode 100644 index 0000000..19ab67e Binary files /dev/null and b/research/inner_decompiled/images/258_com.arc.dh.state.MainScreen_buttonMinigameSprite.png differ diff --git a/research/inner_decompiled/images/259_com.arc.dh.state.PlayMode_BITMAP_SPRITE.png b/research/inner_decompiled/images/259_com.arc.dh.state.PlayMode_BITMAP_SPRITE.png new file mode 100644 index 0000000..8b4bfaa Binary files /dev/null and b/research/inner_decompiled/images/259_com.arc.dh.state.PlayMode_BITMAP_SPRITE.png differ diff --git a/research/inner_decompiled/images/260_com.arc.dh.objects.enemies.Seed_sprite.png b/research/inner_decompiled/images/260_com.arc.dh.objects.enemies.Seed_sprite.png new file mode 100644 index 0000000..dc24cf3 Binary files /dev/null and b/research/inner_decompiled/images/260_com.arc.dh.objects.enemies.Seed_sprite.png differ diff --git a/research/inner_decompiled/images/261_com.arc.dh.entities.Player_shieldSprite.png b/research/inner_decompiled/images/261_com.arc.dh.entities.Player_shieldSprite.png new file mode 100644 index 0000000..b5c0226 Binary files /dev/null and b/research/inner_decompiled/images/261_com.arc.dh.entities.Player_shieldSprite.png differ diff --git a/research/inner_decompiled/images/262_com.arc.dh.objects.Diamond_sprite.png b/research/inner_decompiled/images/262_com.arc.dh.objects.Diamond_sprite.png new file mode 100644 index 0000000..1d68bfd Binary files /dev/null and b/research/inner_decompiled/images/262_com.arc.dh.objects.Diamond_sprite.png differ diff --git a/research/inner_decompiled/images/263_com.arc.dh.objects.enemies.Laser_spriteV.png b/research/inner_decompiled/images/263_com.arc.dh.objects.enemies.Laser_spriteV.png new file mode 100644 index 0000000..706ed8f Binary files /dev/null and b/research/inner_decompiled/images/263_com.arc.dh.objects.enemies.Laser_spriteV.png differ diff --git a/research/inner_decompiled/images/264_com.arc.dh.menu.Menu_closeButton.png b/research/inner_decompiled/images/264_com.arc.dh.menu.Menu_closeButton.png new file mode 100644 index 0000000..719a19f Binary files /dev/null and b/research/inner_decompiled/images/264_com.arc.dh.menu.Menu_closeButton.png differ diff --git a/research/inner_decompiled/images/265_com.arc.dh.util.text.Avatar_PROFESSOR_SPRITE.png b/research/inner_decompiled/images/265_com.arc.dh.util.text.Avatar_PROFESSOR_SPRITE.png new file mode 100644 index 0000000..6dcd59e Binary files /dev/null and b/research/inner_decompiled/images/265_com.arc.dh.util.text.Avatar_PROFESSOR_SPRITE.png differ diff --git a/research/inner_decompiled/images/266_com.arc.dh.objects.enemies.SnailKing_sprite.png b/research/inner_decompiled/images/266_com.arc.dh.objects.enemies.SnailKing_sprite.png new file mode 100644 index 0000000..da27dd3 Binary files /dev/null and b/research/inner_decompiled/images/266_com.arc.dh.objects.enemies.SnailKing_sprite.png differ diff --git a/research/inner_decompiled/images/267_com.arc.dh.objects.enemies.Snake_sprite.png b/research/inner_decompiled/images/267_com.arc.dh.objects.enemies.Snake_sprite.png new file mode 100644 index 0000000..7a1356a Binary files /dev/null and b/research/inner_decompiled/images/267_com.arc.dh.objects.enemies.Snake_sprite.png differ diff --git a/research/inner_decompiled/images/268_com.arc.dh.state.MinigameScreen_buttonRunUnlockedSprite.png b/research/inner_decompiled/images/268_com.arc.dh.state.MinigameScreen_buttonRunUnlockedSprite.png new file mode 100644 index 0000000..dc40dcc Binary files /dev/null and b/research/inner_decompiled/images/268_com.arc.dh.state.MinigameScreen_buttonRunUnlockedSprite.png differ diff --git a/research/inner_decompiled/images/269_com.arc.dh.state.StoryMode_CH2O.png b/research/inner_decompiled/images/269_com.arc.dh.state.StoryMode_CH2O.png new file mode 100644 index 0000000..eaed77d Binary files /dev/null and b/research/inner_decompiled/images/269_com.arc.dh.state.StoryMode_CH2O.png differ diff --git a/research/inner_decompiled/images/270.png b/research/inner_decompiled/images/270.png new file mode 100644 index 0000000..4bac0e7 Binary files /dev/null and b/research/inner_decompiled/images/270.png differ diff --git a/research/inner_decompiled/images/271_com.arc.dh.util.ParticleSystem_p_steelCrate.png b/research/inner_decompiled/images/271_com.arc.dh.util.ParticleSystem_p_steelCrate.png new file mode 100644 index 0000000..1581fa2 Binary files /dev/null and b/research/inner_decompiled/images/271_com.arc.dh.util.ParticleSystem_p_steelCrate.png differ diff --git a/research/inner_decompiled/images/272_org.flixel.system.debug.VCR_ImgStop.png b/research/inner_decompiled/images/272_org.flixel.system.debug.VCR_ImgStop.png new file mode 100644 index 0000000..b1bab1b Binary files /dev/null and b/research/inner_decompiled/images/272_org.flixel.system.debug.VCR_ImgStop.png differ diff --git a/research/inner_decompiled/images/273_com.arc.dh.objects.enemies.Laser_spriteH.png b/research/inner_decompiled/images/273_com.arc.dh.objects.enemies.Laser_spriteH.png new file mode 100644 index 0000000..18d50ea Binary files /dev/null and b/research/inner_decompiled/images/273_com.arc.dh.objects.enemies.Laser_spriteH.png differ diff --git a/research/inner_decompiled/images/274_com.arc.dh.state.HelpScreen_sprite.png b/research/inner_decompiled/images/274_com.arc.dh.state.HelpScreen_sprite.png new file mode 100644 index 0000000..99c78e7 Binary files /dev/null and b/research/inner_decompiled/images/274_com.arc.dh.state.HelpScreen_sprite.png differ diff --git a/research/inner_decompiled/images/275_com.arc.dh.menu.OptionsMenu_onSprite.png b/research/inner_decompiled/images/275_com.arc.dh.menu.OptionsMenu_onSprite.png new file mode 100644 index 0000000..8088167 Binary files /dev/null and b/research/inner_decompiled/images/275_com.arc.dh.menu.OptionsMenu_onSprite.png differ diff --git a/research/inner_decompiled/images/276_com.arc.dh.menu.GameOver_spriteShort.png b/research/inner_decompiled/images/276_com.arc.dh.menu.GameOver_spriteShort.png new file mode 100644 index 0000000..45765b4 Binary files /dev/null and b/research/inner_decompiled/images/276_com.arc.dh.menu.GameOver_spriteShort.png differ diff --git a/research/inner_decompiled/images/277_com.arc.dh.entities.Player_gunRightSprite.png b/research/inner_decompiled/images/277_com.arc.dh.entities.Player_gunRightSprite.png new file mode 100644 index 0000000..40983e2 Binary files /dev/null and b/research/inner_decompiled/images/277_com.arc.dh.entities.Player_gunRightSprite.png differ diff --git a/research/inner_decompiled/images/278_com.arc.dh.objects.Pot_largeSprite.png b/research/inner_decompiled/images/278_com.arc.dh.objects.Pot_largeSprite.png new file mode 100644 index 0000000..2eb6caf Binary files /dev/null and b/research/inner_decompiled/images/278_com.arc.dh.objects.Pot_largeSprite.png differ diff --git a/research/inner_decompiled/images/279_com.arc.dh.entities.Player_gunUpSprite.png b/research/inner_decompiled/images/279_com.arc.dh.entities.Player_gunUpSprite.png new file mode 100644 index 0000000..9bd6c39 Binary files /dev/null and b/research/inner_decompiled/images/279_com.arc.dh.entities.Player_gunUpSprite.png differ diff --git a/research/inner_decompiled/images/281_com.arc.dh.state.PlayMode_UPGRADE_TIP_SPRITE.png b/research/inner_decompiled/images/281_com.arc.dh.state.PlayMode_UPGRADE_TIP_SPRITE.png new file mode 100644 index 0000000..dae24c8 Binary files /dev/null and b/research/inner_decompiled/images/281_com.arc.dh.state.PlayMode_UPGRADE_TIP_SPRITE.png differ diff --git a/research/inner_decompiled/images/282_com.arc.dh.state.Trophy_sprite.png b/research/inner_decompiled/images/282_com.arc.dh.state.Trophy_sprite.png new file mode 100644 index 0000000..1c09026 Binary files /dev/null and b/research/inner_decompiled/images/282_com.arc.dh.state.Trophy_sprite.png differ diff --git a/research/inner_decompiled/images/283_com.arc.dh.objects.enemies.ClimbingSlime_sprite.png b/research/inner_decompiled/images/283_com.arc.dh.objects.enemies.ClimbingSlime_sprite.png new file mode 100644 index 0000000..d6891d9 Binary files /dev/null and b/research/inner_decompiled/images/283_com.arc.dh.objects.enemies.ClimbingSlime_sprite.png differ diff --git a/research/inner_decompiled/images/284_com.arc.dh.state.BossScreen_buttonHeroicSprite.png b/research/inner_decompiled/images/284_com.arc.dh.state.BossScreen_buttonHeroicSprite.png new file mode 100644 index 0000000..1c5b8d6 Binary files /dev/null and b/research/inner_decompiled/images/284_com.arc.dh.state.BossScreen_buttonHeroicSprite.png differ diff --git a/research/inner_decompiled/images/285_com.arc.dh.objects.enemies.SnakeTail_sprite.png b/research/inner_decompiled/images/285_com.arc.dh.objects.enemies.SnakeTail_sprite.png new file mode 100644 index 0000000..aff2420 Binary files /dev/null and b/research/inner_decompiled/images/285_com.arc.dh.objects.enemies.SnakeTail_sprite.png differ diff --git a/research/inner_decompiled/images/286_org.flixel.system.debug.VCR_ImgRecordOn.png b/research/inner_decompiled/images/286_org.flixel.system.debug.VCR_ImgRecordOn.png new file mode 100644 index 0000000..7b6cd23 Binary files /dev/null and b/research/inner_decompiled/images/286_org.flixel.system.debug.VCR_ImgRecordOn.png differ diff --git a/research/inner_decompiled/images/287_com.arc.dh.state.MinigameScreen_buttonLockedSprite.png b/research/inner_decompiled/images/287_com.arc.dh.state.MinigameScreen_buttonLockedSprite.png new file mode 100644 index 0000000..6c4d442 Binary files /dev/null and b/research/inner_decompiled/images/287_com.arc.dh.state.MinigameScreen_buttonLockedSprite.png differ diff --git a/research/inner_decompiled/images/288_com.arc.dh.state.BossScreen_buttonHeroicLockedSprite.png b/research/inner_decompiled/images/288_com.arc.dh.state.BossScreen_buttonHeroicLockedSprite.png new file mode 100644 index 0000000..599eb80 Binary files /dev/null and b/research/inner_decompiled/images/288_com.arc.dh.state.BossScreen_buttonHeroicLockedSprite.png differ diff --git a/research/inner_decompiled/images/289_com.arc.dh.util.Fonts_fontOutlineBlackSSprite.png b/research/inner_decompiled/images/289_com.arc.dh.util.Fonts_fontOutlineBlackSSprite.png new file mode 100644 index 0000000..dae6454 Binary files /dev/null and b/research/inner_decompiled/images/289_com.arc.dh.util.Fonts_fontOutlineBlackSSprite.png differ diff --git a/research/inner_decompiled/images/290_com.arc.dh.state.BossScreen_buttonNormalSprite.png b/research/inner_decompiled/images/290_com.arc.dh.state.BossScreen_buttonNormalSprite.png new file mode 100644 index 0000000..677c9e4 Binary files /dev/null and b/research/inner_decompiled/images/290_com.arc.dh.state.BossScreen_buttonNormalSprite.png differ diff --git a/research/inner_decompiled/images/291_com.arc.dh.menu.OptionsMenu_offSprite.png b/research/inner_decompiled/images/291_com.arc.dh.menu.OptionsMenu_offSprite.png new file mode 100644 index 0000000..3d29c9c Binary files /dev/null and b/research/inner_decompiled/images/291_com.arc.dh.menu.OptionsMenu_offSprite.png differ diff --git a/research/inner_decompiled/images/292_com.arc.dh.objects.powerups.RedDiamond_sprite_outline.png b/research/inner_decompiled/images/292_com.arc.dh.objects.powerups.RedDiamond_sprite_outline.png new file mode 100644 index 0000000..7137f0f Binary files /dev/null and b/research/inner_decompiled/images/292_com.arc.dh.objects.powerups.RedDiamond_sprite_outline.png differ diff --git a/research/inner_decompiled/images/293_com.arc.dh.state.MainScreen_buttonEscapeLockedSprite.png b/research/inner_decompiled/images/293_com.arc.dh.state.MainScreen_buttonEscapeLockedSprite.png new file mode 100644 index 0000000..09d93de Binary files /dev/null and b/research/inner_decompiled/images/293_com.arc.dh.state.MainScreen_buttonEscapeLockedSprite.png differ diff --git a/research/inner_decompiled/images/294_com.arc.dh.state.MainScreen_buttonHost.png b/research/inner_decompiled/images/294_com.arc.dh.state.MainScreen_buttonHost.png new file mode 100644 index 0000000..4e86466 Binary files /dev/null and b/research/inner_decompiled/images/294_com.arc.dh.state.MainScreen_buttonHost.png differ diff --git a/research/inner_decompiled/images/295_com.arc.dh.objects.BulletSpreader_sprite.png b/research/inner_decompiled/images/295_com.arc.dh.objects.BulletSpreader_sprite.png new file mode 100644 index 0000000..053a4a5 Binary files /dev/null and b/research/inner_decompiled/images/295_com.arc.dh.objects.BulletSpreader_sprite.png differ diff --git a/research/inner_decompiled/images/296_com.arc.dh.menu.OptionsMenu_kb1Sprite.png b/research/inner_decompiled/images/296_com.arc.dh.menu.OptionsMenu_kb1Sprite.png new file mode 100644 index 0000000..dd3f689 Binary files /dev/null and b/research/inner_decompiled/images/296_com.arc.dh.menu.OptionsMenu_kb1Sprite.png differ diff --git a/research/inner_decompiled/images/297_com.arc.dh.menu.GunComponentBar_barSprite.png b/research/inner_decompiled/images/297_com.arc.dh.menu.GunComponentBar_barSprite.png new file mode 100644 index 0000000..0921041 Binary files /dev/null and b/research/inner_decompiled/images/297_com.arc.dh.menu.GunComponentBar_barSprite.png differ diff --git a/research/inner_decompiled/images/298_com.arc.dh.objects.enemies.Plant_spriteGold.png b/research/inner_decompiled/images/298_com.arc.dh.objects.enemies.Plant_spriteGold.png new file mode 100644 index 0000000..0c2a0ac Binary files /dev/null and b/research/inner_decompiled/images/298_com.arc.dh.objects.enemies.Plant_spriteGold.png differ diff --git a/research/inner_decompiled/images/299_com.arc.dh.util.ParticleSystem_p_purple.png b/research/inner_decompiled/images/299_com.arc.dh.util.ParticleSystem_p_purple.png new file mode 100644 index 0000000..f399c55 Binary files /dev/null and b/research/inner_decompiled/images/299_com.arc.dh.util.ParticleSystem_p_purple.png differ diff --git a/research/inner_decompiled/images/2_com.newgrounds.assets.DefaultMedalIcon_com.newgrounds.assets.DefaultMedalIcon.png b/research/inner_decompiled/images/2_com.newgrounds.assets.DefaultMedalIcon_com.newgrounds.assets.DefaultMedalIcon.png new file mode 100644 index 0000000..48ae7d5 Binary files /dev/null and b/research/inner_decompiled/images/2_com.newgrounds.assets.DefaultMedalIcon_com.newgrounds.assets.DefaultMedalIcon.png differ diff --git a/research/inner_decompiled/images/300_com.arc.dh.state.Chapter_sprite.png b/research/inner_decompiled/images/300_com.arc.dh.state.Chapter_sprite.png new file mode 100644 index 0000000..5f895f2 Binary files /dev/null and b/research/inner_decompiled/images/300_com.arc.dh.state.Chapter_sprite.png differ diff --git a/research/inner_decompiled/images/301_org.flixel.system.debug.VCR_ImgRestart.png b/research/inner_decompiled/images/301_org.flixel.system.debug.VCR_ImgRestart.png new file mode 100644 index 0000000..8537354 Binary files /dev/null and b/research/inner_decompiled/images/301_org.flixel.system.debug.VCR_ImgRestart.png differ diff --git a/research/inner_decompiled/images/302_com.arc.dh.objects.powerups.Powerup_POWERUP_DIAMOND_BORDER.png b/research/inner_decompiled/images/302_com.arc.dh.objects.powerups.Powerup_POWERUP_DIAMOND_BORDER.png new file mode 100644 index 0000000..c354ab9 Binary files /dev/null and b/research/inner_decompiled/images/302_com.arc.dh.objects.powerups.Powerup_POWERUP_DIAMOND_BORDER.png differ diff --git a/research/inner_decompiled/images/303_com.arc.dh.menu.Menu_spriteStatisticsButton.png b/research/inner_decompiled/images/303_com.arc.dh.menu.Menu_spriteStatisticsButton.png new file mode 100644 index 0000000..0d5a8ce Binary files /dev/null and b/research/inner_decompiled/images/303_com.arc.dh.menu.Menu_spriteStatisticsButton.png differ diff --git a/research/inner_decompiled/images/304_com.arc.dh.menu.StatisticsChapter_heartCrystalObtained.png b/research/inner_decompiled/images/304_com.arc.dh.menu.StatisticsChapter_heartCrystalObtained.png new file mode 100644 index 0000000..2b86686 Binary files /dev/null and b/research/inner_decompiled/images/304_com.arc.dh.menu.StatisticsChapter_heartCrystalObtained.png differ diff --git a/research/inner_decompiled/images/41_com.newgrounds.assets.DefaultSaveIcon_com.newgrounds.assets.DefaultSaveIcon.png b/research/inner_decompiled/images/41_com.newgrounds.assets.DefaultSaveIcon_com.newgrounds.assets.DefaultSaveIcon.png new file mode 100644 index 0000000..1954328 Binary files /dev/null and b/research/inner_decompiled/images/41_com.newgrounds.assets.DefaultSaveIcon_com.newgrounds.assets.DefaultSaveIcon.png differ diff --git a/research/inner_decompiled/images/42_com.arc.dh.util.ParticleSystem_p_black.png b/research/inner_decompiled/images/42_com.arc.dh.util.ParticleSystem_p_black.png new file mode 100644 index 0000000..519dec9 Binary files /dev/null and b/research/inner_decompiled/images/42_com.arc.dh.util.ParticleSystem_p_black.png differ diff --git a/research/inner_decompiled/images/43_com.arc.dh.state.UI_diamondsSprite.png b/research/inner_decompiled/images/43_com.arc.dh.state.UI_diamondsSprite.png new file mode 100644 index 0000000..7749e79 Binary files /dev/null and b/research/inner_decompiled/images/43_com.arc.dh.state.UI_diamondsSprite.png differ diff --git a/research/inner_decompiled/images/44_com.arc.dh.menu.GameOver_spriteMainMenu.png b/research/inner_decompiled/images/44_com.arc.dh.menu.GameOver_spriteMainMenu.png new file mode 100644 index 0000000..b61c014 Binary files /dev/null and b/research/inner_decompiled/images/44_com.arc.dh.menu.GameOver_spriteMainMenu.png differ diff --git a/research/inner_decompiled/images/46_com.arc.dh.objects.enemies.DiveBird_sprite.png b/research/inner_decompiled/images/46_com.arc.dh.objects.enemies.DiveBird_sprite.png new file mode 100644 index 0000000..6beb4e5 Binary files /dev/null and b/research/inner_decompiled/images/46_com.arc.dh.objects.enemies.DiveBird_sprite.png differ diff --git a/research/inner_decompiled/images/47_com.arc.dh.objects.enemies.FloorPlant_sprite.png b/research/inner_decompiled/images/47_com.arc.dh.objects.enemies.FloorPlant_sprite.png new file mode 100644 index 0000000..4341d61 Binary files /dev/null and b/research/inner_decompiled/images/47_com.arc.dh.objects.enemies.FloorPlant_sprite.png differ diff --git a/research/inner_decompiled/images/48_com.arc.dh.state.StoryMode_CH5O.png b/research/inner_decompiled/images/48_com.arc.dh.state.StoryMode_CH5O.png new file mode 100644 index 0000000..e59fc05 Binary files /dev/null and b/research/inner_decompiled/images/48_com.arc.dh.state.StoryMode_CH5O.png differ diff --git a/research/inner_decompiled/images/49_com.arc.dh.objects.enemies.ShadowOrb_sprite.png b/research/inner_decompiled/images/49_com.arc.dh.objects.enemies.ShadowOrb_sprite.png new file mode 100644 index 0000000..9eef44d Binary files /dev/null and b/research/inner_decompiled/images/49_com.arc.dh.objects.enemies.ShadowOrb_sprite.png differ diff --git a/research/inner_decompiled/images/50_com.arc.dh.objects.enemies.Snail_sprite.png b/research/inner_decompiled/images/50_com.arc.dh.objects.enemies.Snail_sprite.png new file mode 100644 index 0000000..fab5c49 Binary files /dev/null and b/research/inner_decompiled/images/50_com.arc.dh.objects.enemies.Snail_sprite.png differ diff --git a/research/inner_decompiled/images/51_com.arc.dh.objects.enemies.BlobDot_sprite.png b/research/inner_decompiled/images/51_com.arc.dh.objects.enemies.BlobDot_sprite.png new file mode 100644 index 0000000..3252133 Binary files /dev/null and b/research/inner_decompiled/images/51_com.arc.dh.objects.enemies.BlobDot_sprite.png differ diff --git a/research/inner_decompiled/images/52_com.arc.dh.util.Fonts_fontOutlineBrownSprite.png b/research/inner_decompiled/images/52_com.arc.dh.util.Fonts_fontOutlineBrownSprite.png new file mode 100644 index 0000000..966c8c6 Binary files /dev/null and b/research/inner_decompiled/images/52_com.arc.dh.util.Fonts_fontOutlineBrownSprite.png differ diff --git a/research/inner_decompiled/images/53_com.arc.dh.util.ParticleSystem_p_rebound.png b/research/inner_decompiled/images/53_com.arc.dh.util.ParticleSystem_p_rebound.png new file mode 100644 index 0000000..61c9589 Binary files /dev/null and b/research/inner_decompiled/images/53_com.arc.dh.util.ParticleSystem_p_rebound.png differ diff --git a/research/inner_decompiled/images/54.png b/research/inner_decompiled/images/54.png new file mode 100644 index 0000000..06e3766 Binary files /dev/null and b/research/inner_decompiled/images/54.png differ diff --git a/research/inner_decompiled/images/55_com.arc.dh.state.PlayMode_CONTROLS_SPRITE.png b/research/inner_decompiled/images/55_com.arc.dh.state.PlayMode_CONTROLS_SPRITE.png new file mode 100644 index 0000000..bffca45 Binary files /dev/null and b/research/inner_decompiled/images/55_com.arc.dh.state.PlayMode_CONTROLS_SPRITE.png differ diff --git a/research/inner_decompiled/images/56.png b/research/inner_decompiled/images/56.png new file mode 100644 index 0000000..23ab784 Binary files /dev/null and b/research/inner_decompiled/images/56.png differ diff --git a/research/inner_decompiled/images/57_com.arc.dh.state.StoryScreen_chooseSprite.png b/research/inner_decompiled/images/57_com.arc.dh.state.StoryScreen_chooseSprite.png new file mode 100644 index 0000000..6a27c56 Binary files /dev/null and b/research/inner_decompiled/images/57_com.arc.dh.state.StoryScreen_chooseSprite.png differ diff --git a/research/inner_decompiled/images/58_com.arc.dh.state.MainScreen_buttonBossSprite.png b/research/inner_decompiled/images/58_com.arc.dh.state.MainScreen_buttonBossSprite.png new file mode 100644 index 0000000..79d4af6 Binary files /dev/null and b/research/inner_decompiled/images/58_com.arc.dh.state.MainScreen_buttonBossSprite.png differ diff --git a/research/inner_decompiled/images/59_com.arc.dh.state.EscapeScreen_startBackSprite.png b/research/inner_decompiled/images/59_com.arc.dh.state.EscapeScreen_startBackSprite.png new file mode 100644 index 0000000..77b55b3 Binary files /dev/null and b/research/inner_decompiled/images/59_com.arc.dh.state.EscapeScreen_startBackSprite.png differ diff --git a/research/inner_decompiled/images/60_com.arc.dh.entities.Player_elevatorSprite.png b/research/inner_decompiled/images/60_com.arc.dh.entities.Player_elevatorSprite.png new file mode 100644 index 0000000..fdf4a19 Binary files /dev/null and b/research/inner_decompiled/images/60_com.arc.dh.entities.Player_elevatorSprite.png differ diff --git a/research/inner_decompiled/images/61_com.arc.dh.menu.StatisticsChapter_bgSprite.png b/research/inner_decompiled/images/61_com.arc.dh.menu.StatisticsChapter_bgSprite.png new file mode 100644 index 0000000..b55b2c6 Binary files /dev/null and b/research/inner_decompiled/images/61_com.arc.dh.menu.StatisticsChapter_bgSprite.png differ diff --git a/research/inner_decompiled/images/62_com.arc.dh.objects.enemies.Tadpole_sprite.png b/research/inner_decompiled/images/62_com.arc.dh.objects.enemies.Tadpole_sprite.png new file mode 100644 index 0000000..4c3d45d Binary files /dev/null and b/research/inner_decompiled/images/62_com.arc.dh.objects.enemies.Tadpole_sprite.png differ diff --git a/research/inner_decompiled/images/63_com.arc.dh.objects.powerups.PowerupHeart_sprite.png b/research/inner_decompiled/images/63_com.arc.dh.objects.powerups.PowerupHeart_sprite.png new file mode 100644 index 0000000..77196c2 Binary files /dev/null and b/research/inner_decompiled/images/63_com.arc.dh.objects.powerups.PowerupHeart_sprite.png differ diff --git a/research/inner_decompiled/images/64_com.arc.dh.state.StoryMode_CH1.png b/research/inner_decompiled/images/64_com.arc.dh.state.StoryMode_CH1.png new file mode 100644 index 0000000..9ecefda Binary files /dev/null and b/research/inner_decompiled/images/64_com.arc.dh.state.StoryMode_CH1.png differ diff --git a/research/inner_decompiled/images/65_com.arc.dh.objects.enemies.Slime_sprite.png b/research/inner_decompiled/images/65_com.arc.dh.objects.enemies.Slime_sprite.png new file mode 100644 index 0000000..d407832 Binary files /dev/null and b/research/inner_decompiled/images/65_com.arc.dh.objects.enemies.Slime_sprite.png differ diff --git a/research/inner_decompiled/images/66_com.arc.dh.state.StoryMode_CH3.png b/research/inner_decompiled/images/66_com.arc.dh.state.StoryMode_CH3.png new file mode 100644 index 0000000..36cfef1 Binary files /dev/null and b/research/inner_decompiled/images/66_com.arc.dh.state.StoryMode_CH3.png differ diff --git a/research/inner_decompiled/images/67_com.arc.dh.state.StoryMode_CH6O.png b/research/inner_decompiled/images/67_com.arc.dh.state.StoryMode_CH6O.png new file mode 100644 index 0000000..9655938 Binary files /dev/null and b/research/inner_decompiled/images/67_com.arc.dh.state.StoryMode_CH6O.png differ diff --git a/research/inner_decompiled/images/68.png b/research/inner_decompiled/images/68.png new file mode 100644 index 0000000..3775497 Binary files /dev/null and b/research/inner_decompiled/images/68.png differ diff --git a/research/inner_decompiled/images/69_com.arc.dh.state.StoryMode_CH2.png b/research/inner_decompiled/images/69_com.arc.dh.state.StoryMode_CH2.png new file mode 100644 index 0000000..adf6183 Binary files /dev/null and b/research/inner_decompiled/images/69_com.arc.dh.state.StoryMode_CH2.png differ diff --git a/research/inner_decompiled/images/70_org.flixel.FlxSprite_ImgDefault.png b/research/inner_decompiled/images/70_org.flixel.FlxSprite_ImgDefault.png new file mode 100644 index 0000000..785c9cf Binary files /dev/null and b/research/inner_decompiled/images/70_org.flixel.FlxSprite_ImgDefault.png differ diff --git a/research/inner_decompiled/images/71_org.flixel.system.debug.VCR_ImgRecordOff.png b/research/inner_decompiled/images/71_org.flixel.system.debug.VCR_ImgRecordOff.png new file mode 100644 index 0000000..2d481a1 Binary files /dev/null and b/research/inner_decompiled/images/71_org.flixel.system.debug.VCR_ImgRecordOff.png differ diff --git a/research/inner_decompiled/images/72_com.arc.dh.state.StoryMode_CH5.png b/research/inner_decompiled/images/72_com.arc.dh.state.StoryMode_CH5.png new file mode 100644 index 0000000..d3046eb Binary files /dev/null and b/research/inner_decompiled/images/72_com.arc.dh.state.StoryMode_CH5.png differ diff --git a/research/inner_decompiled/images/73_com.arc.dh.objects.enemies.BouncingSlime_sprite.png b/research/inner_decompiled/images/73_com.arc.dh.objects.enemies.BouncingSlime_sprite.png new file mode 100644 index 0000000..eed3bbc Binary files /dev/null and b/research/inner_decompiled/images/73_com.arc.dh.objects.enemies.BouncingSlime_sprite.png differ diff --git a/research/inner_decompiled/images/74_com.arc.dh.state.StoryMode_CH4.png b/research/inner_decompiled/images/74_com.arc.dh.state.StoryMode_CH4.png new file mode 100644 index 0000000..132b1ec Binary files /dev/null and b/research/inner_decompiled/images/74_com.arc.dh.state.StoryMode_CH4.png differ diff --git a/research/inner_decompiled/images/75_com.arc.dh.menu.GunComponentBar_bgSprite.png b/research/inner_decompiled/images/75_com.arc.dh.menu.GunComponentBar_bgSprite.png new file mode 100644 index 0000000..60cff55 Binary files /dev/null and b/research/inner_decompiled/images/75_com.arc.dh.menu.GunComponentBar_bgSprite.png differ diff --git a/research/inner_decompiled/images/76_com.arc.dh.state.StoryMode_CH7.png b/research/inner_decompiled/images/76_com.arc.dh.state.StoryMode_CH7.png new file mode 100644 index 0000000..7c4617a Binary files /dev/null and b/research/inner_decompiled/images/76_com.arc.dh.state.StoryMode_CH7.png differ diff --git a/research/inner_decompiled/images/77_com.arc.dh.util.Fonts_fontOutlineGradientSSprite.png b/research/inner_decompiled/images/77_com.arc.dh.util.Fonts_fontOutlineGradientSSprite.png new file mode 100644 index 0000000..74a962c Binary files /dev/null and b/research/inner_decompiled/images/77_com.arc.dh.util.Fonts_fontOutlineGradientSSprite.png differ diff --git a/research/inner_decompiled/images/78_com.arc.dh.state.StoryMode_CH6.png b/research/inner_decompiled/images/78_com.arc.dh.state.StoryMode_CH6.png new file mode 100644 index 0000000..a68e163 Binary files /dev/null and b/research/inner_decompiled/images/78_com.arc.dh.state.StoryMode_CH6.png differ diff --git a/research/inner_decompiled/images/79_com.arc.dh.util.ParticleSystem_p_cyan.png b/research/inner_decompiled/images/79_com.arc.dh.util.ParticleSystem_p_cyan.png new file mode 100644 index 0000000..13ddb14 Binary files /dev/null and b/research/inner_decompiled/images/79_com.arc.dh.util.ParticleSystem_p_cyan.png differ diff --git a/research/inner_decompiled/images/80_com.arc.dh.menu.GunComponentBar_barSpriteUnobtained.png b/research/inner_decompiled/images/80_com.arc.dh.menu.GunComponentBar_barSpriteUnobtained.png new file mode 100644 index 0000000..41ca9b0 Binary files /dev/null and b/research/inner_decompiled/images/80_com.arc.dh.menu.GunComponentBar_barSpriteUnobtained.png differ diff --git a/research/inner_decompiled/images/81_com.arc.dh.state.MainMenu_soundButton.png b/research/inner_decompiled/images/81_com.arc.dh.state.MainMenu_soundButton.png new file mode 100644 index 0000000..820bb67 Binary files /dev/null and b/research/inner_decompiled/images/81_com.arc.dh.state.MainMenu_soundButton.png differ diff --git a/research/inner_decompiled/images/82_com.arc.dh.menu.OptionsMenu_resetButton.png b/research/inner_decompiled/images/82_com.arc.dh.menu.OptionsMenu_resetButton.png new file mode 100644 index 0000000..9bae7e3 Binary files /dev/null and b/research/inner_decompiled/images/82_com.arc.dh.menu.OptionsMenu_resetButton.png differ diff --git a/research/inner_decompiled/images/83_com.arc.dh.state.WeaponUI_sprite.png b/research/inner_decompiled/images/83_com.arc.dh.state.WeaponUI_sprite.png new file mode 100644 index 0000000..284780b Binary files /dev/null and b/research/inner_decompiled/images/83_com.arc.dh.state.WeaponUI_sprite.png differ diff --git a/research/inner_decompiled/images/84.png b/research/inner_decompiled/images/84.png new file mode 100644 index 0000000..b5f17e1 Binary files /dev/null and b/research/inner_decompiled/images/84.png differ diff --git a/research/inner_decompiled/images/85_com.arc.dh.util.ParticleSystem_p_blue.png b/research/inner_decompiled/images/85_com.arc.dh.util.ParticleSystem_p_blue.png new file mode 100644 index 0000000..0b31fb6 Binary files /dev/null and b/research/inner_decompiled/images/85_com.arc.dh.util.ParticleSystem_p_blue.png differ diff --git a/research/inner_decompiled/images/86_org.flixel.system.debug.VCR_ImgPlay.png b/research/inner_decompiled/images/86_org.flixel.system.debug.VCR_ImgPlay.png new file mode 100644 index 0000000..04f59bc Binary files /dev/null and b/research/inner_decompiled/images/86_org.flixel.system.debug.VCR_ImgPlay.png differ diff --git a/research/inner_decompiled/images/87_com.arc.dh.state.CreditsScreen_sprite.png b/research/inner_decompiled/images/87_com.arc.dh.state.CreditsScreen_sprite.png new file mode 100644 index 0000000..81389c5 Binary files /dev/null and b/research/inner_decompiled/images/87_com.arc.dh.state.CreditsScreen_sprite.png differ diff --git a/research/inner_decompiled/images/88.png b/research/inner_decompiled/images/88.png new file mode 100644 index 0000000..c2ac79e Binary files /dev/null and b/research/inner_decompiled/images/88.png differ diff --git a/research/inner_decompiled/images/89_com.arc.dh.objects.enemies.Professor_sadSprite.png b/research/inner_decompiled/images/89_com.arc.dh.objects.enemies.Professor_sadSprite.png new file mode 100644 index 0000000..d012b9c Binary files /dev/null and b/research/inner_decompiled/images/89_com.arc.dh.objects.enemies.Professor_sadSprite.png differ diff --git a/research/inner_decompiled/images/90_com.arc.dh.menu.GunComponent_sprite.png b/research/inner_decompiled/images/90_com.arc.dh.menu.GunComponent_sprite.png new file mode 100644 index 0000000..ed5ca6a Binary files /dev/null and b/research/inner_decompiled/images/90_com.arc.dh.menu.GunComponent_sprite.png differ diff --git a/research/inner_decompiled/images/91_com.arc.dh.objects.Missile_sprite.png b/research/inner_decompiled/images/91_com.arc.dh.objects.Missile_sprite.png new file mode 100644 index 0000000..85b77c7 Binary files /dev/null and b/research/inner_decompiled/images/91_com.arc.dh.objects.Missile_sprite.png differ diff --git a/research/inner_decompiled/images/92_com.arc.dh.objects.Checkpoint_sprite.png b/research/inner_decompiled/images/92_com.arc.dh.objects.Checkpoint_sprite.png new file mode 100644 index 0000000..096c3f3 Binary files /dev/null and b/research/inner_decompiled/images/92_com.arc.dh.objects.Checkpoint_sprite.png differ diff --git a/research/inner_decompiled/images/93_com.arc.dh.state.StoryMode_CH3O.png b/research/inner_decompiled/images/93_com.arc.dh.state.StoryMode_CH3O.png new file mode 100644 index 0000000..4e7689d Binary files /dev/null and b/research/inner_decompiled/images/93_com.arc.dh.state.StoryMode_CH3O.png differ diff --git a/research/inner_decompiled/images/94_com.arc.dh.util.ParticleSystem_p_pot.png b/research/inner_decompiled/images/94_com.arc.dh.util.ParticleSystem_p_pot.png new file mode 100644 index 0000000..06ca66f Binary files /dev/null and b/research/inner_decompiled/images/94_com.arc.dh.util.ParticleSystem_p_pot.png differ diff --git a/research/inner_decompiled/images/95_com.arc.dh.entities.Player_gunDownSprite.png b/research/inner_decompiled/images/95_com.arc.dh.entities.Player_gunDownSprite.png new file mode 100644 index 0000000..030aa42 Binary files /dev/null and b/research/inner_decompiled/images/95_com.arc.dh.entities.Player_gunDownSprite.png differ diff --git a/research/inner_decompiled/images/96_com.arc.dh.objects.powerups.HeartCrystal_sprite.png b/research/inner_decompiled/images/96_com.arc.dh.objects.powerups.HeartCrystal_sprite.png new file mode 100644 index 0000000..2d5e83f Binary files /dev/null and b/research/inner_decompiled/images/96_com.arc.dh.objects.powerups.HeartCrystal_sprite.png differ diff --git a/research/inner_decompiled/images/97_com.arc.dh.objects.powerups.HeartCrystal_sprite_outline.png b/research/inner_decompiled/images/97_com.arc.dh.objects.powerups.HeartCrystal_sprite_outline.png new file mode 100644 index 0000000..51ea13a Binary files /dev/null and b/research/inner_decompiled/images/97_com.arc.dh.objects.powerups.HeartCrystal_sprite_outline.png differ diff --git a/research/inner_decompiled/images/99_com.arc.dh.state.MinigameScreen_buttonPlaySprite.png b/research/inner_decompiled/images/99_com.arc.dh.state.MinigameScreen_buttonPlaySprite.png new file mode 100644 index 0000000..995e54a Binary files /dev/null and b/research/inner_decompiled/images/99_com.arc.dh.state.MinigameScreen_buttonPlaySprite.png differ diff --git a/research/inner_decompiled/scripts/Game.as b/research/inner_decompiled/scripts/Game.as new file mode 100644 index 0000000..0ce7280 --- /dev/null +++ b/research/inner_decompiled/scripts/Game.as @@ -0,0 +1,17 @@ +package +{ + import com.arc.dh.state.Intro; + import com.arc.dh.util.DataSerializer; + import org.flixel.FlxGame; + + public class Game extends FlxGame + { + + public function Game(param1:Main) + { + DataSerializer.load(); + super(360,240,Intro,2,60,60); + } + } +} + diff --git a/research/inner_decompiled/scripts/Main.as b/research/inner_decompiled/scripts/Main.as new file mode 100644 index 0000000..e04384a --- /dev/null +++ b/research/inner_decompiled/scripts/Main.as @@ -0,0 +1,23 @@ +package +{ + import flash.display.Sprite; + import flash.events.Event; + + [SWF(width="720", height="480", backgroundColor="#333333", frameRate="60")] + public class Main extends Sprite + { + + public function Main() + { + super(); + addEventListener(Event.ADDED_TO_STAGE,this.init); + } + + private function init(param1:Event) : void + { + removeEventListener(Event.ADDED_TO_STAGE,this.init); + addChild(new Game(this)); + } + } +} + diff --git a/research/inner_decompiled/scripts/MochiBot.as b/research/inner_decompiled/scripts/MochiBot.as new file mode 100644 index 0000000..497a0ca --- /dev/null +++ b/research/inner_decompiled/scripts/MochiBot.as @@ -0,0 +1,57 @@ +package +{ + import flash.display.Loader; + import flash.display.Sprite; + import flash.net.URLRequest; + import flash.net.URLRequestMethod; + import flash.net.URLVariables; + import flash.system.Capabilities; + import flash.system.Security; + import org.flixel.FlxG; + + public dynamic class MochiBot extends Sprite + { + + public function MochiBot() + { + super(); + } + + public static function track(param1:Sprite, param2:String) : MochiBot + { + if(Security.sandboxType == "localWithFile") + { + return null; + } + var _loc3_:MochiBot = new MochiBot(); + param1.addChild(_loc3_); + Security.allowDomain("*"); + Security.allowInsecureDomain("*"); + var _loc4_:String = "http://core.mochibot.com/my/core.swf"; + var _loc5_:URLVariables = new URLVariables(); + _loc5_["sb"] = Security.sandboxType; + _loc5_["v"] = Capabilities.version; + _loc5_["swfid"] = param2; + _loc5_["mv"] = "8"; + _loc5_["fv"] = "9"; + var _loc6_:String = FlxG.root.loaderInfo.loaderURL; + if(_loc6_.indexOf("http") == 0) + { + _loc5_["url"] = _loc6_; + } + else + { + _loc5_["url"] = "local"; + } + var _loc7_:URLRequest = new URLRequest(_loc4_); + _loc7_.contentType = "application/x-www-form-urlencoded"; + _loc7_.method = URLRequestMethod.POST; + _loc7_.data = _loc5_; + var _loc8_:Loader = new Loader(); + _loc3_.addChild(_loc8_); + _loc8_.load(_loc7_); + return _loc3_; + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/Data.as b/research/inner_decompiled/scripts/Playtomic/Data.as new file mode 100644 index 0000000..f7da5b1 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/Data.as @@ -0,0 +1,225 @@ +package Playtomic +{ + public final class Data + { + + private static var SECTION:String; + + private static var VIEWS:String; + + private static var PLAYS:String; + + private static var PLAYTIME:String; + + private static var CUSTOMMETRIC:String; + + private static var LEVELCOUNTERMETRIC:String; + + private static var LEVELRANGEDMETRIC:String; + + private static var LEVELAVERAGEMETRIC:String; + + public function Data() + { + super(); + } + + internal static function Initialise(param1:String) : void + { + SECTION = Encode.MD5("data-" + param1); + VIEWS = Encode.MD5("data-views-" + param1); + PLAYS = Encode.MD5("data-plays-" + param1); + PLAYTIME = Encode.MD5("data-playtime-" + param1); + CUSTOMMETRIC = Encode.MD5("data-custommetric-" + param1); + LEVELCOUNTERMETRIC = Encode.MD5("data-levelcountermetric-" + param1); + LEVELRANGEDMETRIC = Encode.MD5("data-levelrangedmetric-" + param1); + LEVELAVERAGEMETRIC = Encode.MD5("data-levelaveragemetric-" + param1); + } + + public static function Views(param1:Function, param2:Object = null) : void + { + General(VIEWS,"Views",param1,param2); + } + + public static function Plays(param1:Function, param2:Object = null) : void + { + General(PLAYS,"Plays",param1,param2); + } + + public static function PlayTime(param1:Function, param2:Object = null) : void + { + General(PLAYTIME,"Playtime",param1,param2); + } + + private static function General(param1:String, param2:String, param3:Function, param4:Object) : void + { + if(param4 == null) + { + param4 = new Object(); + } + var _loc5_:Object = new Object(); + _loc5_["type"] = param2; + _loc5_["day"] = param4.hasOwnProperty("day") ? param4["day"] : 0; + _loc5_["month"] = param4.hasOwnProperty("month") ? param4["month"] : 0; + _loc5_["year"] = param4.hasOwnProperty("year") ? param4["year"] : 0; + Request.Load(SECTION,param1,GeneralComplete,param3,_loc5_); + } + + private static function GeneralComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + if(param1 == null) + { + return; + } + var _loc5_:Object = new Object(); + if(param4.Success == 1) + { + _loc5_["Name"] = param2["type"]; + _loc5_["Day"] = param2["day"]; + _loc5_["Month"] = param2["month"]; + _loc5_["Year"] = param2["year"]; + _loc5_["Value"] = int(param3["value"]); + } + param1(_loc5_,param4); + } + + public static function CustomMetric(param1:String, param2:Function, param3:Object = null) : void + { + if(param3 == null) + { + param3 = new Object(); + } + var _loc4_:Object = new Object(); + _loc4_["metric"] = param1; + _loc4_["day"] = param3.hasOwnProperty("day") ? param3["day"] : 0; + _loc4_["month"] = param3.hasOwnProperty("month") ? param3["month"] : 0; + _loc4_["year"] = param3.hasOwnProperty("year") ? param3["year"] : 0; + Request.Load(SECTION,CUSTOMMETRIC,CustomMetricComplete,param2,_loc4_); + } + + private static function CustomMetricComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + if(param1 == null) + { + return; + } + var _loc5_:Object = new Object(); + if(param4.Success) + { + _loc5_["Name"] = "CustomMetric"; + _loc5_["Metric"] = param2["metric"]; + _loc5_["Day"] = param2["day"]; + _loc5_["Month"] = param2["month"]; + _loc5_["Year"] = param2["year"]; + _loc5_["Value"] = int(param3["value"]); + } + param1(_loc5_,param4); + } + + public static function LevelCounterMetric(param1:String, param2:*, param3:Function, param4:Object = null) : void + { + LevelMetric(LEVELCOUNTERMETRIC,param1,param2,LevelCounterMetricComplete,param3,param4); + } + + private static function LevelCounterMetricComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + if(param1 == null) + { + return; + } + var _loc5_:Object = new Object(); + if(param4.Success) + { + _loc5_["Name"] = "LevelAverageMetric"; + _loc5_["Metric"] = param2["metric"]; + _loc5_["Level"] = param2["level"]; + _loc5_["Day"] = param2["day"]; + _loc5_["Month"] = param2["month"]; + _loc5_["Year"] = param2["year"]; + _loc5_["Value"] = int(param3["value"]); + } + param1(_loc5_,param4); + } + + public static function LevelRangedMetric(param1:String, param2:*, param3:Function, param4:Object = null) : void + { + LevelMetric(LEVELRANGEDMETRIC,param1,param2,LevelRangedMetricComplete,param3,param4); + } + + private static function LevelRangedMetricComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + var _loc6_:Array = null; + var _loc7_:XMLList = null; + var _loc8_:XML = null; + if(param1 == null) + { + return; + } + var _loc5_:Object = new Object(); + if(param4.Success) + { + _loc5_["Name"] = "LevelAverageMetric"; + _loc5_["Metric"] = param2["metric"]; + _loc5_["Level"] = param2["level"]; + _loc5_["Day"] = param2["day"]; + _loc5_["Month"] = param2["month"]; + _loc5_["Year"] = param2["year"]; + _loc6_ = new Array(); + _loc7_ = param3["value"]; + for each(_loc8_ in _loc7_) + { + _loc6_.push({ + "TrackValue":int(_loc8_.@trackvalue), + "Value":int(_loc8_) + }); + } + _loc5_["Values"] = _loc6_; + } + param1(_loc5_,param4); + } + + public static function LevelAverageMetric(param1:String, param2:*, param3:Function, param4:Object = null) : void + { + LevelMetric(LEVELAVERAGEMETRIC,param1,param2,LevelAverageMetricComplete,param3,param4); + } + + private static function LevelAverageMetricComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + if(param1 == null) + { + return; + } + var _loc5_:Object = new Object(); + if(param4.Success) + { + _loc5_["Name"] = "LevelAverageMetric"; + _loc5_["Metric"] = param2["metric"]; + _loc5_["Level"] = param2["level"]; + _loc5_["Day"] = param2["day"]; + _loc5_["Month"] = param2["month"]; + _loc5_["Year"] = param2["year"]; + _loc5_["Min"] = int(param3["min"]); + _loc5_["Max"] = int(param3["max"]); + _loc5_["Average"] = int(param3["average"]); + _loc5_["Total"] = Number(param3["total"]); + } + param1(_loc5_,param4); + } + + private static function LevelMetric(param1:String, param2:String, param3:String, param4:Function, param5:Function, param6:Object) : void + { + if(param6 == null) + { + param6 = new Object(); + } + var _loc7_:Object = new Object(); + _loc7_["metric"] = param2; + _loc7_["level"] = param3; + _loc7_["day"] = param6.hasOwnProperty("day") ? param6["day"] : 0; + _loc7_["month"] = param6.hasOwnProperty("month") ? param6["month"] : 0; + _loc7_["year"] = param6.hasOwnProperty("year") ? param6["year"] : 0; + Request.Load(SECTION,param1,param4,param5,_loc7_); + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/Encode.as b/research/inner_decompiled/scripts/Playtomic/Encode.as new file mode 100644 index 0000000..8819be5 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/Encode.as @@ -0,0 +1,429 @@ +package Playtomic +{ + import flash.display.BitmapData; + import flash.utils.ByteArray; + + internal final class Encode + { + + private static var crcTable:Array; + + private static const BASE64_CHARS:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + + private static const decodeChars:Array = [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1]; + + private static var crcTableComputed:Boolean = false; + + private static var hex_chr:String = "0123456789abcdef"; + + public function Encode() + { + super(); + } + + internal static function Base64(param1:ByteArray) : String + { + var _loc3_:Array = null; + var _loc5_:uint = 0; + var _loc6_:uint = 0; + var _loc7_:uint = 0; + var _loc2_:String = ""; + var _loc4_:Array = new Array(4); + param1.position = 0; + while(param1.bytesAvailable > 0) + { + _loc3_ = new Array(); + _loc5_ = 0; + while(_loc5_ < 3 && param1.bytesAvailable > 0) + { + _loc3_[_loc5_] = param1.readUnsignedByte(); + _loc5_++; + } + _loc4_[0] = (_loc3_[0] & 0xFC) >> 2; + _loc4_[1] = (_loc3_[0] & 3) << 4 | _loc3_[1] >> 4; + _loc4_[2] = (_loc3_[1] & 0x0F) << 2 | _loc3_[2] >> 6; + _loc4_[3] = _loc3_[2] & 0x3F; + _loc6_ = _loc3_.length; + while(_loc6_ < 3) + { + _loc4_[_loc6_ + 1] = 64; + _loc6_++; + } + _loc7_ = 0; + while(_loc7_ < _loc4_.length) + { + _loc2_ += BASE64_CHARS.charAt(_loc4_[_loc7_]); + _loc7_++; + } + } + return _loc2_; + } + + internal static function Base64Decode(param1:String) : ByteArray + { + var _loc2_:int = 0; + var _loc3_:int = 0; + var _loc4_:int = 0; + var _loc5_:int = 0; + var _loc6_:* = 0; + var _loc7_:int = 0; + var _loc8_:ByteArray = null; + _loc7_ = param1.length; + _loc6_ = 0; + _loc8_ = new ByteArray(); + loop0: + while(_loc6_ < _loc7_) + { + do + { + _loc2_ = int(decodeChars[param1.charCodeAt(_loc6_++) & 0xFF]); + } + while(_loc6_ < _loc7_ && _loc2_ == -1); + if(_loc2_ == -1) + { + break; + } + do + { + _loc3_ = int(decodeChars[param1.charCodeAt(_loc6_++) & 0xFF]); + } + while(_loc6_ < _loc7_ && _loc3_ == -1); + if(_loc3_ == -1) + { + break; + } + _loc8_.writeByte(_loc2_ << 2 | (_loc3_ & 0x30) >> 4); + while(true) + { + _loc4_ = param1.charCodeAt(_loc6_++) & 0xFF; + if(_loc4_ == 61) + { + break; + } + _loc4_ = int(decodeChars[_loc4_]); + if(!(_loc6_ < _loc7_ && _loc4_ == -1)) + { + if(_loc4_ == -1) + { + break loop0; + } + _loc8_.writeByte((_loc3_ & 0x0F) << 4 | (_loc4_ & 0x3C) >> 2); + while(true) + { + _loc5_ = param1.charCodeAt(_loc6_++) & 0xFF; + if(_loc5_ == 61) + { + break; + } + _loc5_ = int(decodeChars[_loc5_]); + if(!(_loc6_ < _loc7_ && _loc5_ == -1)) + { + if(_loc5_ == -1) + { + break loop0; + } + _loc8_.writeByte((_loc4_ & 3) << 6 | _loc5_); + continue loop0; + } + } + return _loc8_; + } + } + return _loc8_; + } + return _loc8_; + } + + internal static function PNG(param1:BitmapData) : ByteArray + { + var _loc5_:uint = 0; + var _loc6_:int = 0; + var _loc2_:ByteArray = new ByteArray(); + _loc2_.writeUnsignedInt(2303741511); + _loc2_.writeUnsignedInt(218765834); + var _loc3_:ByteArray = new ByteArray(); + _loc3_.writeInt(param1.width); + _loc3_.writeInt(param1.height); + _loc3_.writeUnsignedInt(134610944); + _loc3_.writeByte(0); + writeChunk(_loc2_,1229472850,_loc3_); + var _loc4_:ByteArray = new ByteArray(); + var _loc7_:int = 0; + while(_loc7_ < param1.height) + { + _loc4_.writeByte(0); + if(!param1.transparent) + { + _loc6_ = 0; + while(_loc6_ < param1.width) + { + _loc5_ = param1.getPixel(_loc6_,_loc7_); + _loc4_.writeUnsignedInt(uint((_loc5_ & 0xFFFFFF) << 8 | 0xFF)); + _loc6_++; + } + } + else + { + _loc6_ = 0; + while(_loc6_ < param1.width) + { + _loc5_ = param1.getPixel32(_loc6_,_loc7_); + _loc4_.writeUnsignedInt(uint((_loc5_ & 0xFFFFFF) << 8 | _loc5_ >>> 24)); + _loc6_++; + } + } + _loc7_++; + } + _loc4_.compress(); + writeChunk(_loc2_,1229209940,_loc4_); + writeChunk(_loc2_,1229278788,null); + return _loc2_; + } + + private static function writeChunk(param1:ByteArray, param2:uint, param3:ByteArray) : void + { + var _loc8_:uint = 0; + var _loc9_:uint = 0; + var _loc10_:uint = 0; + if(!crcTableComputed) + { + crcTableComputed = true; + crcTable = []; + _loc9_ = 0; + while(_loc9_ < 256) + { + _loc8_ = _loc9_; + _loc10_ = 0; + while(_loc10_ < 8) + { + if(_loc8_ & 1) + { + _loc8_ = uint(uint(3988292384) ^ uint(_loc8_ >>> 1)); + } + else + { + _loc8_ = uint(_loc8_ >>> 1); + } + _loc10_++; + } + crcTable[_loc9_] = _loc8_; + _loc9_++; + } + } + var _loc4_:uint = 0; + if(param3 != null) + { + _loc4_ = param3.length; + } + param1.writeUnsignedInt(_loc4_); + var _loc5_:uint = param1.position; + param1.writeUnsignedInt(param2); + if(param3 != null) + { + param1.writeBytes(param3); + } + var _loc6_:uint = param1.position; + param1.position = _loc5_; + _loc8_ = 4294967295; + var _loc7_:int = 0; + while(_loc7_ < _loc6_ - _loc5_) + { + _loc8_ = uint(crcTable[(_loc8_ ^ param1.readUnsignedByte()) & uint(255)] ^ uint(_loc8_ >>> 8)); + _loc7_++; + } + _loc8_ = uint(_loc8_ ^ uint(4294967295)); + param1.position = _loc6_; + param1.writeUnsignedInt(_loc8_); + } + + private static function bitOR(param1:Number, param2:Number) : Number + { + var _loc3_:Number = param1 & 1 | param2 & 1; + var _loc4_:Number = param1 >>> 1 | param2 >>> 1; + return _loc4_ << 1 | _loc3_; + } + + private static function bitXOR(param1:Number, param2:Number) : Number + { + var _loc3_:Number = param1 & 1 ^ param2 & 1; + var _loc4_:Number = param1 >>> 1 ^ param2 >>> 1; + return _loc4_ << 1 | _loc3_; + } + + private static function bitAND(param1:Number, param2:Number) : Number + { + var _loc3_:Number = param1 & 1 & (param2 & 1); + var _loc4_:Number = param1 >>> 1 & param2 >>> 1; + return _loc4_ << 1 | _loc3_; + } + + private static function addme(param1:Number, param2:Number) : Number + { + var _loc3_:Number = (param1 & 0xFFFF) + (param2 & 0xFFFF); + var _loc4_:Number = (param1 >> 16) + (param2 >> 16) + (_loc3_ >> 16); + return _loc4_ << 16 | _loc3_ & 0xFFFF; + } + + private static function rhex(param1:Number) : String + { + var _loc3_:int = 0; + var _loc2_:String = ""; + _loc3_ = 0; + while(_loc3_ <= 3) + { + _loc2_ += hex_chr.charAt(param1 >> _loc3_ * 8 + 4 & 0x0F) + hex_chr.charAt(param1 >> _loc3_ * 8 & 0x0F); + _loc3_++; + } + return _loc2_; + } + + private static function str2blks_MD5(param1:String) : Array + { + var _loc4_:int = 0; + var _loc2_:Number = (param1.length + 8 >> 6) + 1; + var _loc3_:Array = new Array(_loc2_ * 16); + _loc4_ = 0; + while(_loc4_ < _loc2_ * 16) + { + _loc3_[_loc4_] = 0; + _loc4_++; + } + _loc4_ = 0; + while(_loc4_ < param1.length) + { + _loc3_[_loc4_ >> 2] |= param1.charCodeAt(_loc4_) << (param1.length * 8 + _loc4_) % 4 * 8; + _loc4_++; + } + _loc3_[_loc4_ >> 2] |= 128 << (param1.length * 8 + _loc4_) % 4 * 8; + var _loc5_:int = param1.length * 8; + _loc3_[_loc2_ * 16 - 2] = _loc5_ & 0xFF; + _loc3_[_loc2_ * 16 - 2] |= (_loc5_ >>> 8 & 0xFF) << 8; + _loc3_[_loc2_ * 16 - 2] |= (_loc5_ >>> 16 & 0xFF) << 16; + _loc3_[_loc2_ * 16 - 2] |= (_loc5_ >>> 24 & 0xFF) << 24; + return _loc3_; + } + + private static function rol(param1:Number, param2:Number) : Number + { + return param1 << param2 | param1 >>> 32 - param2; + } + + private static function cmn(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number, param6:Number) : Number + { + return addme(rol(addme(addme(param2,param1),addme(param4,param6)),param5),param3); + } + + private static function ff(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number, param6:Number, param7:Number) : Number + { + return cmn(bitOR(bitAND(param2,param3),bitAND(~param2,param4)),param1,param2,param5,param6,param7); + } + + private static function gg(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number, param6:Number, param7:Number) : Number + { + return cmn(bitOR(bitAND(param2,param4),bitAND(param3,~param4)),param1,param2,param5,param6,param7); + } + + private static function hh(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number, param6:Number, param7:Number) : Number + { + return cmn(bitXOR(bitXOR(param2,param3),param4),param1,param2,param5,param6,param7); + } + + private static function ii(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number, param6:Number, param7:Number) : Number + { + return cmn(bitXOR(param3,bitOR(param2,~param4)),param1,param2,param5,param6,param7); + } + + internal static function MD5(param1:String) : String + { + var _loc7_:int = 0; + var _loc8_:Number = NaN; + var _loc9_:Number = NaN; + var _loc10_:Number = NaN; + var _loc11_:Number = NaN; + var _loc2_:Array = str2blks_MD5(param1); + var _loc3_:Number = 1732584193; + var _loc4_:Number = -271733879; + var _loc5_:Number = -1732584194; + var _loc6_:Number = 271733878; + _loc7_ = 0; + while(_loc7_ < _loc2_.length) + { + _loc8_ = _loc3_; + _loc9_ = _loc4_; + _loc10_ = _loc5_; + _loc11_ = _loc6_; + _loc3_ = ff(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 0],7,-680876936); + _loc6_ = ff(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 1],12,-389564586); + _loc5_ = ff(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 2],17,606105819); + _loc4_ = ff(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 3],22,-1044525330); + _loc3_ = ff(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 4],7,-176418897); + _loc6_ = ff(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 5],12,1200080426); + _loc5_ = ff(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 6],17,-1473231341); + _loc4_ = ff(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 7],22,-45705983); + _loc3_ = ff(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 8],7,1770035416); + _loc6_ = ff(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 9],12,-1958414417); + _loc5_ = ff(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 10],17,-42063); + _loc4_ = ff(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 11],22,-1990404162); + _loc3_ = ff(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 12],7,1804603682); + _loc6_ = ff(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 13],12,-40341101); + _loc5_ = ff(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 14],17,-1502002290); + _loc4_ = ff(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 15],22,1236535329); + _loc3_ = gg(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 1],5,-165796510); + _loc6_ = gg(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 6],9,-1069501632); + _loc5_ = gg(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 11],14,643717713); + _loc4_ = gg(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 0],20,-373897302); + _loc3_ = gg(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 5],5,-701558691); + _loc6_ = gg(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 10],9,38016083); + _loc5_ = gg(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 15],14,-660478335); + _loc4_ = gg(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 4],20,-405537848); + _loc3_ = gg(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 9],5,568446438); + _loc6_ = gg(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 14],9,-1019803690); + _loc5_ = gg(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 3],14,-187363961); + _loc4_ = gg(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 8],20,1163531501); + _loc3_ = gg(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 13],5,-1444681467); + _loc6_ = gg(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 2],9,-51403784); + _loc5_ = gg(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 7],14,1735328473); + _loc4_ = gg(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 12],20,-1926607734); + _loc3_ = hh(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 5],4,-378558); + _loc6_ = hh(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 8],11,-2022574463); + _loc5_ = hh(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 11],16,1839030562); + _loc4_ = hh(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 14],23,-35309556); + _loc3_ = hh(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 1],4,-1530992060); + _loc6_ = hh(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 4],11,1272893353); + _loc5_ = hh(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 7],16,-155497632); + _loc4_ = hh(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 10],23,-1094730640); + _loc3_ = hh(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 13],4,681279174); + _loc6_ = hh(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 0],11,-358537222); + _loc5_ = hh(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 3],16,-722521979); + _loc4_ = hh(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 6],23,76029189); + _loc3_ = hh(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 9],4,-640364487); + _loc6_ = hh(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 12],11,-421815835); + _loc5_ = hh(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 15],16,530742520); + _loc4_ = hh(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 2],23,-995338651); + _loc3_ = ii(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 0],6,-198630844); + _loc6_ = ii(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 7],10,1126891415); + _loc5_ = ii(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 14],15,-1416354905); + _loc4_ = ii(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 5],21,-57434055); + _loc3_ = ii(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 12],6,1700485571); + _loc6_ = ii(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 3],10,-1894986606); + _loc5_ = ii(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 10],15,-1051523); + _loc4_ = ii(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 1],21,-2054922799); + _loc3_ = ii(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 8],6,1873313359); + _loc6_ = ii(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 15],10,-30611744); + _loc5_ = ii(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 6],15,-1560198380); + _loc4_ = ii(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 13],21,1309151649); + _loc3_ = ii(_loc3_,_loc4_,_loc5_,_loc6_,_loc2_[_loc7_ + 4],6,-145523070); + _loc6_ = ii(_loc6_,_loc3_,_loc4_,_loc5_,_loc2_[_loc7_ + 11],10,-1120210379); + _loc5_ = ii(_loc5_,_loc6_,_loc3_,_loc4_,_loc2_[_loc7_ + 2],15,718787259); + _loc4_ = ii(_loc4_,_loc5_,_loc6_,_loc3_,_loc2_[_loc7_ + 9],21,-343485551); + _loc3_ = addme(_loc3_,_loc8_); + _loc4_ = addme(_loc4_,_loc9_); + _loc5_ = addme(_loc5_,_loc10_); + _loc6_ = addme(_loc6_,_loc11_); + _loc7_ += 16; + } + return rhex(_loc3_) + rhex(_loc4_) + rhex(_loc5_) + rhex(_loc6_); + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/GameVars.as b/research/inner_decompiled/scripts/Playtomic/GameVars.as new file mode 100644 index 0000000..9efba80 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/GameVars.as @@ -0,0 +1,52 @@ +package Playtomic +{ + public final class GameVars + { + + private static var SECTION:String; + + private static var LOAD:String; + + public function GameVars() + { + super(); + } + + internal static function Initialise(param1:String) : void + { + SECTION = Encode.MD5("gamevars-" + param1); + LOAD = Encode.MD5("gamevars-load-" + param1); + } + + public static function Load(param1:Function) : void + { + Request.Load(SECTION,LOAD,LoadComplete,param1,null); + } + + private static function LoadComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + var _loc6_:XMLList = null; + var _loc7_:String = null; + var _loc8_:String = null; + var _loc9_:XML = null; + if(param1 == null) + { + return; + } + var _loc5_:Object = new Object(); + if(param4.Success) + { + _loc6_ = param3["gamevar"]; + for each(_loc9_ in _loc6_) + { + _loc7_ = _loc9_["name"]; + _loc8_ = _loc9_["value"]; + _loc5_[_loc7_] = _loc8_; + } + } + param2 = param2; + param1(_loc5_,param4); + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/GeoIP.as b/research/inner_decompiled/scripts/Playtomic/GeoIP.as new file mode 100644 index 0000000..d794ef1 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/GeoIP.as @@ -0,0 +1,46 @@ +package Playtomic +{ + public final class GeoIP + { + + private static var SECTION:String; + + private static var LOAD:String; + + public function GeoIP() + { + super(); + } + + internal static function Initialise(param1:String) : void + { + SECTION = Encode.MD5("geoip-" + param1); + LOAD = Encode.MD5("geoip-lookup-" + param1); + } + + public static function Lookup(param1:Function) : void + { + Request.Load(SECTION,LOAD,LookupComplete,param1); + } + + private static function LookupComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + if(param1 == null) + { + return; + } + var _loc5_:Object = { + "Code":"N/A", + "Name":"UNKNOWN" + }; + if(param4.Success) + { + _loc5_["Code"] = param3["location"]["code"]; + _loc5_["Name"] = param3["location"]["name"]; + } + param1(_loc5_,param4); + param2 = param2; + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/Leaderboards.as b/research/inner_decompiled/scripts/Playtomic/Leaderboards.as new file mode 100644 index 0000000..06da83b --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/Leaderboards.as @@ -0,0 +1,355 @@ +package Playtomic +{ + import flash.external.ExternalInterface; + + public final class Leaderboards + { + + private static var SECTION:String; + + private static var CREATEPRIVATELEADERBOARD:String; + + private static var LOADPRIVATELEADERBOARD:String; + + private static var SAVEANDLIST:String; + + private static var SAVE:String; + + private static var LIST:String; + + public static const TODAY:String = "today"; + + public static const LAST7DAYS:String = "last7days"; + + public static const LAST30DAYS:String = "last30days"; + + public static const ALLTIME:String = "alltime"; + + public static const NEWEST:String = "newest"; + + public function Leaderboards() + { + super(); + } + + internal static function Initialise(param1:String) : void + { + SECTION = Encode.MD5("leaderboards-" + param1); + CREATEPRIVATELEADERBOARD = Encode.MD5("leaderboards-createprivateleaderboard-" + param1); + LOADPRIVATELEADERBOARD = Encode.MD5("leaderboards-loadprivateleaderboard-" + param1); + SAVEANDLIST = Encode.MD5("leaderboards-saveandlist-" + param1); + SAVE = Encode.MD5("leaderboards-save-" + param1); + LIST = Encode.MD5("leaderboards-list-" + param1); + } + + public static function CreatePrivateLeaderboard(param1:String, param2:String, param3:Function = null, param4:Boolean = true) : void + { + var _loc5_:Object = new Object(); + _loc5_["table"] = param1; + _loc5_["highest"] = param4 ? "y" : "n"; + _loc5_["permalink"] = param2; + Request.Load(SECTION,CREATEPRIVATELEADERBOARD,CreatePrivateLeaderboardComplete,param3,_loc5_); + } + + private static function CreatePrivateLeaderboardComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + if(param1 == null) + { + return; + } + var _loc5_:PrivateLeaderboard = null; + if(param4.Success) + { + _loc5_ = new PrivateLeaderboard(param3["tableid"],param3["name"],param3["bitly"],param3["permalink"],param3["highest"] == "true",param3["realname"]); + } + param1(_loc5_,param4); + param2 = param2; + } + + public static function LoadPrivateLeaderboard(param1:String, param2:Function = null) : void + { + var _loc3_:Object = new Object(); + _loc3_["tableid"] = param1; + Request.Load(SECTION,LOADPRIVATELEADERBOARD,LoadPrivateLeaderboardComplete,param2,_loc3_); + } + + private static function LoadPrivateLeaderboardComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + if(param1 == null) + { + return; + } + var _loc5_:PrivateLeaderboard = null; + if(param4.Success) + { + _loc5_ = new PrivateLeaderboard(param3["tableid"],param3["name"],param3["bitly"],param3["permalink"],param3["highest"] == "true",param3["realname"]); + } + param1(_loc5_,param4); + param2 = param2; + } + + public static function GetLeaderboardFromUrl() : String + { + var url:String = null; + var leaderboardid:String = null; + if(!ExternalInterface.available) + { + return null; + } + try + { + url = String(ExternalInterface.call("window.location.href.toString")); + if(url.indexOf("?") == -1) + { + return null; + } + leaderboardid = url.substring(url.indexOf("leaderboard=") + 12); + if(leaderboardid.indexOf("&") > -1) + { + leaderboardid = leaderboardid.substring(0,leaderboardid.indexOf("&")); + } + if(leaderboardid.indexOf("#") > -1) + { + leaderboardid = leaderboardid.substring(0,leaderboardid.indexOf("#")); + } + return leaderboardid; + } + catch(s:Error) + { + } + return null; + } + + public static function SaveAndList(param1:PlayerScore, param2:String, param3:Function = null, param4:Object = null) : void + { + var _loc16_:String = null; + var _loc17_:String = null; + if(param4 == null) + { + param4 = new Object(); + } + var _loc5_:Boolean = param4.hasOwnProperty("allowduplicates") ? Boolean(param4["allowduplicates"]) : false; + var _loc6_:Boolean = param4.hasOwnProperty("global") ? Boolean(param4["global"]) : true; + var _loc7_:Boolean = param4.hasOwnProperty("highest") ? Boolean(param4["highest"]) : true; + var _loc8_:String = param4.hasOwnProperty("mode") ? param4["mode"] : "alltime"; + var _loc9_:Object = param4.hasOwnProperty("customfilters") ? param4["customfilters"] : {}; + var _loc10_:int = param4.hasOwnProperty("page") ? int(param4["page"]) : 1; + var _loc11_:int = param4.hasOwnProperty("perpage") ? int(param4["perpage"]) : 20; + var _loc12_:Array = param4.hasOwnProperty("friendslist") ? param4["friendslist"] : new Array(); + var _loc13_:Object = new Object(); + _loc13_["url"] = Log.SourceUrl; + _loc13_["table"] = param2; + _loc13_["highest"] = _loc7_ ? "y" : "n"; + _loc13_["name"] = param1.Name; + _loc13_["points"] = param1.Points.toString(); + _loc13_["allowduplicates"] = _loc5_ ? "y" : "n"; + _loc13_["auth"] = Encode.MD5(Log.BaseUrl + param1.Points.toString()); + var _loc14_:int = 0; + if(param1.CustomData != null) + { + for(_loc16_ in param1.CustomData) + { + _loc13_["ckey" + _loc14_] = _loc16_; + _loc13_["cdata" + _loc14_] = param1.CustomData[_loc16_]; + _loc14_++; + } + } + _loc13_["numfields"] = _loc14_; + _loc13_["global"] = _loc6_ ? "y" : "n"; + _loc13_["mode"] = _loc8_; + _loc13_["page"] = _loc10_; + _loc13_["perpage"] = _loc11_; + var _loc15_:int = 0; + if(_loc9_ != null) + { + for(_loc17_ in _loc9_) + { + _loc13_["lkey" + _loc15_] = _loc17_; + _loc13_["ldata" + _loc15_] = _loc9_[_loc17_]; + _loc15_++; + } + } + _loc13_["numfilters"] = _loc15_; + if(param1.FBUserId != null && param1.FBUserId != "") + { + if(_loc12_.length > 0) + { + _loc13_["friendslist"] = _loc12_.join(","); + } + _loc13_["fbuserid"] = param1.FBUserId; + } + Request.Load(SECTION,SAVEANDLIST,SaveAndListComplete,param3,_loc13_); + } + + private static function SaveAndListComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + if(param1 == null) + { + return; + } + if(param4.Success) + { + ProcessScores(param3,param4,param1); + } + else + { + param1([],0,param4); + } + param2 = param2; + } + + public static function Save(param1:PlayerScore, param2:String, param3:Function = null, param4:Object = null) : void + { + var _loc10_:String = null; + if(param4 == null) + { + param4 = new Object(); + } + var _loc5_:Boolean = param4.hasOwnProperty("allowduplicates") ? Boolean(param4["allowduplicates"]) : false; + var _loc6_:Boolean = param4.hasOwnProperty("highest") ? Boolean(param4["highest"]) : true; + var _loc7_:String = param1.Points.toString(); + if(_loc7_.indexOf(".") > -1) + { + _loc7_ = _loc7_.substring(0,_loc7_.indexOf(".")); + } + var _loc8_:Object = new Object(); + var _loc9_:int = 0; + if(param1.CustomData != null) + { + for(_loc10_ in param1.CustomData) + { + _loc8_["ckey" + _loc9_] = _loc10_; + _loc8_["cdata" + _loc9_] = param1.CustomData[_loc10_]; + _loc9_++; + } + } + _loc8_["url"] = Log.BaseUrl; + _loc8_["table"] = param2; + _loc8_["highest"] = _loc6_ ? "y" : "n"; + _loc8_["name"] = param1.Name; + _loc8_["points"] = _loc7_; + _loc8_["allowduplicates"] = _loc5_ ? "y" : "n"; + _loc8_["auth"] = Encode.MD5(Log.BaseUrl + _loc7_); + _loc8_["fb"] = param1.FBUserId != "" && param1.FBUserId != null ? "y" : "n"; + _loc8_["fbuserid"] = param1.FBUserId; + _loc8_["customfields"] = _loc9_; + Request.Load(SECTION,SAVE,SaveComplete,param3,_loc8_); + } + + private static function SaveComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + if(param1 == null) + { + return; + } + param3 = param3; + param2 = param2; + param1(param4); + } + + public static function List(param1:String, param2:Function, param3:Object = null) : void + { + var _loc14_:String = null; + if(param3 == null) + { + param3 = new Object(); + } + var _loc4_:Boolean = param3.hasOwnProperty("global") ? Boolean(param3["global"]) : true; + var _loc5_:Boolean = param3.hasOwnProperty("highest") ? Boolean(param3["highest"]) : true; + var _loc6_:String = param3.hasOwnProperty("mode") ? param3["mode"] : "alltime"; + var _loc7_:Object = param3.hasOwnProperty("customfilters") ? param3["customfilters"] : new Object(); + var _loc8_:int = param3.hasOwnProperty("page") ? int(param3["page"]) : 1; + var _loc9_:int = param3.hasOwnProperty("perpage") ? int(param3["perpage"]) : 20; + var _loc10_:Boolean = param3.hasOwnProperty("facebook") ? Boolean(param3["facebook"]) : false; + var _loc11_:Array = param3.hasOwnProperty("friendslist") ? param3["friendslist"] : new Array(); + var _loc12_:Object = new Object(); + var _loc13_:int = 0; + for(_loc14_ in _loc7_) + { + _loc12_["ckey" + _loc13_] = _loc14_; + _loc12_["cdata" + _loc13_] = _loc7_[_loc14_]; + _loc13_++; + } + _loc12_["url"] = _loc4_ || Log.BaseUrl == null ? "global" : Log.BaseUrl; + _loc12_["mode"] = _loc6_; + _loc12_["page"] = _loc8_; + _loc12_["perpage"] = _loc9_; + _loc12_["highest"] = _loc5_ ? "y" : "n"; + _loc12_["filters"] = _loc13_; + _loc12_["table"] = param1; + if(_loc10_) + { + if(_loc11_.length > 0) + { + _loc12_["friendslist"] = _loc11_.join(","); + } + } + Request.Load(SECTION,LIST,ListComplete,param2,_loc12_); + } + + private static function ListComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + if(param1 == null) + { + return; + } + if(param4.Success) + { + ProcessScores(param3,param4,param1); + } + else + { + param1([],0,param4); + } + param2 = param2; + } + + private static function ProcessScores(param1:XML, param2:Response, param3:Function) : void + { + var _loc7_:String = null; + var _loc8_:int = 0; + var _loc9_:int = 0; + var _loc10_:int = 0; + var _loc11_:XML = null; + var _loc12_:PlayerScore = null; + var _loc13_:XMLList = null; + var _loc14_:XML = null; + var _loc4_:int = parseInt(param1["numscores"]); + var _loc5_:Array = new Array(); + var _loc6_:XMLList = param1["score"]; + for each(_loc11_ in _loc6_) + { + _loc7_ = _loc11_["sdate"]; + _loc8_ = int(_loc7_.substring(_loc7_.lastIndexOf("/") + 1)); + _loc9_ = int(_loc7_.substring(0,_loc7_.indexOf("/"))); + _loc10_ = int(_loc7_.substring(_loc7_.indexOf("/") + 1).substring(0,2)); + _loc12_ = new PlayerScore(); + _loc12_.SDate = new Date(_loc8_,_loc9_ - 1,_loc10_); + _loc12_.RDate = _loc11_["rdate"]; + _loc12_.Name = _loc11_["name"]; + _loc12_.Points = _loc11_["points"]; + _loc12_.Website = _loc11_["website"]; + _loc12_.Rank = _loc11_["rank"]; + if(_loc11_["submittedorbest"] != null) + { + _loc12_.SubmittedOrBest = _loc11_["submittedorbest"] == "true"; + } + if(_loc11_["fbuserid"]) + { + _loc12_.FBUserId = _loc11_["fbuserid"]; + } + if(_loc11_["custom"]) + { + _loc13_ = _loc11_["custom"]; + for each(_loc14_ in _loc13_.children()) + { + _loc12_.CustomData[_loc14_.name()] = _loc14_.text(); + } + } + _loc5_.push(_loc12_); + } + param3(_loc5_,_loc4_,param2); + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/Link.as b/research/inner_decompiled/scripts/Playtomic/Link.as new file mode 100644 index 0000000..2af90d6 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/Link.as @@ -0,0 +1,89 @@ +package Playtomic +{ + import flash.net.URLRequest; + import flash.net.navigateToURL; + + public final class Link + { + + private static var Clicks:Array = new Array(); + + public function Link() + { + super(); + } + + public static function Open(param1:String, param2:String, param3:String) : Boolean + { + var baseurlname:String; + var result:Boolean = false; + var url:String = param1; + var name:String = param2; + var group:String = param3; + var unique:int = 0; + var bunique:int = 0; + var total:int = 0; + var btotal:int = 0; + var fail:int = 0; + var bfail:int = 0; + var key:String = url + "." + name; + var baseurl:String = url; + baseurl = baseurl.replace("http://",""); + if(baseurl.indexOf("/") > -1) + { + baseurl = baseurl.substring(0,baseurl.indexOf("/")); + } + if(baseurl.indexOf("?") > -1) + { + baseurl = baseurl.substring(0,baseurl.indexOf("?")); + } + baseurl = "http://" + baseurl + "/"; + baseurlname = baseurl; + if(baseurlname.indexOf("//") > -1) + { + baseurlname = baseurlname.substring(baseurlname.indexOf("//") + 2); + } + baseurlname = baseurlname.replace("www.",""); + if(baseurlname.indexOf("/") > -1) + { + baseurlname = baseurlname.substring(0,baseurlname.indexOf("/")); + } + try + { + navigateToURL(new URLRequest(url),"dh2"); + if(Clicks.indexOf(key) > -1) + { + total = 1; + } + else + { + total = 1; + unique = 1; + Clicks.push(key); + } + if(Clicks.indexOf(baseurlname) > -1) + { + btotal = 1; + } + else + { + btotal = 1; + bunique = 1; + Clicks.push(baseurlname); + } + result = true; + } + catch(err:Error) + { + fail = 1; + bfail = 1; + result = false; + } + Log.Link(baseurl,baseurlname.toLowerCase(),"DomainTotals",bunique,btotal,bfail); + Log.Link(url,name,group,unique,total,fail); + Log.ForceSend(); + return result; + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/Log.as b/research/inner_decompiled/scripts/Playtomic/Log.as new file mode 100644 index 0000000..4fb3513 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/Log.as @@ -0,0 +1,400 @@ +package Playtomic +{ + import flash.events.TimerEvent; + import flash.external.ExternalInterface; + import flash.net.SharedObject; + import flash.system.Security; + import flash.utils.Timer; + import org.flixel.FlxG; + + public final class Log + { + + internal static var SourceUrl:String; + + internal static var BaseUrl:String; + + private static var Cookie:SharedObject; + + internal static var LogQueue:LogRequest; + + private static var Enabled:Boolean = false; + + private static var Queue:Boolean = true; + + internal static var SWFID:int = 0; + + internal static var GUID:String = ""; + + private static const PingF:Timer = new Timer(60000); + + private static const PingR:Timer = new Timer(30000); + + private static var FirstPing:Boolean = true; + + private static var Pings:int = 0; + + private static var Plays:int = 0; + + private static var Frozen:Boolean = false; + + private static var FrozenQueue:Array = new Array(); + + private static var Customs:Array = new Array(); + + private static var LevelCounters:Array = new Array(); + + private static var LevelAverages:Array = new Array(); + + private static var LevelRangeds:Array = new Array(); + + public function Log() + { + super(); + } + + public static function View(param1:int = 0, param2:String = "", param3:String = "", param4:String = "") : void + { + if(SWFID > 0) + { + return; + } + SWFID = param1; + GUID = param2; + Enabled = true; + if(SWFID == 0 || GUID == "") + { + Enabled = false; + return; + } + FlxG.log("sandboxType: " + Security.sandboxType); + if(param4.indexOf("http://") != 0 && Security.sandboxType != "localWithNetwork" && Security.sandboxType != "localTrusted") + { + FlxG.log("fall through"); + Enabled = false; + return; + } + FlxG.log("Getting url, default is: " + param4); + SourceUrl = GetUrl(param4); + FlxG.log("Found url: " + SourceUrl); + if(SourceUrl == null || SourceUrl == "") + { + Enabled = false; + return; + } + BaseUrl = SourceUrl.split("://")[1]; + BaseUrl = BaseUrl.substring(0,BaseUrl.indexOf("/")); + Parse.Initialise(param3); + GeoIP.Initialise(param3); + Data.Initialise(param3); + Leaderboards.Initialise(param3); + GameVars.Initialise(param3); + PlayerLevels.Initialise(param3); + Request.Initialise(); + LogQueue = LogRequest.Create(); + Cookie = SharedObject.getLocal("playtomic"); + Security.loadPolicyFile("http://g" + param2 + ".api.playtomic.com/crossdomain.xml"); + var _loc5_:int = GetCookie("views"); + Send("v/" + (_loc5_ + 1),true); + PingF.addEventListener(TimerEvent.TIMER,PingServer); + PingF.start(); + } + + internal static function IncreaseViews() : void + { + var _loc1_:int = GetCookie("views"); + _loc1_++; + SaveCookie("views",_loc1_); + } + + internal static function IncreasePlays() : void + { + ++Plays; + } + + public static function Play() : void + { + if(!Enabled) + { + return; + } + LevelCounters = new Array(); + LevelAverages = new Array(); + LevelRangeds = new Array(); + Send("p/" + (Plays + 1),true); + } + + private static function PingServer(param1:TimerEvent) : void + { + if(!Enabled) + { + return; + } + ++Pings; + Send("t/" + (FirstPing ? "y" : "n") + "/" + Pings,true); + if(FirstPing) + { + PingF.stop(); + PingR.addEventListener(TimerEvent.TIMER,PingServer); + PingR.start(); + FirstPing = false; + } + } + + public static function CustomMetric(param1:String, param2:String = null, param3:Boolean = false) : void + { + if(!Enabled) + { + return; + } + if(param2 == null) + { + param2 = ""; + } + if(param3) + { + if(Customs.indexOf(param1) > -1) + { + return; + } + Customs.push(param1); + } + Send("c/" + Clean(param1) + "/" + Clean(param2)); + } + + public static function LevelCounterMetric(param1:String, param2:*, param3:Boolean = false) : void + { + var _loc4_:String = null; + if(!Enabled) + { + return; + } + if(param3) + { + _loc4_ = param1 + "." + (param2 as String); + if(LevelCounters.indexOf(_loc4_) > -1) + { + return; + } + LevelCounters.push(_loc4_); + } + Send("lc/" + Clean(param1) + "/" + Clean(param2)); + } + + public static function LevelRangedMetric(param1:String, param2:*, param3:int, param4:Boolean = false) : void + { + var _loc5_:String = null; + if(!Enabled) + { + return; + } + if(param4) + { + _loc5_ = param1 + "." + (param2 as String); + if(LevelRangeds.indexOf(_loc5_) > -1) + { + return; + } + LevelRangeds.push(_loc5_); + } + Send("lr/" + Clean(param1) + "/" + Clean(param2) + "/" + param3); + } + + public static function LevelAverageMetric(param1:String, param2:*, param3:int, param4:Boolean = false) : void + { + var _loc5_:String = null; + if(!Enabled) + { + return; + } + if(param4) + { + _loc5_ = param1 + "." + (param2 as String); + if(LevelAverages.indexOf(_loc5_) > -1) + { + return; + } + LevelAverages.push(_loc5_); + } + Send("la/" + Clean(param1) + "/" + Clean(param2) + "/" + param3); + } + + internal static function Link(param1:String, param2:String, param3:String, param4:int, param5:int, param6:int) : void + { + if(!Enabled) + { + return; + } + Send("l/" + Clean(param2) + "/" + Clean(param3) + "/" + Clean(param1) + "/" + param4 + "/" + param5 + "/" + param6); + } + + public static function Heatmap(param1:String, param2:String, param3:int, param4:int) : void + { + if(!Enabled) + { + return; + } + Send("h/" + Clean(param1) + "/" + Clean(param2) + "/" + param3 + "/" + param4); + } + + internal static function Funnel(param1:String, param2:String, param3:int) : void + { + if(!Enabled) + { + return; + } + Send("f/" + Clean(param1) + "/" + Clean(param2) + "/" + param3); + } + + internal static function PlayerLevelStart(param1:String) : void + { + if(!Enabled) + { + return; + } + Send("pls/" + param1); + } + + internal static function PlayerLevelWin(param1:String) : void + { + if(!Enabled) + { + return; + } + Send("plw/" + param1); + } + + internal static function PlayerLevelQuit(param1:String) : void + { + if(!Enabled) + { + return; + } + Send("plq/" + param1); + } + + internal static function PlayerLevelFlag(param1:String) : void + { + if(!Enabled) + { + return; + } + Send("plf/" + param1); + } + + internal static function PlayerLevelRetry(param1:String) : void + { + if(!Enabled) + { + return; + } + Send("plr/" + param1); + } + + public static function Freeze() : void + { + Frozen = true; + } + + public static function UnFreeze() : void + { + Frozen = false; + LogQueue.MassQueue(FrozenQueue); + } + + public static function ForceSend() : void + { + if(!Enabled) + { + return; + } + if(LogQueue == null) + { + LogQueue = LogRequest.Create(); + } + LogQueue.Send(); + LogQueue = LogRequest.Create(); + if(FrozenQueue.length > 0) + { + LogQueue.MassQueue(FrozenQueue); + } + } + + private static function Send(param1:String, param2:Boolean = false) : void + { + if(Frozen) + { + FrozenQueue.push(param1); + return; + } + LogQueue.Queue(param1); + if(LogQueue.ready || param2 || !Queue) + { + LogQueue.Send(); + LogQueue = LogRequest.Create(); + } + } + + private static function Clean(param1:String) : String + { + while(param1.indexOf("/") > -1) + { + param1 = param1.replace("/","\\"); + } + while(param1.indexOf("~") > -1) + { + param1 = param1.replace("~","-"); + } + return escape(param1); + } + + private static function GetCookie(param1:String) : int + { + if(Cookie.data[param1] == undefined) + { + return 0; + } + return int(Cookie.data[param1]); + } + + private static function SaveCookie(param1:String, param2:int) : void + { + var n:String = param1; + var v:int = param2; + Cookie.data[n] = v.toString(); + try + { + Cookie.flush(); + } + catch(s:Error) + { + } + } + + private static function GetUrl(param1:String) : String + { + var _loc2_:String = param1; + FlxG.log("External available? " + ExternalInterface.available); + if(_loc2_ == null || _loc2_ == "" || _loc2_ == "null") + { + FlxG.log("empty for some fucking reason"); + if(Security.sandboxType == "localWithNetwork" || Security.sandboxType == "localTrusted") + { + _loc2_ = "http://localhost/"; + } + else + { + _loc2_ = null; + } + } + FlxG.log("Before"); + if(_loc2_.indexOf("http://") != 0) + { + FlxG.log("for some reason it didn\'t start with http"); + _loc2_ = "http://localhost/"; + } + return _loc2_; + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/LogRequest.as b/research/inner_decompiled/scripts/Playtomic/LogRequest.as new file mode 100644 index 0000000..babbb69 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/LogRequest.as @@ -0,0 +1,94 @@ +package Playtomic +{ + internal final class LogRequest + { + + private static var Pool:Array = new Array(); + + private var _data:String = ""; + + private var _hasView:Boolean = false; + + private var _hasPlay:Boolean = false; + + internal var ready:Boolean = false; + + public function LogRequest() + { + super(); + } + + internal static function Create() : LogRequest + { + var _loc1_:LogRequest = Pool.length > 0 ? Pool.pop() as LogRequest : new LogRequest(); + _loc1_._data = ""; + _loc1_._hasView = false; + _loc1_._hasPlay = false; + _loc1_.ready = false; + return _loc1_; + } + + internal function MassQueue(param1:Array) : void + { + var _loc3_:LogRequest = null; + var _loc2_:* = int(param1.length - 1); + while(_loc2_ > -1) + { + this.Queue(param1[_loc2_]); + param1.splice(_loc2_,1); + if(this.ready) + { + this.Send(); + _loc3_ = Create(); + _loc3_.MassQueue(param1); + return; + } + _loc2_--; + } + Log.LogQueue = this; + } + + internal function Queue(param1:String) : void + { + this._data += (this._data == "" ? "" : "~") + param1; + if(this._data.indexOf("v/") == 0) + { + this._hasView = true; + } + if(this._data.indexOf("p/") == 0) + { + this._hasPlay = true; + } + if(this._data.length > 300) + { + this.ready = true; + } + } + + public function Send() : void + { + if(this._data == "") + { + return; + } + Request.SendStatistics(this.Complete,"/tracker/q.aspx?q=" + this._data + "&url=" + (this._hasView ? Log.SourceUrl : Log.BaseUrl)); + } + + private function Complete(param1:Boolean) : void + { + if(param1) + { + if(this._hasView) + { + Log.IncreaseViews(); + } + if(this._hasPlay) + { + Log.IncreasePlays(); + } + } + Pool.push(this); + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/PFObject.as b/research/inner_decompiled/scripts/Playtomic/PFObject.as new file mode 100644 index 0000000..b1b7050 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/PFObject.as @@ -0,0 +1,26 @@ +package Playtomic +{ + public class PFObject + { + + public var ObjectId:String; + + public var ClassName:String; + + public var Pointers:Vector. = new Vector.(); + + public var Data:Object = {}; + + public var UpdatedAt:Date; + + public var CreatedAt:Date; + + public var Password:String; + + public function PFObject() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/PFPointer.as b/research/inner_decompiled/scripts/Playtomic/PFPointer.as new file mode 100644 index 0000000..ba603d5 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/PFPointer.as @@ -0,0 +1,18 @@ +package Playtomic +{ + public final class PFPointer + { + + public var FieldName:String; + + public var PObject:PFObject; + + public function PFPointer(param1:String, param2:PFObject) + { + super(); + this.FieldName = param1; + this.PObject = param2; + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/PFQuery.as b/research/inner_decompiled/scripts/Playtomic/PFQuery.as new file mode 100644 index 0000000..87ee2dd --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/PFQuery.as @@ -0,0 +1,22 @@ +package Playtomic +{ + public final class PFQuery + { + + public var ClassName:String; + + public var WherePointers:Vector. = new Vector.(); + + public var WhereData:Object = {}; + + public var Order:String; + + public var Limit:int = 10; + + public function PFQuery() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/Parse.as b/research/inner_decompiled/scripts/Playtomic/Parse.as new file mode 100644 index 0000000..6f9ede3 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/Parse.as @@ -0,0 +1,260 @@ +package Playtomic +{ + public final class Parse + { + + private static var SECTION:String; + + private static var SAVE:String; + + private static var DELETE:String; + + private static var LOAD:String; + + private static var FIND:String; + + public function Parse() + { + super(); + } + + internal static function Initialise(param1:String) : void + { + SECTION = Encode.MD5("parse-" + param1); + SAVE = Encode.MD5("parse-save-" + param1); + DELETE = Encode.MD5("parse-delete-" + param1); + LOAD = Encode.MD5("parse-load-" + param1); + FIND = Encode.MD5("parse-find-" + param1); + } + + public static function Save(param1:PFObject, param2:Function = null) : void + { + Request.Load(SECTION,SAVE,SaveComplete,param2,ObjectPostData(param1)); + } + + private static function SaveComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + var _loc8_:String = null; + var _loc9_:String = null; + var _loc10_:String = null; + var _loc11_:PFObject = null; + var _loc12_:XMLList = null; + if(param1 == null) + { + return; + } + var _loc5_:XMLList = param3["object"]; + var _loc6_:XML = _loc5_[0]; + var _loc7_:PFObject = new PFObject(); + _loc7_.ObjectId = _loc6_["id"]; + _loc7_.ClassName = param2["classname"]; + _loc7_.Password = param2["password"]; + for(_loc8_ in param2) + { + if(_loc8_.indexOf("data") == 0) + { + _loc7_.Data[_loc8_.substring(4)] = param2[_loc8_]; + } + if(_loc8_.indexOf("pointer") == 0 && _loc8_.indexOf("fieldname") > -1) + { + _loc9_ = _loc8_.substring(7); + _loc9_ = _loc9_.substring(0,_loc9_.indexOf("fieldname")); + _loc10_ = param2["pointer" + _loc9_ + "fieldname"]; + _loc11_ = new PFObject(); + _loc11_.ClassName = param2["pointer" + _loc9_ + "classname"]; + _loc11_.ObjectId = param2["pointer" + _loc9_ + "id"]; + _loc7_.Pointers.push(new PFPointer(_loc10_,_loc11_)); + } + } + if(param4.Success) + { + _loc12_ = param3["object"]; + _loc7_.CreatedAt = DateParse(_loc12_["created"]); + _loc7_.UpdatedAt = DateParse(_loc12_["updated"]); + } + param1(_loc7_,param4); + } + + public static function Delete(param1:PFObject, param2:Function = null) : void + { + Request.Load(SECTION,DELETE,DeleteComplete,param2,ObjectPostData(param1)); + } + + private static function DeleteComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + if(param1 == null) + { + return; + } + param1(param4); + param3 = param3; + param2 = param2; + } + + public static function Load(param1:String, param2:String, param3:Function = null) : void + { + var _loc4_:PFObject = new PFObject(); + _loc4_.ObjectId = param1; + _loc4_.ClassName = param2; + Request.Load(SECTION,LOAD,LoadComplete,param3,ObjectPostData(_loc4_)); + } + + private static function LoadComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + var _loc6_:XMLList = null; + var _loc7_:XMLList = null; + var _loc8_:XML = null; + var _loc9_:XMLList = null; + var _loc10_:XML = null; + var _loc11_:String = null; + var _loc12_:PFObject = null; + if(param1 == null) + { + return; + } + var _loc5_:PFObject = new PFObject(); + _loc5_.ObjectId = param2["objectid"]; + _loc5_.ClassName = param2["classname"]; + if(param4.Success) + { + _loc6_ = param3["object"]; + _loc5_.CreatedAt = DateParse(_loc6_["created"]); + _loc5_.UpdatedAt = DateParse(_loc6_["updated"]); + if(_loc6_.contains("fields")) + { + _loc7_ = _loc6_["fields"]; + for each(_loc8_ in _loc7_.children()) + { + _loc5_[_loc8_.name] = _loc8_.text(); + } + } + if(_loc6_.contains("pointers")) + { + _loc9_ = _loc6_["pointers"]; + for each(_loc10_ in _loc9_.children()) + { + _loc11_ = _loc10_["fieldname"]; + _loc12_ = new PFObject(); + _loc12_.ClassName = _loc10_["classname"]; + _loc12_.ObjectId = _loc10_["id"]; + _loc5_.Pointers.push(new PFPointer(_loc11_,_loc12_)); + } + } + } + param1(_loc5_,param4); + } + + public static function Find(param1:PFQuery, param2:Function = null) : void + { + var _loc4_:String = null; + var _loc5_:* = 0; + var _loc3_:Object = new Object(); + _loc3_["classname"] = param1.ClassName; + _loc3_["limit"] = param1.Limit; + _loc3_["order"] = param1.Order != null && param1.Order != "" ? param1.Order : "created_at"; + for(_loc4_ in param1.WhereData) + { + _loc3_["data" + _loc4_] = param1.WhereData[_loc4_]; + } + _loc5_ = int(param1.WherePointers.length - 1); + while(_loc5_ > -1) + { + _loc3_["pointer" + _loc5_ + "fieldname"] = param1.WherePointers[_loc5_].FieldName; + _loc3_["pointer" + _loc5_ + "classname"] = param1.WherePointers[_loc5_].PObject.ClassName; + _loc3_["pointer" + _loc5_ + "id"] = param1.WherePointers[_loc5_].PObject.ObjectId; + _loc5_--; + } + Request.Load(SECTION,FIND,FindComplete,param2,_loc3_); + } + + private static function FindComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + var _loc6_:XMLList = null; + var _loc7_:XML = null; + var _loc8_:PFObject = null; + var _loc9_:XMLList = null; + var _loc10_:XML = null; + var _loc11_:XMLList = null; + var _loc12_:XML = null; + var _loc13_:String = null; + var _loc14_:PFObject = null; + if(param1 == null) + { + return; + } + var _loc5_:Array = new Array(); + if(param4.Success) + { + _loc6_ = param3["objects"]; + for each(_loc7_ in _loc6_.children()) + { + _loc8_ = new PFObject(); + _loc8_.ObjectId = _loc7_["id"]; + _loc8_.CreatedAt = DateParse(_loc7_["created"]); + _loc8_.UpdatedAt = DateParse(_loc7_["updated"]); + if(_loc7_.contains("fields")) + { + _loc9_ = _loc7_["fields"]; + for each(_loc10_ in _loc9_.children()) + { + _loc8_[_loc10_.name] = _loc10_.text(); + } + } + if(_loc7_.contains("pointers")) + { + _loc11_ = _loc7_["pointers"]; + for each(_loc12_ in _loc11_.children()) + { + _loc13_ = _loc12_["fieldname"]; + _loc14_ = new PFObject(); + _loc14_.ClassName = _loc12_["classname"]; + _loc14_.ObjectId = _loc12_["id"]; + _loc8_.Pointers.push(new PFPointer(_loc13_,_loc14_)); + } + } + _loc5_.push(_loc8_); + } + } + param1(_loc5_,param4); + param2 = param2; + } + + private static function ObjectPostData(param1:PFObject) : Object + { + var _loc3_:String = null; + var _loc4_:* = 0; + var _loc2_:Object = new Object(); + _loc2_["classname"] = param1.ClassName; + _loc2_["id"] = param1.ObjectId == null ? "" : param1.ObjectId; + _loc2_["password"] = param1.Password == null ? "" : param1.Password; + for(_loc3_ in param1.Data) + { + _loc2_["data" + _loc3_] = param1.Data[_loc3_]; + } + _loc4_ = int(param1.Pointers.length - 1); + while(_loc4_ > -1) + { + _loc2_["pointer" + _loc4_ + "fieldname"] = param1.Pointers[_loc4_].FieldName; + _loc2_["pointer" + _loc4_ + "classname"] = param1.Pointers[_loc4_].PObject.ClassName; + _loc2_["pointer" + _loc4_ + "id"] = param1.Pointers[_loc4_].PObject.ObjectId; + _loc4_--; + } + return _loc2_; + } + + private static function DateParse(param1:String) : Date + { + var _loc2_:Array = param1.split(" "); + var _loc3_:Array = (_loc2_[0] as String).split("/"); + var _loc4_:Array = (_loc2_[1] as String).split(":"); + var _loc5_:int = int(_loc3_[1]); + var _loc6_:int = int(_loc3_[0]); + var _loc7_:int = int(_loc3_[2]); + var _loc8_:int = int(_loc4_[0]); + var _loc9_:int = int(_loc4_[1]); + var _loc10_:int = int(_loc4_[2]); + return new Date(Date.UTC(_loc7_,_loc6_,_loc5_,_loc8_,_loc9_,_loc10_)); + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/PlayerLevel.as b/research/inner_decompiled/scripts/Playtomic/PlayerLevel.as new file mode 100644 index 0000000..b85b435 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/PlayerLevel.as @@ -0,0 +1,70 @@ +package Playtomic +{ + import flash.display.Bitmap; + import flash.display.BitmapData; + import flash.display.Loader; + import flash.utils.ByteArray; + + public final class PlayerLevel + { + + public var LevelId:String; + + public var PlayerSource:String = ""; + + public var PlayerId:String = ""; + + public var PlayerName:String = ""; + + public var Permalink:String; + + public var Name:String; + + public var Data:String; + + public var ThumbData:String; + + public var Votes:int; + + public var Starts:int; + + public var Quits:int; + + public var Retries:int; + + public var Flags:int; + + public var Wins:int; + + public var Rating:Number; + + public var Score:int; + + public var SDate:Date; + + public var RDate:String; + + public var CustomData:Object = {}; + + public function PlayerLevel() + { + super(); + this.SDate = new Date(); + this.RDate = "Just now"; + } + + public function Thumb() : BitmapData + { + var _loc1_:ByteArray = Encode.Base64Decode(this.ThumbData); + var _loc2_:Loader = new Loader(); + _loc2_.loadBytes(_loc1_); + return Bitmap(_loc2_).bitmapData; + } + + public function Thumbnail() : String + { + return "http://g" + Log.GUID + ".api.playtomic.com/playerlevels/thumb.aspx?swfid=" + Log.SWFID + "&levelid=" + this.LevelId; + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/PlayerLevels.as b/research/inner_decompiled/scripts/Playtomic/PlayerLevels.as new file mode 100644 index 0000000..d697869 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/PlayerLevels.as @@ -0,0 +1,439 @@ +package Playtomic +{ + import flash.display.BitmapData; + import flash.display.DisplayObject; + import flash.geom.Matrix; + import flash.net.SharedObject; + + public final class PlayerLevels + { + + private static var KongLevelReceiver:Function; + + private static var SECTION:String; + + private static var SAVE:String; + + private static var LIST:String; + + private static var LOAD:String; + + private static var RATE:String; + + public static const NEWEST:String = "newest"; + + public static const POPULAR:String = "popular"; + + private static var KongAPI:* = null; + + public function PlayerLevels() + { + super(); + } + + internal static function Initialise(param1:String) : void + { + SECTION = Encode.MD5("playerlevels-" + param1); + RATE = Encode.MD5("playerlevels-rate-" + param1); + LIST = Encode.MD5("playerlevels-list-" + param1); + SAVE = Encode.MD5("playerlevels-save-" + param1); + LOAD = Encode.MD5("playerlevels-load-" + param1); + } + + public static function DeferToKongregate(param1:*, param2:Function) : void + { + KongLevelReceiver = param2; + KongAPI = param1; + KongAPI.sharedContent.addLoadListener("level",KongLevelLoaded); + } + + public static function LogStart(param1:String) : void + { + Log.PlayerLevelStart(param1); + } + + public static function LogWin(param1:String) : void + { + Log.PlayerLevelWin(param1); + } + + public static function LogQuit(param1:String) : void + { + Log.PlayerLevelQuit(param1); + } + + public static function LogRetry(param1:String) : void + { + Log.PlayerLevelRetry(param1); + } + + public static function Flag(param1:String) : void + { + Log.PlayerLevelFlag(param1); + } + + public static function Rate(param1:String, param2:int, param3:Function = null) : void + { + var _loc4_:SharedObject = SharedObject.getLocal("ratings"); + if(_loc4_.data[param1] != null) + { + if(param3 != null) + { + param3(new Response(0,402)); + } + return; + } + if(param2 < 0 || param2 > 10) + { + if(param3 != null) + { + param3(new Response(0,401)); + } + return; + } + var _loc5_:Object = new Object(); + _loc5_["levelid"] = param1; + _loc5_["rating"] = param2; + _loc4_.data[param1] = param2; + Request.Load(SECTION,RATE,RateComplete,param3,_loc5_); + } + + private static function RateComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + if(param1 == null) + { + return; + } + param1(param4); + param3 = param3; + param2 = param2; + } + + public static function Load(param1:String, param2:Function = null) : void + { + var _loc3_:Object = new Object(); + _loc3_["levelid"] = param1; + Request.Load(SECTION,LOAD,LoadComplete,param2,_loc3_); + } + + private static function LoadComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + var _loc6_:XML = null; + var _loc7_:String = null; + var _loc8_:int = 0; + var _loc9_:int = 0; + var _loc10_:int = 0; + var _loc11_:XMLList = null; + var _loc12_:XML = null; + if(param1 == null) + { + return; + } + var _loc5_:PlayerLevel = null; + if(param4.Success) + { + _loc6_ = XML(param3["level"]); + _loc7_ = _loc6_["sdate"]; + _loc8_ = int(_loc7_.substring(_loc7_.lastIndexOf("/") + 1)); + _loc9_ = int(_loc7_.substring(0,_loc7_.indexOf("/"))); + _loc10_ = int(_loc7_.substring(_loc7_.indexOf("/") + 1).substring(0,2)); + _loc5_ = new PlayerLevel(); + _loc5_.LevelId = _loc6_["levelid"]; + _loc5_.PlayerName = _loc6_["playername"]; + _loc5_.PlayerId = _loc6_["playerid"]; + _loc5_.Name = _loc6_["name"]; + _loc5_.Score = _loc6_["score"]; + _loc5_.Votes = _loc6_["votes"]; + _loc5_.Rating = _loc6_["rating"]; + _loc5_.Data = _loc6_["data"]; + _loc5_.ThumbData = _loc6_["thumb"]; + _loc5_.Wins = _loc6_["wins"]; + _loc5_.Starts = _loc6_["starts"]; + _loc5_.Retries = _loc6_["retries"]; + _loc5_.Quits = _loc6_["quits"]; + _loc5_.Flags = _loc6_["flags"]; + _loc5_.SDate = new Date(_loc8_,_loc9_ - 1,_loc10_); + _loc5_.RDate = _loc6_["rdate"]; + if(_loc6_["custom"]) + { + _loc11_ = _loc6_["custom"]; + for each(_loc12_ in _loc11_.children()) + { + _loc5_.CustomData[_loc12_.name()] = _loc12_.text(); + } + } + } + param1(_loc5_,param4); + param2 = param2; + } + + public static function List(param1:Function = null, param2:Object = null) : void + { + var _loc13_:String = null; + if(param2 == null) + { + param2 = new Object(); + } + var _loc3_:String = param2.hasOwnProperty("mode") ? param2["mode"] : "popular"; + var _loc4_:int = param2.hasOwnProperty("page") ? int(param2["page"]) : 1; + var _loc5_:int = param2.hasOwnProperty("perpage") ? int(param2["perpage"]) : 20; + var _loc6_:String = param2.hasOwnProperty("datemin") ? param2["datemin"] : ""; + var _loc7_:String = param2.hasOwnProperty("datemax") ? param2["datemax"] : ""; + var _loc8_:Boolean = param2.hasOwnProperty("data") ? Boolean(param2["data"]) : false; + var _loc9_:Boolean = param2.hasOwnProperty("thumbs") ? Boolean(param2["thumbs"]) : false; + var _loc10_:Object = param2.hasOwnProperty("customfilters") ? param2["customfilters"] : {}; + if(KongAPI != null) + { + if(_loc3_ == "popular") + { + KongAPI.sharedContent.browse("level",KongAPI.sharedContent.BY_RATING); + } + else + { + KongAPI.sharedContent.browse("level",KongAPI.sharedContent.BY_NEWEST); + } + return; + } + var _loc11_:Object = new Object(); + _loc11_["mode"] = _loc3_; + _loc11_["page"] = _loc4_; + _loc11_["perpage"] = _loc5_; + _loc11_["data"] = _loc8_; + _loc11_["thumbs"] = _loc9_; + _loc11_["datemin"] = _loc6_; + _loc11_["datemax"] = _loc7_; + var _loc12_:int = 0; + if(_loc10_ != null) + { + for(_loc13_ in _loc10_) + { + _loc11_["ckey" + _loc12_] = _loc13_; + _loc11_["cdata" + _loc12_] = _loc10_[_loc13_]; + _loc12_++; + } + } + _loc11_["filters"] = _loc12_; + Request.Load(SECTION,LIST,ListComplete,param1,_loc11_); + } + + private static function ListComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + var _loc7_:XMLList = null; + var _loc8_:XML = null; + var _loc9_:String = null; + var _loc10_:int = 0; + var _loc11_:int = 0; + var _loc12_:int = 0; + var _loc13_:XML = null; + var _loc14_:PlayerLevel = null; + var _loc15_:XMLList = null; + if(param1 == null) + { + return; + } + var _loc5_:Array = []; + var _loc6_:int = 0; + if(param4.Success) + { + _loc7_ = param3["level"]; + _loc6_ = int(param3["numresults"]); + for each(_loc13_ in _loc7_) + { + _loc9_ = _loc13_["sdate"]; + _loc10_ = int(_loc9_.substring(_loc9_.lastIndexOf("/") + 1)); + _loc11_ = int(_loc9_.substring(0,_loc9_.indexOf("/"))); + _loc12_ = int(_loc9_.substring(_loc9_.indexOf("/") + 1).substring(0,2)); + _loc14_ = new PlayerLevel(); + _loc14_.LevelId = _loc13_["levelid"]; + _loc14_.PlayerId = _loc13_["playerid"]; + _loc14_.PlayerName = _loc13_["playername"]; + _loc14_.Name = _loc13_["name"]; + _loc14_.Score = _loc13_["score"]; + _loc14_.Rating = _loc13_["rating"]; + _loc14_.Votes = _loc13_["votes"]; + _loc14_.Wins = _loc13_["wins"]; + _loc14_.Starts = _loc13_["starts"]; + _loc14_.Retries = _loc13_["retries"]; + _loc14_.Quits = _loc13_["quits"]; + _loc14_.Flags = _loc13_["flags"]; + _loc14_.SDate = new Date(_loc10_,_loc11_ - 1,_loc12_); + _loc14_.RDate = _loc13_["rdate"]; + if(_loc13_["data"]) + { + _loc14_.Data = _loc13_["data"]; + } + if(_loc13_["thumb"]) + { + _loc14_.ThumbData = _loc13_["thumb"]; + } + _loc15_ = _loc13_["custom"]; + if(_loc15_ != null) + { + for each(_loc8_ in _loc15_.children()) + { + _loc14_.CustomData[_loc8_.name()] = _loc8_.text(); + } + } + _loc5_.push(_loc14_); + } + } + param1(_loc5_,_loc6_,param4); + param2 = param2; + } + + public static function Save(param1:PlayerLevel, param2:DisplayObject = null, param3:Function = null) : void + { + var postdata:Object; + var customfields:int; + var kcallback:Function = null; + var scale:Number = NaN; + var w:int = 0; + var h:int = 0; + var scaler:Matrix = null; + var image:BitmapData = null; + var key:String = null; + var level:PlayerLevel = param1; + var thumb:DisplayObject = param2; + var callback:Function = param3; + if(KongAPI != null) + { + kcallback = function(param1:Object):void + { + level.LevelId = param1["id"]; + level.Permalink = param1["permalink"]; + level.Name = param1["name"]; + if(callback != null) + { + callback(level,new Response(param1["success"] ? 1 : 0,0)); + } + }; + KongAPI.sharedContent.save("level",level.Data,kcallback,thumb,level.Name); + return; + } + postdata = new Object(); + postdata["data"] = level.Data; + postdata["playerid"] = level.PlayerId; + postdata["playersource"] = level.PlayerSource; + postdata["playername"] = level.PlayerName; + postdata["name"] = level.Name; + if(thumb != null) + { + scale = 1; + w = thumb.width; + h = thumb.height; + if(thumb.width > 100 || thumb.height > 100) + { + if(thumb.width >= thumb.height) + { + scale = 100 / thumb.width; + w = 100; + h = Math.ceil(scale * thumb.height); + } + else if(thumb.height > thumb.width) + { + scale = 100 / thumb.height; + w = Math.ceil(scale * thumb.width); + h = 100; + } + } + scaler = new Matrix(); + scaler.scale(scale,scale); + image = new BitmapData(w,h,true,0); + image.draw(thumb,scaler,null,null,null,true); + postdata["image"] = Encode.Base64(Encode.PNG(image)); + postdata["arrp"] = RandomSample(image); + postdata["hash"] = Encode.MD5(postdata["image"] + postdata["arrp"]); + } + else + { + postdata["nothumb"] = "y"; + } + customfields = 0; + if(level.CustomData != null) + { + for(key in level.CustomData) + { + postdata["ckey" + customfields] = key; + postdata["cdata" + customfields] = level.CustomData[key]; + customfields++; + } + } + postdata["customfields"] = customfields; + Request.Load(SECTION,SAVE,SaveComplete,callback,postdata); + } + + private static function SaveComplete(param1:Function, param2:Object, param3:XML = null, param4:Response = null) : void + { + var _loc6_:String = null; + var _loc7_:String = null; + var _loc8_:String = null; + var _loc9_:String = null; + if(param1 == null) + { + return; + } + var _loc5_:PlayerLevel = new PlayerLevel(); + _loc5_.Data = param2["data"]; + _loc5_.PlayerId = param2["playerid"]; + _loc5_.PlayerSource = param2["playersource"]; + _loc5_.PlayerName = param2["playername"]; + _loc5_.Name = param2["name"]; + for(_loc6_ in param2) + { + if(_loc6_.indexOf("ckey") == 0) + { + _loc7_ = _loc6_.substring(4); + _loc8_ = param2["ckey" + _loc7_]; + _loc9_ = param2["cdata" + _loc7_]; + _loc5_.CustomData[_loc8_] = _loc9_; + } + } + param2["data"] = _loc5_.Data; + param2["playerid"] = _loc5_.PlayerId; + param2["playersource"] = _loc5_.PlayerSource; + param2["playername"] = _loc5_.PlayerName; + param2["name"] = _loc5_.Name; + if(param4.Success || param4.ErrorCode == 406) + { + _loc5_.LevelId = param3["levelid"]; + _loc5_.SDate = new Date(); + _loc5_.RDate = "Just now"; + } + param1(_loc5_,param4); + } + + private static function KongLevelLoaded(param1:Object) : void + { + var _loc2_:PlayerLevel = new PlayerLevel(); + _loc2_.Data = param1["content"]; + _loc2_.Permalink = param1["permalink"]; + _loc2_.Name = param1["name"]; + _loc2_.LevelId = param1["id"]; + if(KongLevelReceiver != null) + { + KongLevelReceiver(_loc2_); + } + } + + private static function RandomSample(param1:BitmapData) : String + { + var _loc3_:int = 0; + var _loc4_:int = 0; + var _loc5_:String = null; + var _loc2_:Array = new Array(); + while(_loc2_.length < 10) + { + _loc3_ = Math.random() * param1.width; + _loc4_ = Math.random() * param1.height; + _loc5_ = param1.getPixel32(_loc3_,_loc4_).toString(16); + while(_loc5_.length < 6) + { + _loc5_ = "0" + _loc5_; + } + _loc2_.push(_loc3_ + "/" + _loc4_ + "/" + _loc5_); + } + return _loc2_.join(","); + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/PlayerScore.as b/research/inner_decompiled/scripts/Playtomic/PlayerScore.as new file mode 100644 index 0000000..2c83ae1 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/PlayerScore.as @@ -0,0 +1,48 @@ +package Playtomic +{ + public final class PlayerScore + { + + public var Name:String; + + public var FBUserId:String; + + public var Points:Number; + + public var Rank:int; + + public var Website:String; + + public var SDate:Date; + + public var RDate:String; + + public var CustomData:Object = {}; + + public var SubmittedOrBest:Boolean = false; + + public function PlayerScore(param1:String = "", param2:int = 0) + { + super(); + this.Name = param1; + this.Points = param2; + } + + public function toString() : String + { + return "Playtomic.PlayerScore:" + "\nRank: " + this.Rank + "\nName: " + this.Name + "\nPoints: " + this.Points; + } + + public function toStringAll() : String + { + var _loc2_:String = null; + var _loc1_:String = "Playtomic.PlayerScore:" + "\nRank: " + this.Rank + "\nName: " + this.Name + "\nFBUserId: " + this.FBUserId + "\nPoints: " + this.Points + "\nWebsite: " + this.Website + "\nSDate: " + this.SDate + "\nRDate: " + this.RDate + "\nCustomData: "; + for each(_loc2_ in this.CustomData) + { + _loc1_ += "\n " + _loc2_ + ": " + this.CustomData[_loc2_]; + } + return _loc1_; + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/PrivateLeaderboard.as b/research/inner_decompiled/scripts/Playtomic/PrivateLeaderboard.as new file mode 100644 index 0000000..c289887 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/PrivateLeaderboard.as @@ -0,0 +1,35 @@ +package Playtomic +{ + public class PrivateLeaderboard + { + + public var TableId:String; + + public var Name:String; + + public var Bitly:String; + + public var Permalink:String; + + public var Highest:Boolean = true; + + public var RealName:String; + + public function PrivateLeaderboard(param1:String = null, param2:String = null, param3:String = null, param4:String = null, param5:Boolean = false, param6:String = null) + { + super(); + this.TableId = param1; + this.Name = param2; + this.Bitly = param3; + this.Permalink = param4; + this.Highest = param5; + this.RealName = param6; + } + + public function toString() : String + { + return "Playtomic.PrivateLeaderboard:" + "\nTableId: " + this.TableId + "\nName: " + this.Name + "\nBitly: " + this.Bitly + "\nPermalink: " + this.Permalink + "\nHighest: " + this.Highest + "\nRealName: " + this.RealName; + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/Request.as b/research/inner_decompiled/scripts/Playtomic/Request.as new file mode 100644 index 0000000..5f77ee4 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/Request.as @@ -0,0 +1,247 @@ +package Playtomic +{ + import flash.events.Event; + import flash.net.URLLoader; + import flash.net.URLRequest; + import flash.net.URLVariables; + import flash.utils.ByteArray; + import flash.utils.Timer; + + public final class Request extends URLLoader + { + + private static var Pool:Vector.; + + private static var Queue:Vector.; + + private static var URLStub:String; + + private static var URLTail:String; + + private static var URL:String; + + private var urlRequest:URLRequest = new URLRequest(); + + private var complete:Function; + + private var callback:Function; + + private var handled:Boolean; + + private var logging:Boolean; + + private var postdata:Object; + + private var time:int; + + public function Request() + { + super(); + addEventListener("ioError",Fail); + addEventListener("networkError",Fail); + addEventListener("verifyError",Fail); + addEventListener("diskError",Fail); + addEventListener("securityError",Fail); + addEventListener("httpStatus",HTTPStatusIgnore); + addEventListener("complete",Complete); + } + + internal static function Initialise() : void + { + Pool = new Vector.(); + Queue = new Vector.(); + URLStub = "http://g" + Log.GUID + ".api.playtomic.com"; + URLTail = "swfid=" + Log.SWFID; + URL = URLStub + "/v3/api.aspx?" + URLTail; + var _loc1_:Timer = new Timer(500); + _loc1_.addEventListener("timer",TimeoutHandler); + _loc1_.start(); + var _loc2_:int = 0; + while(_loc2_ < 20) + { + Pool.push(new Request()); + _loc2_++; + } + } + + internal static function SendStatistics(param1:Function, param2:String) : void + { + var _loc3_:Request = Pool.length > 0 ? Pool.pop() : new Request(); + _loc3_.time = 0; + _loc3_.handled = false; + _loc3_.complete = param1; + _loc3_.callback = null; + _loc3_.logging = true; + _loc3_.urlRequest.url = URLStub + param2 + (param2.indexOf("?") > -1 ? "&" : "?") + URLTail + "&" + Math.random() + "Z"; + _loc3_.urlRequest.method = "GET"; + _loc3_.urlRequest.data = null; + _loc3_.postdata = null; + _loc3_.load(_loc3_.urlRequest); + Queue.push(_loc3_); + } + + internal static function Load(param1:String, param2:String, param3:Function, param4:Function, param5:Object = null) : void + { + var url:String; + var timestamp:String; + var nonce:String; + var pd:Array; + var request:Request = null; + var key:String = null; + var pda:ByteArray = null; + var postvars:URLVariables = null; + var section:String = param1; + var action:String = param2; + var complete:Function = param3; + var callback:Function = param4; + var postdata:Object = param5; + request = Pool.length > 0 ? Pool.pop() : new Request(); + request.time = 0; + request.handled = false; + request.complete = complete; + request.callback = callback; + request.logging = false; + url = URL + "&r=" + Math.random() + "Z"; + timestamp = String(new Date().time).substring(0,10); + nonce = Encode.MD5(new Date().time * Math.random() + Log.GUID); + pd = new Array(); + pd.push("nonce=" + nonce); + pd.push("timestamp=" + timestamp); + for(key in postdata) + { + pd.push(key + "=" + Escape(postdata[key])); + } + pd.sort(); + GenerateKey("section",section,pd); + GenerateKey("action",action,pd); + GenerateKey("signature",nonce + timestamp + section + action + url + Log.GUID,pd); + pda = new ByteArray(); + pda.writeUTFBytes(pd.join("&")); + pda.position = 0; + postvars = new URLVariables(); + postvars["data"] = Escape(Encode.Base64(pda)); + request.urlRequest.url = url; + request.urlRequest.method = "POST"; + request.urlRequest.data = postvars; + request.postdata = postdata; + try + { + request.load(request.urlRequest); + } + catch(s:Error) + { + request.complete(request.callback,request.postdata,null,new Response(0,1)); + } + Queue.push(request); + } + + internal static function Escape(param1:String) : String + { + if(param1 == null) + { + return ""; + } + param1 = param1.split("%").join("%25"); + param1 = param1.split(";").join("%3B"); + param1 = param1.split("?").join("%3F"); + param1 = param1.split("/").join("%2F"); + param1 = param1.split(":").join("%3A"); + param1 = param1.split("#").join("%23"); + param1 = param1.split("&").join("%26"); + param1 = param1.split("=").join("%3D"); + param1 = param1.split("+").join("%2B"); + param1 = param1.split("$").join("%24"); + param1 = param1.split(",").join("%2C"); + param1 = param1.split(" ").join("%20"); + param1 = param1.split("<").join("%3C"); + param1 = param1.split(">").join("%3E"); + return param1.split("~").join("%7E"); + } + + private static function GenerateKey(param1:String, param2:String, param3:Array) : void + { + param3.sort(); + param3.push(param1 + "=" + Encode.MD5(param3.join("&") + param2)); + } + + private static function TimeoutHandler(param1:Event) : void + { + var _loc2_:Request = null; + var _loc3_:* = int(Queue.length - 1); + for(; _loc3_ > -1; _loc3_--) + { + _loc2_ = Queue[_loc3_]; + if(!_loc2_.handled) + { + ++_loc2_.time; + if(_loc2_.time < 40) + { + continue; + } + if(_loc2_.logging) + { + _loc2_.complete(false); + } + else + { + _loc2_.complete(_loc2_.callback,_loc2_.postdata,null,new Response(0,3)); + } + } + Queue.splice(_loc3_,1); + Dispose(_loc2_); + } + } + + private static function Complete(param1:Event) : void + { + var _loc2_:Request = param1.target as Request; + if(_loc2_.handled) + { + return; + } + _loc2_.handled = true; + if(_loc2_.logging) + { + _loc2_.complete(true); + return; + } + var _loc3_:XML = XML(_loc2_.data); + var _loc4_:int = parseInt(_loc3_["status"]); + var _loc5_:int = parseInt(_loc3_["errorcode"]); + _loc2_.complete(_loc2_.callback,_loc2_.postdata,_loc3_,new Response(_loc4_,_loc5_)); + } + + private static function Fail(param1:Event) : void + { + var _loc2_:Request = param1.target as Request; + if(_loc2_.handled) + { + return; + } + _loc2_.handled = true; + if(_loc2_.logging) + { + _loc2_.complete(false); + } + else + { + _loc2_.complete(_loc2_.callback,_loc2_.postdata,null,new Response(0,1)); + } + } + + private static function HTTPStatusIgnore(param1:Event) : void + { + } + + private static function Dispose(param1:Request) : void + { + if(!param1.handled) + { + param1.handled = true; + param1.close(); + } + Pool.push(param1); + } + } +} + diff --git a/research/inner_decompiled/scripts/Playtomic/Response.as b/research/inner_decompiled/scripts/Playtomic/Response.as new file mode 100644 index 0000000..21c86e6 --- /dev/null +++ b/research/inner_decompiled/scripts/Playtomic/Response.as @@ -0,0 +1,66 @@ +package Playtomic +{ + public class Response + { + + private static const ERRORS:Object = new Object(); + + ERRORS[0] = "Nothing went wrong!"; + ERRORS[1] = "General error, this typically means the player is unable to connect to the Playtomic servers"; + ERRORS[2] = "Invalid game credentials. Make sure you use your SWFID and GUID from the `API` section in the dashboard."; + ERRORS[3] = "Request timed out."; + ERRORS[4] = "Invalid request."; + ERRORS[100] = "GeoIP API has been disabled. This may occur if your game is faulty or overwhelming the Playtomic servers."; + ERRORS[200] = "Leaderboard API has been disabled. This may occur if your game is faulty or overwhelming the Playtomic servers."; + ERRORS[201] = "The source URL or name weren\'t provided when saving a score. Make sure the player specifies a name and the game is initialized before anything else using the code in the `Set your game up` section."; + ERRORS[202] = "Invalid auth key. You should not see this normally, players might if they tamper with your game."; + ERRORS[203] = "No Facebook user id on a score specified as a Facebook submission."; + ERRORS[204] = "Table name wasn\'t specified for creating a private leaderboard."; + ERRORS[205] = "Permalink structure wasn\'t specified: http://website.com/game/whatever?leaderboard="; + ERRORS[206] = "Leaderboard id wasn\'t provided loading a private leaderboard."; + ERRORS[207] = "Invalid leaderboard id was provided for a private leaderboard."; + ERRORS[208] = "Player is banned from submitting scores in your game."; + ERRORS[209] = "Score was not the player\'s best score. You can notify the player, or circumvent this by pecifying \'allowduplicates\' to be true in your save options."; + ERRORS[300] = "GameVars API has been disabled. This may occur if your game is faulty or overwhelming the Playtomic servers."; + ERRORS[400] = "Level sharing API has been disabled. This may occur if your game is faulty or overwhelming the Playtomic servers."; + ERRORS[401] = "Invalid rating value (must be 1 - 10)."; + ERRORS[402] = "Player has already rated that level."; + ERRORS[403] = "The level name wasn\'t provided when saving a level."; + ERRORS[404] = "Invalid image auth. You should not see this normally, players might if they tamper with your game."; + ERRORS[405] = "Invalid image auth (again). You should not see this normally, players might if they tamper with your game."; + ERRORS[500] = "Data API has been disabled. This may occur if the Data API is not enabled for your game, or your game is faulty or overwhelming the Playtomic servers."; + ERRORS[600] = "You have not configured your Parse.com database. Sign up at Parse and then enter your API credentials in your Playtomic dashboard."; + ERRORS[601] = "No response was returned from Parse. If you experience this a lot let us know exactly what you\'re doing so we can sort out a fix for it."; + ERRORS[6021] = "Parse\'s servers had an error."; + ERRORS[602101] = "Object not found. Make sure you include the classname and objectid and that they are correct."; + ERRORS[602102] = "Invalid query. If you think you\'re doing it right let us know what you\'re doing and we\'ll look into it."; + ERRORS[602103] = "Invalid classname."; + ERRORS[602104] = "Missing objectid."; + ERRORS[602105] = "Invalid key name."; + ERRORS[602106] = "Invalid pointer."; + ERRORS[602107] = "Invalid JSON."; + ERRORS[602108] = "Command unavailable."; + + public var Success:Boolean = false; + + public var ErrorCode:int = 0; + + public function Response(param1:int, param2:int) + { + super(); + this.Success = param1 == 1; + this.ErrorCode = param2; + } + + public function get ErrorMessage() : String + { + return ERRORS[this.ErrorCode]; + } + + public function toString() : String + { + return "Playtomic.Response:" + "\nSuccess: " + this.Success + "\nErrorCode: " + this.ErrorCode + "\nErrorMessage: " + this.ErrorMessage; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/Color.as b/research/inner_decompiled/scripts/com/arc/dh/Color.as new file mode 100644 index 0000000..274a850 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/Color.as @@ -0,0 +1,28 @@ +package com.arc.dh +{ + public class Color + { + + public static const RED:int = 0; + + public static const BLUE:int = 1; + + public static const GREEN:int = 2; + + public static const YELLOW:int = 3; + + public static const PURPLE:int = 4; + + public static const BLACK:int = 5; + + public static const CYAN:int = 6; + + public static const WHITE:int = 7; + + public function Color() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/Gun.as b/research/inner_decompiled/scripts/com/arc/dh/Gun.as new file mode 100644 index 0000000..c5a146b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/Gun.as @@ -0,0 +1,48 @@ +package com.arc.dh +{ + public class Gun + { + + public static const PRIME:String = "Prime Gun"; + + public static const PRIME_DAMAGE:Array = [20,30,60,90,130,170,210,250,290,330,370]; + + public static const PRIME_DELAY:Array = [0.3,0.28,0.26,0.24,0.22,0.2,0.19,0.18,0.17,0.16,0.15]; + + public static const PRIME_SPEED:Number = 500; + + public static const SPREADER:String = "Spreader"; + + public static const SPREADER_DAMAGE:Array = [40,49,57,70,82,94,108,134,155,188,205]; + + public static const SPREADER_DELAY:Array = [0.38,0.36,0.34,0.32,0.3,0.28,0.26,0.24,0.22,0.2,0.18]; + + public static const SPREADER_SPEED:Number = 400; + + public static const MISSILE:String = "Missile Launcher"; + + public static const MISSILE_DAMAGE:Array = [140,200,260,320,430,500,620,730,870,1000,1120]; + + public static const MISSILE_DELAY:Array = [0.7,0.67,0.64,0.61,0.58,0.55,0.52,0.49,0.46,0.43,0.4]; + + public static const MISSILE_SPEED:Number = 400; + + public static const REBOUNDER:String = "Rebounder"; + + public static const REBOUND_DAMAGE:Array = [75,100,125,150,175,200,230,270,310,370,410]; + + public static const REBOUND_DELAY:Array = [0.34,0.32,0.3,0.28,0.26,0.24,0.22,0.2,0.16,0.14,0.12]; + + public static const REBOUNDER_SPEED:Number = 300; + + public static const SPECIAL_ONE:int = 2; + + public static const SPECIAL_TWO:int = 3; + + public function Gun() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/entities/Entity.as b/research/inner_decompiled/scripts/com/arc/dh/entities/Entity.as new file mode 100644 index 0000000..03f3fa1 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/entities/Entity.as @@ -0,0 +1,42 @@ +package com.arc.dh.entities +{ + import com.arc.dh.state.HorizontalMode; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxObject; + + public class Entity extends ArcSprite + { + + public var of:Function; + + public function Entity(param1:Number, param2:Number) + { + super(param1,param2); + this.of = Data.state is HorizontalMode ? this.ofh : this.ofv; + } + + public function handleCollision(param1:FlxObject) : void + { + } + + public function get outside() : Boolean + { + return this.of(); + } + + public function ofh() : Boolean + { + var _loc1_:int = x / Config.BLOCK_SIZE; + return _loc1_ <= Data.state.despawnTop - 2; + } + + public function ofv() : Boolean + { + var _loc1_:int = y / Config.BLOCK_SIZE; + return _loc1_ >= Data.state.despawnBottom || _loc1_ <= Data.state.despawnTop - height; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/entities/Player.as b/research/inner_decompiled/scripts/com/arc/dh/entities/Player.as new file mode 100644 index 0000000..9b0c6a6 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/entities/Player.as @@ -0,0 +1,705 @@ +package com.arc.dh.entities +{ + import com.arc.dh.state.HorizontalMode; + import com.arc.dh.state.TadpoleMode; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcSprite; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + import org.flixel.FlxSprite; + + public class Player extends Entity + { + + public static const sprite:Class = Player_sprite; + + public static const shieldSprite:Class = Player_shieldSprite; + + private static const gunRightSprite:Class = Player_gunRightSprite; + + private static const gunUpSprite:Class = Player_gunUpSprite; + + private static const gunDownSprite:Class = Player_gunDownSprite; + + private static const dotSprite:Class = Player_dotSprite; + + private static const elevatorSprite:Class = Player_elevatorSprite; + + private static const JUMP_HOLD:Number = 0.2; + + private static const DOUBLE_JUMP_HOLD:Number = 0.03; + + private static const TRIPLE_JUMP_HOLD:Number = 0.03; + + private static const HIT_TIME:Number = 0.4; + + private static const BASE_MOVE_SPEED:Number = 80; + + private var JUMP_TIME:Array = [0.2,0.03,0.03]; + + private var _jump:Array = [0,0,0]; + + private var _jumping:Boolean = false; + + private var _doubleJumping:Boolean = false; + + private var _jumpTimer:Number = 0.2; + + private var _doubleJump:Number = 0.03; + + private var dots:Array = new Array(); + + private var dot:FlxSprite; + + private var _startheight:int = 0; + + private var _maxheight:int = 0; + + public var invulnerable:Number = 0; + + public var dashing:Number = 0; + + private var _canDash:Boolean = true; + + public var gun:String; + + private var _inWater:Number = 0; + + public var radians:Number; + + public var lastHitLava:Boolean = false; + + public var inHidden:int = 0; + + private var _lastRight:Number = 0; + + private var _lastLeft:Number = 0; + + private var hitTimer:Number = 0; + + private var gunDown:ArcSprite; + + private var gunRight:ArcSprite; + + private var gunUp:ArcSprite; + + private var _shieldSprite:ArcSprite; + + private var _shield:Number = 0; + + private var _shieldParticle:Number = 0.3; + + private var _shieldBlinkTimer:Number = 0; + + private var _xray:ArcSprite; + + private var i:int; + + private var j:int; + + public var hasGun:Boolean = true; + + public var elevator:ArcSprite; + + public var controllable:Boolean = true; + + public function Player(param1:Number, param2:Number) + { + this.gun = Data.gun; + super(param1,param2); + loadGraphic(sprite,true,true,16,24); + offset.y = 10; + height = 12; + offset.x = 5; + width = 6; + drag.x = 400; + acceleration.y = 600; + var _loc3_:int = 0; + while(_loc3_ < 50) + { + this.dot = new FlxSprite(0,0,dotSprite); + this.dot.alpha = 0.8 - _loc3_ * 0.016; + this.dots[_loc3_] = this.dot; + _loc3_++; + } + addAnimation("walk",[0,1,2,3,4],7,true); + addAnimation("stand",[6,7],4,true); + addAnimation("jump",[5]); + this.gunRight = new ArcSprite(); + this.gunRight.loadGraphic(gunRightSprite,true,true,16,24); + this.gunRight.offset.y = 10; + this.gunRight.height = 12; + this.gunRight.offset.x = 5; + this.gunRight.width = 6; + this.gunUp = new ArcSprite(); + this.gunUp.loadGraphic(gunUpSprite,true,true,16,24); + this.gunUp.offset.y = 10; + this.gunUp.height = 12; + this.gunUp.offset.x = 5; + this.gunUp.width = 6; + this.gunDown = new ArcSprite(); + this.gunDown.loadGraphic(gunDownSprite,true,true,16,24); + this.gunDown.offset.y = 10; + this.gunDown.height = 12; + this.gunDown.offset.x = 5; + this.gunDown.width = 6; + this._startheight = this._maxheight = y; + new Date().getTime(); + this._shieldSprite = new ArcSprite(0,0,shieldSprite); + play("stand"); + } + + public function get moveSpeed() : Number + { + return (BASE_MOVE_SPEED + Data.agility * 5) * (this._inWater > 0 ? 0.5 : 1); + } + + public function get maxHeight() : int + { + return (this._maxheight - this._startheight) / -9; + } + + private function pressedJump() : Boolean + { + return FlxG.keys.justPressed("W") && Data.control != Data.CONTROL_KEYBOARDI || FlxG.keys.justPressed("SPACE") || FlxG.keys.justPressed("Z") || FlxG.keys.justPressed("UP") && Data.control != Data.CONTROL_KEYBOARD; + } + + private function pressingJump() : Boolean + { + return FlxG.keys.pressed("W") && Data.control != Data.CONTROL_KEYBOARDI || FlxG.keys.pressed("SPACE") || FlxG.keys.pressed("Z") || FlxG.keys.pressed("UP") && Data.control != Data.CONTROL_KEYBOARD; + } + + override public function update() : void + { + var _loc1_:Array = null; + var _loc2_:Number = NaN; + var _loc3_:Number = NaN; + var _loc4_:Number = NaN; + if(Data.state.over) + { + alpha -= FlxG.elapsed; + super.update(); + return; + } + if(y < this._maxheight) + { + this._maxheight = y; + } + if(this._shield > 0) + { + this._shield -= FlxG.elapsed; + this._shieldParticle -= FlxG.elapsed; + if(this._shieldParticle <= 0) + { + ArcParticleSystem.emit(Data.state.particles,"rebound",getMidpoint().x,getMidpoint().y,1,1,0.5,0,-30,30,-30,30); + this._shieldParticle = 0.1; + } + if(this._shield < 2) + { + this._shieldBlinkTimer -= FlxG.elapsed; + if(this._shieldBlinkTimer <= 0) + { + this._shieldBlinkTimer = 0.1; + if(this._shieldSprite.alpha == 1) + { + this._shieldSprite.alpha = 0.2; + } + else + { + this._shieldSprite.alpha = 1; + } + } + } + } + if(Data.control == Data.CONTROL_MOUSE) + { + if(x < FlxG.mouse.x) + { + facing = RIGHT; + } + else + { + facing = LEFT; + } + } + else if(Data.control == Data.CONTROL_KEYBOARD) + { + if(FlxG.keys.LEFT) + { + facing = LEFT; + } + else if(FlxG.keys.RIGHT) + { + facing = RIGHT; + } + else if(FlxG.keys.A) + { + facing = LEFT; + } + else if(FlxG.keys.D) + { + facing = RIGHT; + } + } + else if(Data.control == Data.CONTROL_KEYBOARDI) + { + if(FlxG.keys.A) + { + facing = LEFT; + } + else if(FlxG.keys.D) + { + facing = RIGHT; + } + else if(FlxG.keys.LEFT) + { + facing = LEFT; + } + else if(FlxG.keys.RIGHT) + { + facing = RIGHT; + } + } + if(this.hitTimer <= 0 && this.dashing <= 0 && this.controllable && !Data.state.xraying) + { + if(Data.state.controlCharacter) + { + if(FlxG.keys.D || FlxG.keys.RIGHT && Data.control == Data.CONTROL_MOUSE) + { + velocity.x = this.moveSpeed; + } + else if(FlxG.keys.A || FlxG.keys.LEFT && Data.control == Data.CONTROL_MOUSE) + { + velocity.x = -this.moveSpeed; + } + else + { + velocity.x = 0; + } + if(Data.control == Data.CONTROL_MOUSE) + { + if(FlxG.keys.D || FlxG.keys.RIGHT) + { + velocity.x = this.moveSpeed; + } + else if(FlxG.keys.A || FlxG.keys.LEFT) + { + velocity.x = -this.moveSpeed; + } + else + { + velocity.x = 0; + } + } + else if(Data.control == Data.CONTROL_KEYBOARD) + { + if(FlxG.keys.D) + { + velocity.x = this.moveSpeed; + } + else if(FlxG.keys.A) + { + velocity.x = -this.moveSpeed; + } + else + { + velocity.x = 0; + } + } + else if(Data.control == Data.CONTROL_KEYBOARDI) + { + if(FlxG.keys.RIGHT) + { + velocity.x = this.moveSpeed; + } + else if(FlxG.keys.LEFT) + { + velocity.x = -this.moveSpeed; + } + else + { + velocity.x = 0; + } + } + } + acceleration.y = 700; + _loc1_ = [true,Data.skyboots == 1,Data.moonboots == 1]; + this.i = 0; + while(this.i < this._jump.length) + { + if(_loc1_[this.i]) + { + _loc2_ = Number(this._jump[this.i]); + if(_loc2_ > 0) + { + if(this.pressedJump()) + { + this._jumping = true; + SoundSystem.play(Sound["JUMP" + this.i],0.6); + } + if(this.pressingJump() && this._jumping) + { + this._jump[this.i] -= FlxG.elapsed; + if(this._jump[this.i] <= 0 || isTouching(UP)) + { + this._jumping = false; + } + velocity.y = this._inWater > 0 ? -150 : -200; + } + else if(this._jumping) + { + this._jumping = false; + _loc3_ = 1 - this._jump[this.i] / (this.JUMP_TIME[this.i] + Data.jump * 0.015); + _loc4_ = _loc3_ * -100; + if(_loc4_ > -50) + { + _loc4_ = -50; + } + if(velocity.y < _loc4_) + { + velocity.y = _loc4_; + } + this._jump[this.i] = 0; + } + else if(this._jump[this.i] != this.JUMP_TIME[this.i] + Data.jump * 0.01) + { + this._jump[this.i] = 0; + } + break; + } + } + ++this.i; + } + if(!isTouching(DOWN) && !this.pressingJump()) + { + this._jump[0] = 0; + } + if(isTouching(DOWN)) + { + this.i = 0; + while(this.i < this._jump.length) + { + this._jump[this.i] = this.JUMP_TIME[this.i] + Data.jump * 0.01; + ++this.i; + } + } + } + else if(this.hitTimer > 0) + { + this.hitTimer -= FlxG.elapsed; + } + if(velocity.y != 0) + { + play("jump"); + } + else if(velocity.x != 0) + { + play("walk"); + } + else + { + play("stand"); + } + if(this._inWater > 0) + { + --this._inWater; + drag.x = 600; + acceleration.y = 100; + if(velocity.y < 0) + { + maxVelocity.y = 400; + } + else + { + maxVelocity.y = 50; + } + } + else + { + drag.x = 400; + maxVelocity.y = 400; + } + --this.inHidden; + super.update(); + if(!(Data.state is HorizontalMode)) + { + if(x + width > FlxG.width) + { + x = FlxG.width - width; + } + } + if(x < 0) + { + x = 0; + } + if(Data.hp > 0) + { + if(this.invulnerable > 0) + { + this.invulnerable -= FlxG.elapsed; + alpha = 0.65; + } + else + { + alpha = 1; + } + } + if(getScreenXY().y > Config.HEIGHT + height) + { + Data.hp = 0; + Data.state.die(); + } + } + + override public function draw() : void + { + var _loc3_:ArcSprite = null; + var _loc4_:Number = NaN; + var _loc5_:Number = NaN; + var _loc6_:int = 0; + var _loc1_:Number = x + width / 2; + var _loc2_:Number = y + height / 2; + if(!this.controllable || Data.state.isComplete() || Data.state.inMenu) + { + this.radians = facing == LEFT ? (Number(this.radians = Math.PI)) : 0; + } + else if(Data.control == Data.CONTROL_MOUSE) + { + this.radians = Math.atan2(FlxG.mouse.y - _loc2_,FlxG.mouse.x - _loc1_); + } + else if(Data.control == Data.CONTROL_KEYBOARD) + { + if(FlxG.keys.LEFT && FlxG.keys.UP) + { + this.radians = 5 * Math.PI / 4; + } + else if(FlxG.keys.LEFT && FlxG.keys.DOWN) + { + this.radians = 3 * Math.PI / 4; + } + else if(FlxG.keys.LEFT) + { + this.radians = 4 * Math.PI / 4; + } + else if(FlxG.keys.RIGHT && FlxG.keys.UP) + { + this.radians = 7 * Math.PI / 4; + } + else if(FlxG.keys.RIGHT && FlxG.keys.DOWN) + { + this.radians = 1 * Math.PI / 4; + } + else if(FlxG.keys.RIGHT) + { + this.radians = 0; + } + else if(FlxG.keys.DOWN) + { + this.radians = 2 * Math.PI / 4; + } + else if(FlxG.keys.UP) + { + this.radians = 6 * Math.PI / 4; + } + else if(facing == LEFT) + { + this.radians = 4 * Math.PI / 4; + } + else if(facing == RIGHT) + { + this.radians = 0; + } + } + else if(Data.control == Data.CONTROL_KEYBOARDI) + { + if(FlxG.keys.A && FlxG.keys.W) + { + this.radians = 5 * Math.PI / 4; + } + else if(FlxG.keys.A && FlxG.keys.S) + { + this.radians = 3 * Math.PI / 4; + } + else if(FlxG.keys.A) + { + this.radians = 4 * Math.PI / 4; + } + else if(FlxG.keys.D && FlxG.keys.W) + { + this.radians = 7 * Math.PI / 4; + } + else if(FlxG.keys.D && FlxG.keys.S) + { + this.radians = 1 * Math.PI / 4; + } + else if(FlxG.keys.D) + { + this.radians = 0; + } + else if(FlxG.keys.S) + { + this.radians = 2 * Math.PI / 4; + } + else if(FlxG.keys.W) + { + this.radians = 6 * Math.PI / 4; + } + else if(facing == LEFT) + { + this.radians = 4 * Math.PI / 4; + } + else if(facing == RIGHT) + { + this.radians = 0; + } + } + if(!Data.state.inMenu && Data.lasersight == 1 && Data.hp > 0 && this.controllable && Data.control == Data.CONTROL_MOUSE && !Data.state.isComplete()) + { + _loc4_ = 8 * Math.cos(this.radians); + _loc5_ = 8 * Math.sin(this.radians); + _loc6_ = 0; + while(_loc6_ < 50) + { + this.dots[_loc6_].x = x + width / 2 + _loc4_ * _loc6_; + this.dots[_loc6_].y = y + height / 2 + _loc5_ * _loc6_; + this.dots[_loc6_].draw(); + _loc6_++; + } + } + super.draw(); + if(this.radians <= -0.4 && this.radians > -2.74 || this.radians > 3.9) + { + _loc3_ = this.gunUp; + } + else if(this.radians >= 0.4 && this.radians < 2.74) + { + _loc3_ = this.gunDown; + } + else + { + _loc3_ = this.gunRight; + } + _loc3_.x = x; + _loc3_.y = y; + _loc3_.frame = frame; + _loc3_.facing = facing; + _loc3_.alpha = alpha; + if(Boolean(Data.prime) && this.hasGun) + { + _loc3_.draw(); + } + if(this.shielded && Data.hp > 0) + { + this._shieldSprite.x = x - 7; + this._shieldSprite.y = y - 7; + this._shieldSprite.draw(); + } + if(this.elevator != null) + { + this.elevator.x = getMidpoint().x - 30; + this.elevator.y = y + height; + this.elevator.draw(); + } + if(Data.state.xraying) + { + Data.state.xray.x = x + 3; + Data.state.xray.y = y + 6; + Data.state.xray.angle = this.radians * 180 / Math.PI; + } + } + + public function hit(param1:int, param2:Boolean = false, param3:Boolean = true, param4:Boolean = true, param5:Boolean = false) : Boolean + { + var _loc6_:int = 0; + if(this.invulnerable > 0 && !param2 || Data.hp <= 0) + { + return false; + } + this.lastHitLava = param5; + if(param4) + { + this.hitTimer = HIT_TIME - Data.recover * 0.05; + } + this.invulnerable = 1 + 0.15 * Data.aegis; + if(param3) + { + _loc6_ = ArcU.clamp(Math.min(1 + Math.floor(param1 / 6),param5 ? 16 : 12) - Data.defense,1,19); + if(param1 > 50) + { + _loc6_ = ArcU.clamp(_loc6_ - 2,1,19); + } + else if(param1 > 40) + { + _loc6_ = ArcU.clamp(_loc6_ - 1,1,19); + } + Data.hp -= _loc6_; + SoundSystem.play(Sound.HURT); + } + if(Data.hp <= 0) + { + this.kill(); + } + return true; + } + + override public function kill() : void + { + Data.hp = 0; + Data.state.die(); + SoundSystem.play(Sound.PLAYER_DIE); + } + + public function get isHit() : Boolean + { + return this.hitTimer > 0; + } + + public function shield(param1:Number) : void + { + this._shield = Data.state is TadpoleMode ? 5 : param1; + this._shieldSprite.alpha = 1; + } + + public function get shielded() : Boolean + { + return this._shield > 0; + } + + public function inWater() : void + { + this._inWater = 3; + } + + public function inLava() : void + { + this.hit(10); + } + + override public function reset(param1:Number, param2:Number) : void + { + super.reset(param1,param2); + this.hitTimer = 0; + this._shield = 0; + this._inWater = 0; + this.invulnerable = 0; + alpha = 1; + } + + public function showElevator() : void + { + this.elevator = new ArcSprite(0,0,elevatorSprite); + } + + public function drawShield(param1:Number, param2:Number) : void + { + this._shieldSprite.x = param1 + 2; + this._shieldSprite.y = param2 + 3; + this._shieldSprite.draw(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/entities/PlayerTadpole.as b/research/inner_decompiled/scripts/com/arc/dh/entities/PlayerTadpole.as new file mode 100644 index 0000000..54dd9ef --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/entities/PlayerTadpole.as @@ -0,0 +1,86 @@ +package com.arc.dh.entities +{ + import com.arc.dh.state.TadpoleMode; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcSprite; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + + public class PlayerTadpole extends ArcSprite + { + + public static const sprite:Class = PlayerTadpole_sprite; + + private static const DY:Number = 400; + + private static const MAXVY:Number = 100; + + private var _dead:Boolean = false; + + public function PlayerTadpole(param1:Number, param2:Number) + { + super(param1,param2); + loadRotatedGraphic(sprite,60,-1,true,true); + width = height = 2; + offset.x = offset.y = 6; + angle = 90; + this.draw(); + } + + override public function update() : void + { + var _loc1_:Number = NaN; + if(!this._dead) + { + if(this.held()) + { + velocity.y -= FlxG.elapsed * DY; + } + else + { + velocity.y += FlxG.elapsed * DY; + } + velocity.y = ArcU.clamp(velocity.y,-MAXVY,MAXVY); + _loc1_ = Math.atan2(velocity.y,MAXVY); + angle = 180 / Math.PI * _loc1_ + 45; + } + else + { + velocity.x = 0; + velocity.y = 0; + } + super.update(); + } + + override public function draw() : void + { + super.draw(); + if(Data.state.player.shielded) + { + Data.state.player.drawShield(x - 7,y - 7); + Data.state.player.drawShield(x - 7,y - 7); + } + } + + private function held() : Boolean + { + return FlxG.mouse.pressed() || FlxG.keys.SPACE || FlxG.keys.W || FlxG.keys.UP; + } + + private function get speed() : Number + { + return (Data.state as TadpoleMode).camera.velocity.x; + } + + public function die() : void + { + this._dead = true; + } + + public function isDead() : Boolean + { + return this._dead; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/entities/PlayerTadpole_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/entities/PlayerTadpole_sprite.as new file mode 100644 index 0000000..da07682 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/entities/PlayerTadpole_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.entities +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/188_com.arc.dh.entities.PlayerTadpole_sprite.png")] + public class PlayerTadpole_sprite extends BitmapAsset + { + + public function PlayerTadpole_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/entities/Player_dotSprite.as b/research/inner_decompiled/scripts/com/arc/dh/entities/Player_dotSprite.as new file mode 100644 index 0000000..b2559ec --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/entities/Player_dotSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.entities +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/106_com.arc.dh.entities.Player_dotSprite.png")] + public class Player_dotSprite extends BitmapAsset + { + + public function Player_dotSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/entities/Player_elevatorSprite.as b/research/inner_decompiled/scripts/com/arc/dh/entities/Player_elevatorSprite.as new file mode 100644 index 0000000..2890430 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/entities/Player_elevatorSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.entities +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/60_com.arc.dh.entities.Player_elevatorSprite.png")] + public class Player_elevatorSprite extends BitmapAsset + { + + public function Player_elevatorSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/entities/Player_gunDownSprite.as b/research/inner_decompiled/scripts/com/arc/dh/entities/Player_gunDownSprite.as new file mode 100644 index 0000000..c34d8a4 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/entities/Player_gunDownSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.entities +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/95_com.arc.dh.entities.Player_gunDownSprite.png")] + public class Player_gunDownSprite extends BitmapAsset + { + + public function Player_gunDownSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/entities/Player_gunRightSprite.as b/research/inner_decompiled/scripts/com/arc/dh/entities/Player_gunRightSprite.as new file mode 100644 index 0000000..96f8100 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/entities/Player_gunRightSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.entities +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/277_com.arc.dh.entities.Player_gunRightSprite.png")] + public class Player_gunRightSprite extends BitmapAsset + { + + public function Player_gunRightSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/entities/Player_gunUpSprite.as b/research/inner_decompiled/scripts/com/arc/dh/entities/Player_gunUpSprite.as new file mode 100644 index 0000000..8cb1e70 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/entities/Player_gunUpSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.entities +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/279_com.arc.dh.entities.Player_gunUpSprite.png")] + public class Player_gunUpSprite extends BitmapAsset + { + + public function Player_gunUpSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/entities/Player_shieldSprite.as b/research/inner_decompiled/scripts/com/arc/dh/entities/Player_shieldSprite.as new file mode 100644 index 0000000..2a78842 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/entities/Player_shieldSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.entities +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/261_com.arc.dh.entities.Player_shieldSprite.png")] + public class Player_shieldSprite extends BitmapAsset + { + + public function Player_shieldSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/entities/Player_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/entities/Player_sprite.as new file mode 100644 index 0000000..c5241d6 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/entities/Player_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.entities +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/243_com.arc.dh.entities.Player_sprite.png")] + public class Player_sprite extends BitmapAsset + { + + public function Player_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/CharacterPane.as b/research/inner_decompiled/scripts/com/arc/dh/menu/CharacterPane.as new file mode 100644 index 0000000..bd6d1a0 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/CharacterPane.as @@ -0,0 +1,121 @@ +package com.arc.dh.menu +{ + import com.arc.dh.util.Data; + import com.arc.dh.util.Fonts; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class CharacterPane extends MenuPane + { + + private static const sprite:Class = CharacterPane_sprite; + + private static const heartMeterSprite:Class = CharacterPane_heartMeterSprite; + + private var _diamonds:FlxBitmapText; + + private var _skills:Array = new Array(); + + private var _guns:Array = new Array(); + + private var _heartmeter:ArcSprite = new ArcSprite(); + + public function CharacterPane() + { + var _loc3_:String = null; + var _loc4_:Array = null; + var _loc5_:int = 0; + var _loc6_:GunComponent = null; + var _loc7_:SkillMeter = null; + var _loc8_:Array = null; + var _loc9_:Equipment = null; + super(1,1,sprite); + var _loc1_:Array = ["agility","jump","attract","recover","aegis","defense"]; + var _loc2_:int = 43; + for each(_loc3_ in _loc1_) + { + _loc7_ = new SkillMeter(14,_loc2_,_loc3_); + this.add(_loc7_); + this._skills.push(_loc7_); + _loc2_ += 10; + } + _loc4_ = [["autofirer","Autofire"],["lasersight","Laser Sight"],["skyboots","Sky Boots"],["moltensuit","Molten Suit"],["moonboots","Moon Boots"],["prime","Prime Gun"],["spreader","Spreader Gun"],["missile","Missile Gun"],["rebound","Rebound Gun"],["xrayscope","X-Ray Scope"]]; + _loc5_ = 0; + while(_loc5_ < _loc4_.length) + { + _loc8_ = _loc4_[_loc5_] as Array; + _loc9_ = new Equipment(_loc5_,_loc8_[1] as String,_loc8_[0] as String); + this.add(_loc9_); + _loc5_++; + } + this._diamonds = new FlxBitmapText(26,195,Fonts.font(Fonts.SMALL_WHITE),Data.diamonds + " DIAMONDS","center",99); + this.add(this._diamonds); + this._heartmeter = new ArcSprite(33,23); + this._heartmeter.loadGraphic(heartMeterSprite,true,false,103,7); + this.add(this._heartmeter); + _loc6_ = new GunComponent(150,21,"primegun","prime"); + this._guns.push(_loc6_); + this.add(_loc6_); + _loc6_ = new GunComponent(250,21,"spreadergun","spreader"); + this._guns.push(_loc6_); + this.add(_loc6_); + _loc6_ = new GunComponent(150,114,"missilegun","missile"); + this._guns.push(_loc6_); + this.add(_loc6_); + _loc6_ = new GunComponent(250,114,"reboundgun","rebound"); + this._guns.push(_loc6_); + this.add(_loc6_); + this.sync(); + setAll("scrollFactor",new FlxPoint(0,0)); + } + + public function clickTryAgain() : void + { + } + + public function clickMenu() : void + { + } + + override public function sync(param1:Boolean = false) : void + { + var _loc2_:SkillMeter = null; + var _loc3_:GunComponent = null; + this._heartmeter.frame = Data.hpm; + this._diamonds.text = Data.diamonds + " DIAMONDS"; + for each(_loc2_ in this._skills) + { + _loc2_.sync(); + } + for each(_loc3_ in this._guns) + { + _loc3_.sync(); + } + } + + override public function update() : void + { + if(this._heartmeter.hover()) + { + if(Menu.tooltip == null || Menu.tooltip.source != this) + { + Menu.tooltip = new MenuTooltip(this._heartmeter.x + this._heartmeter.width / 2,this._heartmeter.y,"Heart Crystals Obtained",Data.vitality + " of 17"); + Menu.tooltip.source = this; + } + Menu.hovering = true; + } + super.update(); + if(FlxG.mouse.justPressed()) + { + this.sync(); + } + } + + public function tooltip(param1:String, param2:String = "left") : void + { + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/CharacterPane_heartMeterSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/CharacterPane_heartMeterSprite.as new file mode 100644 index 0000000..d322b2a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/CharacterPane_heartMeterSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/104_com.arc.dh.menu.CharacterPane_heartMeterSprite.png")] + public class CharacterPane_heartMeterSprite extends BitmapAsset + { + + public function CharacterPane_heartMeterSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/CharacterPane_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/CharacterPane_sprite.as new file mode 100644 index 0000000..7410bb4 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/CharacterPane_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/250_com.arc.dh.menu.CharacterPane_sprite.png")] + public class CharacterPane_sprite extends BitmapAsset + { + + public function CharacterPane_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/CompleteWindow.as b/research/inner_decompiled/scripts/com/arc/dh/menu/CompleteWindow.as new file mode 100644 index 0000000..3f1fc3d --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/CompleteWindow.as @@ -0,0 +1,101 @@ +package com.arc.dh.menu +{ + import com.arc.dh.state.MainMenu; + import com.arc.dh.state.StoryMode; + import com.arc.dh.util.Data; + import com.arc.dh.util.Fonts; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class CompleteWindow extends ArcGroup + { + + protected static const sprite:Class = CompleteWindow_sprite; + + private static const FADE_SPEED:Number = 2; + + private var _window:ArcSprite; + + private var _diamonds:ArcGroup = new ArcGroup(); + + private var _enemies:ArcGroup = new ArcGroup(); + + private var _time:ArcGroup = new ArcGroup(); + + private var _heart:ArcGroup = new ArcGroup(); + + private var _red:ArcGroup = new ArcGroup(); + + private var _continue:FlxBitmapText; + + private var _complete:Boolean = false; + + private var _fading:Boolean = false; + + public function CompleteWindow(param1:String, param2:String, param3:String, param4:String, param5:String) + { + super(71,74); + this._window = new ArcSprite(0,0,sprite); + this.add(this._window); + this.addGroup(this._diamonds,21,40,60,"Diamonds",param1); + this.addGroup(this._enemies,92,40,56,"Enemies",param2); + this.addGroup(this._time,148,40,72,"Total Time",param3); + this.addGroup(this._heart,27,61,91,"Heart Crystals",param4); + this.addGroup(this._red,116,61,91,"Red Diamonds",param5); + this._continue = new FlxBitmapText(0,82,Fonts.font(Fonts.BEVEL_BLUE),"CLICK TO CONTINUE","center",217); + this.add(this._continue); + setAll("scrollFactor",new FlxPoint(0,0)); + alpha = 0; + } + + private function addGroup(param1:ArcGroup, param2:int, param3:int, param4:int, param5:String, param6:String) : void + { + var _loc7_:FlxBitmapText = new FlxBitmapText(param2,param3,Fonts.font(Fonts.SMALL_WHITE),param5.toUpperCase(),"center",param4); + param1.add(_loc7_); + var _loc8_:FlxBitmapText = new FlxBitmapText(param2,param3 + 8,Fonts.font(Fonts.SMALL_WHITE),param6.toUpperCase(),"center",param4); + _loc8_.alpha = 0.8; + param1.add(_loc8_); + this.add(param1); + } + + override public function update() : void + { + var order:Array = null; + var o:* = undefined; + if(!this._complete) + { + order = [this._window,this._diamonds,this._enemies,this._time,this._heart,this._red,this._continue]; + for each(o in order) + { + if(o.alpha < 1) + { + o.alpha += FADE_SPEED * FlxG.elapsed; + if(o.alpha > 1) + { + o.alpha = 1; + } + return; + } + } + this._complete = true; + } + else if(!this._fading) + { + if(FlxG.mouse.justPressed() || FlxG.keys.justPressed("SPACE") || FlxG.keys.justPressed("ESCAPE") || FlxG.keys.justPressed("ENTER")) + { + FlxG.camera.fade(4278190080,0.5,function():void + { + var _loc1_:int = Data.state is StoryMode ? 3 : 0; + FlxG.switchState(new MainMenu(_loc1_)); + }); + this._fading = true; + } + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/CompleteWindow_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/CompleteWindow_sprite.as new file mode 100644 index 0000000..9c716b7 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/CompleteWindow_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/232_com.arc.dh.menu.CompleteWindow_sprite.png")] + public class CompleteWindow_sprite extends BitmapAsset + { + + public function CompleteWindow_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/ConfirmationMenu.as b/research/inner_decompiled/scripts/com/arc/dh/menu/ConfirmationMenu.as new file mode 100644 index 0000000..20be2b1 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/ConfirmationMenu.as @@ -0,0 +1,81 @@ +package com.arc.dh.menu +{ + import com.arc.dh.state.BossMode; + import com.arc.dh.state.EscapeMode; + import com.arc.dh.state.MainMenu; + import com.arc.dh.state.StoryMode; + import com.arc.dh.util.Data; + import com.arc.dh.util.DataSerializer; + import com.arc.dh.util.Fonts; + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class ConfirmationMenu extends ArcGroup + { + + private var window:Class; + + private var quit:Class; + + private var cancel:Class; + + private var menu:Menu; + + public function ConfirmationMenu(param1:Menu) + { + var window:ArcSprite; + var M:Menu = param1; + this.window = ConfirmationMenu_window; + this.quit = ConfirmationMenu_quit; + this.cancel = ConfirmationMenu_cancel; + super(); + this.menu = M; + window = new ArcSprite(71,95,this.window); + this.add(window); + this.add(new ArcButton(window.x + 22,window.y + 41,72,13,this.quit).selectable(false).callback(function():void + { + var screen:* = undefined; + screen = 0; + if(Data.state is StoryMode) + { + screen = 3; + } + else if(Data.state is BossMode) + { + screen = 2; + } + else if(Data.state is EscapeMode) + { + screen = 1; + } + FlxG.fade(4278190080,0.25,function():void + { + FlxG.mouse.hide(); + DataSerializer.save(); + FlxG.switchState(new MainMenu(screen)); + }); + })); + this.add(new ArcButton(window.x + 123,window.y + 41,72,13,this.cancel).selectable(false).callback(function():void + { + menu.inConfirmation = false; + })); + this.add(new FlxBitmapText(window.x + 10,window.y + 13,Fonts.font(Fonts.SMALL_WHITE),"ARE YOU SURE YOU WANT TO RETURN TO THE MAIN MENU? YOU WILL LOSE ALL SAVED PROGRESS ON THIS STAGE.","center",197)); + setAll("scrollFactor",new FlxPoint(0,0)); + } + + override public function update() : void + { + if(FlxG.keys.justPressed("ESCAPE")) + { + this.menu.inConfirmation = false; + FlxG.keys.update(); + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/ConfirmationMenu_cancel.as b/research/inner_decompiled/scripts/com/arc/dh/menu/ConfirmationMenu_cancel.as new file mode 100644 index 0000000..1e1bbe7 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/ConfirmationMenu_cancel.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/254_com.arc.dh.menu.ConfirmationMenu_cancel.png")] + public class ConfirmationMenu_cancel extends BitmapAsset + { + + public function ConfirmationMenu_cancel() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/ConfirmationMenu_quit.as b/research/inner_decompiled/scripts/com/arc/dh/menu/ConfirmationMenu_quit.as new file mode 100644 index 0000000..9d8bb8b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/ConfirmationMenu_quit.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/257_com.arc.dh.menu.ConfirmationMenu_quit.png")] + public class ConfirmationMenu_quit extends BitmapAsset + { + + public function ConfirmationMenu_quit() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/ConfirmationMenu_window.as b/research/inner_decompiled/scripts/com/arc/dh/menu/ConfirmationMenu_window.as new file mode 100644 index 0000000..53e5070 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/ConfirmationMenu_window.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/252_com.arc.dh.menu.ConfirmationMenu_window.png")] + public class ConfirmationMenu_window extends BitmapAsset + { + + public function ConfirmationMenu_window() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/Equipment.as b/research/inner_decompiled/scripts/com/arc/dh/menu/Equipment.as new file mode 100644 index 0000000..dd97685 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/Equipment.as @@ -0,0 +1,96 @@ +package com.arc.dh.menu +{ + import com.arc.dh.util.Data; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxPoint; + + public class Equipment extends ArcGroup + { + + private static const icons:Class = Equipment_icons; + + private var _name:FlxBitmapText; + + private var _acquired:FlxBitmapText; + + private var _skill:String; + + private var _sprite:ArcSprite; + + private var _item:String; + + public function Equipment(param1:Number, param2:String, param3:String) + { + var _loc4_:int = param1 / 5; + var _loc5_:int = param1 % 5; + super(22 + _loc5_ * 23 + (_loc5_ > 1 ? 1 : 0),127 + _loc4_ * 23); + this._skill = param3; + this._sprite = new ArcSprite(0,0); + this._sprite.loadGraphic(icons,true,false,14,14); + this._sprite.addAnimation("item",[param1]); + this._sprite.play("item"); + this.add(this._sprite); + this._item = param2; + setAll("scrollFactor",new FlxPoint(0,0)); + this.sync(); + } + + override public function update() : void + { + if(this._sprite.hover()) + { + if(Menu.tooltip == null || Menu.tooltip.source != this) + { + Menu.tooltip = new MenuTooltip(this._sprite.x + this._sprite.width / 2,this._sprite.y,this.getName().toUpperCase(),this.getDescription().toUpperCase()); + Menu.tooltip.source = this; + } + Menu.hovering = true; + } + this.sync(); + super.update(); + } + + private function getDescription() : String + { + switch(this._item) + { + case "Autofire": + return "Allows you to fire your weapon automatically. Press \'F\' to toggle."; + case "Laser Sight": + return "Creates a laser beam to aid in aiming."; + case "Sky Boots": + return "Allows you to double jump."; + case "Molten Suit": + return "Allows you to survive short periods in lava, taking damage over time."; + case "Moon Boots": + return "Allows you to triple jump."; + case "Prime Gun": + return "Shoots a steady stream of medium powered bullets.\nHotkey: 1"; + case "Spreader Gun": + return "Shoots multiple spread out weak bullets.\nHotkey: 2"; + case "Missile Gun": + return "Shoots high powered missiles that can break steel blocks and destroy spinning blades.\nHotkey: 3"; + case "Rebound Gun": + return "Shoots medium powered bullets that bounce off\nof terrain.\nHotkey: 4"; + case "X-Ray Scope": + return "Shines a scope to find hidden areas in the terrain. Cannot shoot or move while active.\nHotkey: SHIFT"; + default: + return "MOTHERFUCKER"; + } + } + + private function getName() : String + { + return this._item; + } + + public function sync() : void + { + this._sprite.alpha = Data[this._skill] == 1 ? 0.9 : 0.3; + this._sprite.alpha *= _alpha; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/Equipment_icons.as b/research/inner_decompiled/scripts/com/arc/dh/menu/Equipment_icons.as new file mode 100644 index 0000000..648907e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/Equipment_icons.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/215.png")] + public class Equipment_icons extends BitmapAsset + { + + public function Equipment_icons() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver.as b/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver.as new file mode 100644 index 0000000..954b11c --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver.as @@ -0,0 +1,194 @@ +package com.arc.dh.menu +{ + import com.arc.dh.state.BossMode; + import com.arc.dh.state.HorizontalMode; + import com.arc.dh.util.Data; + import com.arc.dh.util.Fonts; + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class GameOver extends ArcGroup + { + + protected static const sprite:Class = GameOver_sprite; + + protected static const spriteShort:Class = GameOver_spriteShort; + + protected static const spriteComplete:Class = GameOver_spriteComplete; + + protected static const spriteRetry:Class = GameOver_spriteRetry; + + protected static const spriteMainMenu:Class = GameOver_spriteMainMenu; + + private static const FADE_SPEED:Number = 4; + + private var _window:ArcSprite; + + private var _diamonds:ArcGroup; + + private var _height:ArcGroup; + + private var _time:ArcGroup; + + private var _heart:ArcGroup; + + private var _red:ArcGroup; + + private var _continue:FlxBitmapText; + + private var _complete:Boolean = false; + + private var _fading:Boolean = false; + + private var _buttonRetry:ArcButton; + + private var _buttonMainMenu:ArcButton; + + private var _tipText:FlxBitmapText; + + private var _retryFunction:Function; + + private var _menuFunction:Function; + + public function GameOver(param1:String, param2:String, param3:String) + { + var buttonY:int; + var message:String = null; + var offset:int = 0; + var diamonds:String = param1; + var height:String = param2; + var time:String = param3; + this._diamonds = new ArcGroup(); + this._height = new ArcGroup(); + this._time = new ArcGroup(); + this._heart = new ArcGroup(); + this._red = new ArcGroup(); + super(71,89); + if(diamonds == null && time == null) + { + this._window = new ArcSprite(0,0,spriteShort); + } + else if(diamonds == null) + { + this._window = new ArcSprite(0,0,spriteComplete); + } + else + { + this._window = new ArcSprite(0,0,sprite); + } + this.add(this._window); + if(diamonds != null && time != null) + { + this.addGroup(this._diamonds,21,26,60,"Diamonds",diamonds); + this.addGroup(this._height,92,26,56,Data.state is HorizontalMode ? "Distance" : "Height",height); + this.addGroup(this._time,148,26,72,"Total Time",time); + } + else if(time != null) + { + message = !(Data.state as BossMode).isPractice() ? "You have successfully completed " + ((Data.state as BossMode).isHeroic() ? "Heroic" : "Normal") + " Boss Mode!\nTime: " + time : "You\'ve successfully defeated a practice mode boss!"; + this._tipText = new FlxBitmapText(0,33,Fonts.font(Fonts.SMALL_WHITE),message.toUpperCase(),"center",218); + this._tipText.y += (30 - this._tipText.height) / 2; + this.add(this._tipText); + } + else + { + this._tipText = new FlxBitmapText(0,23,Fonts.font(Fonts.SMALL_WHITE),Tip.random(),"center",218); + offset = (30 - this._tipText.height) / 2; + this._tipText.y += offset; + this.add(this._tipText); + } + buttonY = diamonds == null && time == null ? 57 : (diamonds == null ? 64 : 50); + this._buttonRetry = new ArcButton(22,buttonY,72,13,spriteRetry).callback(function():void + { + if(_complete && !_fading) + { + FlxG.camera.fade(4278190080,0.5,function():void + { + _retryFunction(); + }); + } + }).selectable(false); + this.add(this._buttonRetry); + this._buttonMainMenu = new ArcButton(123,buttonY,72,13,spriteMainMenu).callback(function():void + { + if(_complete && !_fading) + { + FlxG.camera.fade(4278190080,0.5,function():void + { + _menuFunction(); + }); + } + }).selectable(false); + this.add(this._buttonMainMenu); + setAll("scrollFactor",new FlxPoint(0,0)); + alpha = 0; + } + + public function setCallback(param1:Function, param2:Function) : GameOver + { + this._retryFunction = param1; + this._menuFunction = param2; + return this; + } + + private function addGroup(param1:ArcGroup, param2:int, param3:int, param4:int, param5:String, param6:String) : void + { + var _loc7_:FlxBitmapText = new FlxBitmapText(param2,param3,Fonts.font(Fonts.SMALL_WHITE),param5.toUpperCase(),"center",param4); + param1.add(_loc7_); + var _loc8_:FlxBitmapText = new FlxBitmapText(param2,param3 + 8,Fonts.font(Fonts.SMALL_WHITE),param6.toUpperCase(),"center",param4); + _loc8_.alpha = 0.8; + param1.add(_loc8_); + this.add(param1); + } + + override public function update() : void + { + var order:Array = null; + var o:* = undefined; + if(!this._complete) + { + order = [this._window,this._diamonds,this._height,this._time,this._tipText]; + for each(o in order) + { + if(o != null) + { + if(o.alpha < 1) + { + o.alpha += FADE_SPEED * FlxG.elapsed; + if(o.alpha > 1) + { + o.alpha = 1; + } + if(o == this._window) + { + this._buttonRetry.alpha = this._buttonMainMenu.alpha = o.alpha; + } + return; + } + } + } + this._complete = true; + } + else if(FlxG.keys.justPressed("R")) + { + FlxG.camera.fade(4278190080,0.5,function():void + { + _retryFunction(); + }); + } + else if(FlxG.keys.justPressed("M")) + { + FlxG.camera.fade(4278190080,0.5,function():void + { + _menuFunction(); + }); + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver_sprite.as new file mode 100644 index 0000000..20f8aa4 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/115_com.arc.dh.menu.GameOver_sprite.png")] + public class GameOver_sprite extends BitmapAsset + { + + public function GameOver_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver_spriteComplete.as b/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver_spriteComplete.as new file mode 100644 index 0000000..ebed069 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver_spriteComplete.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/154_com.arc.dh.menu.GameOver_spriteComplete.png")] + public class GameOver_spriteComplete extends BitmapAsset + { + + public function GameOver_spriteComplete() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver_spriteMainMenu.as b/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver_spriteMainMenu.as new file mode 100644 index 0000000..dc665eb --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver_spriteMainMenu.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/44_com.arc.dh.menu.GameOver_spriteMainMenu.png")] + public class GameOver_spriteMainMenu extends BitmapAsset + { + + public function GameOver_spriteMainMenu() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver_spriteRetry.as b/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver_spriteRetry.as new file mode 100644 index 0000000..802d86b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver_spriteRetry.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/242_com.arc.dh.menu.GameOver_spriteRetry.png")] + public class GameOver_spriteRetry extends BitmapAsset + { + + public function GameOver_spriteRetry() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver_spriteShort.as b/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver_spriteShort.as new file mode 100644 index 0000000..503708e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/GameOver_spriteShort.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/276_com.arc.dh.menu.GameOver_spriteShort.png")] + public class GameOver_spriteShort extends BitmapAsset + { + + public function GameOver_spriteShort() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponent.as b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponent.as new file mode 100644 index 0000000..631ce9c --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponent.as @@ -0,0 +1,124 @@ +package com.arc.dh.menu +{ + import com.arc.dh.util.Data; + import com.arc.dh.util.Fonts; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxPoint; + + public class GunComponent extends ArcGroup + { + + private static const sprite:Class = GunComponent_sprite; + + private static const COSTS:Array = [25,40,75,125,200,300,450,700,1000,1500,-1]; + + private var _bg:ArcSprite; + + private var _skill:String; + + private var _barPower:GunComponentBar; + + private var _barSpeed:GunComponentBar; + + private var _barSpecial:GunComponentBar; + + private var _barSpecial2:GunComponentBar; + + private var _name:FlxBitmapText; + + private var _frame:int = 0; + + private var _obtained:Boolean; + + private var _obtainedSkill:String; + + public function GunComponent(param1:Number, param2:Number, param3:String, param4:String) + { + var _loc5_:String = null; + super(param1,param2); + this._skill = param3; + this._obtainedSkill = param4; + this._bg = new ArcSprite(-1,0); + this._bg.loadGraphic(sprite,true,false,97,90); + this.add(this._bg); + this._obtained = Data[param4] == 1; + this._bg.frame = this._frame = this._obtained ? 0 : 1; + switch(param3) + { + case "primegun": + _loc5_ = "Prime Gun"; + break; + case "spreadergun": + _loc5_ = "Spreader Gun"; + break; + case "missilegun": + _loc5_ = "Missile Gun"; + break; + case "reboundgun": + _loc5_ = "Rebound Gun"; + } + if(!this._obtained) + { + _loc5_ = "Unknown"; + } + this._name = new FlxBitmapText(3,4,Fonts.font(this._obtained ? Fonts.BEVEL_BLUE : Fonts.BEVEL_GRAY),_loc5_.toUpperCase(),"center",89,true); + this.add(this._name); + this._barPower = new GunComponentBar(6,12,param3,0,"Main Gun",this._obtained); + this.add(this._barPower); + this._barSpeed = new GunComponentBar(6,29,param3,1,"Main Gun",this._obtained); + this.add(this._barSpeed); + this._barSpecial = new GunComponentBar(6,47,param3,2,"Main Gun",this._obtained); + this.add(this._barSpecial); + this._barSpecial2 = new GunComponentBar(6,65,param3,3,"Main Gun",this._obtained); + this.add(this._barSpecial2); + setAll("scrollFactor",new FlxPoint(0,0)); + this.sync(); + } + + override public function update() : void + { + this._bg.frame = this._frame == 0 && this._bg.hover() ? 2 : uint(this._frame); + super.update(); + } + + public function sync() : void + { + var _loc2_:String = null; + var _loc1_:Boolean = Data[this._obtainedSkill] == 1; + if(_loc1_ != this._obtained) + { + this._obtained = _loc1_; + switch(this._skill) + { + case "primegun": + _loc2_ = "Prime Gun"; + break; + case "spreadergun": + _loc2_ = "Spreader Gun"; + break; + case "missilegun": + _loc2_ = "Missile Gun"; + break; + case "reboundgun": + _loc2_ = "Rebound Gun"; + } + this.remove(this._name); + this._name = new FlxBitmapText(3,4,Fonts.font(Fonts.BEVEL_BLUE),_loc2_.toUpperCase(),"center",89,true); + this._name.scrollFactor = new FlxPoint(0,0); + this.add(this._name); + this._bg.frame = this._frame = 0; + this._barPower.motherfuckingSync(); + this._barSpeed.motherfuckingSync(); + this._barSpecial.motherfuckingSync(); + this._barSpecial2.motherfuckingSync(); + } + this._barPower.sync(); + this._barSpeed.sync(); + this._barSpecial.sync(); + this._barSpecial2.sync(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar.as b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar.as new file mode 100644 index 0000000..0660b00 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar.as @@ -0,0 +1,308 @@ +package com.arc.dh.menu +{ + import com.arc.dh.Gun; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Data; + import com.arc.dh.util.DataSerializer; + import com.arc.dh.util.Fonts; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class GunComponentBar extends ArcGroup + { + + private static const diamondsSprite:Class = GunComponentBar_diamondsSprite; + + private static const bgSprite:Class = GunComponentBar_bgSprite; + + private static const barSprite:Class = GunComponentBar_barSprite; + + private static const singleBarSprite:Class = GunComponentBar_singleBarSprite; + + private static const barSpriteUnobtained:Class = GunComponentBar_barSpriteUnobtained; + + private static const singleBarSpriteUnobtained:Class = GunComponentBar_singleBarSpriteUnobtained; + + private static const COSTS:Array = [100,150,200,300,450,600,800,1000,1200,1500]; + + private static const SPECIAL_COST:int = 2500; + + private var _bg:ArcSprite; + + private var _bar:ArcSprite; + + private var _skill:String; + + private var _offset:int; + + private var _type:int; + + private var _name:FlxBitmapText; + + private var _diamond:ArcSprite; + + private var _cost:FlxBitmapText; + + private var _obtained:Boolean; + + public function GunComponentBar(param1:Number, param2:Number, param3:String, param4:int, param5:String, param6:Boolean) + { + super(param1,param2); + this._skill = param3; + this._offset = param4; + this._type = param4 >= 2 ? 1 : 10; + this._obtained = param6; + this._bg = new ArcSprite(-1,3); + this.add(this._bg); + this._bar = new ArcSprite(0,10); + if(this._type == 1) + { + this._bar.loadGraphic(param6 ? singleBarSprite : singleBarSpriteUnobtained,true,false,83,7); + } + else if(this._type == 10) + { + this._bar.loadGraphic(param6 ? barSprite : barSpriteUnobtained,true,false,83,7); + } + this._bg.loadGraphic(bgSprite,false,false,85,15); + this._bar.frame = Data[this._skill][this._offset]; + this.add(this._bar); + this._diamond = new ArcSprite(this._bar.width - 8,3); + this._diamond.loadGraphic(diamondsSprite,true,false,8,8); + this._diamond.frame = param6 ? 1 : 5; + this._diamond.alpha = param6 ? 1 : 0.5; + this.add(this._diamond); + this._cost = new FlxBitmapText(this._diamond.x - 48,4,Fonts.font(Fonts.OUTLINE_BLUE_S),"","right",40,true); + this.add(this._cost); + var _loc7_:String = param6 ? this.getName(param3,param4) : "Unknown"; + this._name = new FlxBitmapText(0,4,Fonts.font(param6 ? Fonts.OUTLINE_BLUE_S : Fonts.OUTLINE_BLACK_S),_loc7_.toUpperCase(),"left",100,true); + if(!param6) + { + this._name.alpha = 0.5; + } + this.add(this._name); + this.sync(); + setAll("scrollFactor",new FlxPoint(0,0)); + } + + public function sync() : void + { + var _loc1_:int = this.getCost(this._skill,this._offset); + this._bar.frame = Data[this._skill][this._offset]; + if(this._obtained) + { + this._cost.text = _loc1_ == -1 ? "" : _loc1_.toString(); + } + this._diamond.frame = !this._obtained ? 5 : (_loc1_ == -1 ? 4 : (_loc1_ > Data.diamonds ? 3 : 1)); + } + + public function motherfuckingSync() : void + { + if(this._type == 1) + { + this._bar.loadGraphic(singleBarSprite,true,false,83,7); + } + else if(this._type == 10) + { + this._bar.loadGraphic(barSprite,true,false,83,7); + } + this._obtained = true; + this._bar.frame = Data[this._skill][this._offset]; + this._name.font = Fonts.font(Fonts.OUTLINE_BLUE_S); + this._name.text = this.getName(this._skill,this._offset); + this._name.alpha = 1; + this.sync(); + } + + override public function update() : void + { + var _loc1_:String = null; + var _loc2_:Number = NaN; + var _loc3_:Number = NaN; + var _loc4_:String = null; + var _loc5_:Array = null; + if(this._bg.hover()) + { + this._bg.alpha = 0.4; + if(FlxG.mouse.justPressed() && this._obtained) + { + if(Data[this._skill][this._offset] < this._type && Data.diamonds >= this.getCost(this._skill,this._offset)) + { + SoundSystem.play(Sound.BUY); + Data.diamonds -= this.getCost(this._skill,this._offset); + ++Data[this._skill][this._offset]; + AchievementSystem.guns(); + this.sync(); + DataSerializer.save(); + Menu.tooltip = null; + } + } + if((Menu.tooltip == null || Menu.tooltip.source != this) && this._obtained) + { + _loc1_ = null; + _loc2_ = 0; + _loc3_ = 0; + _loc4_ = this._skill.replace("gun","").toUpperCase(); + if(this._offset == 0) + { + _loc1_ = "DAMAGE"; + switch(this._skill) + { + case "primegun": + _loc5_ = Gun.PRIME_DAMAGE; + break; + case "spreadergun": + _loc5_ = Gun.SPREADER_DAMAGE; + break; + case "missilegun": + _loc5_ = Gun.MISSILE_DAMAGE; + break; + case "reboundgun": + _loc5_ = Gun.REBOUND_DAMAGE; + } + } + else if(this._offset == 1) + { + _loc1_ = "DELAY"; + switch(this._skill) + { + case "primegun": + _loc5_ = Gun.PRIME_DELAY; + break; + case "spreadergun": + _loc5_ = Gun.SPREADER_DELAY; + break; + case "missilegun": + _loc5_ = Gun.MISSILE_DELAY; + break; + case "reboundgun": + _loc5_ = Gun.REBOUND_DELAY; + } + } + if(_loc1_ != null) + { + _loc2_ = Number(_loc5_[Data[this._skill][this._offset]]); + _loc3_ = Data[this._skill][this._offset] < 10 ? Number(_loc5_[Data[this._skill][this._offset] + 1]) : Number(null); + } + Menu.tooltip = new MenuTooltip(this._bg.x + this._bg.width / 2,this._bg.y,this.getName(this._skill,this._offset),this.getDescription(this._skill,this._offset),_loc1_,_loc2_,_loc3_); + Menu.tooltip.source = this; + } + Menu.hovering = true; + } + else + { + this._bg.alpha = 0.17; + } + super.update(); + } + + private function getCost(param1:String, param2:int) : int + { + var _loc3_:int = int(Data[param1][param2]); + if(param2 == 0) + { + return _loc3_ == 10 ? -1 : int(COSTS[_loc3_]); + } + if(param2 == 1) + { + return _loc3_ == 10 ? -1 : int(COSTS[_loc3_]); + } + if(param2 == 2) + { + return _loc3_ == 1 ? -1 : SPECIAL_COST; + } + if(param2 == 3) + { + return _loc3_ == 1 ? -1 : SPECIAL_COST; + } + return -1; + } + + private function getDescription(param1:String, param2:int) : String + { + if(param2 == 0) + { + return "Increases damage done"; + } + if(param2 == 1) + { + return "Increases firing rate"; + } + if(param2 == 2) + { + switch(param1) + { + case "primegun": + return "Adds a 30% chance of double damage"; + case "spreadergun": + return "Shoots 5 bullets instead of 3"; + case "missilegun": + return "Missiles obsorb enemy projectiles"; + case "reboundgun": + return "Rebound bullets bounce three times"; + } + } + else if(param2 == 3) + { + switch(param1) + { + case "primegun": + return "Shoots 2 bullets side by side"; + case "spreadergun": + return "Doubles the damage of your center spreader bullet"; + case "missilegun": + return "Missiles explode into 6 bullets on contact"; + case "reboundgun": + return "Rebound bullets bounce off enemies"; + } + } + return "SHIT"; + } + + private function getName(param1:String, param2:int) : String + { + if(param2 == 0) + { + return "POWER"; + } + if(param2 == 1) + { + return "SPEED"; + } + if(param2 == 2) + { + switch(param1) + { + case "primegun": + return "CRITICAL"; + case "spreadergun": + return "SPREAD"; + case "missilegun": + return "ABSORB"; + case "reboundgun": + return "TRIPLE"; + } + } + else if(param2 == 3) + { + switch(param1) + { + case "primegun": + return "TWIN"; + case "spreadergun": + return "FOCUS"; + case "missilegun": + return "SHRAPNEL"; + case "reboundgun": + return "ENEMY"; + } + } + return "FUCK"; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_barSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_barSprite.as new file mode 100644 index 0000000..caeeb44 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_barSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/297_com.arc.dh.menu.GunComponentBar_barSprite.png")] + public class GunComponentBar_barSprite extends BitmapAsset + { + + public function GunComponentBar_barSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_barSpriteUnobtained.as b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_barSpriteUnobtained.as new file mode 100644 index 0000000..1b1a2a0 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_barSpriteUnobtained.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/80_com.arc.dh.menu.GunComponentBar_barSpriteUnobtained.png")] + public class GunComponentBar_barSpriteUnobtained extends BitmapAsset + { + + public function GunComponentBar_barSpriteUnobtained() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_bgSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_bgSprite.as new file mode 100644 index 0000000..64287dd --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_bgSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/75_com.arc.dh.menu.GunComponentBar_bgSprite.png")] + public class GunComponentBar_bgSprite extends BitmapAsset + { + + public function GunComponentBar_bgSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_diamondsSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_diamondsSprite.as new file mode 100644 index 0000000..66c2975 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_diamondsSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/146.png")] + public class GunComponentBar_diamondsSprite extends BitmapAsset + { + + public function GunComponentBar_diamondsSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_singleBarSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_singleBarSprite.as new file mode 100644 index 0000000..0e2a699 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_singleBarSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/226_com.arc.dh.menu.GunComponentBar_singleBarSprite.png")] + public class GunComponentBar_singleBarSprite extends BitmapAsset + { + + public function GunComponentBar_singleBarSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_singleBarSpriteUnobtained.as b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_singleBarSpriteUnobtained.as new file mode 100644 index 0000000..4a8cf7f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponentBar_singleBarSpriteUnobtained.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/136_com.arc.dh.menu.GunComponentBar_singleBarSpriteUnobtained.png")] + public class GunComponentBar_singleBarSpriteUnobtained extends BitmapAsset + { + + public function GunComponentBar_singleBarSpriteUnobtained() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponent_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponent_sprite.as new file mode 100644 index 0000000..ab672ce --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/GunComponent_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/90_com.arc.dh.menu.GunComponent_sprite.png")] + public class GunComponent_sprite extends BitmapAsset + { + + public function GunComponent_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/Menu.as b/research/inner_decompiled/scripts/com/arc/dh/menu/Menu.as new file mode 100644 index 0000000..3f466c5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/Menu.as @@ -0,0 +1,293 @@ +package com.arc.dh.menu +{ + import com.arc.dh.state.Tooltip; + import com.arc.dh.state.UI; + import com.arc.dh.util.Data; + import com.arc.dh.util.DataSerializer; + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcButtonGroup; + import com.arc.flixel.ArcGroup; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class Menu extends ArcGroup + { + + public static var tooltip:Tooltip; + + public static const optionsButton:Class = Menu_optionsButton; + + public static const backButton:Class = Menu_backButton; + + public static const closeButton:Class = Menu_closeButton; + + private static const FADE_SPEED:int = 7; + + public static var hovering:Boolean = false; + + private var spriteCharacterButton:Class; + + private var spriteStatisticsButton:Class; + + private var _pane:MenuPane; + + private var _paneCharacter:MenuPane; + + private var _paneStatistics:MenuPane; + + private var _paneMessageLog:MenuPane; + + private var _buttons:ArcButtonGroup; + + private var _open:Boolean = false; + + private var _fading:Boolean = false; + + private var _characterButton:ArcButton; + + private var _statisticsButton:ArcButton; + + private var _closeButton:ArcButton; + + private var _backButton:ArcButton; + + private var _optionsButton:ArcButton; + + public var options:OptionsMenu; + + public var inOptions:Boolean = false; + + public var confirmation:ConfirmationMenu; + + public var inConfirmation:Boolean = false; + + public function Menu() + { + var pane:MenuPane = null; + this.spriteCharacterButton = Menu_spriteCharacterButton; + this.spriteStatisticsButton = Menu_spriteStatisticsButton; + this._paneCharacter = new CharacterPane(); + this._paneStatistics = new StatisticsPane(); + this._paneMessageLog = new MessageLogPane(); + this._buttons = new ArcButtonGroup(); + super(); + this._pane = this._paneCharacter; + for each(pane in [this._paneCharacter,this._paneStatistics]) + { + pane.update(); + } + add(this._buttons); + this._buttons.addButton(this._characterButton = new ArcButton(52,219,128,17,this.spriteCharacterButton).callback(function():void + { + _pane = _paneCharacter; + _pane.sync(); + }).select()); + this._buttons.addButton(this._statisticsButton = new ArcButton(52 + 127,219,128,17,this.spriteStatisticsButton).callback(function():void + { + _pane = _paneStatistics; + _pane.sync(); + })); + this._optionsButton = new ArcButton(313,204,34,29,optionsButton).selectable(false).callback(function():void + { + inOptions = true; + }); + this.add(this._optionsButton); + this.options = new OptionsMenu(function():void + { + inOptions = false; + }); + this._backButton = new ArcButton(13,207,33,23,backButton).selectable(false).callback(function():void + { + toMenu(); + }); + this.add(this._backButton); + this._closeButton = new ArcButton(318,5,32,11,closeButton).selectable(false).callback(function():void + { + Data.state.toggleMenu(); + }); + this.add(this._closeButton); + this.confirmation = new ConfirmationMenu(this); + this.setAlpha(false); + setAll("scrollFactor",new FlxPoint(0,0)); + alpha = 0; + } + + override public function update() : void + { + var _loc1_:Array = null; + var _loc2_:Array = null; + var _loc3_:int = 0; + var _loc4_:ArcButton = null; + var _loc5_:Array = null; + if(this.inOptions) + { + if(FlxG.keys.justPressed("ESCAPE")) + { + FlxG.keys.update(); + this.inOptions = false; + DataSerializer.save(); + } + this.options.update(); + _loc1_ = [this.options.mouse,this.options.kb1,this.options.kb2,this.options.reset]; + _loc2_ = [["Mouse Controls","Use A/D or LEFT/RIGHT to move, W or SPACE or UP to jump, MOUSE to aim, MOUSE BUTTON to shoot."],["Keyboard Controls","Use A/D to move, W or SPACE to jump, ARROWS to aim and shoot."],["Inverse Keyboard","Use LEFT/RIGHT to move, UP or SPACE to jump, A/S/D/W to aim and shoot."],["Reset All Data","This will clear all your saved data and restart you from scratch. Hold shift and click this button to clear data."]]; + _loc3_ = 0; + while(_loc3_ < _loc1_.length) + { + _loc4_ = _loc1_[_loc3_] as ArcButton; + _loc5_ = _loc2_[_loc3_] as Array; + if(_loc4_.hover()) + { + if(tooltip == null || tooltip.source != _loc4_) + { + tooltip = new MenuTooltip(_loc4_.x + _loc4_.width / 2,_loc4_.y,_loc5_[0],_loc5_[1]); + tooltip.source = _loc4_; + } + hovering = true; + } + _loc3_++; + } + if(!hovering && tooltip != null) + { + tooltip = null; + } + hovering = false; + return; + } + if(this.inConfirmation) + { + this.confirmation.update(); + return; + } + if(this._fading) + { + if(this._open) + { + _alpha += FlxG.elapsed * FADE_SPEED; + if(_alpha >= 1) + { + _alpha = 1; + this._fading = false; + Data.state.setMenu(this._open); + } + } + else + { + _alpha -= FlxG.elapsed * FADE_SPEED; + if(_alpha <= 0) + { + _alpha = 0; + this._fading = false; + Data.state.setMenu(this._open); + } + } + this.setAlpha(); + } + if(this._pane == this._paneMessageLog) + { + this._statisticsButton.visible = this._characterButton.visible = this._optionsButton.visible = this._backButton.visible = false; + } + else + { + this._statisticsButton.visible = this._characterButton.visible = this._optionsButton.visible = this._backButton.visible = true; + } + this._pane.update(); + super.update(); + if(!hovering && tooltip != null) + { + tooltip = null; + } + hovering = false; + } + + public function toMenu() : void + { + this.inConfirmation = true; + } + + public function sync(param1:Boolean = false) : void + { + } + + override public function draw() : void + { + this._pane.draw(); + super.draw(); + if(this.inOptions) + { + this.options.draw(); + if(tooltip != null) + { + tooltip.draw(); + } + return; + } + if(this.inConfirmation) + { + this.confirmation.draw(); + return; + } + if(tooltip != null) + { + tooltip.draw(); + } + } + + public function fade(param1:Boolean, param2:int = 0) : void + { + this._fading = true; + this._open = param1; + if(param1) + { + if(param2 == 1) + { + this._characterButton.select(true,true); + this.setAlpha(); + this._paneStatistics.alpha = 1; + this._paneStatistics.sync(); + } + else if(param2 == 2) + { + this._statisticsButton.select(true,true); + this.setAlpha(); + this._paneCharacter.alpha = 1; + this._paneCharacter.sync(); + } + else if(param2 == 3) + { + this._pane = this._paneMessageLog; + this._pane.sync(); + this.setAlpha(); + } + else if(this._pane == this._paneMessageLog) + { + this._characterButton.select(true,true); + this.setAlpha(); + this._paneStatistics.alpha = 1; + this._paneStatistics.sync(); + } + else + { + this._pane.sync(); + } + Data.state.setMenu(this._open); + } + } + + private function setAlpha(param1:Boolean = true) : void + { + alpha = _alpha; + this._pane.alpha = _alpha; + var _loc2_:UI = Data.state.ui; + if(_loc2_ != null && param1) + { + Data.state.ui.alpha = 1 - _alpha; + } + } + + public function getAlpha() : Number + { + return _alpha; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/MenuPane.as b/research/inner_decompiled/scripts/com/arc/dh/menu/MenuPane.as new file mode 100644 index 0000000..2bbb086 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/MenuPane.as @@ -0,0 +1,25 @@ +package com.arc.dh.menu +{ + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxPoint; + + public class MenuPane extends ArcGroup + { + + private var background:ArcSprite; + + public function MenuPane(param1:Number, param2:Number, param3:Class) + { + super(); + this.background = new ArcSprite(param1,param2,param3); + this.add(this.background); + setAll("scrollFactor",new FlxPoint(0,0)); + } + + public function sync(param1:Boolean = false) : void + { + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/MenuTooltip.as b/research/inner_decompiled/scripts/com/arc/dh/menu/MenuTooltip.as new file mode 100644 index 0000000..86c64c6 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/MenuTooltip.as @@ -0,0 +1,87 @@ +package com.arc.dh.menu +{ + import com.arc.dh.state.Tooltip; + import com.arc.dh.util.Fonts; + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class MenuTooltip extends Tooltip + { + + private static const spriteTooltipArrow:Class = MenuTooltip_spriteTooltipArrow; + + private static const TOOLTIP_WIDTH:int = 120; + + private static const TOOLTIP_TEXT_WIDTH:int = 112; + + private static const MINIMUM_HEIGHT:int = 5; + + public var bsource:ArcButton = null; + + private var _contents:ArcGroup = new ArcGroup(); + + public function MenuTooltip(param1:Number, param2:Number, param3:String, param4:String, param5:String = null, param6:Number = -1, param7:Number = -1) + { + var _loc10_:FlxBitmapText = null; + var _loc14_:ArcSprite = null; + var _loc8_:int = param1 - TOOLTIP_WIDTH / 2; + if(_loc8_ < 10) + { + _loc8_ = 10; + } + else if(_loc8_ + TOOLTIP_WIDTH > FlxG.width - 10) + { + _loc8_ = FlxG.width - TOOLTIP_WIDTH - 10; + } + super(_loc8_,param2); + var _loc9_:int = 5; + _loc10_ = new FlxBitmapText(4,_loc9_,Fonts.font(Fonts.OUTLINE_GRADIENT),param3.toUpperCase(),"center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc10_); + _loc9_ += _loc10_.height + 1; + _loc10_ = new FlxBitmapText(4,_loc9_,Fonts.font(Fonts.OUTLINE_BLACK),param4.toUpperCase(),"center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc10_); + _loc9_ += _loc10_.height + 2; + if(param5 != null) + { + _loc14_ = new ArcSprite(6,_loc9_); + _loc14_.makeGraphic(TOOLTIP_TEXT_WIDTH - 2,1,2868903935); + this._contents.add(_loc14_); + _loc9_ += 3; + _loc10_ = new FlxBitmapText(4,_loc9_,Fonts.font(Fonts.OUTLINE_GRADIENT_S),"CURRENT " + param5 + ": " + param6 + (param5 == "DELAY" ? " SEC" : ""),"center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc10_); + _loc9_ += _loc10_.height + 2; + if(param7 > 0) + { + _loc10_ = new FlxBitmapText(4,_loc9_,Fonts.font(Fonts.OUTLINE_GRADIENT_S),"NEXT " + param5 + ": " + param7 + (param5 == "DELAY" ? " SEC" : ""),"center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc10_); + _loc9_ += _loc10_.height + 2; + } + } + var _loc11_:int = _loc9_ + 2; + var _loc12_:int = param1 - _loc8_ - 8; + var _loc13_:ArcSprite = new ArcSprite(_loc12_,_loc11_ - 2); + _loc13_.loadGraphic(spriteTooltipArrow,false,true,17,10); + this._contents.add(_loc13_); + createBackground(TOOLTIP_WIDTH,_loc11_); + this.add(this._contents); + this._contents.setAll("scrollFactor",new FlxPoint(0,0)); + if(param2 - _loc11_ - 5 < MINIMUM_HEIGHT) + { + shift(this._contents,0,24); + shift(_background,0,24); + _loc13_.y -= _loc11_ + 6; + _loc13_.scale.y = -1; + } + else + { + shift(this._contents,0,-_loc11_ - 5); + shift(_background,0,-_loc11_ - 5); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/MenuTooltip_spriteTooltipArrow.as b/research/inner_decompiled/scripts/com/arc/dh/menu/MenuTooltip_spriteTooltipArrow.as new file mode 100644 index 0000000..1e8b930 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/MenuTooltip_spriteTooltipArrow.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/68.png")] + public class MenuTooltip_spriteTooltipArrow extends BitmapAsset + { + + public function MenuTooltip_spriteTooltipArrow() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/Menu_backButton.as b/research/inner_decompiled/scripts/com/arc/dh/menu/Menu_backButton.as new file mode 100644 index 0000000..d539c8f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/Menu_backButton.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/241_com.arc.dh.menu.Menu_backButton.png")] + public class Menu_backButton extends BitmapAsset + { + + public function Menu_backButton() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/Menu_closeButton.as b/research/inner_decompiled/scripts/com/arc/dh/menu/Menu_closeButton.as new file mode 100644 index 0000000..78ea9a3 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/Menu_closeButton.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/264_com.arc.dh.menu.Menu_closeButton.png")] + public class Menu_closeButton extends BitmapAsset + { + + public function Menu_closeButton() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/Menu_optionsButton.as b/research/inner_decompiled/scripts/com/arc/dh/menu/Menu_optionsButton.as new file mode 100644 index 0000000..61941d4 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/Menu_optionsButton.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/84.png")] + public class Menu_optionsButton extends BitmapAsset + { + + public function Menu_optionsButton() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/Menu_spriteCharacterButton.as b/research/inner_decompiled/scripts/com/arc/dh/menu/Menu_spriteCharacterButton.as new file mode 100644 index 0000000..a636fbf --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/Menu_spriteCharacterButton.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/144_com.arc.dh.menu.Menu_spriteCharacterButton.png")] + public class Menu_spriteCharacterButton extends BitmapAsset + { + + public function Menu_spriteCharacterButton() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/Menu_spriteStatisticsButton.as b/research/inner_decompiled/scripts/com/arc/dh/menu/Menu_spriteStatisticsButton.as new file mode 100644 index 0000000..6372a4f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/Menu_spriteStatisticsButton.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/303_com.arc.dh.menu.Menu_spriteStatisticsButton.png")] + public class Menu_spriteStatisticsButton extends BitmapAsset + { + + public function Menu_spriteStatisticsButton() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/MessageLogPane.as b/research/inner_decompiled/scripts/com/arc/dh/menu/MessageLogPane.as new file mode 100644 index 0000000..5af3526 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/MessageLogPane.as @@ -0,0 +1,69 @@ +package com.arc.dh.menu +{ + import com.arc.dh.util.Fonts; + import com.arc.dh.util.text.Avatar; + import com.arc.dh.util.text.TextSystem; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxPoint; + + public class MessageLogPane extends MenuPane + { + + private static const sprite:Class = MessageLogPane_sprite; + + private var _messages:ArcGroup = new ArcGroup(); + + public function MessageLogPane() + { + super(1,1,sprite); + this.sync(); + setAll("scrollFactor",new FlxPoint(0,0)); + } + + override public function sync(param1:Boolean = false) : void + { + var _loc5_:FlxBitmapText = null; + var _loc6_:ArcSprite = null; + var _loc2_:Array = TextSystem.instance.recent; + this._messages = new ArcGroup(); + var _loc3_:int = 24; + var _loc4_:* = int(_loc2_.length - 1); + while(_loc4_ > -1) + { + _loc5_ = new FlxBitmapText(36,_loc3_,Fonts.font(Fonts.OUTLINE_BLACK),_loc2_[_loc4_][1].toUpperCase(),"left",308,true); + if(_loc2_[_loc4_][0] == Avatar.PROFESSOR) + { + _loc6_ = new ArcSprite(16,_loc3_,Avatar.PROFESSOR_SPRITE); + } + else + { + _loc6_ = new ArcSprite(16,_loc3_,Avatar.SAGA_SPRITE); + } + _loc3_ += Math.max(_loc5_.height,_loc6_.height) + 4; + if(_loc3_ >= 221) + { + break; + } + this._messages.add(_loc6_); + this._messages.add(_loc5_); + _loc4_--; + } + this._messages.setAll("scrollFactor",new FlxPoint(0,0)); + } + + override public function update() : void + { + this._messages.update(); + super.update(); + } + + override public function draw() : void + { + super.draw(); + this._messages.draw(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/MessageLogPane_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/MessageLogPane_sprite.as new file mode 100644 index 0000000..5258971 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/MessageLogPane_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/218_com.arc.dh.menu.MessageLogPane_sprite.png")] + public class MessageLogPane_sprite extends BitmapAsset + { + + public function MessageLogPane_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu.as b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu.as new file mode 100644 index 0000000..438a8c7 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu.as @@ -0,0 +1,136 @@ +package com.arc.dh.menu +{ + import com.arc.dh.state.MainMenu; + import com.arc.dh.util.Data; + import com.arc.dh.util.DataSerializer; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcButtonGroup; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class OptionsMenu extends ArcGroup + { + + public static const resetButton:Class = OptionsMenu_resetButton; + + private var windowSprite:Class; + + private var mouseSprite:Class; + + private var kb1Sprite:Class; + + private var kb2Sprite:Class; + + private var slowSprite:Class; + + private var medSprite:Class; + + private var fastSprite:Class; + + private var onSprite:Class; + + private var offSprite:Class; + + private var closeSprite:Class; + + public var falsify:Function; + + public var mouse:ArcButton; + + public var kb1:ArcButton; + + public var kb2:ArcButton; + + public var reset:ArcButton; + + public function OptionsMenu(param1:Function) + { + var window:ArcSprite; + var controlGroup:ArcButtonGroup; + var textGroup:ArcButtonGroup; + var soundEffects:ArcButtonGroup; + var music:ArcButtonGroup; + var falsify:Function = param1; + this.windowSprite = OptionsMenu_windowSprite; + this.mouseSprite = OptionsMenu_mouseSprite; + this.kb1Sprite = OptionsMenu_kb1Sprite; + this.kb2Sprite = OptionsMenu_kb2Sprite; + this.slowSprite = OptionsMenu_slowSprite; + this.medSprite = OptionsMenu_medSprite; + this.fastSprite = OptionsMenu_fastSprite; + this.onSprite = OptionsMenu_onSprite; + this.offSprite = OptionsMenu_offSprite; + this.closeSprite = OptionsMenu_closeSprite; + super(); + this.falsify = falsify; + window = new ArcSprite(31,65,this.windowSprite); + this.add(window); + controlGroup = new ArcButtonGroup(); + this.add(this.mouse = new ArcButton(166,window.y + 22,45,13,this.mouseSprite).setGroup(controlGroup,true).selectable(true).callback(function():void + { + Data.control = Data.CONTROL_MOUSE; + }).select(Data.control == Data.CONTROL_MOUSE)); + this.add(this.kb1 = new ArcButton(216,window.y + 22,45,13,this.kb1Sprite).setGroup(controlGroup,true).selectable(true).callback(function():void + { + Data.control = Data.CONTROL_KEYBOARD; + }).select(Data.control == Data.CONTROL_KEYBOARD)); + this.add(this.kb2 = new ArcButton(266,window.y + 22,45,13,this.kb2Sprite).setGroup(controlGroup,true).selectable(true).callback(function():void + { + Data.control = Data.CONTROL_KEYBOARDI; + }).select(Data.control == Data.CONTROL_KEYBOARDI)); + textGroup = new ArcButtonGroup(); + this.add(new ArcButton(166,window.y + 36,45,13,this.slowSprite).setGroup(textGroup,true).selectable(true).callback(function():void + { + Data.textspeed = Data.SPEED_SLOW; + }).select(Data.textspeed == Data.SPEED_SLOW)); + this.add(new ArcButton(216,window.y + 36,45,13,this.medSprite).setGroup(textGroup,true).selectable(true).callback(function():void + { + Data.textspeed = Data.SPEED_MED; + }).select(Data.textspeed == Data.SPEED_MED)); + this.add(new ArcButton(266,window.y + 36,45,13,this.fastSprite).setGroup(textGroup,true).selectable(true).callback(function():void + { + Data.textspeed = Data.SPEED_FAST; + }).select(Data.textspeed == Data.SPEED_FAST)); + soundEffects = new ArcButtonGroup(); + this.add(new ArcButton(191,window.y + 50,45,13,this.offSprite).setGroup(soundEffects,true).selectable(true).callback(function():void + { + SoundSystem.muteSounds(); + }).select(Data.sound == Data.OFF)); + this.add(new ArcButton(241,window.y + 50,45,13,this.onSprite).setGroup(soundEffects,true).selectable(true).callback(function():void + { + SoundSystem.unmuteSounds(); + }).select(Data.sound == Data.ON)); + music = new ArcButtonGroup(); + this.add(new ArcButton(191,window.y + 64,45,13,this.offSprite).setGroup(music,true).selectable(true).callback(function():void + { + SoundSystem.mute(); + }).select(Data.music == Data.OFF)); + this.add(new ArcButton(241,window.y + 64,45,13,this.onSprite).setGroup(music,true).selectable(true).callback(function():void + { + SoundSystem.unmute(); + }).select(Data.music == Data.ON)); + this.add(new ArcButton(window.x + 52,window.y + 95,193,16,this.closeSprite).selectable(false).callback(function():void + { + DataSerializer.save(); + falsify(); + })); + this.add(this.reset = new ArcButton(window.x + 10,window.y + 82,33,23,resetButton).selectable(false).callback(function():void + { + if(FlxG.keys.SHIFT) + { + DataSerializer.reset(); + FlxG.fade(4278190080,0.25,function():void + { + FlxG.mouse.hide(); + FlxG.switchState(new MainMenu()); + }); + } + })); + setAll("scrollFactor",new FlxPoint(0,0)); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_closeSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_closeSprite.as new file mode 100644 index 0000000..69c3e82 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_closeSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/118_com.arc.dh.menu.OptionsMenu_closeSprite.png")] + public class OptionsMenu_closeSprite extends BitmapAsset + { + + public function OptionsMenu_closeSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_fastSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_fastSprite.as new file mode 100644 index 0000000..af9864e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_fastSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/167_com.arc.dh.menu.OptionsMenu_fastSprite.png")] + public class OptionsMenu_fastSprite extends BitmapAsset + { + + public function OptionsMenu_fastSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_kb1Sprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_kb1Sprite.as new file mode 100644 index 0000000..6035a04 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_kb1Sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/296_com.arc.dh.menu.OptionsMenu_kb1Sprite.png")] + public class OptionsMenu_kb1Sprite extends BitmapAsset + { + + public function OptionsMenu_kb1Sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_kb2Sprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_kb2Sprite.as new file mode 100644 index 0000000..afc891a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_kb2Sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/169_com.arc.dh.menu.OptionsMenu_kb2Sprite.png")] + public class OptionsMenu_kb2Sprite extends BitmapAsset + { + + public function OptionsMenu_kb2Sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_medSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_medSprite.as new file mode 100644 index 0000000..9944f3a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_medSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/177_com.arc.dh.menu.OptionsMenu_medSprite.png")] + public class OptionsMenu_medSprite extends BitmapAsset + { + + public function OptionsMenu_medSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_mouseSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_mouseSprite.as new file mode 100644 index 0000000..bdf2287 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_mouseSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/135_com.arc.dh.menu.OptionsMenu_mouseSprite.png")] + public class OptionsMenu_mouseSprite extends BitmapAsset + { + + public function OptionsMenu_mouseSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_offSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_offSprite.as new file mode 100644 index 0000000..800a3a7 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_offSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/291_com.arc.dh.menu.OptionsMenu_offSprite.png")] + public class OptionsMenu_offSprite extends BitmapAsset + { + + public function OptionsMenu_offSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_onSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_onSprite.as new file mode 100644 index 0000000..7968fef --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_onSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/275_com.arc.dh.menu.OptionsMenu_onSprite.png")] + public class OptionsMenu_onSprite extends BitmapAsset + { + + public function OptionsMenu_onSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_resetButton.as b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_resetButton.as new file mode 100644 index 0000000..d165e87 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_resetButton.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/82_com.arc.dh.menu.OptionsMenu_resetButton.png")] + public class OptionsMenu_resetButton extends BitmapAsset + { + + public function OptionsMenu_resetButton() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_slowSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_slowSprite.as new file mode 100644 index 0000000..81f5a73 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_slowSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/248_com.arc.dh.menu.OptionsMenu_slowSprite.png")] + public class OptionsMenu_slowSprite extends BitmapAsset + { + + public function OptionsMenu_slowSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_windowSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_windowSprite.as new file mode 100644 index 0000000..6fb184e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/OptionsMenu_windowSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/137_com.arc.dh.menu.OptionsMenu_windowSprite.png")] + public class OptionsMenu_windowSprite extends BitmapAsset + { + + public function OptionsMenu_windowSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/SkillMeter.as b/research/inner_decompiled/scripts/com/arc/dh/menu/SkillMeter.as new file mode 100644 index 0000000..36f3d29 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/SkillMeter.as @@ -0,0 +1,126 @@ +package com.arc.dh.menu +{ + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Data; + import com.arc.dh.util.DataSerializer; + import com.arc.dh.util.Fonts; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class SkillMeter extends ArcGroup + { + + private static const barSprite:Class = SkillMeter_barSprite; + + private static const diamondSprite:Class = SkillMeter_diamondSprite; + + private static const COSTS:Array = [50,100,175,250,350,450,600,800,1200,1500,-1]; + + private var _bg:ArcSprite; + + private var _bar:ArcSprite; + + private var _skill:String; + + private var _name:FlxBitmapText; + + private var _diamond:ArcSprite; + + private var _cost:FlxBitmapText; + + public function SkillMeter(param1:Number, param2:Number, param3:String) + { + super(param1,param2); + this._skill = param3; + this._bg = new ArcSprite(-2,0); + this._bg.makeGraphic(127,7,4294967295); + this._bg.alpha = 0.1; + this.add(this._bg); + this._bar = new ArcSprite(36,0); + this._bar.loadGraphic(barSprite,true,false,53,7); + this._bar.frame = Math.random() * 10; + this.add(this._bar); + this._name = new FlxBitmapText(0,1,Fonts.font(Fonts.SMALL_WHITE),param3.toUpperCase(),"left",1000); + this._name.alpha = 0.9; + this.add(this._name); + this._diamond = new ArcSprite(115,-1); + this._diamond.loadGraphic(diamondSprite,true,false,8,8); + this.add(this._diamond); + this._cost = new FlxBitmapText(13,1,Fonts.font(Fonts.SMALL_WHITE),param3,"right",100); + this.add(this._cost); + setAll("scrollFactor",new FlxPoint(0,0)); + this.sync(); + } + + private function getDescription() : String + { + switch(this._skill) + { + case "agility": + return "Increases movement speed"; + case "jump": + return "Increases jump height"; + case "attract": + return "Increases diamond attraction"; + case "recover": + return "Increases speed of recover after knockback"; + case "aegis": + return "Increases invulnerability time after being hit"; + case "defense": + return "Decreases damage from higher level enemies"; + default: + return "THE FUCK!?"; + } + } + + override public function update() : void + { + if(this._bg.hover()) + { + this._bg.alpha = 0.4; + if(FlxG.mouse.justPressed()) + { + if(Data[this._skill] < 10 && Data.diamonds >= this.cost()) + { + SoundSystem.play(Sound.BUY); + Data.diamonds -= this.cost(); + ++Data[this._skill]; + this.sync(); + AchievementSystem.skills(); + DataSerializer.save(); + } + } + if(Menu.tooltip == null || Menu.tooltip.source != this) + { + Menu.tooltip = new MenuTooltip(this._bg.x + this._bg.width / 2,this._bg.y - 1,this._skill.toUpperCase(),this.getDescription().toUpperCase()); + Menu.tooltip.source = this; + } + Menu.hovering = true; + } + else + { + this._bg.alpha = 0.1; + } + super.update(); + } + + public function sync() : void + { + this._bar.frame = Data[this._skill]; + var _loc1_:int = this.cost(); + this._cost.text = _loc1_ == -1 ? "" : _loc1_.toString(); + this._diamond.frame = _loc1_ == -1 ? 4 : (_loc1_ > Data.diamonds ? 3 : 1); + } + + private function cost() : int + { + return COSTS[Data[this._skill]]; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/SkillMeter_barSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/SkillMeter_barSprite.as new file mode 100644 index 0000000..98f9f67 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/SkillMeter_barSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/111_com.arc.dh.menu.SkillMeter_barSprite.png")] + public class SkillMeter_barSprite extends BitmapAsset + { + + public function SkillMeter_barSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/SkillMeter_diamondSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/SkillMeter_diamondSprite.as new file mode 100644 index 0000000..f536c26 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/SkillMeter_diamondSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/146.png")] + public class SkillMeter_diamondSprite extends BitmapAsset + { + + public function SkillMeter_diamondSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter.as b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter.as new file mode 100644 index 0000000..dc7cd34 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter.as @@ -0,0 +1,143 @@ +package com.arc.dh.menu +{ + import com.arc.dh.state.Chapter; + import com.arc.dh.util.Data; + import com.arc.dh.util.Fonts; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxPoint; + + public class StatisticsChapter extends ArcGroup + { + + public static const bgSprite:Class = StatisticsChapter_bgSprite; + + public static const heartCrystalObtained:Class = StatisticsChapter_heartCrystalObtained; + + public static const heartCrystalUnobtained:Class = StatisticsChapter_heartCrystalUnobtained; + + public static const redDiamondObtained:Class = StatisticsChapter_redDiamondObtained; + + public static const redDiamondUnobtained:Class = StatisticsChapter_redDiamondUnobtained; + + private static const startHearts:Array = [0,3,6,9,11,13,15]; + + private static const HEARTS:Array = [[0,1,14],[2,3,15],[4,5,16],[6,7],[8,9],[10,11],[12,13]]; + + private var bg:ArcSprite; + + private var chapter:int; + + private var badge:ArcSprite; + + private var time:FlxBitmapText; + + private var hearts:Array = new Array(); + + private var diamonds:Array = new Array(); + + public function StatisticsChapter(param1:Number, param2:Number, param3:int) + { + var _loc7_:ArcSprite = null; + var _loc8_:ArcSprite = null; + super(param1,param2); + this.chapter = param3; + this.bg = new ArcSprite(-2,-2,bgSprite); + this.add(this.bg); + this.badge = new ArcSprite(0,-1); + this.badge.loadGraphic(Chapter.badgesSprite,true,false,16,9); + this.add(this.badge); + this.time = new FlxBitmapText(64,0,Fonts.font(Fonts.OUTLINE_GRADIENT_S),"4:27","right",50); + this.add(this.time); + var _loc4_:int = param3 < 3 ? 3 : 2; + var _loc5_:int = 0; + while(_loc5_ < _loc4_) + { + _loc7_ = new ArcSprite(122 + _loc5_ * 12 + (_loc4_ == 2 ? 6 : 0),-1); + this.add(_loc7_); + this.hearts.push(_loc7_); + _loc5_++; + } + var _loc6_:int = 5; + _loc5_ = 0; + while(_loc5_ < _loc6_) + { + _loc8_ = new ArcSprite(164 + _loc5_ * 10,-2); + this.add(_loc8_); + this.diamonds.push(_loc8_); + _loc5_++; + } + this.sync(); + setAll("scrollFactor",new FlxPoint(0,0)); + } + + override public function update() : void + { + if(this.bg.hover()) + { + this.bg.alpha = 1; + } + else + { + this.bg.alpha = 0.3; + } + super.update(); + } + + public function sync() : void + { + var _loc1_:int = 0; + var _loc4_:String = null; + var _loc5_:String = null; + var _loc6_:ArcSprite = null; + var _loc7_:ArcSprite = null; + this.badge.frame = Data.chapters[this.chapter][0] == 0 ? 4 : 2; + if(Data.chapters[this.chapter][1] != 0) + { + _loc4_ = Data.duration(0,Data.chapters[this.chapter][1]); + _loc5_ = _loc4_.substr(_loc4_.indexOf(":") + 1); + this.time.text = _loc5_; + } + else + { + this.time.text = "--:--"; + } + _loc1_ = 0; + while(_loc1_ < this.diamonds.length) + { + _loc6_ = this.diamonds[_loc1_] as ArcSprite; + if(Data.hasRed(this.chapter + 1,4 - _loc1_)) + { + _loc6_.loadGraphic(redDiamondObtained,true,false,10,10); + _loc6_.addAnimation("glow",[0,1,2,3,4,5,4,3,2,1],5,true); + _loc6_.play("glow"); + } + else + { + _loc6_.loadGraphic(redDiamondUnobtained,false,false,10,10); + _loc6_.frame = 0; + } + _loc1_++; + } + var _loc2_:Array = HEARTS[this.chapter]; + var _loc3_:int = 0; + for each(_loc1_ in _loc2_) + { + _loc7_ = this.hearts[_loc3_] as ArcSprite; + if(Data.heartcrystals[_loc1_] == 1) + { + _loc7_.loadGraphic(heartCrystalObtained,false,false); + _loc7_.frame = 0; + } + else + { + _loc7_.loadGraphic(heartCrystalUnobtained,false,false); + _loc7_.frame = 0; + } + _loc3_++; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter_bgSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter_bgSprite.as new file mode 100644 index 0000000..e6d3f2d --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter_bgSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/61_com.arc.dh.menu.StatisticsChapter_bgSprite.png")] + public class StatisticsChapter_bgSprite extends BitmapAsset + { + + public function StatisticsChapter_bgSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter_heartCrystalObtained.as b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter_heartCrystalObtained.as new file mode 100644 index 0000000..80aac62 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter_heartCrystalObtained.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/304_com.arc.dh.menu.StatisticsChapter_heartCrystalObtained.png")] + public class StatisticsChapter_heartCrystalObtained extends BitmapAsset + { + + public function StatisticsChapter_heartCrystalObtained() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter_heartCrystalUnobtained.as b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter_heartCrystalUnobtained.as new file mode 100644 index 0000000..d2d92d0 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter_heartCrystalUnobtained.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/190_com.arc.dh.menu.StatisticsChapter_heartCrystalUnobtained.png")] + public class StatisticsChapter_heartCrystalUnobtained extends BitmapAsset + { + + public function StatisticsChapter_heartCrystalUnobtained() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter_redDiamondObtained.as b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter_redDiamondObtained.as new file mode 100644 index 0000000..eb0f33b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter_redDiamondObtained.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/175_com.arc.dh.menu.StatisticsChapter_redDiamondObtained.png")] + public class StatisticsChapter_redDiamondObtained extends BitmapAsset + { + + public function StatisticsChapter_redDiamondObtained() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter_redDiamondUnobtained.as b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter_redDiamondUnobtained.as new file mode 100644 index 0000000..d480c25 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsChapter_redDiamondUnobtained.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/114_com.arc.dh.menu.StatisticsChapter_redDiamondUnobtained.png")] + public class StatisticsChapter_redDiamondUnobtained extends BitmapAsset + { + + public function StatisticsChapter_redDiamondUnobtained() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsPane.as b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsPane.as new file mode 100644 index 0000000..aa2e763 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsPane.as @@ -0,0 +1,169 @@ +package com.arc.dh.menu +{ + import Playtomic.Link; + import com.arc.dh.state.Trophy; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.Fonts; + import com.arc.flixel.ArcButton; + import org.flixel.FlxBitmapText; + import org.flixel.FlxPoint; + + public class StatisticsPane extends MenuPane + { + + private static const sprite:Class = StatisticsPane_sprite; + + private static const refreshSprite:Class = StatisticsPane_refreshSprite; + + private static const pegasSprite:Class = StatisticsPane_pegasSprite; + + private var _chapters:Array; + + private var _tiptext:FlxBitmapText; + + private var _statistics:Array; + + private var _statisticsTexts:Array; + + private var _completion:FlxBitmapText; + + private var _trophies:Array; + + private var _buttonPegas:ArcButton; + + public function StatisticsPane() + { + var refresh:ArcButton; + var i:int = 0; + var rx:int = 0; + var ry:int = 0; + var chapter:StatisticsChapter = null; + var t:Trophy = null; + this._chapters = new Array(); + this._statistics = new Array(); + this._statisticsTexts = new Array(); + this._trophies = new Array(); + super(1,1,sprite); + i = 0; + while(i < 7) + { + rx = 14; + ry = 21 + i * 13; + chapter = new StatisticsChapter(rx,ry,i); + this.add(chapter); + this._chapters.push(chapter); + i++; + } + i = 0; + while(i < AchievementSystem.achievements.length) + { + t = new Trophy(249 + i % 5 * 20,24 + Math.floor(i / 5) * 20,i); + this._trophies.push(t); + this.add(t); + i++; + } + this._tiptext = new FlxBitmapText(134,151,Fonts.font(Fonts.OUTLINE_BLACK),Tip.random(),"center",102); + this.add(this._tiptext); + refresh = new ArcButton(203,137,11,11,refreshSprite).selectable(false).callback(function():void + { + _tiptext.text = Tip.random(); + }); + this.add(refresh); + this.addStatistic("total diamonds",function():int + { + return Data.totaldiamonds; + }); + this.addStatistic("escape height",function():int + { + return Data.maxheight; + }); + this.addStatistic("enemies killed",function():int + { + return Data.enemies; + }); + this.addStatistic("upgrades",function():String + { + return Data.upgrades + "/60"; + }); + this.addStatistic("deaths",function():int + { + return Data.deaths; + }); + this.addStatistic("playtime",function():String + { + return Data.duration(0,Data.time * 1000); + }); + this.addStatistic("bullets fired",function():int + { + return Data.bullets; + }); + this.addStatistic("achievements",function():String + { + return Data.getAchievementCount() + "/45"; + }); + this._completion = new FlxBitmapText(134,126,Fonts.font(Fonts.BEVEL_YELLOW),"","center",104); + this.add(this._completion); + if(Config.RELEASE == Config.PEGAS) + { + this._buttonPegas = new ArcButton(134,196,103,17,pegasSprite).callback(function():void + { + Link.Open("http://www.pegasgames.com/","StatisticsMenu","Sponsor"); + }).selectable(false); + this.add(this._buttonPegas); + } + this.sync(); + setAll("scrollFactor",new FlxPoint(0,0)); + } + + public function clickTryAgain() : void + { + } + + public function clickMenu() : void + { + } + + override public function sync(param1:Boolean = false) : void + { + var _loc2_:StatisticsChapter = null; + var _loc3_:Array = null; + var _loc4_:Trophy = null; + var _loc5_:FlxBitmapText = null; + var _loc6_:Function = null; + for each(_loc2_ in this._chapters) + { + _loc2_.sync(); + } + this._tiptext.text = Tip.random(); + this._completion.text = Data.completion + "% COMPLETE"; + for each(_loc3_ in this._statistics) + { + _loc5_ = _loc3_[0] as FlxBitmapText; + _loc6_ = _loc3_[1] as Function; + _loc5_.text = _loc6_(); + } + for each(_loc4_ in this._trophies) + { + _loc4_.sync(); + } + } + + override public function update() : void + { + super.update(); + } + + public function addStatistic(param1:String, param2:Function) : void + { + var _loc3_:int = int(this._statistics.length); + var _loc4_:FlxBitmapText = new FlxBitmapText(14,126 + 10 * _loc3_,Fonts.font(Fonts.OUTLINE_BLACK_S),param1.toUpperCase(),"left",109); + var _loc5_:FlxBitmapText = new FlxBitmapText(_loc4_.x,_loc4_.y,Fonts.font(Fonts.OUTLINE_GRADIENT_S),"","right",109); + this.add(_loc4_); + this.add(_loc5_); + this._statistics.push([_loc5_,param2]); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsPane_pegasSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsPane_pegasSprite.as new file mode 100644 index 0000000..c794a0f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsPane_pegasSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/229_com.arc.dh.menu.StatisticsPane_pegasSprite.png")] + public class StatisticsPane_pegasSprite extends BitmapAsset + { + + public function StatisticsPane_pegasSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsPane_refreshSprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsPane_refreshSprite.as new file mode 100644 index 0000000..f26ed66 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsPane_refreshSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/223_com.arc.dh.menu.StatisticsPane_refreshSprite.png")] + public class StatisticsPane_refreshSprite extends BitmapAsset + { + + public function StatisticsPane_refreshSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsPane_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsPane_sprite.as new file mode 100644 index 0000000..c434e61 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/StatisticsPane_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.menu +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/247_com.arc.dh.menu.StatisticsPane_sprite.png")] + public class StatisticsPane_sprite extends BitmapAsset + { + + public function StatisticsPane_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/menu/Tip.as b/research/inner_decompiled/scripts/com/arc/dh/menu/Tip.as new file mode 100644 index 0000000..c57e813 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/menu/Tip.as @@ -0,0 +1,22 @@ +package com.arc.dh.menu +{ + import com.arc.flixel.ArcU; + + public class Tip + { + + private static var tips:Array = ["Upgrading your defense will reduce the damage you take from higher level enemies.","Upgrading your gun power will allow you to defeat enemies quicker.","Red diamonds are often hidden in secret areas. Be sure to search everywhere!","If you are having a hard time, search for Heart Crystals to increase your maximum hit points.","You can collect diamonds to upgrade in any mode. If you have trouble, try another mode!","Remember to grab checkpoints in story mode in case you die!","You can change the control scheme in the options menu.","Upgrade your attract skill to attract diamonds easier if you want to collect diamonds more quickly.","Once you acquire the x-ray scope, you can search for hidden red diamonds and heart crystals more easily.","Tired of the music? You can turn it off in options!","Holding down jump allows you to jump higher. Practice double jumping at the peak!","Stuck on a boss? Try a different gun! Each is useful in its own way!","Don\'t forget to upgrade your defense in order to take less damage." + ,"The subtle patterns on slimes tell you which movement pattern they will use.","Upgrade to the latest flash player and use new versions of Chrome or Firefox if you have issues!","Golden plants cannot be killed during boss encounters.","You can also use the mouse wheel or Q and E to switch weapons."]; + + public function Tip() + { + super(); + } + + public static function random() : String + { + return (tips[ArcU.rand(0,tips.length - 1)] as String).toUpperCase(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/BossDoor.as b/research/inner_decompiled/scripts/com/arc/dh/objects/BossDoor.as new file mode 100644 index 0000000..2658e73 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/BossDoor.as @@ -0,0 +1,64 @@ +package com.arc.dh.objects +{ + import com.arc.dh.Color; + import com.arc.dh.entities.Entity; + import com.arc.dh.entities.Player; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcParticleSystem; + + public class BossDoor extends Entity + { + + private static const sprite:Class = BossDoor_sprite; + + private var _c:int; + + private var _r:int; + + private var _locked:Boolean = false; + + public function BossDoor(param1:Number, param2:Number, param3:int) + { + var _loc4_:Number = param1 * Config.BLOCK_SIZE; + var _loc5_:Number = param2 * Config.BLOCK_SIZE; + super(_loc4_,_loc5_); + this._c = param1; + this._r = param2; + if(Data.state.player.y > y && Data.state.tilemap.getTile(this._c,this._r) != 0) + { + Data.state.tilemap.setTile(this._c,this._r,0,true); + } + loadGraphic(sprite,true,false,12,12); + immovable = true; + solid = false; + visible = true; + alpha = 0.35; + } + + override public function kill() : void + { + } + + override public function update() : void + { + if(outside) + { + } + var _loc1_:Player = Data.state.player; + if(!this._locked && _loc1_.y <= y && (Boolean(_loc1_.touching & DOWN) || Boolean(_loc1_.wasTouching & DOWN))) + { + this._locked = true; + visible = false; + Data.state.tilemap.setTile(this._c,this._r,56,true); + ArcParticleSystem.emit(Data.state.particles,Color.RED,getMidpoint().x,getMidpoint().y,2,1,1,0,-50,50,-50,50); + ArcParticleSystem.emit(Data.state.particles,Color.GREEN,getMidpoint().x,getMidpoint().y,2,1,1,0,-50,50,-50,50); + ArcParticleSystem.emit(Data.state.particles,Color.BLUE,getMidpoint().x,getMidpoint().y,2,1,1,0,-50,50,-50,50); + ArcParticleSystem.emit(Data.state.particles,Color.YELLOW,getMidpoint().x,getMidpoint().y,2,1,1,0,-50,50,-50,50); + Data.state.setBoss(y); + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/BossDoor_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/BossDoor_sprite.as new file mode 100644 index 0000000..7d783eb --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/BossDoor_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/102_com.arc.dh.objects.BossDoor_sprite.png")] + public class BossDoor_sprite extends BitmapAsset + { + + public function BossDoor_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Bullet.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Bullet.as new file mode 100644 index 0000000..f57e138 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Bullet.as @@ -0,0 +1,66 @@ +package com.arc.dh.objects +{ + import com.arc.dh.state.HorizontalMode; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxG; + import org.flixel.FlxObject; + import org.flixel.FlxPoint; + + public class Bullet extends ArcSprite + { + + protected var _collider:FlxObject; + + private var _dir:Number; + + private var _speed:Number; + + public var damage:int; + + public function Bullet(param1:Number, param2:Number, param3:Number, param4:Number) + { + super(param1,param2); + velocity.x = param3 * Math.cos(param4); + velocity.y = param3 * Math.sin(param4); + this._dir = param4; + this._speed = param3; + if(Data.state is HorizontalMode) + { + velocity.x += (Data.state as HorizontalMode).camera.velocity.x; + } + x += velocity.x * 0.005; + y += velocity.y * 0.005; + } + + override public function update() : void + { + if(this.offScreen()) + { + alive = false; + exists = false; + } + super.update(); + } + + override public function offScreen() : Boolean + { + var _loc1_:FlxPoint = getScreenXY(); + return _loc1_.x < -width || _loc1_.x > FlxG.width || _loc1_.y < -height - 60 || _loc1_.y > FlxG.height + 60; + } + + public function setCollider(param1:FlxObject) : void + { + this._collider = param1; + } + + public function shift(param1:Number, param2:int = 1) : Bullet + { + var _loc3_:Number = this._dir + Math.PI / 2 * param2; + x += this._speed * param1 * Math.cos(_loc3_); + y += this._speed * param1 * Math.sin(_loc3_); + return this; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/BulletFactory.as b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletFactory.as new file mode 100644 index 0000000..2412f7a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletFactory.as @@ -0,0 +1,50 @@ +package com.arc.dh.objects +{ + import com.arc.dh.Gun; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Data; + + public class BulletFactory + { + + public static var nonMissile:Boolean = false; + + public function BulletFactory() + { + super(); + } + + public static function create(param1:Number, param2:Number, param3:Number, param4:Number, param5:Class) : Bullet + { + var _loc6_:Bullet = new param5(param1,param2,param3,param4); + _loc6_.damage = damage(param5); + ++Data.bullets; + AchievementSystem.bullets(); + if(param5 != Missile && param5 != BulletFragment) + { + nonMissile = true; + } + return _loc6_; + } + + public static function damage(param1:Class) : int + { + switch(param1) + { + case BulletPrime: + return Gun.PRIME_DAMAGE[Data.primegun[0]]; + case BulletSpreader: + return Gun.SPREADER_DAMAGE[Data.spreadergun[0]]; + case Missile: + return Gun.MISSILE_DAMAGE[Data.missilegun[0]]; + case BulletRebound: + return Gun.REBOUND_DAMAGE[Data.reboundgun[0]]; + case BulletFragment: + return Gun.MISSILE_DAMAGE[Data.missilegun[0]] / 8; + default: + return 0; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/BulletFragment.as b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletFragment.as new file mode 100644 index 0000000..07841eb --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletFragment.as @@ -0,0 +1,46 @@ +package com.arc.dh.objects +{ + import com.arc.dh.util.Data; + import com.arc.flixel.ArcParticleSystem; + + public class BulletFragment extends Bullet + { + + public static const sprite:Class = BulletFragment_sprite; + + public function BulletFragment(param1:Number, param2:Number, param3:Number, param4:Number) + { + super(param1,param2,param3,param4); + loadGraphic(sprite,false,false,4,4); + width = height = 2; + offset.x = offset.y = 1; + } + + override public function kill() : void + { + if(touching & UP) + { + ArcParticleSystem.emit(Data.state.particles,"prime",x + width / 2,y,3,1,3,400,-60,60,0,20); + } + else if(touching & DOWN) + { + ArcParticleSystem.emit(Data.state.particles,"prime",x + width / 2,y + height,3,1,3,400,-60,60,-100,0); + } + else if(touching & LEFT) + { + ArcParticleSystem.emit(Data.state.particles,"prime",x,y + height / 2,3,1,3,400,0,60,-100,0); + } + else if(touching & RIGHT) + { + ArcParticleSystem.emit(Data.state.particles,"prime",x + width,y + height / 2,3,1,3,400,-60,0,-100,0); + } + else + { + ArcParticleSystem.emit(Data.state.particles,"prime",x + width / 2,y,3,1,3,400,-60,60,-100,0); + } + alive = false; + exists = false; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/BulletFragment_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletFragment_sprite.as new file mode 100644 index 0000000..07b144a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletFragment_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/253_com.arc.dh.objects.BulletFragment_sprite.png")] + public class BulletFragment_sprite extends BitmapAsset + { + + public function BulletFragment_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/BulletPrime.as b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletPrime.as new file mode 100644 index 0000000..7bcf44f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletPrime.as @@ -0,0 +1,46 @@ +package com.arc.dh.objects +{ + import com.arc.dh.util.Data; + import com.arc.flixel.ArcParticleSystem; + + public class BulletPrime extends Bullet + { + + public static const sprite:Class = BulletPrime_sprite; + + public function BulletPrime(param1:Number, param2:Number, param3:Number, param4:Number) + { + super(param1,param2,param3,param4); + loadGraphic(sprite,false,false,4,4); + width = height = 2; + offset.x = offset.y = 1; + } + + override public function kill() : void + { + if(touching & UP) + { + ArcParticleSystem.emit(Data.state.particles,"prime",x + width / 2,y,3,1,3,400,-60,60,0,20); + } + else if(touching & DOWN) + { + ArcParticleSystem.emit(Data.state.particles,"prime",x + width / 2,y + height,3,1,3,400,-60,60,-100,0); + } + else if(touching & LEFT) + { + ArcParticleSystem.emit(Data.state.particles,"prime",x,y + height / 2,3,1,3,400,0,60,-100,0); + } + else if(touching & RIGHT) + { + ArcParticleSystem.emit(Data.state.particles,"prime",x + width,y + height / 2,3,1,3,400,-60,0,-100,0); + } + else + { + ArcParticleSystem.emit(Data.state.particles,"prime",x + width / 2,y,3,1,3,400,-60,60,-100,0); + } + alive = false; + exists = false; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/BulletPrime_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletPrime_sprite.as new file mode 100644 index 0000000..0b77515 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletPrime_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/233_com.arc.dh.objects.BulletPrime_sprite.png")] + public class BulletPrime_sprite extends BitmapAsset + { + + public function BulletPrime_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/BulletRebound.as b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletRebound.as new file mode 100644 index 0000000..90401c8 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletRebound.as @@ -0,0 +1,120 @@ +package com.arc.dh.objects +{ + import com.arc.dh.Gun; + import com.arc.dh.objects.enemies.Enemy; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class BulletRebound extends Bullet + { + + public static const sprite:Class = BulletRebound_sprite; + + private static const SOLID_TIME:Number = 0.15; + + private var bounces:int = 2; + + public var solidTimer:Number = 0.15; + + private var side:String = ""; + + private var _vx:Number; + + private var _vy:Number; + + public var lastEnemy:Enemy; + + public function BulletRebound(param1:Number, param2:Number, param3:Number, param4:Number) + { + super(param1,param2,param3,param4); + loadGraphic(sprite,false,false,4,4); + this._vx = velocity.x; + this._vy = velocity.y; + this.bounces = Data.reboundgun[Gun.SPECIAL_ONE] == 1 ? 3 : 2; + } + + override public function update() : void + { + if(this.solidTimer > 0) + { + this.solidTimer -= FlxG.elapsed; + if(this.solidTimer <= 0) + { + solid = true; + } + } + super.update(); + } + + override public function kill() : void + { + var _loc1_:Number = NaN; + var _loc2_:Number = NaN; + var _loc3_:FlxPoint = null; + var _loc4_:Number = NaN; + var _loc5_:Number = NaN; + var _loc6_:FlxPoint = null; + var _loc7_:Number = NaN; + var _loc8_:Number = NaN; + var _loc9_:Number = NaN; + var _loc10_:Number = NaN; + var _loc11_:Number = NaN; + var _loc12_:Number = NaN; + if(this.bounces > 0 && _collider != null) + { + this.solidTimer = SOLID_TIME; + --this.bounces; + _loc1_ = velocity.x * FlxG.elapsed; + _loc2_ = velocity.y * FlxG.elapsed; + if(touching & (UP | DOWN)) + { + this._vy = 0 - this._vy; + velocity.y = this._vy; + velocity.x = this._vx; + } + else if(touching & (LEFT | RIGHT)) + { + this._vx = 0 - this._vx; + velocity.y = this._vy; + velocity.x = this._vx; + } + else + { + _loc3_ = _collider.getMidpoint(); + _loc4_ = _loc3_.x; + _loc5_ = _loc3_.y; + _loc6_ = getMidpoint(); + _loc7_ = _loc6_.x; + _loc8_ = _loc6_.y; + _loc9_ = _loc7_ - _loc4_; + _loc10_ = _loc8_ - _loc5_; + _loc11_ = ArcU.abs(_loc9_); + _loc12_ = ArcU.abs(_loc10_); + if((_loc11_ > _loc12_ || _loc8_ <= _loc5_ && velocity.y <= 0 || _loc8_ >= _loc5_ && velocity.y >= 0) && (_loc7_ <= _loc4_ && velocity.x >= 0 || _loc7_ >= _loc4_ && velocity.x <= 0)) + { + this._vx = 0 - this._vx; + velocity.y = this._vy; + velocity.x = this._vx; + } + else + { + this._vy = 0 - this._vy; + velocity.y = this._vy; + velocity.x = this._vx; + } + } + ArcParticleSystem.emit(Data.state.particles,"rebound",x + width / 2,y + width / 2,1,1,3,400,-60,60,-100,0); + } + else + { + ArcParticleSystem.emit(Data.state.particles,"rebound",x + width / 2,y + width / 2,1,3,3,400,-60,60,-100,0); + alive = false; + exists = false; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/BulletRebound_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletRebound_sprite.as new file mode 100644 index 0000000..9f73020 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletRebound_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/158_com.arc.dh.objects.BulletRebound_sprite.png")] + public class BulletRebound_sprite extends BitmapAsset + { + + public function BulletRebound_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/BulletSpreader.as b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletSpreader.as new file mode 100644 index 0000000..9f4fabe --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletSpreader.as @@ -0,0 +1,32 @@ +package com.arc.dh.objects +{ + import com.arc.dh.util.Data; + import com.arc.flixel.ArcParticleSystem; + + public class BulletSpreader extends Bullet + { + + public static const sprite:Class = BulletSpreader_sprite; + + public static const spriteGreen:Class = BulletSpreader_spriteGreen; + + public function BulletSpreader(param1:Number, param2:Number, param3:Number, param4:Number) + { + super(param1,param2,param3,param4); + loadGraphic(sprite,false,false,4,4); + } + + override public function kill() : void + { + ArcParticleSystem.emit(Data.state.particles,"prime",x + width / 2,y + width / 2,1,1,3,400,-60,60,-100,0); + alive = false; + exists = false; + } + + public function green() : void + { + loadGraphic(spriteGreen,false,false,4,4); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/BulletSpreader_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletSpreader_sprite.as new file mode 100644 index 0000000..ab88b92 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletSpreader_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/295_com.arc.dh.objects.BulletSpreader_sprite.png")] + public class BulletSpreader_sprite extends BitmapAsset + { + + public function BulletSpreader_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/BulletSpreader_spriteGreen.as b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletSpreader_spriteGreen.as new file mode 100644 index 0000000..1479585 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/BulletSpreader_spriteGreen.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/212_com.arc.dh.objects.BulletSpreader_spriteGreen.png")] + public class BulletSpreader_spriteGreen extends BitmapAsset + { + + public function BulletSpreader_spriteGreen() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Camera.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Camera.as new file mode 100644 index 0000000..7611e36 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Camera.as @@ -0,0 +1,16 @@ +package com.arc.dh.objects +{ + import org.flixel.FlxSprite; + + public class Camera extends FlxSprite + { + + public function Camera(param1:Number, param2:Number) + { + super(param1,param2); + width = height = 1; + visible = false; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Checkpoint.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Checkpoint.as new file mode 100644 index 0000000..c813f9e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Checkpoint.as @@ -0,0 +1,69 @@ +package com.arc.dh.objects +{ + import com.arc.dh.Color; + import com.arc.dh.objects.powerups.Powerup; + import com.arc.dh.util.Data; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcParticleSystem; + import org.flixel.FlxG; + + public class Checkpoint extends Powerup + { + + private static const sprite:Class = Checkpoint_sprite; + + private static const spriteRed:Class = Checkpoint_spriteRed; + + private var _activated:Boolean = false; + + public function Checkpoint(param1:Number, param2:Number) + { + var _loc6_:Array = null; + super(param1,param2); + Data.state.spawner[_c + "," + _r] = true; + var _loc3_:Boolean = false; + var _loc4_:Array = Data.state.checkpoints; + var _loc5_:int = 0; + while(_loc5_ < _loc4_.length) + { + _loc6_ = _loc4_[_loc5_]; + if(_loc6_[0] == param1 && _loc6_[1] == param2) + { + loadRotatedGraphic(spriteRed,32,-1,true,true); + this._activated = true; + _loc3_ = true; + break; + } + _loc5_++; + } + if(!_loc3_) + { + loadRotatedGraphic(sprite,32,-1,true,true); + } + } + + override public function update() : void + { + angle += FlxG.elapsed * 300; + super.update(); + } + + override public function activate() : void + { + if(this._activated) + { + return; + } + loadRotatedGraphic(spriteRed,32,-1,true,true); + ArcParticleSystem.emit(Data.state.emitters,Color.RED,x,y,25,1,2,0,-200,200,-200,200,width,height); + ArcParticleSystem.emit(Data.state.emitters,Color.BLACK,x,y,25,1,2,0,-200,200,-200,200,width,height); + this._activated = true; + Data.state.checkpoints.push([_c,_r]); + Data.state.checkpoint(); + Data.hp = Data.hpm; + SoundSystem.play(Sound.CHECKPOINT); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Checkpoint_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Checkpoint_sprite.as new file mode 100644 index 0000000..bb85f8b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Checkpoint_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/92_com.arc.dh.objects.Checkpoint_sprite.png")] + public class Checkpoint_sprite extends BitmapAsset + { + + public function Checkpoint_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Checkpoint_spriteRed.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Checkpoint_spriteRed.as new file mode 100644 index 0000000..eb28e55 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Checkpoint_spriteRed.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/140_com.arc.dh.objects.Checkpoint_spriteRed.png")] + public class Checkpoint_spriteRed extends BitmapAsset + { + + public function Checkpoint_spriteRed() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Diamond.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Diamond.as new file mode 100644 index 0000000..c8fe69b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Diamond.as @@ -0,0 +1,228 @@ +package com.arc.dh.objects +{ + import com.arc.dh.Color; + import com.arc.dh.state.HorizontalMode; + import com.arc.dh.state.TadpoleMode; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcSprite; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + import org.flixel.FlxU; + + public class Diamond extends ArcSprite + { + + private static const sprite:Class = Diamond_sprite; + + private static const PULL_DISTANCE:int = 25; + + private static const PULL_SPEED:int = 240; + + public var value:int = 1; + + public var pullDelay:Number = 0; + + public var diamondColor:int = 0; + + private var _pulled:Boolean = false; + + private var _magnet:Boolean = false; + + private var _hidden:Boolean = false; + + private var _thisPoint:FlxPoint = new FlxPoint(); + + private var _otherPoint:FlxPoint = new FlxPoint(); + + private var outsideFunction:Function; + + private var _c:int = -1; + + private var _r:int = -1; + + public function Diamond(param1:Number, param2:Number, param3:int = 1, param4:Boolean = false, param5:int = -1, param6:int = -1) + { + var _loc7_:int = 0; + super(param1,param2); + loadGraphic(sprite,true,false,10,10); + this._hidden = param4; + this._c = param5; + this._r = param6; + solid = false; + this.value = param3; + switch(param3) + { + case 1: + _loc7_ = 0; + this.diamondColor = Color.YELLOW; + break; + case 2: + _loc7_ = 1; + this.diamondColor = Color.GREEN; + break; + case 3: + _loc7_ = 2; + this.diamondColor = Color.CYAN; + break; + case 4: + _loc7_ = 3; + this.diamondColor = Color.BLUE; + break; + case 5: + _loc7_ = 4; + this.diamondColor = Color.PURPLE; + break; + case 6: + _loc7_ = 5; + this.diamondColor = Color.WHITE; + break; + case 10: + _loc7_ = 6; + this.diamondColor = Color.BLACK; + break; + default: + _loc7_ = 0; + this.diamondColor = Color.GREEN; + } + var _loc8_:int = _loc7_ * 6; + addAnimation("glow",[_loc8_ + 0,_loc8_ + 1,_loc8_ + 2,_loc8_ + 3,_loc8_ + 4,_loc8_ + 5,_loc8_ + 4,_loc8_ + 3,_loc8_ + 2,_loc8_ + 1],ArcU.rand(5,12),true); + play("glow"); + if(Data.state is HorizontalMode) + { + this.outsideFunction = this.runmodeOutside; + } + else + { + this.outsideFunction = this.playmodeOutside; + } + } + + public static function valueFromLevel(param1:int) : int + { + var _loc2_:int = 0; + if(param1 < 9) + { + _loc2_ = 1; + } + else if(param1 < 20) + { + _loc2_ = 2; + } + else if(param1 < 31) + { + _loc2_ = 3; + } + else if(param1 < 42) + { + _loc2_ = 4; + } + else if(param1 < 53) + { + _loc2_ = 5; + } + else if(param1 < 61) + { + _loc2_ = 6; + } + else + { + _loc2_ = 10; + } + return _loc2_; + } + + private function runmodeOutside() : Boolean + { + var _loc1_:int = x / Config.BLOCK_SIZE; + if(_loc1_ <= Data.state.despawnTop - 2) + { + return true; + } + return false; + } + + private function playmodeOutside() : Boolean + { + var _loc1_:int = y / Config.BLOCK_SIZE; + if(_loc1_ >= Data.state.despawnBottom + 2 || _loc1_ <= Data.state.despawnTop - 2) + { + return true; + } + return false; + } + + public function get pullDistance() : int + { + if(Data.state is TadpoleMode) + { + return 50; + } + return PULL_DISTANCE + Data.attract * 7; + } + + override public function update() : void + { + var _loc2_:Number = NaN; + var _loc3_:Number = NaN; + var _loc4_:Number = NaN; + if(this.outsideFunction()) + { + kill(); + } + this.pullDelay -= FlxG.elapsed; + var _loc1_:Boolean = !this._hidden || Data.state.player.inHidden > 0; + if(_loc1_ && (this.pullDelay <= 0 || this._magnet)) + { + this._thisPoint.x = x + 2; + this._thisPoint.y = y + 2; + this._otherPoint.x = Data.state.player.x + Data.state.player.width / 2; + this._otherPoint.y = Data.state.player.y + Data.state.player.height / 2; + _loc2_ = FlxU.getDistance(this._thisPoint,this._otherPoint); + if(_loc2_ < this.pullDistance && Data.state.tilemap.ray(this._thisPoint,this._otherPoint) || this._magnet) + { + _loc3_ = FlxU.getAngle(this._thisPoint,this._otherPoint) - 90; + _loc4_ = Math.PI / 180 * _loc3_; + this._pulled = true; + velocity.x = (PULL_SPEED + (this._magnet ? 150 : 0)) * Math.cos(_loc4_) + (Data.state is HorizontalMode ? (Data.state as HorizontalMode).camera.velocity.x : 0); + velocity.y = (PULL_SPEED + (this._magnet ? 150 : 0)) * Math.sin(_loc4_); + if(!this._magnet) + { + solid = true; + } + } + else if(this._pulled) + { + velocity.x = velocity.y = 0; + } + if(_loc2_ < 4) + { + solid = true; + } + } + super.update(); + } + + public function set magnet(param1:Boolean) : void + { + var _loc2_:int = getScreenXY().x; + var _loc3_:int = getScreenXY().y; + var _loc4_:Boolean = !this._hidden || Data.state.player.inHidden > 0; + if(_loc2_ >= -width && _loc2_ < FlxG.width && _loc3_ >= -height && _loc3_ < FlxG.height && _loc4_) + { + this._magnet = true; + solid = false; + } + } + + public function despawn() : void + { + if(this._c != -1 && this._r != -1) + { + Data.state.despawn(this._c,this._r); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Diamond_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Diamond_sprite.as new file mode 100644 index 0000000..70234a7 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Diamond_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/262_com.arc.dh.objects.Diamond_sprite.png")] + public class Diamond_sprite extends BitmapAsset + { + + public function Diamond_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Healthbar.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Healthbar.as new file mode 100644 index 0000000..d772912 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Healthbar.as @@ -0,0 +1,60 @@ +package com.arc.dh.objects +{ + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + + public class Healthbar extends ArcGroup + { + + public static const WIDTH:int = 15; + + public static const HEIGHT:int = 6; + + private static const BORDER_WIDTH:int = 2; + + private var backgroundSprite:Class = Healthbar_backgroundSprite; + + private var barSprite:Class = Healthbar_barSprite; + + private var background:ArcSprite; + + public var bar:ArcSprite; + + public function Healthbar() + { + super(); + this.background = new ArcSprite(0,0); + this.background.loadGraphic(this.backgroundSprite,false,false,WIDTH,HEIGHT); + add(this.background); + this.bar = new ArcSprite(BORDER_WIDTH,BORDER_WIDTH); + this.bar.loadGraphic(this.barSprite,false,false,11,2); + this.bar.origin.x = this.bar.origin.y = 0; + this.bar.addAnimation("red",[0]); + this.bar.addAnimation("gold",[1]); + this.bar.play("red"); + add(this.bar); + alive = true; + exists = true; + } + + public function move(param1:int, param2:int, param3:Number) : void + { + this.background.alpha = param3; + this.background.x = param1; + this.background.y = param2; + this.bar.alpha = param3; + this.bar.x = param1 + BORDER_WIDTH; + this.bar.y = param2 + BORDER_WIDTH; + } + + public function scale(param1:Number) : void + { + this.bar.scale.x = param1; + } + + override public function update() : void + { + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Healthbar_backgroundSprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Healthbar_backgroundSprite.as new file mode 100644 index 0000000..32a2a93 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Healthbar_backgroundSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/230_com.arc.dh.objects.Healthbar_backgroundSprite.png")] + public class Healthbar_backgroundSprite extends BitmapAsset + { + + public function Healthbar_backgroundSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Healthbar_barSprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Healthbar_barSprite.as new file mode 100644 index 0000000..065d5ab --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Healthbar_barSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/207_com.arc.dh.objects.Healthbar_barSprite.png")] + public class Healthbar_barSprite extends BitmapAsset + { + + public function Healthbar_barSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Missile.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Missile.as new file mode 100644 index 0000000..73e4885 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Missile.as @@ -0,0 +1,46 @@ +package com.arc.dh.objects +{ + import com.arc.dh.Color; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcParticleSystem; + import org.flixel.FlxG; + + public class Missile extends Bullet + { + + public static const sprite:Class = Missile_sprite; + + private var _particleTime:Number = 0; + + public function Missile(param1:Number, param2:Number, param3:Number, param4:Number) + { + super(param1,param2,param3,param4); + loadRotatedGraphic(sprite,60,-1,true,false); + width = 3; + height = 3; + offset.x = 6; + offset.y = 6; + angle = param4 * 57.2957795; + } + + override public function draw() : void + { + this._particleTime -= FlxG.elapsed; + if(this._particleTime <= 0) + { + ArcParticleSystem.emit(Data.state.particles,Color.BLACK,getMidpoint().x,getMidpoint().y,1,1,0,0,0,0,0,0); + this._particleTime = 0.02; + } + super.draw(); + } + + override public function kill() : void + { + ArcParticleSystem.emit(Data.state.particles,Color.BLACK,x + width / 2,y + width / 2,5,2,0.2,0,-30,30,-30,30); + ArcParticleSystem.emit(Data.state.particles,Color.WHITE,x + width / 2,y + width / 2,5,2,0.2,0,-30,30,-30,30); + alive = false; + exists = false; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Missile_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Missile_sprite.as new file mode 100644 index 0000000..347197b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Missile_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/91_com.arc.dh.objects.Missile_sprite.png")] + public class Missile_sprite extends BitmapAsset + { + + public function Missile_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Pot.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Pot.as new file mode 100644 index 0000000..5977b87 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Pot.as @@ -0,0 +1,55 @@ +package com.arc.dh.objects +{ + import com.arc.dh.entities.Entity; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Data; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcU; + + public class Pot extends Entity + { + + private static const largeSprite:Class = Pot_largeSprite; + + public function Pot(param1:Number, param2:Number, param3:int) + { + super(param1,param2); + loadGraphic(largeSprite,true,false,12,12); + addAnimation("pot",[ArcU.rand(0,3)]); + play("pot"); + immovable = true; + } + + override public function kill() : void + { + var _loc1_:int = ArcU.rand(0,100); + if(_loc1_ >= 50) + { + if(_loc1_ < 95) + { + Data.state.addDiamonds(x,y,ArcU.rand(1,3)); + } + else + { + Data.state.createHeart(x,y); + } + } + ++Data.pots; + SoundSystem.play(Sound.POT); + AchievementSystem.pots(); + super.kill(); + } + + override public function update() : void + { + if(outside) + { + exists = false; + alive = false; + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Pot_largeSprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Pot_largeSprite.as new file mode 100644 index 0000000..23c78f1 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Pot_largeSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/278_com.arc.dh.objects.Pot_largeSprite.png")] + public class Pot_largeSprite extends BitmapAsset + { + + public function Pot_largeSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/SteelCrate.as b/research/inner_decompiled/scripts/com/arc/dh/objects/SteelCrate.as new file mode 100644 index 0000000..92bfc05 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/SteelCrate.as @@ -0,0 +1,50 @@ +package com.arc.dh.objects +{ + import com.arc.dh.entities.Entity; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcU; + + public class SteelCrate extends Entity + { + + private static const sprite:Class = SteelCrate_sprite; + + public function SteelCrate(param1:Number, param2:Number, param3:int) + { + var _loc4_:Number = param1 * Config.BLOCK_SIZE; + var _loc5_:Number = param2 * Config.BLOCK_SIZE; + super(_loc4_,_loc5_); + loadGraphic(sprite,true,false,12,12); + immovable = true; + } + + override public function kill() : void + { + var _loc1_:int = ArcU.rand(0,100); + if(_loc1_ >= 50) + { + if(_loc1_ < 95) + { + Data.state.addDiamonds(x,y,ArcU.rand(1,3)); + } + else + { + Data.state.createHeart(x,y); + } + } + super.kill(); + } + + override public function update() : void + { + if(outside) + { + exists = false; + alive = false; + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/SteelCrate_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/SteelCrate_sprite.as new file mode 100644 index 0000000..2ce824a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/SteelCrate_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/201_com.arc.dh.objects.SteelCrate_sprite.png")] + public class SteelCrate_sprite extends BitmapAsset + { + + public function SteelCrate_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Tile.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Tile.as new file mode 100644 index 0000000..5ae023e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Tile.as @@ -0,0 +1,18 @@ +package com.arc.dh.objects +{ + import com.arc.flixel.ArcSprite; + + public class Tile extends ArcSprite + { + + public function Tile(param1:int = 0, param2:int = 0, param3:Class = null) + { + super(param1,param2,param3); + immovable = true; + width = 12; + height = 12; + offset.x = offset.y = 0; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/Wall.as b/research/inner_decompiled/scripts/com/arc/dh/objects/Wall.as new file mode 100644 index 0000000..f6dd12e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/Wall.as @@ -0,0 +1,112 @@ +package com.arc.dh.objects +{ + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + + public class Wall extends Tile + { + + public static const HIDDEN_DISTANCE:int = 80; + + public static const HIDDEN_DISTANCE_OFFSET:int = 30; + + public static const IN_HIDDEN_DISTANCE_X:int = 8; + + public static const IN_HIDDEN_DISTANCE_Y:int = 10; + + private var _cx:int; + + private var _cy:int; + + private var _row:int; + + private var _hidden:Boolean; + + public function Wall(param1:Number, param2:Number, param3:uint, param4:Class, param5:Boolean = false) + { + super(param1,param2); + loadGraphic(param4,true,false,Config.BLOCK_SIZE,Config.BLOCK_SIZE); + this._cx = x + width / 2; + this._cy = y + width / 2; + this._row = y / Config.BLOCK_SIZE; + this._hidden = param5; + solid = false; + frame = param3; + } + + override public function update() : void + { + var _loc8_:Number = NaN; + var _loc9_:Number = NaN; + var _loc10_:Number = NaN; + var _loc11_:Number = NaN; + if(this._row >= Data.state.despawnBottom || this._row <= Data.state.despawnTop) + { + exists = false; + alive = false; + } + if(!this._hidden) + { + return; + } + var _loc1_:int = Data.state.player.x + Data.state.player.width / 2; + var _loc2_:int = Data.state.player.y + Data.state.player.height / 2; + var _loc3_:int = ArcU.abs(this._cx - _loc1_); + var _loc4_:int = ArcU.abs(this._cy - _loc2_); + var _loc5_:int = _loc3_ > _loc4_ ? _loc3_ : _loc4_; + var _loc6_:Boolean = _loc3_ < HIDDEN_DISTANCE && _loc4_ < HIDDEN_DISTANCE; + var _loc7_:Boolean = ArcU.abs(this._cx - _loc1_) < IN_HIDDEN_DISTANCE_X && ArcU.abs(this._cy - _loc2_) < IN_HIDDEN_DISTANCE_Y; + if(_loc7_) + { + Data.state.player.inHidden = 2; + } + if(_loc6_ && Data.state.player.inHidden > 0) + { + if(_loc5_ > HIDDEN_DISTANCE_OFFSET) + { + _loc8_ = (_loc5_ - HIDDEN_DISTANCE_OFFSET) / (HIDDEN_DISTANCE - HIDDEN_DISTANCE_OFFSET); + } + else + { + _loc8_ = 0; + } + } + else + { + _loc8_ = 1; + } + if(alpha < _loc8_) + { + alpha += FlxG.elapsed * 2; + if(alpha > _loc8_) + { + alpha = _loc8_; + } + } + else if(alpha > _loc8_) + { + alpha -= FlxG.elapsed * 2; + if(alpha < _loc8_) + { + alpha = _loc8_; + } + } + if(Data.state.xraying) + { + _loc9_ = Math.atan2(this._cy - _loc2_,this._cx - _loc1_); + _loc10_ = ArcU.abs(_loc9_ - Data.state.player.radians); + if(_loc10_ < 0.5) + { + _loc11_ = int(_loc10_ * 20) / 8 - 0.25; + if(_loc11_ < alpha) + { + alpha = _loc11_; + } + } + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/WoodenCrate.as b/research/inner_decompiled/scripts/com/arc/dh/objects/WoodenCrate.as new file mode 100644 index 0000000..49e65d8 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/WoodenCrate.as @@ -0,0 +1,53 @@ +package com.arc.dh.objects +{ + import com.arc.dh.entities.Entity; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcU; + + public class WoodenCrate extends Entity + { + + private static const sprite:Class = WoodenCrate_sprite; + + public function WoodenCrate(param1:Number, param2:Number, param3:int) + { + var _loc4_:Number = param1 * Config.BLOCK_SIZE; + var _loc5_:Number = param2 * Config.BLOCK_SIZE; + super(_loc4_,_loc5_); + loadGraphic(sprite,true,false,12,12); + immovable = true; + } + + override public function kill() : void + { + var _loc1_:int = ArcU.rand(0,100); + if(_loc1_ >= 50) + { + if(_loc1_ < 95) + { + Data.state.addDiamonds(x,y,ArcU.rand(1,3)); + } + else + { + Data.state.createHeart(x,y); + } + } + ++Data.boxes; + AchievementSystem.boxes(); + super.kill(); + } + + override public function update() : void + { + if(outside) + { + exists = false; + alive = false; + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/WoodenCrate_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/WoodenCrate_sprite.as new file mode 100644 index 0000000..5342901 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/WoodenCrate_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/236_com.arc.dh.objects.WoodenCrate_sprite.png")] + public class WoodenCrate_sprite extends BitmapAsset + { + + public function WoodenCrate_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Bird.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Bird.as new file mode 100644 index 0000000..55dcb5f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Bird.as @@ -0,0 +1,44 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.util.Config; + import com.arc.flixel.ArcU; + + public class Bird extends Enemy + { + + private static const sprite:Class = Bird_sprite; + + private static const FLY_SPEED:Number = 60; + + public function Bird(param1:Number, param2:Number, param3:int) + { + var _loc4_:Number = NaN; + var _loc5_:Number = NaN; + _loc4_ = param1 * Config.BLOCK_SIZE; + _loc5_ = param2 * Config.BLOCK_SIZE; + _c = param1; + _r = param2; + super(_loc4_,_loc5_,param3); + loadGraphic(sprite,true,true,33,18); + width = 28; + height = 11; + offset.x = 2; + offset.y = 6; + facing = ArcU.rand(0,1) == 0 ? LEFT : RIGHT; + velocity.x = facing == LEFT ? -FLY_SPEED : FLY_SPEED; + addAnimation("fly",[0,1,2,1],5,true); + play("fly"); + } + + override public function update() : void + { + if(velocity.x == 0) + { + _moveSpeed = FLY_SPEED; + go(facing == LEFT ? RIGHT : LEFT); + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Bird_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Bird_sprite.as new file mode 100644 index 0000000..0e42973 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Bird_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/123_com.arc.dh.objects.enemies.Bird_sprite.png")] + public class Bird_sprite extends BitmapAsset + { + + public function Bird_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Blade.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Blade.as new file mode 100644 index 0000000..e1e91c4 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Blade.as @@ -0,0 +1,116 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class Blade extends Enemy + { + + private static const sprite:Class = Blade_sprite; + + private static var BLADE_SPEED:int = 100; + + private var _dir:int = 16; + + private var _turnRightPoint:FlxPoint = new FlxPoint(); + + private var _turnLeftPoint:FlxPoint = new FlxPoint(); + + private var _spr:ArcSprite = new ArcSprite(); + + public function Blade(param1:Number, param2:Number, param3:int) + { + var _loc4_:Number = NaN; + var _loc5_:Number = NaN; + _loc4_ = param1 * Config.BLOCK_SIZE; + _loc5_ = param2 * Config.BLOCK_SIZE; + _c = param1; + _r = param2; + super(_loc4_,_loc5_,param3); + loadRotatedGraphic(sprite,32,-1,true,false); + killable = false; + width = 19; + height = 19; + offset.x = 4; + offset.y = 4; + x += 4; + y += 4; + this._spr.makeGraphic(12,12,4294901760); + } + + override public function update() : void + { + angle += FlxG.elapsed * 200; + switch(this._dir) + { + case RIGHT: + velocity.x = BLADE_SPEED; + velocity.y = 0; + this._turnRightPoint.x = 0; + this._turnRightPoint.y = 1; + this._turnLeftPoint.x = 1; + this._turnLeftPoint.y = 0; + break; + case DOWN: + velocity.x = 0; + velocity.y = BLADE_SPEED; + this._turnRightPoint.x = -1; + this._turnRightPoint.y = 1; + this._turnLeftPoint.x = 0; + this._turnLeftPoint.y = 1; + break; + case LEFT: + velocity.x = -BLADE_SPEED; + velocity.y = 0; + this._turnRightPoint.x = 0; + this._turnRightPoint.y = 0; + this._turnLeftPoint.x = -1; + this._turnLeftPoint.y = 0; + break; + case UP: + velocity.x = 0; + velocity.y = -BLADE_SPEED; + this._turnRightPoint.x = 1; + this._turnRightPoint.y = 0; + this._turnLeftPoint.x = 0; + this._turnLeftPoint.y = -1; + } + var _loc1_:int = (x - 4) / Config.BLOCK_SIZE + 1; + var _loc2_:int = (y - 4) / Config.BLOCK_SIZE + 1; + var _loc3_:uint = Data.state.tilemap.getTile(_loc1_ + this._turnRightPoint.x,_loc2_ + this._turnRightPoint.y); + if(_loc3_ == 0) + { + switch(this._dir) + { + case RIGHT: + this._dir = DOWN; + break; + case DOWN: + this._dir = LEFT; + x -= 4; + break; + case LEFT: + this._dir = UP; + break; + case UP: + this._dir = RIGHT; + x += 4; + } + } + super.update(); + } + + override public function draw() : void + { + super.draw(); + var _loc1_:int = x / Config.BLOCK_SIZE + 1; + var _loc2_:int = y / Config.BLOCK_SIZE + 1; + this._spr.x = _loc1_ * Config.BLOCK_SIZE; + this._spr.y = _loc2_ * Config.BLOCK_SIZE; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Blade_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Blade_sprite.as new file mode 100644 index 0000000..0fa73b4 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Blade_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/107_com.arc.dh.objects.enemies.Blade_sprite.png")] + public class Blade_sprite extends BitmapAsset + { + + public function Blade_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Blob.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Blob.as new file mode 100644 index 0000000..894d5ef --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Blob.as @@ -0,0 +1,232 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.Color; + import com.arc.dh.util.Data; + import com.arc.dh.util.text.Avatar; + import com.arc.dh.util.text.TextSystem; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + + public class Blob extends Boss + { + + private static const sprite:Class = Blob_sprite; + + private static const SLIME_SPAWN_DELAY:Number = 5; + + private static const EXPLODE_DELAY:Number = 4; + + private static const EXPLODE_SEED_SPEED:Number = 100; + + private var slimeTimer:Number = 1; + + private var explodeTimer:Number = 4; + + public function Blob(param1:Number, param2:Number) + { + super(param1,param2); + loadRotatedGraphic(sprite,60,0,true,true); + _moveSpeed = 30; + hp = hpm = mode(5000,50000,80000); + setPhases([75,50,25]); + } + + override public function intro() : Boolean + { + var _loc1_:Plant = null; + go(RIGHT); + this.spawnDots(); + if(heroic) + { + _loc1_ = new Plant(1,14,1,RIGHT); + _loc1_.goldenize(); + Data.state.enemies.add(_loc1_); + spawnBurst(_loc1_.getMidpoint().x,_loc1_.getMidpoint().y); + _loc1_ = new Plant(28,14,1,LEFT); + _loc1_.goldenize(); + Data.state.enemies.add(_loc1_); + spawnBurst(_loc1_.getMidpoint().x,_loc1_.getMidpoint().y); + } + super.intro(); + return true; + } + + override public function outro() : Boolean + { + var _loc1_:Enemy = null; + for each(_loc1_ in Data.state.enemies.members) + { + if(!(_loc1_ is Boss)) + { + _loc1_.silentKill(); + } + } + super.outro(); + return true; + } + + override public function engaged() : Boolean + { + var _loc1_:Tadpole = null; + var _loc2_:int = 0; + var _loc3_:int = 0; + var _loc4_:int = 0; + this.slimeTimer -= FlxG.elapsed; + if(this.slimeTimer <= 0) + { + this.slimeTimer = SLIME_SPAWN_DELAY; + _loc1_ = new Tadpole(15,3,mode(50,20,30)); + _loc1_.goldenize(); + Data.state.enemies.add(_loc1_); + } + angle += FlxG.elapsed * 100; + if(phase >= mode(3,3,2)) + { + this.explodeTimer -= FlxG.elapsed; + if(this.explodeTimer <= 0) + { + this.explodeTimer = EXPLODE_DELAY - mode(0,0,2); + _loc2_ = getMidpoint().x; + _loc3_ = getMidpoint().y; + _loc4_ = 0; + while(_loc4_ < 360) + { + this.shootSeed(_loc2_,_loc3_,_loc4_); + _loc4_ += mode(30,30,20); + } + } + } + if(x > 290) + { + this.burst(); + if(facing == RIGHT) + { + x = 325; + y = 46; + go(LEFT); + } + else + { + x = 26; + y = 46; + go(RIGHT); + } + this.burst(); + } + super.engaged(); + return false; + } + + private function shootSeed(param1:int, param2:int, param3:int) : void + { + var _loc4_:Number = param3 * Math.PI / 180; + var _loc5_:Seed = new Seed(param1,param2,1); + _loc5_.velocity.x = EXPLODE_SEED_SPEED * Math.cos(_loc4_); + _loc5_.velocity.y = EXPLODE_SEED_SPEED * Math.sin(_loc4_); + Data.state.enemies.add(_loc5_); + } + + private function burst() : void + { + ArcParticleSystem.emit(Data.state.particles,Color.BLUE,getMidpoint().x,getMidpoint().y,20,1,1,0,-50,50,-50,50); + ArcParticleSystem.emit(Data.state.particles,Color.YELLOW,getMidpoint().x,getMidpoint().y,20,1,1,0,-50,50,-50,50); + } + + override public function kill() : void + { + super.kill(); + } + + private function spawnDots() : void + { + var _loc1_:Enemy = null; + var _loc2_:int = 0; + var _loc3_:int = 0; + var _loc4_:BlobDot = null; + for each(_loc1_ in Data.state.enemies.members) + { + if(_loc1_ is BlobDot) + { + _loc3_ = 0; + while(_loc3_ < 4) + { + this.shootSeed(_loc1_.x + 7,_loc1_.y + 7,ArcU.rand(_loc3_ * 90,(_loc3_ + 1) * 90)); + _loc3_++; + } + _loc1_.kill(); + } + } + _loc2_ = 0; + while(_loc2_ < 360) + { + _loc4_ = new BlobDot(0,0,_loc2_,this,phase == 0 ? 0 : int(phase - 1),mode(1,20,50)); + if(phase >= 3) + { + _loc4_.missileonly = true; + _loc4_.hpm = _loc4_.hp = 1; + } + Data.state.enemies.add(_loc4_); + _loc2_ += 30; + } + } + + override public function changePhase(param1:int) : void + { + var _loc5_:CeilingPlant = null; + var _loc6_:Plant = null; + var _loc7_:Tadpole = null; + switch(param1) + { + case 2: + _loc5_ = new CeilingPlant(5,2,1); + _loc5_.goldenize(); + Data.state.enemies.add(_loc5_); + spawnBurst(_loc5_.getMidpoint().x,_loc5_.getMidpoint().y); + _loc5_ = new CeilingPlant(24,2,1); + _loc5_.goldenize(); + Data.state.enemies.add(_loc5_); + spawnBurst(_loc5_.getMidpoint().x,_loc5_.getMidpoint().y); + break; + case 3: + if(heroic) + { + _loc6_ = new Plant(1,12,1,RIGHT); + _loc6_.goldenize(); + Data.state.enemies.add(_loc6_); + spawnBurst(_loc6_.getMidpoint().x,_loc6_.getMidpoint().y); + _loc6_ = new Plant(28,12,1,LEFT); + _loc6_.goldenize(); + Data.state.enemies.add(_loc6_); + spawnBurst(_loc6_.getMidpoint().x,_loc6_.getMidpoint().y); + } + TextSystem.display(Avatar.SAGA,"His barrier appears to be thickening. You may need to use missiles to break through it!"); + break; + case 4: + _loc6_ = new Plant(1,16,1,RIGHT); + _loc6_.goldenize(); + Data.state.enemies.add(_loc6_); + spawnBurst(_loc6_.getMidpoint().x,_loc6_.getMidpoint().y); + _loc6_ = new Plant(28,16,1,LEFT); + _loc6_.goldenize(); + Data.state.enemies.add(_loc6_); + spawnBurst(_loc6_.getMidpoint().x,_loc6_.getMidpoint().y); + } + this.spawnDots(); + loadRotatedGraphic(sprite,60,phase - 1,true,true); + var _loc2_:int = getMidpoint().x; + var _loc3_:int = getMidpoint().y; + var _loc4_:int = 0; + while(_loc4_ < 360) + { + _loc7_ = new Tadpole(_loc2_,_loc3_,mode(20,20,30)); + _loc7_.x = _loc2_ - _loc7_.width / 2; + _loc7_.y = _loc3_ - _loc7_.height / 2; + _loc7_.move(_loc4_); + Data.state.enemies.add(_loc7_); + _loc4_ += 60; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/BlobDot.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/BlobDot.as new file mode 100644 index 0000000..20b3b90 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/BlobDot.as @@ -0,0 +1,54 @@ +package com.arc.dh.objects.enemies +{ + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class BlobDot extends Enemy + { + + private static const sprite:Class = BlobDot_sprite; + + private static const SPEED:int = 100; + + private static const ROTATION_SPEED:Number = 150; + + private var degrees:int = 0; + + private var blob:Blob; + + private var _distance:Number = 0; + + public function BlobDot(param1:int, param2:int, param3:int, param4:Blob, param5:int, param6:int) + { + super(param1,param2,param6); + this.blob = param4; + this.degrees = param3; + loadGraphic(sprite,true,false,14,14); + frame = param5; + healthbar.kill(); + healthbar = null; + } + + public function move(param1:int) : void + { + var _loc2_:Number = NaN; + var _loc3_:FlxPoint = null; + _loc2_ = Math.PI / 180 * param1; + _loc3_ = this.blob.getMidpoint(); + x = _loc3_.x + this._distance * Math.cos(_loc2_) - 7; + y = _loc3_.y + this._distance * Math.sin(_loc2_) - 7; + } + + override public function update() : void + { + if(this._distance < 30) + { + this._distance += FlxG.elapsed * 50; + } + this.degrees += ROTATION_SPEED * FlxG.elapsed; + this.move(this.degrees); + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/BlobDot_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/BlobDot_sprite.as new file mode 100644 index 0000000..ea8832c --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/BlobDot_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/51_com.arc.dh.objects.enemies.BlobDot_sprite.png")] + public class BlobDot_sprite extends BitmapAsset + { + + public function BlobDot_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Blob_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Blob_sprite.as new file mode 100644 index 0000000..027824e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Blob_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/213_com.arc.dh.objects.enemies.Blob_sprite.png")] + public class Blob_sprite extends BitmapAsset + { + + public function Blob_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Boss.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Boss.as new file mode 100644 index 0000000..d86e88d --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Boss.as @@ -0,0 +1,241 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.Color; + import com.arc.dh.objects.Healthbar; + import com.arc.dh.state.BossMode; + import com.arc.dh.state.StoryMode; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.text.TextSystem; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + + public class Boss extends Enemy + { + + protected static const STATE_UNENGAGED:int = 0; + + protected static const STATE_INTRO:int = 1; + + protected static const STATE_ENGAGED:int = 2; + + protected static const STATE_OUTRO:int = 3; + + protected static const STATE_PENDING:int = 4; + + protected static const STATE_COMPLETE:int = 5; + + protected static const PENDING_DELAY:Number = 4; + + private static const SEED_SPEED:int = 100; + + protected var state:int = 0; + + protected var phases:Array = new Array(); + + protected var previousPhase:int = 100; + + protected var phase:int = 0; + + public var bosshealthbar:Healthbar; + + protected var pendingTimer:Number = 4; + + public function Boss(param1:Number, param2:Number) + { + var _loc3_:Number = param1 * Config.BLOCK_SIZE; + var _loc4_:Number = param2 * Config.BLOCK_SIZE; + _c = param1; + _r = param2; + super(_loc3_,_loc4_,1); + killable = false; + healthbar.kill(); + healthbar = null; + this.bosshealthbar = new Healthbar(); + this.bosshealthbar.alpha = 0; + Data.state.healthbars.add(this.bosshealthbar); + } + + override public function update() : void + { + var _loc1_:Function = null; + switch(this.state) + { + case STATE_UNENGAGED: + _loc1_ = this.unengaged; + break; + case STATE_INTRO: + _loc1_ = this.intro; + break; + case STATE_ENGAGED: + _loc1_ = this.engaged; + break; + case STATE_OUTRO: + _loc1_ = this.outro; + break; + case STATE_PENDING: + _loc1_ = this.pending; + break; + case STATE_COMPLETE: + _loc1_ = null; + } + if(_loc1_ != null && Boolean(_loc1_())) + { + ++this.state; + if(this.state == STATE_ENGAGED) + { + killable = true; + this.phase = 1; + } + else if(this.state == STATE_COMPLETE) + { + Data.state.complete(); + } + } + super.update(); + } + + protected function get hpp() : int + { + return hp / hpm * 100; + } + + public function unengaged() : Boolean + { + return Data.state.boss == 2; + } + + public function intro() : Boolean + { + return true; + } + + public function engaged() : Boolean + { + if(this.phases.length > 0 && this.hpp < this.phases[0]) + { + this.previousPhase = this.phases.shift(); + ++this.phase; + this.changePhase(this.phase); + } + return false; + } + + public function outro() : Boolean + { + this.state = STATE_PENDING; + return true; + } + + public function pending() : Boolean + { + this.pendingTimer -= FlxG.elapsed; + if(TextSystem.active() || this.pendingTimer > 0) + { + return false; + } + return true; + } + + public function setPhases(param1:Array) : void + { + this.phases = param1; + } + + public function changePhase(param1:int) : void + { + } + + override public function draw() : void + { + var _loc1_:int = 0; + var _loc2_:Number = NaN; + super.draw(); + if(this.bosshealthbar != null) + { + _loc1_ = this.phases.length > 0 ? int(this.phases[0]) : 0; + if(this.phases.length > 0) + { + this.bosshealthbar.bar.play("gold"); + } + else + { + this.bosshealthbar.bar.play("red"); + } + _loc2_ = (100 * hp / hpm - _loc1_) / (this.previousPhase - _loc1_); + if(healthbarOffset == 0) + { + healthbarOffset = Math.round(width / 2 - Healthbar.WIDTH / 2); + } + this.bosshealthbar.scale(_loc2_); + this.bosshealthbar.move(x + healthbarOffset,y - 7,1); + } + } + + override public function kill() : void + { + if(this.bosshealthbar != null) + { + this.bosshealthbar.kill(); + } + ArcParticleSystem.emit(Data.state.particles,Color.RED,x,y,20,2,1,0,-50,50,-50,50); + ArcParticleSystem.emit(Data.state.particles,Color.BLACK,x,y,20,2,1,0,-50,50,-50,50); + var _loc1_:int = ArcU.rand(7,13); + var _loc2_:int = 2 * Data.state.chapter; + if(Data.state is BossMode && (Data.state as BossMode).isHeroic()) + { + _loc2_ *= 3; + } + if(!(Data.state is BossMode && (Data.state as BossMode).isPractice())) + { + Data.state.addDiamonds(x,y,_loc1_ + _loc2_,0); + if(Data.state is BossMode) + { + Data.state.createHeart(x - 5,y); + Data.state.createHeart(x,y - 10); + Data.state.createHeart(x + 5,y); + } + } + visible = false; + solid = false; + velocity.x = velocity.y = 0; + acceleration.x = acceleration.y = 0; + this.outro(); + } + + protected function spawnBurst(param1:int, param2:int) : void + { + ArcParticleSystem.emit(Data.state.particles,Color.RED,param1,param2,20,1,1,0,-50,50,-50,50); + } + + protected function mode(param1:Number, param2:Number, param3:Number) : Number + { + if(Data.state is StoryMode) + { + return param1; + } + if(this.heroic) + { + return param3; + } + return param2; + } + + protected function get heroic() : Boolean + { + return Data.state is BossMode && (Data.state as BossMode).isHeroic(); + } + + protected function shoot(param1:int, param2:int, param3:int, param4:int = 1) : Seed + { + var _loc5_:Number = param3 * Math.PI / 180; + var _loc6_:Seed = new Seed(param1,param2,param4); + _loc6_.velocity.x = SEED_SPEED * Math.cos(_loc5_); + _loc6_.velocity.y = SEED_SPEED * Math.sin(_loc5_); + Data.state.enemies.add(_loc6_); + return _loc6_; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/BouncingSlime.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/BouncingSlime.as new file mode 100644 index 0000000..ad27962 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/BouncingSlime.as @@ -0,0 +1,75 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.state.HorizontalMode; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcU; + + public class BouncingSlime extends Enemy + { + + private static const sprite:Class = BouncingSlime_sprite; + + public var _jumping:Boolean = false; + + public function BouncingSlime(param1:Number, param2:Number, param3:int) + { + var _loc4_:Number = NaN; + var _loc5_:Number = NaN; + _loc4_ = param1 * Config.BLOCK_SIZE; + _loc5_ = param2 * Config.BLOCK_SIZE; + _c = param1; + _r = param2; + super(_loc4_,_loc5_,param3); + loadGraphic(sprite,true,true,14,11); + facing = ArcU.rand(0,1) == 0 ? LEFT : RIGHT; + if(Data.state is HorizontalMode) + { + facing = RIGHT; + } + velocity.x = facing == LEFT ? -MOVE_SPEED : MOVE_SPEED; + width = 10; + offset.x = 2; + y += 1; + hittable = true; + acceleration.y = 400; + var _loc6_:int = ArcU.rand(0,11); + addAnimation("walk",[_loc6_ * 2,_loc6_ * 2 + 1],5,true); + play("walk"); + } + + override public function unhit() : void + { + go(_hitDirection); + super.unhit(); + } + + override public function update() : void + { + var _loc1_:int = 0; + var _loc2_:int = 0; + var _loc3_:uint = 0; + if(!_hit) + { + _loc1_ = x / Config.BLOCK_SIZE + (velocity.x > 0 ? 1 : 0); + _loc2_ = y / Config.BLOCK_SIZE + 1; + _loc3_ = Data.state.tilemap.getTile(_loc1_,_loc2_); + if(_loc3_ == 0 && !this._jumping) + { + velocity.y = -250; + this._jumping = true; + } + else if(velocity.x == 0) + { + go(facing == LEFT ? RIGHT : LEFT); + } + if(touching & DOWN) + { + this._jumping = false; + } + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/BouncingSlime_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/BouncingSlime_sprite.as new file mode 100644 index 0000000..58a1032 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/BouncingSlime_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/73_com.arc.dh.objects.enemies.BouncingSlime_sprite.png")] + public class BouncingSlime_sprite extends BitmapAsset + { + + public function BouncingSlime_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/CeilingPlant.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/CeilingPlant.as new file mode 100644 index 0000000..f1d8d4b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/CeilingPlant.as @@ -0,0 +1,85 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.state.HorizontalMode; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + + public class CeilingPlant extends Enemy + { + + private static const sprite:Class = CeilingPlant_sprite; + + private static const spriteGold:Class = CeilingPlant_spriteGold; + + private static const SHOOT_TIME:Number = 3; + + private var _shootTimer:Number = ArcU.rand(10,SHOOT_TIME * 10) / 10; + + public function CeilingPlant(param1:Number, param2:Number, param3:int) + { + var _loc4_:Number = NaN; + var _loc5_:Number = NaN; + _loc4_ = param1 * Config.BLOCK_SIZE; + _loc5_ = param2 * Config.BLOCK_SIZE - 13; + _c = param1; + _r = param2; + super(_loc4_,_loc5_,param3); + loadGraphic(sprite,true,true,19,14); + addAnimation("idle",[0]); + addAnimation("shoot",[1,2,3],6,false); + addAnimation("unshoot",[3,2,1,0],6,false); + play("idle"); + } + + override public function update() : void + { + var _loc1_:Seed = null; + var _loc2_:int = 0; + var _loc3_:int = 0; + var _loc4_:int = 0; + var _loc5_:int = 0; + var _loc6_:Number = NaN; + this._shootTimer -= FlxG.elapsed; + if(this._shootTimer <= 0 && getScreenXY().y >= 0) + { + play("shoot"); + this._shootTimer = SHOOT_TIME + ArcU.rand(0,SHOOT_TIME * 50) / 100; + } + else if(this._shootTimer <= 0) + { + this._shootTimer = SHOOT_TIME / 10 + ArcU.rand(0,SHOOT_TIME * 50) / 100; + } + if(_curAnim.name == "shoot" && finished) + { + play("unshoot"); + _loc1_ = new Seed(x + width / 2 - 3,y + 8,level); + _loc2_ = Data.state.player.x + Data.state.player.width / 2; + _loc3_ = Data.state.player.y + Data.state.player.height / 2; + _loc4_ = _loc1_.x + _loc1_.width / 2; + _loc5_ = _loc1_.y + _loc1_.height / 2; + _loc6_ = Math.atan2(_loc3_ - _loc5_,_loc2_ - _loc4_); + _loc1_.velocity.x = 120 * Math.cos(_loc6_); + _loc1_.velocity.y = 120 * Math.sin(_loc6_); + if(Data.state is HorizontalMode) + { + _loc1_.velocity.x += (Data.state as HorizontalMode).camera.velocity.x; + } + Data.state.enemies.add(_loc1_); + } + if(_curAnim.name == "unshoot" && finished) + { + play("idle"); + } + super.update(); + } + + override public function goldenize() : void + { + killable = false; + loadGraphic(spriteGold,true,true,19,14); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/CeilingPlant_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/CeilingPlant_sprite.as new file mode 100644 index 0000000..298ed0f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/CeilingPlant_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/121_com.arc.dh.objects.enemies.CeilingPlant_sprite.png")] + public class CeilingPlant_sprite extends BitmapAsset + { + + public function CeilingPlant_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/CeilingPlant_spriteGold.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/CeilingPlant_spriteGold.as new file mode 100644 index 0000000..61cbf3e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/CeilingPlant_spriteGold.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/224_com.arc.dh.objects.enemies.CeilingPlant_spriteGold.png")] + public class CeilingPlant_spriteGold extends BitmapAsset + { + + public function CeilingPlant_spriteGold() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ClimbingSlime.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ClimbingSlime.as new file mode 100644 index 0000000..5574543 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ClimbingSlime.as @@ -0,0 +1,100 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcU; + + public class ClimbingSlime extends Enemy + { + + private static const sprite:Class = ClimbingSlime_sprite; + + private var _jumping:Boolean = false; + + public function ClimbingSlime(param1:Number, param2:Number, param3:int) + { + var _loc4_:Number = NaN; + var _loc5_:Number = NaN; + _loc4_ = param1 * Config.BLOCK_SIZE; + _loc5_ = param2 * Config.BLOCK_SIZE; + _c = param1; + _r = param2; + super(_loc4_,_loc5_,param3); + loadGraphic(sprite,true,true,14,11); + facing = ArcU.rand(0,1) == 0 ? LEFT : RIGHT; + velocity.x = facing == LEFT ? -MOVE_SPEED : MOVE_SPEED; + width = 10; + offset.x = 2; + y += 1; + hittable = true; + acceleration.y = 400; + var _loc6_:int = ArcU.rand(0,11); + addAnimation("walk",[_loc6_ * 2,_loc6_ * 2 + 1],5,true); + play("walk"); + } + + override public function unhit() : void + { + go(_hitDirection); + super.unhit(); + } + + override public function update() : void + { + var _loc1_:int = 0; + var _loc2_:int = 0; + var _loc3_:uint = 0; + var _loc4_:int = 0; + if(!_hit) + { + _loc1_ = x / Config.BLOCK_SIZE + (velocity.x > 0 ? 1 : 0); + _loc2_ = y / Config.BLOCK_SIZE + 1; + _loc3_ = Data.state.tilemap.getTile(_loc1_,_loc2_); + if(_loc3_ == 0 && !this._jumping) + { + velocity.y = -100; + this._jumping = true; + } + else + { + _loc4_ = facing == RIGHT ? 3 : -2; + _loc1_ = x / Config.BLOCK_SIZE + _loc4_; + _loc2_ = y / Config.BLOCK_SIZE; + if(_loc1_ < Config.BLOCK_WIDTH && _loc1_ > 0 && Data.state.tilemap.getTile(_loc1_,_loc2_) != 0 && !this._jumping) + { + if(Data.state.tilemap.getTile(_loc1_,_loc2_ - 4) == 0 && Data.state.tilemap.getTile(_loc1_ - _loc4_,_loc2_ - 4) == 0) + { + velocity.y = -200; + this._jumping = true; + } + else if(Data.state.tilemap.getTile(_loc1_,_loc2_ - 3) == 0 && Data.state.tilemap.getTile(_loc1_ - _loc4_,_loc2_ - 3) == 0) + { + velocity.y = -160; + this._jumping = true; + } + else if(Data.state.tilemap.getTile(_loc1_,_loc2_ - 2) == 0 && Data.state.tilemap.getTile(_loc1_ - _loc4_,_loc2_ - 2) == 0) + { + velocity.y = -120; + this._jumping = true; + } + else if(Data.state.tilemap.getTile(_loc1_,_loc2_ - 1) == 0 && Data.state.tilemap.getTile(_loc1_ - _loc4_,_loc2_ - 1) == 0) + { + velocity.y = 0; + this._jumping = true; + } + } + } + if(velocity.x == 0) + { + go(facing == LEFT ? RIGHT : LEFT); + } + if(Boolean(touching & DOWN) && velocity.y >= 0) + { + this._jumping = false; + } + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ClimbingSlime_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ClimbingSlime_sprite.as new file mode 100644 index 0000000..2b89634 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ClimbingSlime_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/283_com.arc.dh.objects.enemies.ClimbingSlime_sprite.png")] + public class ClimbingSlime_sprite extends BitmapAsset + { + + public function ClimbingSlime_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/DiveBird.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/DiveBird.as new file mode 100644 index 0000000..cb650bd --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/DiveBird.as @@ -0,0 +1,73 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcU; + + public class DiveBird extends Enemy + { + + private static const sprite:Class = DiveBird_sprite; + + private static const FLY_SPEED:Number = 180; + + public function DiveBird(param1:Number, param2:Number, param3:int, param4:int) + { + var _loc5_:Number = NaN; + var _loc6_:Number = NaN; + _loc5_ = param1 * Config.BLOCK_SIZE; + _loc6_ = param2 * Config.BLOCK_SIZE; + _c = param1; + _r = param2; + super(_loc5_,_loc6_,param3); + loadGraphic(sprite,true,true,33,18); + width = 20; + height = 11; + offset.x = 6; + offset.y = 6; + facing = param4; + var _loc7_:int = int(facing); + this.goAt(ArcU.rand(30,130) / 200); + if(_loc7_ == LEFT) + { + facing = LEFT; + velocity.x *= -1; + } + velocity.y = ArcU.rand(10,40); + killable = false; + alpha = 0.5; + addAnimation("fly",[0,1,2,1],5,true); + play("fly"); + } + + private function goAt(param1:Number) : void + { + velocity.x = FLY_SPEED * Math.cos(param1); + velocity.y = FLY_SPEED * Math.sin(param1); + facing = velocity.x < 0 ? LEFT : RIGHT; + } + + override public function update() : void + { + var _loc1_:int = 0; + if(velocity.x == 0) + { + this.goAt(Math.atan2(Data.state.player.y - y,Data.state.player.x - x)); + killable = true; + alpha = 1; + } + if(velocity.y == 0) + { + _loc1_ = int(facing); + this.goAt(-ArcU.rand(80,200) / 200); + if(_loc1_ == LEFT) + { + facing = LEFT; + velocity.x *= -1; + } + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/DiveBird_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/DiveBird_sprite.as new file mode 100644 index 0000000..3a056bf --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/DiveBird_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/46_com.arc.dh.objects.enemies.DiveBird_sprite.png")] + public class DiveBird_sprite extends BitmapAsset + { + + public function DiveBird_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Enemy.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Enemy.as new file mode 100644 index 0000000..bed3945 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Enemy.as @@ -0,0 +1,271 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.Color; + import com.arc.dh.entities.Entity; + import com.arc.dh.objects.Bullet; + import com.arc.dh.objects.Diamond; + import com.arc.dh.objects.Healthbar; + import com.arc.dh.objects.Missile; + import com.arc.dh.state.BossMode; + import com.arc.dh.state.EscapeMode; + import com.arc.dh.state.HorizontalMode; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + + public class Enemy extends Entity + { + + public static const MOVE_SPEED:int = 50; + + protected static const BASE_HP:int = 50; + + public static const FLASH_TIME:Number = 0.05; + + protected var _moveSpeed:int = 50; + + public var hp:int = 100; + + public var hpm:int = 100; + + public var flashTimer:Number = 0; + + public var level:int = 1; + + public var killable:Boolean = true; + + public var pierce:Boolean = false; + + protected var _hit:Boolean = false; + + protected var _hitDirection:int = 0; + + public var hittable:Boolean = false; + + public var missileonly:Boolean = false; + + public var bossenemy:Boolean = false; + + protected var healthbar:Healthbar; + + protected var healthbarOffset:int = 0; + + protected var healthbarAlpha:Number = 0; + + protected var _c:int; + + protected var _r:int; + + protected var _pixel:uint; + + private var outsideFunction:Function; + + public function Enemy(param1:Number, param2:Number, param3:int, param4:Boolean = true) + { + super(param1,param2); + this.level = param3; + this.hp = BASE_HP + (this.level - 1) * 5 * (Data.state is BossMode ? 10 : 1); + this.hpm = this.hp; + Data.state.spawner[this._c + "," + this._r] = true; + this.killable = param4; + if(this.killable) + { + this.healthbar = new Healthbar(); + this.healthbar.visible = false; + this.healthbar.alpha = 0; + Data.state.healthbars.add(this.healthbar); + } + if(Data.state is HorizontalMode) + { + this.outsideFunction = this.runmodeOutside; + } + else + { + this.outsideFunction = this.playmodeOutside; + } + } + + private function runmodeOutside() : Boolean + { + var _loc1_:int = x / Config.BLOCK_SIZE; + if(_loc1_ <= Data.state.despawnTop - 2) + { + return true; + } + return false; + } + + private function playmodeOutside() : Boolean + { + var _loc1_:int = y / Config.BLOCK_SIZE; + if(_loc1_ >= Data.state.despawnBottom + 2 || _loc1_ <= Data.state.despawnTop - 2) + { + return true; + } + return false; + } + + override public function update() : void + { + if(this.outsideFunction()) + { + Data.state.spawner[this._c + "," + this._r] = null; + exists = false; + alive = false; + if(this.healthbar != null) + { + this.healthbar.kill(); + } + if(this is Boss && (this as Boss).bosshealthbar != null) + { + (this as Boss).bosshealthbar.kill(); + } + } + if(this.flashTimer > 0) + { + this.flashTimer -= FlxG.elapsed; + color = 12268339; + } + else + { + color = 16777215; + } + if(Boolean(touching & DOWN) && Boolean(this._hit) && velocity.y == 0) + { + this.unhit(); + } + super.update(); + } + + public function flash() : void + { + this.flashTimer = FLASH_TIME; + } + + public function hit(param1:int) : void + { + if(!this.hittable) + { + return; + } + if(param1 == LEFT) + { + velocity.x = -120; + velocity.y = -60; + } + else + { + velocity.x = 120; + velocity.y = -60; + } + y -= 2; + this._hit = true; + this._hitDirection = param1; + } + + public function unhit() : void + { + this._hit = false; + } + + public function damage(param1:int, param2:Bullet = null) : void + { + if(this.missileonly && !(param2 is Missile)) + { + return; + } + this.flash(); + this.hp -= param1; + if(this.hp <= 0) + { + this.kill(); + } + else if(this.healthbar != null) + { + this.healthbar.visible = true; + } + } + + override public function kill() : void + { + if(Data.state.boss == 0) + { + ++Data.state.cenemies; + ++Data.enemies; + AchievementSystem.enemies(); + SoundSystem.play(Sound["EXPLODE" + ArcU.rand(1,5)]); + Data.state.despawn(this._c,this._r); + if(ArcU.rand(1,20) == 5) + { + Data.state.createHeart(x,y); + } + Data.state.addDiamonds(x,y,ArcU.rand(2,Diamond.valueFromLevel(this.level) * 3 * (Data.state is EscapeMode ? 1 : 1) * (Data.state is HorizontalMode ? 0.6 : 1))); + } + ArcParticleSystem.emit(Data.state.particles,Color.RED,getMidpoint().x,getMidpoint().y,5,1,0.3,0,-50,50,-50,50); + if(this.healthbar != null) + { + this.healthbar.kill(); + } + super.kill(); + } + + override public function draw() : void + { + super.draw(); + if(this.healthbar != null && this.healthbar.visible) + { + if(this.healthbarAlpha < 1) + { + this.healthbarAlpha += FlxG.elapsed * 5; + } + if(this.healthbarOffset == 0) + { + this.healthbarOffset = Math.round(width / 2 - Healthbar.WIDTH / 2); + } + this.healthbar.scale(this.hp / this.hpm); + this.healthbar.move(x + this.healthbarOffset,y - 7,this.healthbarAlpha); + } + } + + protected function reverse() : void + { + this.go(facing == LEFT ? RIGHT : LEFT); + } + + protected function go(param1:uint) : void + { + facing = param1; + if(param1 == LEFT) + { + velocity.x = -this._moveSpeed; + x = x - 1; + } + else + { + velocity.x = this._moveSpeed; + x += 1; + } + } + + public function silentKill() : void + { + exists = false; + alive = false; + visible = false; + if(this.healthbar != null) + { + this.healthbar.kill(); + } + } + + public function goldenize() : void + { + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/FloorPlant.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/FloorPlant.as new file mode 100644 index 0000000..c7a3e60 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/FloorPlant.as @@ -0,0 +1,80 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + + public class FloorPlant extends Enemy + { + + private static const sprite:Class = FloorPlant_sprite; + + private static const spriteGold:Class = FloorPlant_spriteGold; + + private static const SHOOT_TIME:Number = 3; + + private var _shootTimer:Number = 3; + + public function FloorPlant(param1:Number, param2:Number, param3:int) + { + var _loc4_:Number = NaN; + var _loc5_:Number = NaN; + _loc4_ = param1 * Config.BLOCK_SIZE; + _loc5_ = param2 * Config.BLOCK_SIZE + 3; + _c = param1; + _r = param2; + super(_loc4_,_loc5_,param3); + loadGraphic(sprite,true,true,19,9); + addAnimation("idle",[0]); + addAnimation("shoot",[1,2,3,4],10,false); + addAnimation("unshoot",[4,3,2,1,0],10,false); + play("idle"); + } + + override public function update() : void + { + var _loc1_:Number = NaN; + var _loc2_:Seed = null; + var _loc3_:Number = NaN; + this._shootTimer -= FlxG.elapsed; + if(this._shootTimer <= 0 && getScreenXY().y >= 0) + { + play("shoot"); + this._shootTimer = SHOOT_TIME + ArcU.rand(0,SHOOT_TIME * 50) / 100; + } + else if(this._shootTimer <= 0) + { + this._shootTimer = SHOOT_TIME / 3 + ArcU.rand(0,SHOOT_TIME * 50) / 100; + } + if(_curAnim.name == "shoot" && finished) + { + play("unshoot"); + _loc1_ = 70; + while(_loc1_ < 130) + { + _loc2_ = new Seed(x + width / 2 - 3,y + 4,level); + _loc2_.velocity.y = 100; + _loc3_ = Math.PI / 180 * (_loc1_ + 180); + _loc2_.velocity.x = 120 * Math.cos(_loc3_); + _loc2_.velocity.y = 180 * Math.sin(_loc3_); + _loc2_.acceleration.y = 300; + Data.state.enemies.add(_loc2_); + _loc1_ += 15; + } + } + if(_curAnim.name == "unshoot" && finished) + { + play("idle"); + } + super.update(); + } + + override public function goldenize() : void + { + killable = false; + loadGraphic(spriteGold,true,true,19,9); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/FloorPlant_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/FloorPlant_sprite.as new file mode 100644 index 0000000..2390fce --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/FloorPlant_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/47_com.arc.dh.objects.enemies.FloorPlant_sprite.png")] + public class FloorPlant_sprite extends BitmapAsset + { + + public function FloorPlant_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/FloorPlant_spriteGold.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/FloorPlant_spriteGold.as new file mode 100644 index 0000000..76dce8b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/FloorPlant_spriteGold.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/173_com.arc.dh.objects.enemies.FloorPlant_spriteGold.png")] + public class FloorPlant_spriteGold extends BitmapAsset + { + + public function FloorPlant_spriteGold() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Laser.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Laser.as new file mode 100644 index 0000000..f206692 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Laser.as @@ -0,0 +1,86 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxPoint; + + public class Laser extends Enemy + { + + private static const sprite:Class = Laser_sprite; + + public static const spriteH:Class = Laser_spriteH; + + public static const spriteV:Class = Laser_spriteV; + + private var _beam:ArcSprite; + + private var _ldx:int; + + private var _ldy:int; + + public function Laser(param1:Number, param2:Number, param3:int, param4:int, param5:FlxPoint) + { + super(param1,param2,param3); + loadGraphic(sprite,true,true,12,12); + if(param4 == 0) + { + y -= 10; + } + var _loc6_:int = x; + var _loc7_:int = y; + var _loc8_:int = 10; + var _loc9_:int = 10; + if(param4 == 0) + { + _loc6_ += 1; + _loc9_ = param5.y * Config.BLOCK_SIZE - param2 + 11; + } + else if(param4 == 1) + { + _loc7_ += 5; + _loc8_ = param1 - param5.x * Config.BLOCK_SIZE + 11; + _loc6_ -= _loc8_ - 6; + } + else if(param4 == 2) + { + _loc6_ += 1; + _loc9_ = param2 - param5.y * Config.BLOCK_SIZE + 11; + _loc7_ -= _loc9_ - 11; + } + else if(param4 == 3) + { + _loc7_ += 5; + _loc8_ = param5.x * Config.BLOCK_SIZE - param1 + 11; + } + var _loc10_:Class = param4 == 0 || param4 == 2 ? spriteV : spriteH; + this._beam = new LaserBeam(_loc6_,_loc7_,_loc8_,_loc9_,_loc10_,param4); + Data.state.enemies.add(this._beam); + this._ldx = _loc6_ - x; + this._ldy = _loc7_ - y; + addAnimation("facing",[param4]); + play("facing"); + } + + override public function kill() : void + { + this._beam.kill(); + super.kill(); + } + + override public function update() : void + { + this._beam.x = x + this._ldx + 3; + this._beam.y = y + this._ldy; + super.update(); + } + + override public function goldenize() : void + { + killable = false; + super.goldenize(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/LaserBeam.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/LaserBeam.as new file mode 100644 index 0000000..79970ad --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/LaserBeam.as @@ -0,0 +1,55 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.flixel.ArcSprite; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + + public class LaserBeam extends Enemy + { + + private static const BEAM_ALPHA:Number = 0.5; + + private var _beam:ArcSprite; + + public var face:int; + + public function LaserBeam(param1:Number, param2:Number, param3:int, param4:int, param5:Class, param6:int) + { + super(param1,param2,1,false); + loadGraphic(param5,true,true,param3,param4); + pierce = false; + this.face = param6; + if(param5 == Laser.spriteH) + { + height = 4; + offset.y = 3; + y += 3; + } + else + { + width = 4; + offset.x = 3; + x += 3; + } + alpha = 0; + immovable = true; + var _loc7_:int = ArcU.rand(0,4); + addAnimation("color",[_loc7_]); + play("color"); + } + + override public function update() : void + { + if(alpha < BEAM_ALPHA) + { + alpha += FlxG.elapsed / 2; + if(alpha > BEAM_ALPHA) + { + alpha = BEAM_ALPHA; + } + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Laser_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Laser_sprite.as new file mode 100644 index 0000000..6c0b453 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Laser_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/182_com.arc.dh.objects.enemies.Laser_sprite.png")] + public class Laser_sprite extends BitmapAsset + { + + public function Laser_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Laser_spriteH.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Laser_spriteH.as new file mode 100644 index 0000000..fa35023 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Laser_spriteH.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/273_com.arc.dh.objects.enemies.Laser_spriteH.png")] + public class Laser_spriteH extends BitmapAsset + { + + public function Laser_spriteH() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Laser_spriteV.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Laser_spriteV.as new file mode 100644 index 0000000..4658c77 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Laser_spriteV.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/263_com.arc.dh.objects.enemies.Laser_spriteV.png")] + public class Laser_spriteV extends BitmapAsset + { + + public function Laser_spriteV() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Orb.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Orb.as new file mode 100644 index 0000000..92459e7 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Orb.as @@ -0,0 +1,38 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.Color; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcParticleSystem; + import org.flixel.FlxG; + + public class Orb extends Enemy + { + + private static const sprite:Class = Orb_sprite; + + private static const PARTICLE_DELAY:Number = 0.1; + + private var _particleTimer:Number = 0.1; + + public function Orb(param1:int, param2:int, param3:int) + { + super(param1,param2,1); + loadGraphic(sprite,true,false,12,30); + hp = hpm = param3; + ArcParticleSystem.emit(Data.state.particles,Color.WHITE,x,y,20,1,1,0,-50,50,-50,50,width,height); + ArcParticleSystem.emit(Data.state.particles,Color.PURPLE,x,y,20,1,1,0,-50,50,-50,50,width,height); + } + + override public function update() : void + { + this._particleTimer -= FlxG.elapsed; + if(this._particleTimer <= 0) + { + this._particleTimer = PARTICLE_DELAY; + ArcParticleSystem.emit(Data.state.particles,Color.WHITE,x + 6,y + 6,1,1,1,0,-50,50,-50,50); + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Orb_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Orb_sprite.as new file mode 100644 index 0000000..5107664 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Orb_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/126_com.arc.dh.objects.enemies.Orb_sprite.png")] + public class Orb_sprite extends BitmapAsset + { + + public function Orb_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Plant.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Plant.as new file mode 100644 index 0000000..f069b80 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Plant.as @@ -0,0 +1,82 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + + public class Plant extends Enemy + { + + private static const sprite:Class = Plant_sprite; + + private static const spriteGold:Class = Plant_spriteGold; + + private static const SHOOT_TIME:Number = 2.5; + + private var _shootTimer:Number = ArcU.rand(10,SHOOT_TIME * 10) / 10; + + public function Plant(param1:Number, param2:Number, param3:int, param4:int) + { + var _loc5_:Number = NaN; + var _loc6_:Number = NaN; + _loc5_ = param1 * Config.BLOCK_SIZE; + _loc6_ = param2 * Config.BLOCK_SIZE; + _c = param1; + _r = param2; + super(_loc5_,_loc6_,param3); + loadGraphic(sprite,true,true,14,11); + facing = param4; + if(param4 == LEFT) + { + x += 2; + } + else + { + x -= 4; + } + addAnimation("idle",[0]); + addAnimation("shoot",[1,2],8,true); + play("idle"); + } + + override public function update() : void + { + var _loc1_:Seed = null; + this._shootTimer -= FlxG.elapsed; + if(this._shootTimer <= 0 && getScreenXY().y >= 0) + { + play("shoot"); + this._shootTimer = SHOOT_TIME + ArcU.rand(0,SHOOT_TIME * 50) / 100; + } + else if(this._shootTimer <= 0) + { + this._shootTimer = SHOOT_TIME / 10 + ArcU.rand(0,SHOOT_TIME * 20) / 100; + } + if(_curAnim.name == "shoot" && finished) + { + play("idle"); + _loc1_ = new Seed(x,y + 3,level); + if(facing == RIGHT) + { + _loc1_.velocity.x = 100; + _loc1_.x += 6; + } + else + { + _loc1_.velocity.x = -100; + _loc1_.x -= 0; + } + Data.state.enemies.add(_loc1_); + } + super.update(); + } + + override public function goldenize() : void + { + killable = false; + loadGraphic(spriteGold,true,true,14,11); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Plant_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Plant_sprite.as new file mode 100644 index 0000000..bd587b5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Plant_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/211_com.arc.dh.objects.enemies.Plant_sprite.png")] + public class Plant_sprite extends BitmapAsset + { + + public function Plant_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Plant_spriteGold.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Plant_spriteGold.as new file mode 100644 index 0000000..9a533f9 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Plant_spriteGold.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/298_com.arc.dh.objects.enemies.Plant_spriteGold.png")] + public class Plant_spriteGold extends BitmapAsset + { + + public function Plant_spriteGold() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor.as new file mode 100644 index 0000000..38843cb --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor.as @@ -0,0 +1,1050 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.Color; + import com.arc.dh.state.BossMode; + import com.arc.dh.state.StoryMode; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.text.Avatar; + import com.arc.dh.util.text.TextSystem; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcSprite; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class Professor extends Boss + { + + private static const sprite:Class = Professor_sprite; + + private static const shieldSprite:Class = Professor_shieldSprite; + + private static const equipmentSprite:Class = Professor_equipmentSprite; + + private static const endingSprite:Class = Professor_endingSprite; + + private static const sadSprite:Class = Professor_sadSprite; + + private static const LASER_DELAY:Number = 1.5; + + private static const JUMP_DELAY:Number = 1; + + private static const EXPLODE_SEED_SPEED:Number = 120; + + private static const SPRAY_DELAY:Number = 3; + + private static const LASER_SPEED:Number = 70; + + private static const LASER_SPAWN_DELAY:Number = 15; + + private static const ROUND_EXPLODE_SPEED:Number = 150; + + private static const ROUND_EXPLODE_DELAY:Number = 6; + + private static const SLIME_SPAWN_DELAY:Number = 5; + + private static const ENDING_FADER_SPEED:Number = 4; + + private var laserTimer:Number = 1; + + private var jumpTimer:Number = 1; + + private var sprayTimer:Number = 0; + + private var _thisPoint:FlxPoint = new FlxPoint(); + + private var _otherPoint:FlxPoint = new FlxPoint(); + + private var _laserLeft:Laser; + + private var _laserLeftTarget:int = -12; + + private var _laserRight:Laser; + + private var _laserRightTarget:int = -336; + + private var _laserReturn:Boolean = false; + + private var stage:int = -1; + + private var _enemyTracker:Array = new Array(); + + private var _tempEnemies:Array = new Array(); + + private var _laserSpawnTimer:Number = 1; + + private var _shadowOrbTimer:Number = 2; + + private var _shadowOrbs:Array = new Array(); + + private var _shadowOrbState:int = 0; + + private var _shadowOrbShootTimer:Number = 1; + + private var _shadowOrbsShot:int = 0; + + private var _roundExplodeTimer:Number = 6; + + private var slimeTimer:Number = 1; + + private var _shieldSprite:ArcSprite; + + private var endingPhase:Boolean = false; + + private var endingStage:int = 0; + + private var endingStageInitialized:Boolean = false; + + private var endingStageComplete:Boolean = false; + + private var endingTimer:Number = 0; + + private var endingOrb:ArcSprite; + + private var endingGun:ArcSprite; + + public var ending:ArcSprite; + + public var sad:ArcSprite; + + public function Professor(param1:Number, param2:Number) + { + super(param1,param2); + loadGraphic(sprite,true,true,16,24); + offset.y = 6; + height = 16; + offset.x = 3; + width = 10; + facing = LEFT; + acceleration.y = 400; + _moveSpeed = 100; + hp = hpm = mode(12000,30000,50000); + setPhases([80,60]); + addAnimation("walk",[0,1,2,3,4],7,true); + addAnimation("stand",[6,7],4,true); + addAnimation("jump",[5]); + this._shieldSprite = new ArcSprite(0,0,shieldSprite); + this._shieldSprite.visible = false; + } + + override public function intro() : Boolean + { + go(LEFT); + var _loc1_:Enemy = new Blade(15,9,1); + this._tempEnemies.push(_loc1_); + Data.state.penemies.add(_loc1_); + if(heroic) + { + _loc1_ = new Plant(1,4,1,RIGHT); + Data.state.enemies.add(_loc1_); + _loc1_.goldenize(); + _loc1_ = new Plant(1,9,1,RIGHT); + Data.state.enemies.add(_loc1_); + _loc1_.goldenize(); + _loc1_ = new Plant(28,5,1,LEFT); + Data.state.enemies.add(_loc1_); + _loc1_.goldenize(); + _loc1_ = new Plant(28,14,1,LEFT); + Data.state.enemies.add(_loc1_); + _loc1_.goldenize(); + } + super.intro(); + return true; + } + + override public function outro() : Boolean + { + var _loc1_:Enemy = null; + for each(_loc1_ in Data.state.enemies.members) + { + if(!(_loc1_ is Boss)) + { + _loc1_.silentKill(); + } + } + super.outro(); + return true; + } + + override public function engaged() : Boolean + { + var _loc1_:int = 0; + var _loc2_:int = 0; + var _loc3_:uint = 0; + var _loc4_:int = 0; + var _loc5_:Number = NaN; + var _loc6_:Number = NaN; + var _loc7_:Number = NaN; + if(phase < 3) + { + } + if(solid && phase < 3) + { + if(velocity.x == 0) + { + go(facing == LEFT ? RIGHT : LEFT); + } + if(touching & DOWN) + { + this.jumpTimer -= FlxG.elapsed; + if(this.jumpTimer <= 0) + { + velocity.y = -ArcU.rand(100,400); + this.jumpTimer = JUMP_DELAY + ArcU.rand(0,500) / 1000; + } + } + _loc1_ = x / Config.BLOCK_SIZE + (velocity.x > 0 ? 1 : 0); + _loc2_ = y / Config.BLOCK_SIZE + 2; + _loc3_ = Data.state.tilemap.getTile(_loc1_,_loc2_); + if(_loc3_ == 0 && Boolean(touching & DOWN)) + { + velocity.y = -250; + } + this._thisPoint.x = x + 5; + this._thisPoint.y = y + 8; + this._otherPoint.x = Data.state.player.x + Data.state.player.width / 2; + this._otherPoint.y = Data.state.player.y + Data.state.player.height / 2; + this.sprayTimer -= FlxG.elapsed; + if(Data.state.tilemap.ray(this._thisPoint,this._otherPoint) && this.sprayTimer <= 0 && (this._otherPoint.x < this._thisPoint.x && facing == LEFT || this._otherPoint.x > this._thisPoint.x && facing == RIGHT)) + { + this.sprayTimer = SPRAY_DELAY - mode(0,0,2); + _loc4_ = facing == LEFT ? -7 : 3; + _loc5_ = Math.atan2(this._otherPoint.y - this._thisPoint.y,this._otherPoint.x - this._thisPoint.x); + if(phase == 1) + { + this.shootSeed(this._thisPoint.x + _loc4_,this._thisPoint.y - 5,_loc5_); + } + else if(phase == 2) + { + this.shootSeed(this._thisPoint.x + _loc4_,this._thisPoint.y - 5,_loc5_ - Math.PI / 56); + this.shootSeed(this._thisPoint.x + _loc4_,this._thisPoint.y - 5,_loc5_ + Math.PI / 56); + } + else if(phase == 3) + { + this.shootSeed(this._thisPoint.x + _loc4_,this._thisPoint.y - 5,_loc5_ - Math.PI / 32); + this.shootSeed(this._thisPoint.x + _loc4_,this._thisPoint.y - 5,_loc5_); + this.shootSeed(this._thisPoint.x + _loc4_,this._thisPoint.y - 5,_loc5_ + Math.PI / 32); + } + } + if(phase == 1) + { + _moveSpeed = 100; + } + else if(phase == 2) + { + _moveSpeed = 100; + } + else if(phase == 3) + { + _moveSpeed = 125; + } + } + if(phase < 3) + { + if(solid) + { + if(phase == 3) + { + play("stand"); + } + else + { + play("walk"); + } + } + else + { + play("stand"); + } + } + if(this._laserLeft != null && this._laserRight != null) + { + if(this.stage == 3) + { + this.laserTimer -= FlxG.elapsed; + if(phase >= 2 && this.laserTimer <= 0) + { + this.laserTimer = LASER_DELAY; + this._laserLeftTarget = ArcU.rand(12,200); + } + this._laserRightTarget = this._laserLeftTarget + 130; + } + if(this._laserLeftTarget > 0 && this._laserLeft.x < this._laserLeftTarget) + { + this._laserLeft.x += LASER_SPEED * FlxG.elapsed; + if(this._laserLeft.x > this._laserLeftTarget) + { + this._laserLeft.x = this._laserLeftTarget; + if(this._laserReturn) + { + this._laserLeftTarget = -12; + } + } + } + else if(this._laserLeftTarget > 0 && this._laserLeft.x > this._laserLeftTarget) + { + this._laserLeft.x -= LASER_SPEED * FlxG.elapsed; + if(this._laserLeft.x < this._laserLeftTarget) + { + this._laserLeft.x = this._laserLeftTarget; + if(this._laserReturn) + { + this._laserLeftTarget = -12; + } + } + } + else if(this._laserLeftTarget < 0 && this._laserLeft.x > this._laserLeftTarget * -1) + { + this._laserLeft.x -= LASER_SPEED * FlxG.elapsed; + if(this._laserLeft.x < this._laserLeftTarget * -1) + { + this._laserLeft.x = this._laserLeftTarget * -1; + } + } + if(this._laserRightTarget > 0 && this._laserRight.x > this._laserRightTarget) + { + this._laserRight.x -= LASER_SPEED * FlxG.elapsed; + if(this._laserRight.x < this._laserRightTarget) + { + this._laserRight.x = this._laserRightTarget; + if(this._laserReturn) + { + this._laserRightTarget = -336; + } + } + } + else if(this._laserRightTarget > 0 && this._laserRight.x < this._laserRightTarget) + { + this._laserRight.x += LASER_SPEED * FlxG.elapsed; + if(this._laserRight.x > this._laserRightTarget) + { + this._laserRight.x = this._laserRightTarget; + if(this._laserReturn) + { + this._laserRightTarget = -336; + } + } + } + else if(this._laserRightTarget < 0 && this._laserRight.x < this._laserRightTarget * -1) + { + this._laserRight.x += LASER_SPEED * FlxG.elapsed; + if(this._laserRight.x > this._laserRightTarget * -1) + { + this._laserRight.x = this._laserRightTarget * -1; + } + } + } + if(!this.endingPhase) + { + if(this.stage > -1 && phase < 4) + { + this["phaseStage" + phase](); + } + if(phase == 3 && this.stage == -1) + { + _loc6_ = 300; + _loc7_ = 1200; + if(y > 150) + { + velocity.y -= _loc7_ * FlxG.elapsed; + } + else if(y < 40) + { + velocity.y += _loc7_ * FlxG.elapsed; + } + else + { + velocity.y += ArcU.rand(-_loc6_ * FlxG.elapsed,_loc6_ * FlxG.elapsed); + } + velocity.y = ArcU.clamp(velocity.y,-120,120); + if(x > 300) + { + velocity.x -= _loc7_ * FlxG.elapsed; + } + else if(x < 60) + { + velocity.x += _loc7_ * FlxG.elapsed; + } + else + { + velocity.x += ArcU.rand(-_loc6_ * FlxG.elapsed,_loc6_ * FlxG.elapsed); + } + velocity.x = ArcU.clamp(velocity.x,-120,120); + if(velocity.x < 0) + { + facing = LEFT; + } + else + { + facing = RIGHT; + } + this.finalPhase(); + } + super.engaged(); + return false; + } + this.handleEnding(); + return false; + } + + private function phaseStage1() : void + { + } + + private function phaseStage2() : void + { + var _loc1_:Enemy = null; + var _loc2_:int = 0; + var _loc3_:Enemy = null; + if(this.stage == 0) + { + this._enemyTracker = new Array(); + _loc2_ = 2; + while(_loc2_ < Config.BLOCK_WIDTH - 3) + { + _loc1_ = new Slime(_loc2_,3,mode(40,20,30)); + Data.state.enemies.add(_loc1_); + this._enemyTracker.push(_loc1_); + _loc2_ += 8; + } + Data.state.player.shield(1); + this.stage = 1; + } + else if(this.stage == 1) + { + if(!this.enemiesCleared()) + { + return; + } + this._laserLeftTarget = 12 + 50; + this._laserRightTarget = 336 - 50; + this._enemyTracker = new Array(); + _loc2_ = 2; + while(_loc2_ < Config.BLOCK_WIDTH - 3) + { + _loc1_ = new BouncingSlime(_loc2_,3,mode(40,20,30)); + Data.state.enemies.add(_loc1_); + this._enemyTracker.push(_loc1_); + _loc2_ += 8; + } + Data.state.player.shield(1); + this.stage = 2; + } + else if(this.stage == 2) + { + if(!this.enemiesCleared()) + { + return; + } + this._laserLeftTarget = 12 + 120; + this._laserRightTarget = 336 - 120; + this._enemyTracker = new Array(); + this.laserTimer = 3; + _loc2_ = 2; + while(_loc2_ < Config.BLOCK_WIDTH - 3) + { + _loc1_ = new Tadpole(_loc2_,3,mode(1,1,20)); + Data.state.enemies.add(_loc1_); + this._enemyTracker.push(_loc1_); + _loc2_ += 4; + } + Data.state.player.shield(1); + this.stage = 3; + } + else if(this.stage == 3) + { + if(!this.enemiesCleared()) + { + return; + } + this.reappear(); + this.stage = -1; + this._laserLeft.kill(); + this._laserLeft = null; + this._laserRight.kill(); + this._laserRight = null; + this.killTempEnemies(); + _loc1_ = new FloorPlant(15,9,1); + Data.state.enemies.add(_loc1_); + this._tempEnemies.push(_loc1_); + if(!heroic) + { + _loc1_ = new Plant(1,4,1,RIGHT); + Data.state.enemies.add(_loc1_); + this._tempEnemies.push(_loc1_); + _loc1_ = new Plant(1,9,1,RIGHT); + Data.state.enemies.add(_loc1_); + this._tempEnemies.push(_loc1_); + _loc1_ = new Plant(28,5,1,LEFT); + Data.state.enemies.add(_loc1_); + this._tempEnemies.push(_loc1_); + _loc1_ = new Plant(28,14,1,LEFT); + Data.state.enemies.add(_loc1_); + this._tempEnemies.push(_loc1_); + } + _loc1_ = new Plant(6,16,1,RIGHT); + Data.state.enemies.add(_loc1_); + this._tempEnemies.push(_loc1_); + _loc1_ = new CeilingPlant(15,2,1); + Data.state.enemies.add(_loc1_); + this._tempEnemies.push(_loc1_); + _loc1_ = new CeilingPlant(15,13,1); + Data.state.enemies.add(_loc1_); + this._tempEnemies.push(_loc1_); + Data.state.player.shield(1); + for each(_loc3_ in this._tempEnemies) + { + _loc3_.goldenize(); + } + } + } + + private function phaseStage3() : void + { + var _loc1_:Enemy = null; + var _loc2_:int = 0; + if(this.stage == 0) + { + this._enemyTracker = new Array(); + _loc2_ = 2; + while(_loc2_ < Config.BLOCK_WIDTH - 3) + { + _loc1_ = new Slime(_loc2_,3,mode(40,20,30)); + Data.state.enemies.add(_loc1_); + this._enemyTracker.push(_loc1_); + _loc2_ += 8; + } + Data.state.player.shield(1); + this.stage = 1; + } + else if(this.stage == 1) + { + if(!this.enemiesCleared()) + { + return; + } + this._enemyTracker = new Array(); + _loc2_ = 2; + while(_loc2_ < Config.BLOCK_WIDTH - 3) + { + _loc1_ = new BouncingSlime(_loc2_,3,mode(40,20,30)); + Data.state.enemies.add(_loc1_); + this._enemyTracker.push(_loc1_); + _loc2_ += 8; + } + Data.state.player.shield(1); + this.stage = 2; + } + else if(this.stage == 2) + { + if(!this.enemiesCleared()) + { + return; + } + this._enemyTracker = new Array(); + _loc2_ = 2; + while(_loc2_ < Config.BLOCK_WIDTH - 3) + { + _loc1_ = new Tadpole(_loc2_,3,mode(1,1,20)); + Data.state.enemies.add(_loc1_); + this._enemyTracker.push(_loc1_); + _loc2_ += 4; + } + Data.state.player.shield(1); + this.stage = 3; + } + else if(this.stage == 3) + { + if(!this.enemiesCleared()) + { + return; + } + play("stand"); + acceleration.y = 0; + this.reappear(); + this.stage = -1; + this.killTempEnemies(); + this.rebuildLevel(); + } + } + + private function finalPhase() : void + { + var _loc1_:int = 0; + var _loc2_:Laser = null; + var _loc3_:int = 0; + var _loc4_:int = 0; + var _loc5_:int = 0; + var _loc6_:Number = NaN; + var _loc7_:Tadpole = null; + this._laserSpawnTimer -= FlxG.elapsed; + if(this._laserSpawnTimer <= 0) + { + this._laserSpawnTimer = LASER_SPAWN_DELAY - mode(0,0,8); + _loc1_ = ArcU.rand(0,1); + _loc2_ = new Laser(_loc1_ == 0 ? 12 : 336,12,mode(1,20,120),_loc1_ == 0 ? 3 : 1,_loc1_ == 0 ? new FlxPoint(29,0) : new FlxPoint(1,0)); + Data.state.enemies.add(_loc2_); + _loc2_.velocity.y = 20; + } + this._shadowOrbTimer -= FlxG.elapsed; + if(this._shadowOrbTimer <= 0 && this._shadowOrbState == 0) + { + this.spawnOrbs(); + this._shadowOrbState = 1; + this._shadowOrbTimer = 3; + } + else if(this._shadowOrbTimer <= 0 && this._shadowOrbState == 1) + { + this._shadowOrbShootTimer -= FlxG.elapsed; + if(this._shadowOrbShootTimer <= 0) + { + this._shadowOrbShootTimer = 1; + (this._shadowOrbs[this._shadowOrbsShot] as ShadowOrb).shoot(); + ++this._shadowOrbsShot; + if(this._shadowOrbsShot >= this._shadowOrbs.length) + { + this._shadowOrbState = 0; + this._shadowOrbTimer = 4; + } + } + } + this._roundExplodeTimer -= FlxG.elapsed; + if(this._roundExplodeTimer <= 0) + { + this._roundExplodeTimer = ROUND_EXPLODE_DELAY - mode(0,0,4); + _loc3_ = getMidpoint().x - 2; + _loc4_ = getMidpoint().y - 2; + _loc5_ = 0; + while(_loc5_ < 360) + { + _loc6_ = _loc5_ * Math.PI / 180; + this.shootSeed(_loc3_,_loc4_,_loc6_,true); + _loc5_ += mode(30,30,60); + } + } + this.slimeTimer -= FlxG.elapsed; + if(this.slimeTimer <= 0) + { + this.slimeTimer = SLIME_SPAWN_DELAY - mode(0,0,2); + _loc7_ = new Tadpole(15,3,mode(40,20,30)); + _loc7_.goldenize(); + Data.state.enemies.add(_loc7_); + } + } + + private function spawnOrbs() : void + { + var _loc2_:ShadowOrb = null; + this._shadowOrbs = new Array(); + this._shadowOrbsShot = 0; + var _loc1_:int = 0; + while(_loc1_ < 6) + { + _loc2_ = new ShadowOrb(x,y,_loc1_ * 60,this); + Data.state.enemies.add(_loc2_); + this._shadowOrbs.push(_loc2_); + _loc1_++; + } + } + + private function rebuildLevel() : void + { + var _loc1_:int = 0; + var _loc2_:int = 0; + _loc1_ = 1; + while(_loc1_ < 29) + { + _loc2_ = 2; + while(_loc2_ < 17) + { + Data.state.tilemap.setTile(_loc1_,_loc2_,0,true); + _loc2_++; + } + _loc1_++; + } + _loc2_ = 2; + while(_loc2_ < 17) + { + Data.state.tilemap.setTile(0,_loc2_,87,true); + Data.state.tilemap.setTile(29,_loc2_,84,true); + _loc2_++; + } + _loc1_ = 1; + while(_loc1_ < 26) + { + Data.state.tilemap.setTile(_loc1_,17,ArcU.rand(81,82),true); + _loc1_++; + } + Data.state.worldAllFuckedUp = true; + } + + private function enemiesCleared() : Boolean + { + var _loc1_:int = 0; + while(_loc1_ < this._enemyTracker.length) + { + if((this._enemyTracker[_loc1_] as Enemy).alive) + { + return false; + } + _loc1_++; + } + return true; + } + + private function reappear() : void + { + ArcParticleSystem.emit(Data.state.particles,Color.RED,getMidpoint().x,getMidpoint().y,50,1,1,0,-50,50,-50,50); + visible = true; + bosshealthbar.visible = true; + solid = true; + killable = true; + if(phase < 3) + { + acceleration.y = 400; + } + this._shieldSprite.visible = false; + } + + private function killTempEnemies() : void + { + var _loc1_:Enemy = null; + for each(_loc1_ in this._tempEnemies) + { + _loc1_.kill(); + } + this._tempEnemies = new Array(); + } + + private function shootSeed(param1:int, param2:int, param3:Number, param4:Boolean = false) : void + { + var _loc5_:Seed = new Seed(param1,param2,1); + _loc5_.velocity.x = EXPLODE_SEED_SPEED * Math.cos(param3); + _loc5_.velocity.y = EXPLODE_SEED_SPEED * Math.sin(param3); + if(param4) + { + _loc5_.x += _loc5_.velocity.x * 0.1; + _loc5_.y += _loc5_.velocity.y * 0.1; + } + Data.state.enemies.add(_loc5_); + } + + override public function kill() : void + { + var _loc1_:BossMode = null; + hp = 0; + killable = false; + if(Data.state is BossMode) + { + _loc1_ = Data.state as BossMode; + if(_loc1_.isPractice()) + { + super.kill(); + } + else + { + if(_loc1_.isHeroic()) + { + AchievementSystem.bossRushHeroic(); + } + else + { + AchievementSystem.bossRush(); + } + super.kill(); + } + } + else + { + if(bosshealthbar != null) + { + bosshealthbar.kill(); + } + Data.hp = Data.hpm; + this.endingPhase = true; + } + } + + override public function changePhase(param1:int) : void + { + switch(param1) + { + case 2: + this._laserLeft = new Laser(12,24,1,0,new FlxPoint(0,17)); + this._laserLeft.goldenize(); + Data.state.enemies.add(this._laserLeft); + this._laserRight = new Laser(336,24,1,0,new FlxPoint(0,17)); + this._laserRight.goldenize(); + Data.state.enemies.add(this._laserRight); + break; + case 3: + break; + case 4: + this.endingPhase = true; + } + this.laserTimer = LASER_DELAY; + if(!heroic) + { + bosshealthbar.visible = false; + solid = false; + velocity.x = velocity.y = 0; + acceleration.y = 0; + } + this.stage = 0; + killable = false; + this._shieldSprite.visible = true; + ArcParticleSystem.emit(Data.state.particles,Color.RED,getMidpoint().x,getMidpoint().y,50,1,1,0,-50,50,-50,50); + } + + override public function draw() : void + { + if(this.ending == null) + { + super.draw(); + } + else + { + this.ending.draw(); + Data.state.player.draw(); + if(this.sad != null) + { + this.sad.draw(); + } + } + if(this._shieldSprite.visible) + { + this._shieldSprite.x = x - 5; + this._shieldSprite.y = y - 3; + this._shieldSprite.draw(); + } + } + + private function handleEnding() : void + { + var _loc1_:ShadowOrb = null; + var _loc2_:Enemy = null; + var _loc3_:int = 0; + var _loc4_:int = 0; + var _loc5_:int = 0; + if(this.endingStage == 0) + { + if(this.endingStageInitialized) + { + } + this.endingStageComplete = true; + } + else if(this.endingStage == 1) + { + if(!this.endingStageInitialized) + { + (Data.state as StoryMode).whitefader = new ArcSprite(0,0); + (Data.state as StoryMode).whitefader.makeGraphic(FlxG.width,FlxG.height,4294967295); + (Data.state as StoryMode).whitefader.scrollFactor = new FlxPoint(0,0); + (Data.state as StoryMode).whitefader.alpha = 0; + this.endingTimer = 0; + } + (Data.state as StoryMode).whitefader.alpha += FlxG.elapsed * ENDING_FADER_SPEED; + this.endingTimer += FlxG.elapsed; + this.endingStageComplete = (Data.state as StoryMode).whitefader.alpha >= 1 && this.endingTimer > 1; + } + else if(this.endingStage == 2) + { + if(!this.endingStageInitialized) + { + Data.state.player.x = 44; + Data.state.player.y = 190; + Data.state.player.controllable = false; + Data.state.player.facing = RIGHT; + Data.state.player.play("stand"); + Data.state.player.acceleration.y = 0; + Data.state.player.velocity.x = Data.state.player.velocity.y = 0; + x = 304; + y = 188; + velocity.x = 0; + velocity.y = 0; + this._shieldSprite.visible = false; + facing = LEFT; + play("stand"); + (Data.state as StoryMode).whitefader.alpha = 1; + for each(_loc1_ in this._shadowOrbs) + { + _loc1_.kill(); + } + for each(_loc2_ in Data.state.enemies.members) + { + _loc2_.kill(); + } + _loc3_ = 1; + while(_loc3_ < 29) + { + Data.state.tilemap.setTile(_loc3_,0,0,true); + Data.state.tilemap.setTile(_loc3_,1,0,true); + _loc3_++; + } + this._shadowOrbs = null; + } + (Data.state as StoryMode).whitefader.alpha -= FlxG.elapsed; + this.endingStageComplete = (Data.state as StoryMode).whitefader.alpha <= 0; + } + else if(this.endingStage == 3) + { + if(!this.endingStageInitialized) + { + TextSystem.display(Avatar.PROFESSOR,"Go ahead. Finish me off. I dare you..."); + TextSystem.display(Avatar.SAGA,"No! I\'m sorry, I can\'t do it. I swore never to harm another human."); + TextSystem.display(Avatar.SAGA,"We\'ve made it through his lab. Let\'s just leave him down here to rot."); + TextSystem.display(Avatar.PROFESSOR,"..."); + TextSystem.display(Avatar.PROFESSOR,"Ha... ha... ha..."); + TextSystem.display(Avatar.PROFESSOR,"I appear to have underestimated your will SAGA. Perhaps you can be useful after all. With a little reprogramming you will do my bidding once more."); + } + this.endingStageComplete = !TextSystem.active(); + } + else if(this.endingStage == 4) + { + if(!this.endingStageInitialized) + { + this.endingOrb = new ArcSprite(x,y,ShadowOrb.sprite); + this.endingOrb.velocity.x = -400; + Data.state.add(this.endingOrb); + } + ArcParticleSystem.emit(Data.state.particles,Color.BLACK,this.endingOrb.x,this.endingOrb.y,1,1,1,0,-200,200,-200,200,this.endingOrb.width,this.endingOrb.height); + this.endingStageComplete = this.endingOrb.x < Data.state.player.x + Data.state.player.width; + } + else if(this.endingStage == 5) + { + if(!this.endingStageInitialized) + { + ArcParticleSystem.emit(Data.state.particles,Color.BLACK,this.endingOrb.x,this.endingOrb.y,40,1,1,0,-200,200,-200,200,this.endingOrb.width,this.endingOrb.height); + Data.state.player.hasGun = false; + this.endingOrb.kill(); + this.endingGun = new ArcSprite(Data.state.player.x,Data.state.player.y); + this.endingGun.loadGraphic(equipmentSprite,true,false,14,14); + this.endingGun.frame = 5; + this.endingGun.velocity.x = 150; + this.endingGun.velocity.y = -350; + this.endingGun.acceleration.y = 400; + Data.state.add(this.endingGun); + } + this.endingStageComplete = this.endingGun.x >= x; + } + else if(this.endingStage == 6) + { + if(!this.endingStageInitialized) + { + ArcParticleSystem.emit(Data.state.particles,Color.WHITE,this.endingGun.x,this.endingGun.y,20,1,1,0,-200,200,-200,200,this.endingGun.width,this.endingGun.height); + ArcParticleSystem.emit(Data.state.particles,Color.BLUE,this.endingGun.x,this.endingGun.y,20,1,1,0,-200,200,-200,200,this.endingGun.width,this.endingGun.height); + this.endingGun.kill(); + TextSystem.display(Avatar.PROFESSOR,"And now to finish off this pesky little kid."); + TextSystem.display(Avatar.SAGA,"No...! Emergency elevator activate!"); + } + this.endingStageComplete = !TextSystem.active(); + } + else if(this.endingStage == 7) + { + if(!this.endingStageInitialized) + { + Data.state.player.showElevator(); + Data.state.player.solid = false; + Data.state.player.velocity.y = -75; + } + this.endingStageComplete = Data.state.player.y + Data.state.player.height < 0; + } + else if(this.endingStage == 8) + { + if(!this.endingStageInitialized) + { + TextSystem.display(Avatar.PROFESSOR,"You are an annoying little machine you know that. But no bother, let him run, I\'ve got work to do on you."); + } + this.endingStageComplete = !TextSystem.active(); + } + else if(this.endingStage == 9) + { + if(!this.endingStageInitialized) + { + this.endingTimer = 0; + } + (Data.state as StoryMode).whitefader.alpha += FlxG.elapsed / 2; + this.endingTimer += FlxG.elapsed; + this.endingStageComplete = (Data.state as StoryMode).whitefader.alpha >= 1 && this.endingTimer > 3; + } + else if(this.endingStage == 10) + { + if(!this.endingStageInitialized) + { + this.ending = new ArcSprite(0,0,endingSprite); + this.ending.scrollFactor = new FlxPoint(0,0); + Data.state.player.velocity.y = 0; + Data.state.player.x = 72; + Data.state.player.y = 86; + Data.state.player.elevator = null; + Data.state.player.visible = false; + _loc4_ = 0; + while(_loc4_ < 30) + { + _loc5_ = 0; + while(_loc5_ < 20) + { + Data.state.tilemap.setTile(_loc4_,_loc5_,0,true); + _loc5_++; + } + _loc4_++; + } + } + (Data.state as StoryMode).whitefader.alpha -= FlxG.elapsed / 2; + this.endingStageComplete = (Data.state as StoryMode).whitefader.alpha <= 0; + } + else if(this.endingStage == 11) + { + if(!this.endingStageInitialized) + { + TextSystem.display(Avatar.SAGA,"Nooooooooo...! I... Don\'t... Want to... Kill..."); + } + this.endingStageComplete = !TextSystem.active(); + } + else if(this.endingStage == 12) + { + if(!this.endingStageInitialized) + { + this.sad = new ArcSprite(77,68,sadSprite); + this.sad.scrollFactor = new FlxPoint(0,0); + this.sad.alpha = 0; + this.endingTimer = 0; + } + this.sad.alpha += FlxG.elapsed; + this.endingTimer += FlxG.elapsed; + this.endingStageComplete = this.endingTimer > 3; + } + else if(this.endingStage == 13) + { + if(!this.endingStageInitialized) + { + this.endingTimer = 0; + } + this.sad.alpha -= FlxG.elapsed; + this.endingTimer += FlxG.elapsed; + this.endingStageComplete = this.endingTimer > 2; + } + else if(this.endingStage == 14) + { + if(!this.endingStageInitialized) + { + (Data.state as StoryMode).complete(); + } + this.endingStageComplete = false; + } + if(!this.endingStageInitialized) + { + this.endingStageInitialized = true; + } + if(this.endingStageComplete) + { + ++this.endingStage; + this.endingStageInitialized = false; + this.endingStageComplete = false; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ProfessorShade.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ProfessorShade.as new file mode 100644 index 0000000..115ac7b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ProfessorShade.as @@ -0,0 +1,305 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.Color; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class ProfessorShade extends Boss + { + + private static const sprite:Class = ProfessorShade_sprite; + + private static const LASER_DELAY:Number = 10; + + private static const JUMP_DELAY:Number = 1; + + private static const EXPLODE_SEED_SPEED:Number = 120; + + private static const SPRAY_DELAY:Number = 2; + + private static const LASER_SPEED:Number = 50; + + private static const TADPOLE_DELAY:Number = 2; + + private var laserTimer:Number = 1; + + private var jumpTimer:Number = 1; + + private var sprayTimer:Number = 0; + + private var _thisPoint:FlxPoint = new FlxPoint(); + + private var _otherPoint:FlxPoint = new FlxPoint(); + + private var _laserLeft:Laser; + + private var _laserLeftTarget:int = 12; + + private var _laserRight:Laser; + + private var _laserRightTarget:int = 336; + + private var tadpoleTimer:Number = 2; + + public function ProfessorShade(param1:Number, param2:Number) + { + super(param1,param2); + loadGraphic(sprite,true,true,16,24); + offset.y = 6; + height = 16; + offset.x = 3; + width = 10; + facing = LEFT; + acceleration.y = 400; + _moveSpeed = 100; + hp = hpm = mode(12000,30000,50000); + setPhases([70,40]); + addAnimation("walk",[0,1,2,3,4],7,true); + addAnimation("stand",[6,7],4,true); + addAnimation("jump",[5]); + play("walk"); + } + + override public function intro() : Boolean + { + var _loc1_:Plant = null; + var _loc2_:CeilingPlant = null; + go(LEFT); + if(heroic) + { + _loc2_ = new CeilingPlant(3,2,1); + _loc2_.goldenize(); + Data.state.enemies.add(_loc2_); + _loc2_ = new CeilingPlant(26,2,1); + _loc2_.goldenize(); + Data.state.enemies.add(_loc2_); + _loc2_ = new CeilingPlant(14,2,1); + _loc2_.goldenize(); + Data.state.enemies.add(_loc2_); + } + this._laserLeft = new Laser(12,24,1,0,new FlxPoint(0,17)); + this._laserLeft.goldenize(); + Data.state.enemies.add(this._laserLeft); + this._laserRight = new Laser(336,24,1,0,new FlxPoint(0,17)); + this._laserRight.goldenize(); + Data.state.enemies.add(this._laserRight); + _loc1_ = new Plant(1,8,1,RIGHT); + _loc1_.goldenize(); + Data.state.enemies.add(_loc1_); + _loc1_ = new Plant(28,8,1,LEFT); + _loc1_.goldenize(); + Data.state.enemies.add(_loc1_); + super.intro(); + return true; + } + + override public function outro() : Boolean + { + var _loc1_:Enemy = null; + for each(_loc1_ in Data.state.enemies.members) + { + if(!(_loc1_ is Boss)) + { + _loc1_.silentKill(); + } + } + super.outro(); + return true; + } + + override public function engaged() : Boolean + { + var _loc5_:Tadpole = null; + var _loc6_:int = 0; + var _loc7_:Number = NaN; + this.laserTimer -= FlxG.elapsed; + if(heroic && this._laserLeft.x == 12 && this._laserRight.x == 336) + { + this.laserTimer = 0; + } + if(phase >= 2 && this.laserTimer <= 0) + { + this.laserTimer = LASER_DELAY; + if(ArcU.rand(0,1) == 0) + { + this._laserLeftTarget = 12 + 250; + } + else + { + this._laserRightTarget = 336 - 250; + } + } + this.tadpoleTimer -= FlxG.elapsed; + if(heroic && this.tadpoleTimer <= 0) + { + this.tadpoleTimer = TADPOLE_DELAY; + _loc5_ = new Tadpole(ArcU.rand(0,1) == 0 ? 0 : 26,ArcU.rand(0,1) == 0 ? 3 : 17,5); + Data.state.enemies.add(_loc5_); + } + if(velocity.x == 0) + { + go(facing == LEFT ? RIGHT : LEFT); + } + if(touching & DOWN) + { + this.jumpTimer -= FlxG.elapsed; + if(this.jumpTimer <= 0) + { + velocity.y = -ArcU.rand(100,400); + this.jumpTimer = JUMP_DELAY + ArcU.rand(0,500) / 1000; + } + } + var _loc1_:int = x / Config.BLOCK_SIZE + (velocity.x > 0 ? 1 : 0); + var _loc2_:int = y / Config.BLOCK_SIZE + 2; + var _loc3_:uint = Data.state.tilemap.getTile(_loc1_,_loc2_); + if(_loc3_ == 0 && Boolean(touching & DOWN)) + { + velocity.y = -250; + } + this._thisPoint.x = x + 5; + this._thisPoint.y = y + 8; + this._otherPoint.x = Data.state.player.x + Data.state.player.width / 2; + this._otherPoint.y = Data.state.player.y + Data.state.player.height / 2; + this.sprayTimer -= FlxG.elapsed; + if(Data.state.tilemap.ray(this._thisPoint,this._otherPoint) && this.sprayTimer <= 0 && (this._otherPoint.x < this._thisPoint.x && facing == LEFT || this._otherPoint.x > this._thisPoint.x && facing == RIGHT)) + { + this.sprayTimer = SPRAY_DELAY; + _loc6_ = facing == LEFT ? -7 : 3; + _loc7_ = Math.atan2(this._otherPoint.y - this._thisPoint.y,this._otherPoint.x - this._thisPoint.x); + if(phase == 1) + { + this.shootSeed(this._thisPoint.x + _loc6_,this._thisPoint.y - 5,_loc7_); + } + else if(phase == 2) + { + this.shootSeed(this._thisPoint.x + _loc6_,this._thisPoint.y - 5,_loc7_ - Math.PI / 56); + this.shootSeed(this._thisPoint.x + _loc6_,this._thisPoint.y - 5,_loc7_ + Math.PI / 56); + } + else if(phase == 3) + { + this.shootSeed(this._thisPoint.x + _loc6_,this._thisPoint.y - 5,_loc7_ - Math.PI / 32); + this.shootSeed(this._thisPoint.x + _loc6_,this._thisPoint.y - 5,_loc7_); + this.shootSeed(this._thisPoint.x + _loc6_,this._thisPoint.y - 5,_loc7_ + Math.PI / 32); + } + } + if(phase == 1) + { + _moveSpeed = 100; + } + else if(phase == 2) + { + _moveSpeed = 100; + } + else if(phase == 3) + { + _moveSpeed = 125; + } + var _loc4_:Number = mode(LASER_SPEED,LASER_SPEED,LASER_SPEED * 1.6); + if(this._laserLeft.x < this._laserLeftTarget) + { + this._laserLeft.x += _loc4_ * FlxG.elapsed; + if(this._laserLeft.x >= this._laserLeftTarget) + { + this._laserLeft.x = this._laserLeftTarget; + this._laserLeftTarget = 12; + } + } + else if(this._laserLeft.x > this._laserLeftTarget) + { + this._laserLeft.x -= _loc4_ * FlxG.elapsed; + if(this._laserLeft.x <= this._laserLeftTarget) + { + this._laserLeft.x = this._laserLeftTarget; + if(this._laserLeftTarget != 12) + { + this._laserLeftTarget = 12; + } + } + } + if(this._laserRight.x > this._laserRightTarget) + { + this._laserRight.x -= _loc4_ * FlxG.elapsed; + if(this._laserRight.x <= this._laserRightTarget) + { + this._laserRight.x = this._laserRightTarget; + this._laserRightTarget = 336; + } + } + else if(this._laserRight.x < this._laserRightTarget) + { + this._laserRight.x += _loc4_ * FlxG.elapsed; + if(this._laserRight.x >= this._laserRightTarget) + { + this._laserRight.x = this._laserRightTarget; + if(this._laserRightTarget != 336) + { + this._laserRightTarget = 336; + } + } + } + super.engaged(); + return false; + } + + private function shootSeed(param1:int, param2:int, param3:Number) : void + { + var _loc4_:Seed = new Seed(param1,param2,1); + _loc4_.velocity.x = EXPLODE_SEED_SPEED * Math.cos(param3); + _loc4_.velocity.y = EXPLODE_SEED_SPEED * Math.sin(param3); + Data.state.enemies.add(_loc4_); + } + + override public function kill() : void + { + super.kill(); + } + + override public function changePhase(param1:int) : void + { + var _loc3_:Plant = null; + var _loc4_:CeilingPlant = null; + var _loc5_:Enemy = null; + var _loc6_:Enemy = null; + switch(param1) + { + case 2: + _loc3_ = new Plant(1,16,1,RIGHT); + _loc3_.goldenize(); + Data.state.enemies.add(_loc3_); + _loc3_ = new Plant(28,16,1,LEFT); + _loc3_.goldenize(); + Data.state.enemies.add(_loc3_); + this._laserLeftTarget = 12 + 100; + this._laserRightTarget = 336 - 100; + break; + case 3: + _moveSpeed = 100; + go(facing); + this._laserLeftTarget = 12 + 150; + this._laserRightTarget = 336 - 150; + if(!heroic) + { + _loc4_ = new CeilingPlant(14,2,1); + _loc4_.goldenize(); + Data.state.enemies.add(_loc4_); + } + } + this.laserTimer = LASER_DELAY; + ArcParticleSystem.emit(Data.state.particles,Color.RED,getMidpoint().x,getMidpoint().y,50,1,1,0,-50,50,-50,50); + var _loc2_:int = 2; + while(_loc2_ < Config.BLOCK_WIDTH - 3) + { + _loc5_ = new BouncingSlime(_loc2_,3,mode(40,40,50)); + Data.state.enemies.add(_loc5_); + _loc6_ = new Tadpole(_loc2_ + 4,3,mode(40,40,50)); + Data.state.enemies.add(_loc6_); + _loc2_ += 16; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ProfessorShade_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ProfessorShade_sprite.as new file mode 100644 index 0000000..00874e6 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ProfessorShade_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/150_com.arc.dh.objects.enemies.ProfessorShade_sprite.png")] + public class ProfessorShade_sprite extends BitmapAsset + { + + public function ProfessorShade_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor_endingSprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor_endingSprite.as new file mode 100644 index 0000000..fc517ed --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor_endingSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/249_com.arc.dh.objects.enemies.Professor_endingSprite.png")] + public class Professor_endingSprite extends BitmapAsset + { + + public function Professor_endingSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor_equipmentSprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor_equipmentSprite.as new file mode 100644 index 0000000..3649635 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor_equipmentSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/215.png")] + public class Professor_equipmentSprite extends BitmapAsset + { + + public function Professor_equipmentSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor_sadSprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor_sadSprite.as new file mode 100644 index 0000000..4a32817 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor_sadSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/89_com.arc.dh.objects.enemies.Professor_sadSprite.png")] + public class Professor_sadSprite extends BitmapAsset + { + + public function Professor_sadSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor_shieldSprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor_shieldSprite.as new file mode 100644 index 0000000..7eb1b18 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor_shieldSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/174_com.arc.dh.objects.enemies.Professor_shieldSprite.png")] + public class Professor_shieldSprite extends BitmapAsset + { + + public function Professor_shieldSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor_sprite.as new file mode 100644 index 0000000..6e8b6ac --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Professor_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/100_com.arc.dh.objects.enemies.Professor_sprite.png")] + public class Professor_sprite extends BitmapAsset + { + + public function Professor_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Seed.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Seed.as new file mode 100644 index 0000000..35f462e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Seed.as @@ -0,0 +1,70 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.Color; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcParticleSystem; + import org.flixel.FlxG; + import org.flixel.FlxObject; + + public class Seed extends Enemy + { + + private static const sprite:Class = Seed_sprite; + + public function Seed(param1:Number, param2:Number, param3:int) + { + super(param1,param2,param3,false); + loadRotatedGraphic(sprite,16,-1,true,true); + width = height = 5; + offset.x = offset.y = 4; + } + + override public function update() : void + { + angle += FlxG.elapsed * 1000; + super.update(); + } + + override public function handleCollision(param1:FlxObject) : void + { + var _loc2_:int = 0; + var _loc3_:int = 0; + var _loc4_:int = 0; + var _loc5_:int = 0; + if(velocity.x < 0) + { + _loc2_ = 0; + _loc4_ = 20; + } + else if(velocity.x > 0) + { + _loc2_ = -20; + _loc4_ = 0; + } + else + { + _loc2_ = -20; + _loc4_ = 20; + } + if(velocity.y < 0) + { + _loc3_ = 0; + _loc5_ = 20; + } + else if(velocity.y > 0) + { + _loc3_ = -20; + _loc5_ = 0; + } + else + { + _loc3_ = -20; + _loc5_ = 20; + } + ArcParticleSystem.emit(Data.state.particles,Color.RED,x + width / 2,y + width / 2,2,2,0.25,0,_loc2_,_loc4_,_loc3_,_loc5_); + exists = false; + alive = false; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Seed_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Seed_sprite.as new file mode 100644 index 0000000..9b1295e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Seed_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/260_com.arc.dh.objects.enemies.Seed_sprite.png")] + public class Seed_sprite extends BitmapAsset + { + + public function Seed_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ShadowOrb.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ShadowOrb.as new file mode 100644 index 0000000..b2a0a39 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ShadowOrb.as @@ -0,0 +1,90 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.Color; + import com.arc.dh.objects.Bullet; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcParticleSystem; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class ShadowOrb extends Enemy + { + + public static const sprite:Class = ShadowOrb_sprite; + + private static const SPEED:int = 250; + + private static const ROTATION_SPEED:Number = 250; + + private static const TARGET_DISTANCE:Number = 15; + + private var degrees:int = 0; + + private var professor:Professor; + + private var _distance:Number = 0; + + private var _shot:Boolean = false; + + public function ShadowOrb(param1:int, param2:int, param3:int, param4:Professor) + { + super(param1,param2,1); + this.professor = param4; + this.degrees = param3; + loadGraphic(sprite,true,false,14,14); + healthbar.kill(); + healthbar = null; + } + + override public function damage(param1:int, param2:Bullet = null) : void + { + } + + public function move(param1:int) : void + { + var _loc2_:Number = NaN; + var _loc3_:FlxPoint = null; + _loc2_ = Math.PI / 180 * param1; + _loc3_ = this.professor.getMidpoint(); + x = _loc3_.x + this._distance * Math.cos(_loc2_) - 7; + y = _loc3_.y + this._distance * Math.sin(_loc2_) - 7; + } + + override public function update() : void + { + if(!this._shot) + { + if(this._distance < TARGET_DISTANCE) + { + this._distance += FlxG.elapsed * 50; + if(this._distance > TARGET_DISTANCE) + { + this._distance = TARGET_DISTANCE; + } + } + this.degrees += ROTATION_SPEED * FlxG.elapsed; + this.move(this.degrees); + } + else if(touching & (DOWN | UP | LEFT | RIGHT)) + { + this.kill(); + } + super.update(); + } + + public function shoot() : void + { + this._shot = true; + var _loc1_:Number = Math.atan2(Data.state.player.y - y,Data.state.player.x - x); + velocity.x = SPEED * Math.cos(_loc1_); + velocity.y = SPEED * Math.sin(_loc1_); + } + + override public function kill() : void + { + ArcParticleSystem.emit(Data.state.particles,Color.BLACK,getMidpoint().x,getMidpoint().y,15,1,0.3,0,-50,50,-50,50); + super.kill(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ShadowOrb_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ShadowOrb_sprite.as new file mode 100644 index 0000000..e3e040d --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/ShadowOrb_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/49_com.arc.dh.objects.enemies.ShadowOrb_sprite.png")] + public class ShadowOrb_sprite extends BitmapAsset + { + + public function ShadowOrb_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Slime.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Slime.as new file mode 100644 index 0000000..f5bcebf --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Slime.as @@ -0,0 +1,70 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcU; + + public class Slime extends Enemy + { + + private static const sprite:Class = Slime_sprite; + + public function Slime(param1:Number, param2:Number, param3:int) + { + var _loc4_:Number = NaN; + var _loc5_:Number = NaN; + _loc4_ = param1 * Config.BLOCK_SIZE; + _loc5_ = param2 * Config.BLOCK_SIZE; + _c = param1; + _r = param2; + super(_loc4_,_loc5_,param3); + loadGraphic(sprite,true,true,14,11); + facing = ArcU.rand(0,1) == 0 ? LEFT : RIGHT; + velocity.x = facing == LEFT ? -MOVE_SPEED : MOVE_SPEED; + width = 10; + offset.x = 2; + y += 1; + hittable = true; + acceleration.y = 400; + var _loc6_:int = ArcU.rand(0,11); + addAnimation("walk",[_loc6_ * 2,_loc6_ * 2 + 1],5,true); + play("walk"); + } + + override public function unhit() : void + { + go(_hitDirection); + super.unhit(); + } + + override public function update() : void + { + var _loc1_:int = 0; + var _loc2_:int = 0; + var _loc3_:uint = 0; + if(!_hit && velocity.y == 0) + { + _loc1_ = x / Config.BLOCK_SIZE + (velocity.x > 0 ? 1 : 0); + _loc2_ = y / Config.BLOCK_SIZE + 1; + _loc3_ = Data.state.tilemap.getTile(_loc1_,_loc2_); + if(_loc3_ == 0) + { + if(velocity.x < 0) + { + go(RIGHT); + } + else + { + go(LEFT); + } + } + else if(velocity.x == 0) + { + go(facing == LEFT ? RIGHT : LEFT); + } + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SlimeKing.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SlimeKing.as new file mode 100644 index 0000000..1e7e57b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SlimeKing.as @@ -0,0 +1,182 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.Color; + import com.arc.dh.state.StoryMode; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.text.Avatar; + import com.arc.dh.util.text.TextSystem; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + + public class SlimeKing extends Boss + { + + private static const sprite:Class = SlimeKing_sprite; + + private static const SLIME_SPAWN_DELAY:Number = 4; + + private static const JUMP_DELAY:Number = 1; + + private var slimeTimer:Number = 1; + + private var jumpTimer:Number = 1; + + public function SlimeKing(param1:Number, param2:Number) + { + super(param1,param2); + loadGraphic(sprite,true,true,19,14); + facing = LEFT; + acceleration.y = 400; + _moveSpeed = 100; + hp = hpm = mode(1600,30000,50000); + setPhases([70,40]); + addAnimation("walk",[0,1,2],5,true); + play("walk"); + } + + override public function intro() : Boolean + { + TextSystem.display(Avatar.PROFESSOR,"I see you\'ve found my old useless gun, Silo. Unfortunately, your escape stops here."); + go(LEFT); + super.intro(); + return true; + } + + override public function outro() : Boolean + { + var _loc1_:Enemy = null; + TextSystem.display(Avatar.PROFESSOR,"That was impressive. Don\'t think you\'re ever getting out of this cave though, my boy."); + for each(_loc1_ in Data.state.enemies.members) + { + if(!(_loc1_ is Boss)) + { + _loc1_.silentKill(); + } + } + super.outro(); + return true; + } + + override public function engaged() : Boolean + { + var _loc1_:Enemy = null; + this.slimeTimer -= FlxG.elapsed; + if(this.slimeTimer <= 0) + { + this.slimeTimer = SLIME_SPAWN_DELAY + mode(1,0,0); + _loc1_ = new BouncingSlime(ArcU.rand(2,Config.BLOCK_WIDTH - 3),1,mode(1,30,90)); + Data.state.enemies.add(_loc1_); + this.cornerShot(); + } + if(velocity.x == 0) + { + go(facing == LEFT ? RIGHT : LEFT); + } + if(phase == 2 || phase == 3) + { + if(touching & DOWN) + { + this.jumpTimer -= FlxG.elapsed; + if(this.jumpTimer <= 0) + { + velocity.y = -ArcU.rand(100,400); + this.jumpTimer = JUMP_DELAY + ArcU.rand(0,500) / 1000; + } + } + } + else if(phase == 4) + { + if(touching & DOWN) + { + this.jumpTimer -= FlxG.elapsed; + if(this.jumpTimer <= 0) + { + velocity.y = -ArcU.rand(100,400); + this.jumpTimer = ArcU.rand(0,300) / 1000; + } + } + } + super.engaged(); + return false; + } + + override public function kill() : void + { + super.kill(); + } + + override public function changePhase(param1:int) : void + { + var _loc2_:CeilingPlant = null; + var _loc4_:Enemy = null; + switch(param1) + { + case 2: + _loc2_ = new CeilingPlant(3,2,mode(1,50,150)); + _loc2_.goldenize(); + Data.state.enemies.add(_loc2_); + _loc2_ = new CeilingPlant(26,2,mode(1,50,150)); + _loc2_.goldenize(); + Data.state.enemies.add(_loc2_); + break; + case 3: + _moveSpeed = 140; + go(facing); + _loc2_ = new CeilingPlant(10,2,1); + _loc2_.goldenize(); + Data.state.enemies.add(_loc2_); + _loc2_ = new CeilingPlant(19,2,1); + _loc2_.goldenize(); + Data.state.enemies.add(_loc2_); + } + if(Data.state is StoryMode) + { + Data.state.createHeart(x + 3,y); + } + ArcParticleSystem.emit(Data.state.particles,Color.RED,getMidpoint().x,getMidpoint().y,50,1,1,0,-50,50,-50,50); + var _loc3_:int = 2; + while(_loc3_ < Config.BLOCK_WIDTH - 3) + { + _loc4_ = new BouncingSlime(_loc3_,1,mode(1,30,50)); + Data.state.enemies.add(_loc4_); + _loc3_ += 8; + } + } + + private function cornerShot() : void + { + var _loc1_:int = 0; + var _loc2_:int = 0; + var _loc3_:Number = NaN; + var _loc4_:Number = NaN; + if(!heroic) + { + return; + } + if(ArcU.rand(0,1) == 0) + { + _loc1_ = 16; + _loc2_ = 24; + _loc3_ = 0; + _loc4_ = 90; + } + else + { + _loc1_ = 335; + _loc2_ = 24; + _loc3_ = 90; + _loc4_ = 180; + } + var _loc5_:int = phase < 3 ? 15 : (phase < 4 ? 10 : 7); + var _loc6_:int = _loc3_; + while(_loc6_ <= _loc4_) + { + shoot(_loc1_,_loc2_,_loc6_,1); + _loc6_ += _loc5_; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SlimeKing_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SlimeKing_sprite.as new file mode 100644 index 0000000..6db3e56 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SlimeKing_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/194_com.arc.dh.objects.enemies.SlimeKing_sprite.png")] + public class SlimeKing_sprite extends BitmapAsset + { + + public function SlimeKing_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Slime_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Slime_sprite.as new file mode 100644 index 0000000..694c9da --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Slime_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/65_com.arc.dh.objects.enemies.Slime_sprite.png")] + public class Slime_sprite extends BitmapAsset + { + + public function Slime_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Snail.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Snail.as new file mode 100644 index 0000000..0d8b2e3 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Snail.as @@ -0,0 +1,44 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.util.Config; + import com.arc.flixel.ArcU; + + public class Snail extends Enemy + { + + private static const sprite:Class = Snail_sprite; + + private static const CRAWL_SPEED:int = 30; + + public function Snail(param1:Number, param2:Number, param3:int) + { + var _loc4_:Number = NaN; + var _loc5_:Number = NaN; + _loc4_ = param1 * Config.BLOCK_SIZE; + _loc5_ = param2 * Config.BLOCK_SIZE; + _c = param1; + _r = param2; + super(_loc4_,_loc5_,param3); + loadGraphic(sprite,true,true,20,10); + _moveSpeed = CRAWL_SPEED; + acceleration.y = 400; + hittable = true; + width = 10; + offset.x = 5; + facing = ArcU.rand(0,1) == 0 ? LEFT : RIGHT; + velocity.x = facing == LEFT ? -_moveSpeed : _moveSpeed; + addAnimation("walk",[0,1,2,3],5,true); + play("walk"); + } + + override public function update() : void + { + if(velocity.x == 0 && Boolean(touching & DOWN)) + { + reverse(); + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SnailKing.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SnailKing.as new file mode 100644 index 0000000..07cbabc --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SnailKing.as @@ -0,0 +1,196 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.Color; + import com.arc.dh.entities.Player; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxG; + + public class SnailKing extends Boss + { + + private static const sprite:Class = SnailKing_sprite; + + private static const SLIME_SPAWN_DELAY:Number = 4; + + private var slimeTimer:Number = 1; + + private var leftOrb:Orb; + + private var rightOrb:Orb; + + private var _shieldSprite:ArcSprite; + + private var _speedMove:int = 80; + + private var _startHP:int; + + public function SnailKing(param1:Number, param2:Number) + { + super(param1,param2); + loadGraphic(sprite,true,true,20,12); + facing = RIGHT; + acceleration.y = 400; + _moveSpeed = 30; + hp = hpm = mode(8000,60000,60000); + setPhases([70,30]); + this._shieldSprite = new ArcSprite(0,0,Player.shieldSprite); + this._shieldSprite.visible = false; + this._startHP = Data.hp; + addAnimation("walk",[0,1,2,3],5,true); + play("walk"); + } + + override public function intro() : Boolean + { + go(RIGHT); + super.intro(); + return true; + } + + override public function outro() : Boolean + { + var _loc1_:Enemy = null; + for each(_loc1_ in Data.state.enemies.members) + { + if(!(_loc1_ is Boss)) + { + _loc1_.silentKill(); + } + } + super.outro(); + return true; + } + + override public function engaged() : Boolean + { + var _loc1_:Tadpole = null; + this.slimeTimer -= FlxG.elapsed; + if(this.slimeTimer <= 0) + { + this.slimeTimer = SLIME_SPAWN_DELAY; + _loc1_ = new Tadpole(15,3,mode(30,30,50)); + _loc1_.goldenize(); + Data.state.enemies.add(_loc1_); + } + if((this.leftOrb == null || this.leftOrb.alive == false) && (this.rightOrb == null || this.rightOrb.alive == false)) + { + killable = true; + if(_moveSpeed == this._speedMove) + { + _moveSpeed = 30; + go(facing); + } + } + if(velocity.x == 0) + { + this.burst(); + if(facing == RIGHT) + { + x = 325; + y = 46; + go(LEFT); + } + else + { + x = 12; + y = 46; + go(RIGHT); + } + this.burst(); + } + super.engaged(); + return false; + } + + private function burst() : void + { + ArcParticleSystem.emit(Data.state.particles,Color.BLUE,getMidpoint().x,getMidpoint().y,20,1,1,0,-50,50,-50,50); + ArcParticleSystem.emit(Data.state.particles,Color.YELLOW,getMidpoint().x,getMidpoint().y,20,1,1,0,-50,50,-50,50); + } + + override public function kill() : void + { + if(Data.hp == this._startHP) + { + AchievementSystem.snailimmune(); + } + super.kill(); + } + + override public function draw() : void + { + super.draw(); + if(killable == false && phase > 1) + { + this._shieldSprite.x = x - 1; + this._shieldSprite.y = y - 3; + this._shieldSprite.draw(); + } + } + + override public function changePhase(param1:int) : void + { + var _loc2_:CeilingPlant = null; + var _loc3_:Plant = null; + switch(param1) + { + case 2: + _loc2_ = new CeilingPlant(5,2,1); + _loc2_.goldenize(); + Data.state.enemies.add(_loc2_); + spawnBurst(_loc2_.getMidpoint().x,_loc2_.getMidpoint().y); + _loc2_ = new CeilingPlant(24,2,1); + _loc2_.goldenize(); + Data.state.enemies.add(_loc2_); + spawnBurst(_loc2_.getMidpoint().x,_loc2_.getMidpoint().y); + if(heroic) + { + _loc2_ = new CeilingPlant(14,2,1); + _loc2_.goldenize(); + Data.state.enemies.add(_loc2_); + spawnBurst(_loc2_.getMidpoint().x,_loc2_.getMidpoint().y); + } + break; + case 3: + _loc3_ = new Plant(10,16,1,RIGHT); + _loc3_.goldenize(); + Data.state.enemies.add(_loc3_); + spawnBurst(_loc3_.getMidpoint().x,_loc3_.getMidpoint().y); + _loc3_ = new Plant(19,16,1,LEFT); + _loc3_.goldenize(); + Data.state.enemies.add(_loc3_); + spawnBurst(_loc3_.getMidpoint().x,_loc3_.getMidpoint().y); + if(heroic) + { + _loc3_ = new Plant(7,12,1,RIGHT); + _loc3_.goldenize(); + Data.state.enemies.add(_loc3_); + spawnBurst(_loc3_.getMidpoint().x,_loc3_.getMidpoint().y); + _loc3_ = new Plant(22,12,1,LEFT); + _loc3_.goldenize(); + Data.state.enemies.add(_loc3_); + spawnBurst(_loc3_.getMidpoint().x,_loc3_.getMidpoint().y); + _loc3_ = new Plant(4,8,1,RIGHT); + _loc3_.goldenize(); + Data.state.enemies.add(_loc3_); + spawnBurst(_loc3_.getMidpoint().x,_loc3_.getMidpoint().y); + _loc3_ = new Plant(25,8,1,LEFT); + _loc3_.goldenize(); + Data.state.enemies.add(_loc3_); + spawnBurst(_loc3_.getMidpoint().x,_loc3_.getMidpoint().y); + } + } + this.leftOrb = new Orb(20,31,mode(700,3500,7500)); + this.rightOrb = new Orb(330,31,mode(700,3500,7500)); + Data.state.enemies.add(this.leftOrb); + Data.state.enemies.add(this.rightOrb); + killable = false; + _moveSpeed = this._speedMove; + go(facing); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SnailKing_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SnailKing_sprite.as new file mode 100644 index 0000000..d1c9da9 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SnailKing_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/266_com.arc.dh.objects.enemies.SnailKing_sprite.png")] + public class SnailKing_sprite extends BitmapAsset + { + + public function SnailKing_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Snail_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Snail_sprite.as new file mode 100644 index 0000000..b6a41ab --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Snail_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/50_com.arc.dh.objects.enemies.Snail_sprite.png")] + public class Snail_sprite extends BitmapAsset + { + + public function Snail_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Snake.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Snake.as new file mode 100644 index 0000000..0293ad7 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Snake.as @@ -0,0 +1,301 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.Color; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + + public class Snake extends Boss + { + + private static const sprite:Class = Snake_sprite; + + private static const SLIME_SPAWN_DELAY:Number = 4; + + private static const JUMP_DELAY:Number = 1; + + private static const EXPLODE_SEED_SPEED:Number = 100; + + public static const SPEED:int = 70; + + private var slimeTimer:Number = 1; + + private var jumpTimer:Number = 1; + + private var seedColumnTimer:Number = 3; + + private var degrees:int = 0; + + public var turns:Array = new Array(); + + private var _tadpoles:int = 0; + + public function Snake(param1:Number, param2:Number) + { + super(param1,param2); + loadRotatedGraphic(sprite,60,-1,true,true); + width = height = 22; + offset.x = offset.y = 8; + hp = hpm = mode(10000,50000,80000); + setPhases([70,30]); + _moveSpeed = SPEED; + } + + public function move(param1:int) : void + { + this.degrees = param1; + angle = this.degrees + 45; + var _loc2_:Number = Math.PI / 180 * this.degrees; + velocity.x = _moveSpeed * Math.cos(_loc2_); + velocity.y = _moveSpeed * Math.sin(_loc2_); + this.turns.push([x,y,velocity.x,velocity.y]); + } + + private function touch(param1:uint) : Boolean + { + return isTouching(param1); + } + + override public function intro() : Boolean + { + var _loc1_:Plant = null; + this.degrees = ArcU.rand(0,360); + this.move(this.degrees); + if(heroic) + { + _loc1_ = new Plant(1,13,1,RIGHT); + _loc1_.goldenize(); + Data.state.enemies.add(_loc1_); + spawnBurst(_loc1_.getMidpoint().x,_loc1_.getMidpoint().y); + _loc1_ = new Plant(28,13,1,LEFT); + _loc1_.goldenize(); + Data.state.enemies.add(_loc1_); + spawnBurst(_loc1_.getMidpoint().x,_loc1_.getMidpoint().y); + } + super.intro(); + return true; + } + + override public function outro() : Boolean + { + var _loc1_:Enemy = null; + for each(_loc1_ in Data.state.enemies.members) + { + if(!(_loc1_ is Boss)) + { + _loc1_.silentKill(); + } + } + super.outro(); + return true; + } + + override public function engaged() : Boolean + { + var _loc1_:int = 0; + var _loc2_:int = 0; + var _loc3_:int = 0; + var _loc4_:int = 0; + var _loc5_:Number = NaN; + var _loc6_:int = 0; + var _loc7_:int = 0; + if(!visible) + { + return false; + } + if(this.touch(LEFT | RIGHT | UP | DOWN)) + { + if(this.touch(LEFT)) + { + if(velocity.y < 0) + { + _loc1_ = ArcU.rand(-60,0); + } + else + { + _loc1_ = ArcU.rand(0,60); + } + } + else if(this.touch(RIGHT)) + { + if(velocity.y < 0) + { + _loc1_ = ArcU.rand(180,240); + } + else + { + _loc1_ = ArcU.rand(120,180); + } + } + else if(this.touch(DOWN)) + { + if(velocity.x > 0) + { + _loc1_ = ArcU.rand(270,330); + } + else + { + _loc1_ = ArcU.rand(210,270); + } + } + else if(this.touch(UP)) + { + if(velocity.x > 0) + { + _loc1_ = ArcU.rand(30,90); + } + else + { + _loc1_ = ArcU.rand(90,150); + } + } + this.move(_loc1_); + _loc2_ = getMidpoint().x; + _loc3_ = getMidpoint().y; + _loc4_ = ArcU.rand(0,59); + while(_loc4_ < 360) + { + this.shootSeed(_loc2_,_loc3_,_loc4_); + _loc4_ += mode(60,60,30); + } + } + this.seedColumnTimer -= FlxG.elapsed; + if(this.seedColumnTimer <= 0) + { + _loc5_ = 0; + _loc6_ = 1; + switch(phase) + { + case 1: + _loc5_ = 5; + break; + case 2: + _loc5_ = 4; + break; + case 3: + _loc5_ = 4; + _loc6_ = 2; + } + this.seedColumnTimer = _loc5_; + if(_loc6_ == 1) + { + this.shootColumn(ArcU.rand(0,2)); + } + else + { + _loc7_ = ArcU.rand(0,2); + if(_loc7_ == 0) + { + this.shootColumn(0); + this.shootColumn(1); + } + else if(_loc7_ == 1) + { + this.shootColumn(1); + this.shootColumn(2); + } + else if(_loc7_ == 2) + { + this.shootColumn(0); + this.shootColumn(2); + } + } + } + if(FlxG.keys.justPressed("Q")) + { + this.shootColumn(0); + this.shootColumn(1); + this.shootColumn(2); + } + super.engaged(); + return false; + } + + override public function kill() : void + { + super.kill(); + } + + override public function changePhase(param1:int) : void + { + var _loc3_:SnakeTail = null; + switch(param1) + { + case 2: + _moveSpeed = 100; + break; + case 3: + _moveSpeed = 140; + } + ArcParticleSystem.emit(Data.state.particles,Color.RED,getMidpoint().x,getMidpoint().y,50,1,1,0,-50,50,-50,50); + visible = false; + bosshealthbar.visible = false; + solid = false; + velocity.x = velocity.y = 0; + this._tadpoles = 10; + var _loc2_:int = 0; + while(_loc2_ < this._tadpoles) + { + _loc3_ = new SnakeTail(0,0,this,mode(50,20,50)); + _loc3_.x = x + 4; + _loc3_.y = y + 4; + Data.state.enemies.add(_loc3_); + _loc2_++; + } + x = _c * Config.BLOCK_SIZE; + y = _r * Config.BLOCK_SIZE; + } + + public function shootSeed(param1:int, param2:int, param3:int) : void + { + var _loc4_:Number = param3 * Math.PI / 180; + var _loc5_:Seed = new Seed(param1,param2,1); + _loc5_.velocity.x = EXPLODE_SEED_SPEED * Math.cos(_loc4_); + _loc5_.velocity.y = EXPLODE_SEED_SPEED * Math.sin(_loc4_); + Data.state.enemies.add(_loc5_); + } + + private function shootColumn(param1:int) : void + { + var _loc2_:int = 0; + var _loc4_:Seed = null; + switch(param1) + { + case 0: + _loc2_ = 1; + break; + case 1: + _loc2_ = 12; + break; + case 2: + _loc2_ = 23; + } + var _loc3_:int = _loc2_; + while(_loc3_ < _loc2_ + (param1 == 0 ? 7 : 7)) + { + _loc4_ = new Seed(_loc3_ * Config.BLOCK_SIZE,1 * Config.BLOCK_SIZE,1); + _loc4_.velocity.y = 50; + _loc4_.x += 5; + Data.state.enemies.add(_loc4_); + _loc3_++; + } + } + + public function killTadpole() : void + { + --this._tadpoles; + if(this._tadpoles <= 0) + { + ArcParticleSystem.emit(Data.state.particles,Color.RED,getMidpoint().x,getMidpoint().y,50,1,1,0,-50,50,-50,50); + visible = true; + bosshealthbar.visible = true; + solid = true; + this.degrees = ArcU.rand(0,360); + this.move(this.degrees); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SnakeTail.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SnakeTail.as new file mode 100644 index 0000000..850044c --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SnakeTail.as @@ -0,0 +1,127 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.util.Config; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + + public class SnakeTail extends Enemy + { + + private static const sprite:Class = SnakeTail_sprite; + + private static const SPEED:int = 90; + + private var degrees:int = 0; + + private var _snake:Snake; + + public function SnakeTail(param1:Number, param2:Number, param3:Snake, param4:int) + { + var _loc5_:Number = NaN; + var _loc6_:Number = NaN; + _loc5_ = param1 * Config.BLOCK_SIZE; + _loc6_ = param2 * Config.BLOCK_SIZE; + _c = param1; + _r = param2; + super(_loc5_,_loc6_,param4); + loadRotatedGraphic(sprite,60,-1,true,true); + this._snake = param3; + width = height = 10; + offset.x = offset.y = 6; + x += 20; + y -= 20; + this.degrees = ArcU.rand(0,360); + this.move(this.degrees); + } + + public function move(param1:int) : void + { + this.degrees = param1; + angle = this.degrees + 45; + var _loc2_:Number = Math.PI / 180 * this.degrees; + velocity.x = SPEED * Math.cos(_loc2_); + velocity.y = SPEED * Math.sin(_loc2_); + } + + private function touch(param1:uint) : Boolean + { + return isTouching(param1); + } + + override public function update() : void + { + var _loc1_:int = 0; + var _loc2_:int = 0; + var _loc3_:int = 0; + var _loc4_:int = 0; + if(FlxG.keys.justPressed("X")) + { + this.move(this.degrees + 5); + } + if(this.touch(LEFT | RIGHT | UP | DOWN)) + { + if(this.touch(LEFT)) + { + if(velocity.y < 0) + { + _loc1_ = ArcU.rand(-60,0); + } + else + { + _loc1_ = ArcU.rand(0,60); + } + } + else if(this.touch(RIGHT)) + { + if(velocity.y < 0) + { + _loc1_ = ArcU.rand(180,240); + } + else + { + _loc1_ = ArcU.rand(120,180); + } + } + else if(this.touch(DOWN)) + { + if(velocity.x > 0) + { + _loc1_ = ArcU.rand(270,330); + } + else + { + _loc1_ = ArcU.rand(210,270); + } + } + else if(this.touch(UP)) + { + if(velocity.x > 0) + { + _loc1_ = ArcU.rand(30,90); + } + else + { + _loc1_ = ArcU.rand(90,150); + } + } + this.move(_loc1_); + _loc2_ = getMidpoint().x; + _loc3_ = getMidpoint().y; + _loc4_ = ArcU.rand(0,59); + while(_loc4_ < 360) + { + this._snake.shootSeed(_loc2_,_loc3_,_loc4_); + _loc4_ += 120; + } + } + super.update(); + } + + override public function kill() : void + { + this._snake.killTadpole(); + super.kill(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SnakeTail_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SnakeTail_sprite.as new file mode 100644 index 0000000..d4079fd --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/SnakeTail_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/285_com.arc.dh.objects.enemies.SnakeTail_sprite.png")] + public class SnakeTail_sprite extends BitmapAsset + { + + public function SnakeTail_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Snake_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Snake_sprite.as new file mode 100644 index 0000000..b4f0e30 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Snake_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/267_com.arc.dh.objects.enemies.Snake_sprite.png")] + public class Snake_sprite extends BitmapAsset + { + + public function Snake_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Spider.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Spider.as new file mode 100644 index 0000000..843ccca --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Spider.as @@ -0,0 +1,79 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.state.HorizontalMode; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcSprite; + import com.arc.flixel.ArcU; + import org.flixel.FlxPoint; + + public class Spider extends Enemy + { + + private static const sprite:Class = Spider_sprite; + + private static const threadSprite:Class = Spider_threadSprite; + + private var _thread:ArcSprite; + + private var _falling:Boolean = false; + + private var _climbing:Boolean = false; + + private var _sp:FlxPoint; + + public function Spider(param1:Number, param2:Number, param3:int) + { + var _loc4_:Number = NaN; + var _loc5_:Number = NaN; + _loc4_ = param1 * Config.BLOCK_SIZE; + _loc5_ = param2 * Config.BLOCK_SIZE; + _c = param1; + _r = param2; + super(_loc4_,_loc5_,param3); + loadGraphic(sprite,true,true,13,10); + width = 9; + offset.x = 2; + y -= 12; + this._sp = new FlxPoint(x,y); + this._thread = new ArcSprite(x + 4,y,threadSprite); + addAnimation("wiggle",[0,1],5,true); + play("wiggle"); + } + + override public function update() : void + { + if(!this._falling && !this._climbing && ArcU.abs(Data.state.player.getMidpoint().x + (Data.state is HorizontalMode ? (Data.state as HorizontalMode).camera.velocity.x * 0.3 : 0) - getMidpoint().x) < 40) + { + if(Data.state.tilemap.ray(this._sp,new FlxPoint(Data.state.player.x,Data.state.player.y))) + { + velocity.y = 150; + acceleration.y = 400; + this._falling = true; + } + } + if(this._falling && !this._climbing && Boolean(touching & DOWN)) + { + this._climbing = true; + acceleration.y = 0; + velocity.y = -50; + } + if(this._climbing && this._falling && y <= this._sp.y) + { + this._climbing = false; + this._falling = false; + y = this._sp.y; + velocity.y = 0; + } + super.update(); + } + + override public function draw() : void + { + this._thread.sourceRect.height = y - this._sp.y + 2; + this._thread.draw(); + super.draw(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Spider_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Spider_sprite.as new file mode 100644 index 0000000..43e5e63 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Spider_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/225_com.arc.dh.objects.enemies.Spider_sprite.png")] + public class Spider_sprite extends BitmapAsset + { + + public function Spider_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Spider_threadSprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Spider_threadSprite.as new file mode 100644 index 0000000..7ecb154 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Spider_threadSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/125_com.arc.dh.objects.enemies.Spider_threadSprite.png")] + public class Spider_threadSprite extends BitmapAsset + { + + public function Spider_threadSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Spike.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Spike.as new file mode 100644 index 0000000..9890fe5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Spike.as @@ -0,0 +1,23 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.util.Config; + + public class Spike extends Enemy + { + + private static const sprite:Class = Spike_sprite; + + public function Spike(param1:Number, param2:Number, param3:int) + { + _c = param1; + _r = param2; + super(param1 * Config.BLOCK_SIZE + 2,param2 * Config.BLOCK_SIZE + 8,param3,false); + loadGraphic(sprite,true,true,12,12); + width = 8; + offset.x = 2; + height = 4; + offset.y = 2; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Spike_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Spike_sprite.as new file mode 100644 index 0000000..fc9e7af --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Spike_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/165_com.arc.dh.objects.enemies.Spike_sprite.png")] + public class Spike_sprite extends BitmapAsset + { + + public function Spike_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/StoneBird.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/StoneBird.as new file mode 100644 index 0000000..a01019e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/StoneBird.as @@ -0,0 +1,177 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.Color; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Data; + import com.arc.dh.util.text.Avatar; + import com.arc.dh.util.text.TextSystem; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class StoneBird extends Boss + { + + private static const sprite:Class = StoneBird_sprite; + + private static const BIRD_SPAWN_DELAY:Number = 4; + + private static const SLIME_DROP_DELAY:Number = 6; + + private static const JUMP_DELAY:Number = 1; + + private static const HEROIC_SHOOT_DELAY:Number = 0.3; + + private var birdTimer:Number = 1; + + private var slimeTimer:Number = 6; + + private var jumpTimer:Number = 1; + + private var heroicShootTimer:Number = 0.3; + + private var heroicShootAngle:Number = 45; + + public function StoneBird(param1:Number, param2:Number) + { + super(param1,param2); + loadGraphic(sprite,true,true,33,18); + facing = RIGHT; + _moveSpeed = 60; + go(LEFT); + hp = hpm = mode(6000,60000,80000); + setPhases([75,50]); + addAnimation("walk",[0,1],5,true); + play("walk"); + } + + override public function update() : void + { + if(velocity.x == 0) + { + go(facing == LEFT ? RIGHT : LEFT); + } + super.update(); + } + + override public function intro() : Boolean + { + super.intro(); + return true; + } + + override public function outro() : Boolean + { + var _loc1_:Enemy = null; + TextSystem.display(Avatar.PROFESSOR,"Not bad... Not bad at all."); + for each(_loc1_ in Data.state.enemies.members) + { + if(!(_loc1_ is Boss)) + { + _loc1_.silentKill(); + } + } + super.outro(); + return true; + } + + private function spawnBird(param1:int, param2:int) : void + { + var _loc3_:Enemy = null; + _loc3_ = new DiveBird(0,0,param1,param2); + _loc3_.x = x; + _loc3_.y = y; + Data.state.enemies.add(_loc3_); + } + + override public function engaged() : Boolean + { + var _loc1_:int = 0; + var _loc2_:int = 0; + var _loc3_:int = 0; + var _loc4_:Enemy = null; + var _loc5_:BouncingSlime = null; + var _loc6_:FlxPoint = null; + this.birdTimer -= FlxG.elapsed; + if(this.birdTimer <= 0) + { + this.birdTimer = BIRD_SPAWN_DELAY - (phase > 1 ? 1 : 0); + _loc1_ = mode(2,15,50); + this.spawnBird(_loc1_,facing); + if(phase > 2) + { + this.spawnBird(_loc1_,facing == LEFT ? int(RIGHT) : int(LEFT)); + } + _loc2_ = 0; + _loc3_ = 0; + while(_loc3_ < Data.state.enemies.members.length) + { + _loc4_ = Data.state.enemies.members[_loc3_]; + if(_loc4_ != null && _loc4_ is DiveBird && _loc4_.alive) + { + _loc2_++; + } + _loc3_++; + } + AchievementSystem.birds(_loc2_); + } + this.slimeTimer -= FlxG.elapsed; + if(this.slimeTimer <= 0) + { + this.slimeTimer = SLIME_DROP_DELAY; + _loc5_ = new BouncingSlime(ArcU.rand(0,1) == 0 ? 2 : 28,2,mode(20,20,50)); + _loc5_._jumping = true; + Data.state.enemies.add(_loc5_); + } + this.heroicShootTimer -= FlxG.elapsed; + if(this.heroicShootTimer <= 0 && heroic) + { + this.heroicShootTimer = HEROIC_SHOOT_DELAY; + _loc6_ = getMidpoint(); + shoot(_loc6_.x,_loc6_.y,this.heroicShootAngle,1); + this.heroicShootAngle += 15; + if(this.heroicShootAngle > 135) + { + this.heroicShootAngle -= 90; + } + } + super.engaged(); + return false; + } + + override public function kill() : void + { + super.kill(); + } + + override public function changePhase(param1:int) : void + { + var _loc2_:CeilingPlant = null; + var _loc3_:Plant = null; + switch(param1) + { + case 2: + _loc2_ = new CeilingPlant(7,2,1); + _loc2_.goldenize(); + Data.state.enemies.add(_loc2_); + _loc2_ = new CeilingPlant(22,2,1); + _loc2_.goldenize(); + Data.state.enemies.add(_loc2_); + break; + case 3: + _loc3_ = new Plant(1,16,1,RIGHT); + _loc3_.goldenize(); + Data.state.enemies.add(_loc3_); + if(heroic) + { + _loc3_ = new Plant(28,16,1,LEFT); + _loc3_.goldenize(); + Data.state.enemies.add(_loc3_); + } + } + ArcParticleSystem.emit(Data.state.particles,Color.RED,getMidpoint().x,getMidpoint().y,50,1,1,0,-50,50,-50,50); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/StoneBird_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/StoneBird_sprite.as new file mode 100644 index 0000000..31cf410 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/StoneBird_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/172_com.arc.dh.objects.enemies.StoneBird_sprite.png")] + public class StoneBird_sprite extends BitmapAsset + { + + public function StoneBird_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Tadpole.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Tadpole.as new file mode 100644 index 0000000..75918f8 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Tadpole.as @@ -0,0 +1,123 @@ +package com.arc.dh.objects.enemies +{ + import com.arc.dh.state.HorizontalMode; + import com.arc.dh.state.TadpoleMode; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + + public class Tadpole extends Enemy + { + + public static const sprite:Class = Tadpole_sprite; + + public static const redSprite:Class = Tadpole_redSprite; + + private static const SPEED:int = 100; + + private var degrees:int = 0; + + public var red:Boolean = false; + + public function Tadpole(param1:Number, param2:Number, param3:int) + { + var _loc4_:Number = NaN; + var _loc5_:Number = NaN; + _loc4_ = param1 * Config.BLOCK_SIZE; + _loc5_ = param2 * Config.BLOCK_SIZE; + _c = param1; + _r = param2; + super(_loc4_,_loc5_,param3); + loadRotatedGraphic(sprite,60,-1,true,true); + width = height = 10; + offset.x = offset.y = 6; + x += 20; + y -= 20; + this.degrees = ArcU.rand(0,360); + this.move(this.degrees); + if(Data.state is TadpoleMode) + { + hpm = hp = 1; + } + } + + public function move(param1:int) : void + { + var _loc2_:Number = Data.state is HorizontalMode ? SPEED * 0.5 : SPEED; + this.degrees = param1; + angle = this.degrees + 45; + var _loc3_:Number = Math.PI / 180 * this.degrees; + velocity.x = _loc2_ * Math.cos(_loc3_); + velocity.y = _loc2_ * Math.sin(_loc3_); + } + + private function touch(param1:uint) : Boolean + { + return isTouching(param1); + } + + override public function update() : void + { + var _loc1_:int = 0; + if(FlxG.keys.justPressed("X")) + { + this.move(this.degrees + 5); + } + if(this.touch(LEFT | RIGHT | UP | DOWN)) + { + if(this.touch(LEFT)) + { + if(velocity.y < 0) + { + _loc1_ = ArcU.rand(-60,0); + } + else + { + _loc1_ = ArcU.rand(0,60); + } + } + else if(this.touch(RIGHT)) + { + if(velocity.y < 0) + { + _loc1_ = ArcU.rand(180,240); + } + else + { + _loc1_ = ArcU.rand(120,180); + } + } + else if(this.touch(DOWN)) + { + if(velocity.x > 0) + { + _loc1_ = ArcU.rand(270,330); + } + else + { + _loc1_ = ArcU.rand(210,270); + } + } + else if(this.touch(UP)) + { + if(velocity.x > 0) + { + _loc1_ = ArcU.rand(30,90); + } + else + { + _loc1_ = ArcU.rand(90,150); + } + } + if(this.red) + { + this.kill(); + } + this.move(_loc1_); + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Tadpole_redSprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Tadpole_redSprite.as new file mode 100644 index 0000000..6a1f64c --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Tadpole_redSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/216_com.arc.dh.objects.enemies.Tadpole_redSprite.png")] + public class Tadpole_redSprite extends BitmapAsset + { + + public function Tadpole_redSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Tadpole_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Tadpole_sprite.as new file mode 100644 index 0000000..1d99590 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/enemies/Tadpole_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.enemies +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/62_com.arc.dh.objects.enemies.Tadpole_sprite.png")] + public class Tadpole_sprite extends BitmapAsset + { + + public function Tadpole_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/HeartCrystal.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/HeartCrystal.as new file mode 100644 index 0000000..23e07ac --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/HeartCrystal.as @@ -0,0 +1,59 @@ +package com.arc.dh.objects.powerups +{ + import com.arc.dh.Color; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Data; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcParticleSystem; + + public class HeartCrystal extends Powerup + { + + private static const sprite:Class = HeartCrystal_sprite; + + private static const spriteBorder:Class = HeartCrystal_spriteBorder; + + private static const sprite_outline:Class = HeartCrystal_sprite_outline; + + private var _id:int; + + public function HeartCrystal(param1:Number, param2:Number, param3:int) + { + this._id = param3; + super(param1,param2,Data.heartcrystals[this._id] == 1 ? sprite_outline : sprite,Data.heartcrystals[this._id] == 1 ? null : Color.RED,Data.heartcrystals[this._id] == 1 ? sprite_outline : spriteBorder,17); + } + + override public function update() : void + { + if(Data.heartcrystals[this._id] == 1) + { + solid = false; + } + super.update(); + } + + override public function activate() : void + { + if(Data.hp <= 0) + { + return; + } + ++Data.hp; + Data.heartcrystals[this._id] = 1; + var _loc1_:int = 0; + var _loc2_:int = 0; + while(_loc2_ < 17) + { + _loc1_ += Data.heartcrystals[_loc2_]; + _loc2_++; + } + Data.vitality = _loc1_; + ArcParticleSystem.emit(Data.state.emitters,Color.RED,x + 6,y + 6,15,2,0.5,0,-80,80,-80,80); + AchievementSystem.heartcrystal(); + SoundSystem.play(Sound.HEART_CRYSTAL); + kill(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/HeartCrystal_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/HeartCrystal_sprite.as new file mode 100644 index 0000000..4c5c313 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/HeartCrystal_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.powerups +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/96_com.arc.dh.objects.powerups.HeartCrystal_sprite.png")] + public class HeartCrystal_sprite extends BitmapAsset + { + + public function HeartCrystal_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/HeartCrystal_spriteBorder.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/HeartCrystal_spriteBorder.as new file mode 100644 index 0000000..1a0aa61 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/HeartCrystal_spriteBorder.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.powerups +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/112_com.arc.dh.objects.powerups.HeartCrystal_spriteBorder.png")] + public class HeartCrystal_spriteBorder extends BitmapAsset + { + + public function HeartCrystal_spriteBorder() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/HeartCrystal_sprite_outline.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/HeartCrystal_sprite_outline.as new file mode 100644 index 0000000..a471654 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/HeartCrystal_sprite_outline.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.powerups +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/97_com.arc.dh.objects.powerups.HeartCrystal_sprite_outline.png")] + public class HeartCrystal_sprite_outline extends BitmapAsset + { + + public function HeartCrystal_sprite_outline() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/Powerup.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/Powerup.as new file mode 100644 index 0000000..cc70275 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/Powerup.as @@ -0,0 +1,133 @@ +package com.arc.dh.objects.powerups +{ + import com.arc.dh.entities.Entity; + import com.arc.dh.objects.Checkpoint; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxG; + + public class Powerup extends Entity + { + + public static const POWERUP_DIAMOND_BORDER:Class = Powerup_POWERUP_DIAMOND_BORDER; + + protected var _border:ArcSprite; + + private var _borderAlphaIncreasing:Boolean = true; + + private var _sinOffset:Number = 0; + + protected var _sy:int; + + private var _yOffset:Number = 0; + + private var _yOffsetIncreasing:Boolean = true; + + protected var _particles:Object; + + private var _particleTimer:Number = 0; + + protected var _waver:Boolean = true; + + protected var _c:int; + + protected var _r:int; + + public function Powerup(param1:Number, param2:Number, param3:Class = null, param4:Object = 7, param5:Class = null, param6:int = 13) + { + super(param1 * Config.BLOCK_SIZE,param2 * Config.BLOCK_SIZE - 5); + this._c = param1; + this._r = param2; + if(param3 != null) + { + loadGraphic(param3,false,false,param6,param6); + this._border = new ArcSprite(x,y,param5 == null ? POWERUP_DIAMOND_BORDER : param5); + } + this._sy = y; + this._particles = param4; + } + + public function activate() : void + { + } + + override public function update() : void + { + if(outside) + { + if(this is Checkpoint || this is PowerupEquipment || this is PowerupFire || this is PowerupMagnet || this is PowerupShield) + { + Data.state.spawner[this._c + "," + this._r] = null; + } + kill(); + } + if(this._border != null) + { + if(this._borderAlphaIncreasing) + { + this._border.alpha += FlxG.elapsed; + if(this._border.alpha >= 1) + { + this._border.alpha = 1; + this._borderAlphaIncreasing = false; + } + } + else + { + this._border.alpha -= FlxG.elapsed; + if(this._border.alpha <= 0.2) + { + this._border.alpha = 0.2; + this._borderAlphaIncreasing = true; + } + } + } + if(this._waver) + { + if(this._yOffsetIncreasing) + { + this._yOffset += FlxG.elapsed * 4; + if(this._yOffset >= 5) + { + this._yOffset = 5; + this._yOffsetIncreasing = false; + } + } + else + { + this._yOffset -= FlxG.elapsed * 4; + if(this._yOffset <= 0) + { + this._yOffset = 0; + this._yOffsetIncreasing = true; + } + } + y = this._sy + this._yOffset; + } + if(this._particles != null) + { + this._particleTimer -= FlxG.elapsed; + if(this._particleTimer <= 0) + { + this._particleTimer = 0.3; + ArcParticleSystem.emit(Data.state.particles,this._particles,getMidpoint().x,getMidpoint().y,1,1,0.4,0,-20,20,-20,20); + } + } + super.update(); + } + + override public function draw() : void + { + super.draw(); + if(this._border != null) + { + this._border.x = x; + this._border.y = y; + this._border.draw(); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupEquipment.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupEquipment.as new file mode 100644 index 0000000..918efd5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupEquipment.as @@ -0,0 +1,126 @@ +package com.arc.dh.objects.powerups +{ + import com.arc.dh.Color; + import com.arc.dh.util.Data; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.dh.util.text.Avatar; + import com.arc.dh.util.text.TextSystem; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcSprite; + + public class PowerupEquipment extends Powerup + { + + private static const sprite:Class = PowerupEquipment_sprite; + + private static const spriteBorder:Class = PowerupEquipment_spriteBorder; + + private var _offset:int; + + public function PowerupEquipment(param1:Number, param2:Number, param3:int) + { + super(param1,param2,null,Color.RED,null,14); + Data.state.spawner[_c + "," + _r] = true; + loadGraphic(sprite,true,false,14,14); + height = 20; + addAnimation("equipment",[param3]); + play("equipment"); + _border = new ArcSprite(x,y); + _border.loadGraphic(spriteBorder,true,false,14,14); + _border.addAnimation("equipment",[param3]); + _border.play("equipment"); + this._offset = param3; + } + + override public function update() : void + { + super.update(); + } + + override public function activate() : void + { + switch(this.name()) + { + case "prime": + Data.prime = 1; + TextSystem.display(Avatar.SAGA,"Thank you for rescuing me. I am the Slime Annihilating Gun Appartus, call me SAGA. You can think of me as a very smart gun. I don\'t know how you ended up down here, but if we work together we can escape."); + Data.state.ui.showGuns(true); + break; + case "spreader": + Data.spreader = 1; + TextSystem.display(Avatar.SAGA,"That Spreader Chip will augment my ability to create bullets, allowing you to shoot multiple bullets at a time. Press 2 or use Q/E to switch to the Spreader Gun."); + Data.state.ui.showGuns(true); + break; + case "missile": + Data.missile = 1; + TextSystem.display(Avatar.SAGA,"That Missile Chip will allow me to shoot missiles strong enough to knock back slimes and destroy steel crates. Press 3 or use Q/E to switch to the Missile Gun."); + Data.state.ui.showGuns(true); + break; + case "rebound": + Data.rebound = 1; + TextSystem.display(Avatar.SAGA,"That Rebound Chip will allow me to enhance the elasticity of my bullets, causing them to bounce off walls. Press 4 or use Q/E to switch to the Rebound Gun."); + Data.state.ui.showGuns(true); + break; + case "xrayscope": + Data.xrayscope = 1; + TextSystem.display(Avatar.SAGA,"That X-Ray Scope Chip will allow me to send rays through the cave to find hidden areas. However, I cannot move or shoot bullets while generating a beam. Hold SHIFT to activate the X-Ray Scope."); + break; + case "autofirer": + Data.autofirer = 1; + TextSystem.display(Avatar.SAGA,"That Autofire Chip you just collected activates my autofire ability. Press F to enable it."); + break; + case "lasersight": + Data.lasersight = 1; + TextSystem.display(Avatar.SAGA,"Laser Sight activated."); + break; + case "skyboots": + Data.skyboots = 1; + TextSystem.display(Avatar.SAGA,"Those are the prototype Sky Boots the professor developed. They will allow you to double jump."); + break; + case "moltensuit": + Data.moltensuit = 1; + TextSystem.display(Avatar.SAGA,"That Molten Suit will permit you to survive in lava for a short period of time."); + break; + case "moonboots": + Data.moonboots = 1; + TextSystem.display(Avatar.SAGA,"Those Moon Boots were very recently developed by The Professor. Use them to triple jump to help your escape."); + } + SoundSystem.play(Sound.EQUIPMENT); + ArcParticleSystem.emit(Data.state.particles,Color.WHITE,getMidpoint().x,getMidpoint().y,20,1,1,0,-150,150,-150,150); + ArcParticleSystem.emit(Data.state.particles,Color.CYAN,getMidpoint().x,getMidpoint().y,20,1,1,0,-100,100,-100,100); + ArcParticleSystem.emit(Data.state.particles,Color.BLUE,getMidpoint().x,getMidpoint().y,20,1,1,0,-50,50,-50,50); + kill(); + } + + private function name() : String + { + switch(this._offset) + { + case 0: + return "autofirer"; + case 1: + return "lasersight"; + case 2: + return "skyboots"; + case 3: + return "moltensuit"; + case 4: + return "moonboots"; + case 5: + return "prime"; + case 6: + return "spreader"; + case 7: + return "missile"; + case 8: + return "rebound"; + case 9: + return "xrayscope"; + default: + return ""; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupEquipment_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupEquipment_sprite.as new file mode 100644 index 0000000..43497ae --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupEquipment_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.powerups +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/215.png")] + public class PowerupEquipment_sprite extends BitmapAsset + { + + public function PowerupEquipment_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupEquipment_spriteBorder.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupEquipment_spriteBorder.as new file mode 100644 index 0000000..a57d7a4 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupEquipment_spriteBorder.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.powerups +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/221_com.arc.dh.objects.powerups.PowerupEquipment_spriteBorder.png")] + public class PowerupEquipment_spriteBorder extends BitmapAsset + { + + public function PowerupEquipment_spriteBorder() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupFire.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupFire.as new file mode 100644 index 0000000..2294615 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupFire.as @@ -0,0 +1,41 @@ +package com.arc.dh.objects.powerups +{ + import com.arc.dh.Gun; + import com.arc.dh.objects.BulletFactory; + import com.arc.dh.objects.BulletPrime; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Data; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + + public class PowerupFire extends Powerup + { + + private static const sprite:Class = PowerupFire_sprite; + + public function PowerupFire(param1:Number, param2:Number) + { + super(param1,param2,sprite); + Data.state.spawner[_c + "," + _r] = true; + } + + override public function activate() : void + { + var _loc4_:Number = NaN; + var _loc1_:int = getMidpoint().x; + var _loc2_:int = getMidpoint().y; + var _loc3_:int = 0; + while(_loc3_ < 360) + { + _loc4_ = _loc3_ * Math.PI / 180; + Data.state.bullets.add(BulletFactory.create(_loc1_,_loc2_,Gun.PRIME_SPEED,_loc4_,BulletPrime)); + _loc3_ += 6; + } + ++Data.powerups; + AchievementSystem.powerups(); + SoundSystem.play(Sound.POWERUP,2); + kill(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupFire_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupFire_sprite.as new file mode 100644 index 0000000..9027197 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupFire_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.powerups +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/155_com.arc.dh.objects.powerups.PowerupFire_sprite.png")] + public class PowerupFire_sprite extends BitmapAsset + { + + public function PowerupFire_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupHeart.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupHeart.as new file mode 100644 index 0000000..0f49aca --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupHeart.as @@ -0,0 +1,38 @@ +package com.arc.dh.objects.powerups +{ + import com.arc.dh.Color; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Data; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcParticleSystem; + + public class PowerupHeart extends Powerup + { + + private static const sprite:Class = PowerupHeart_sprite; + + private static const spriteBorder:Class = PowerupHeart_spriteBorder; + + public function PowerupHeart(param1:Number, param2:Number) + { + super(param1,param2,sprite,Color.RED,spriteBorder); + } + + override public function activate() : void + { + ++Data.hp; + if(Data.hp > Data.hpm) + { + Data.hp = Data.hpm; + } + ++Data.powerups; + AchievementSystem.powerups(); + SoundSystem.play(Sound.HEART); + ArcParticleSystem.emit(Data.state.emitters,Color.RED,x + 6,y + 6,15,1,0.5,0,-20,20,-20,20); + ArcParticleSystem.emit(Data.state.emitters,Color.WHITE,x + 6,y + 6,15,1,0.5,0,-20,20,-20,20); + kill(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupHeart_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupHeart_sprite.as new file mode 100644 index 0000000..379a7b2 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupHeart_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.powerups +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/63_com.arc.dh.objects.powerups.PowerupHeart_sprite.png")] + public class PowerupHeart_sprite extends BitmapAsset + { + + public function PowerupHeart_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupHeart_spriteBorder.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupHeart_spriteBorder.as new file mode 100644 index 0000000..6947f9f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupHeart_spriteBorder.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.powerups +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/240_com.arc.dh.objects.powerups.PowerupHeart_spriteBorder.png")] + public class PowerupHeart_spriteBorder extends BitmapAsset + { + + public function PowerupHeart_spriteBorder() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupMagnet.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupMagnet.as new file mode 100644 index 0000000..0a5ad11 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupMagnet.as @@ -0,0 +1,35 @@ +package com.arc.dh.objects.powerups +{ + import com.arc.dh.objects.Diamond; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Data; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + + public class PowerupMagnet extends Powerup + { + + private static const sprite:Class = PowerupMagnet_sprite; + + public function PowerupMagnet(param1:Number, param2:Number) + { + super(param1,param2,sprite); + Data.state.spawner[_c + "," + _r] = true; + } + + override public function activate() : void + { + var _loc2_:Diamond = null; + var _loc1_:Array = Data.state.diamonds.members; + for each(_loc2_ in _loc1_) + { + _loc2_.magnet = true; + } + ++Data.powerups; + AchievementSystem.powerups(); + SoundSystem.play(Sound.POWERUP,2); + kill(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupMagnet_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupMagnet_sprite.as new file mode 100644 index 0000000..9dccdb9 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupMagnet_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.powerups +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/217_com.arc.dh.objects.powerups.PowerupMagnet_sprite.png")] + public class PowerupMagnet_sprite extends BitmapAsset + { + + public function PowerupMagnet_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupShield.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupShield.as new file mode 100644 index 0000000..db02304 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupShield.as @@ -0,0 +1,26 @@ +package com.arc.dh.objects.powerups +{ + import com.arc.dh.util.Data; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + + public class PowerupShield extends Powerup + { + + private static const sprite:Class = PowerupShield_sprite; + + public function PowerupShield(param1:Number, param2:Number) + { + super(param1,param2,sprite); + Data.state.spawner[_c + "," + _r] = true; + } + + override public function activate() : void + { + Data.state.player.shield(10); + SoundSystem.play(Sound.POWERUP,2); + kill(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupShield_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupShield_sprite.as new file mode 100644 index 0000000..97a40d8 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/PowerupShield_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.powerups +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/231_com.arc.dh.objects.powerups.PowerupShield_sprite.png")] + public class PowerupShield_sprite extends BitmapAsset + { + + public function PowerupShield_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/Powerup_POWERUP_DIAMOND_BORDER.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/Powerup_POWERUP_DIAMOND_BORDER.as new file mode 100644 index 0000000..60c0091 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/Powerup_POWERUP_DIAMOND_BORDER.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.powerups +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/302_com.arc.dh.objects.powerups.Powerup_POWERUP_DIAMOND_BORDER.png")] + public class Powerup_POWERUP_DIAMOND_BORDER extends BitmapAsset + { + + public function Powerup_POWERUP_DIAMOND_BORDER() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/RedDiamond.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/RedDiamond.as new file mode 100644 index 0000000..62ad25a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/RedDiamond.as @@ -0,0 +1,57 @@ +package com.arc.dh.objects.powerups +{ + import com.arc.dh.Color; + import com.arc.dh.state.StoryMode; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Data; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcParticleSystem; + + public class RedDiamond extends Powerup + { + + private static const sprite:Class = RedDiamond_sprite; + + private static const sprite_outline:Class = RedDiamond_sprite_outline; + + private var _id:int; + + public function RedDiamond(param1:Number, param2:Number, param3:int) + { + super(param1,param2,null,Color.RED); + x -= 6; + y -= 6; + _sy = y; + this._id = param3; + if(Data.hasRed((Data.state as StoryMode).chapter,this._id)) + { + loadGraphic(sprite_outline,true,false,20,20); + solid = false; + alpha = 0.75; + _particles = null; + } + else + { + loadGraphic(sprite,true,false,20,20); + } + addAnimation("float",[0,1,2,3,4,5,4,3,2,1],10,true); + play("float"); + } + + override public function activate() : void + { + Data.obtainRed((Data.state as StoryMode).chapter,this._id); + ArcParticleSystem.emit(Data.state.emitters,Color.RED,x + 6,y + 6,15,2,0.5,0,-80,80,-80,80); + Data.diamonds += 100; + Data.totaldiamonds += 100; + AchievementSystem.diamonds(); + Data.state.cdiamonds += 100; + AchievementSystem.reddiamonds(); + AchievementSystem.diamonds(); + SoundSystem.play(Sound.RED_DIAMOND); + kill(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/RedDiamond_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/RedDiamond_sprite.as new file mode 100644 index 0000000..76f14e7 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/RedDiamond_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.powerups +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/152_com.arc.dh.objects.powerups.RedDiamond_sprite.png")] + public class RedDiamond_sprite extends BitmapAsset + { + + public function RedDiamond_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/RedDiamond_sprite_outline.as b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/RedDiamond_sprite_outline.as new file mode 100644 index 0000000..1b85e59 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/objects/powerups/RedDiamond_sprite_outline.as @@ -0,0 +1,15 @@ +package com.arc.dh.objects.powerups +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/292_com.arc.dh.objects.powerups.RedDiamond_sprite_outline.png")] + public class RedDiamond_sprite_outline extends BitmapAsset + { + + public function RedDiamond_sprite_outline() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/AG.as b/research/inner_decompiled/scripts/com/arc/dh/state/AG.as new file mode 100644 index 0000000..6b02a9d --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/AG.as @@ -0,0 +1,59 @@ +package com.arc.dh.state +{ + import flash.display.Loader; + import flash.events.Event; + import flash.media.SoundMixer; + import flash.system.ApplicationDomain; + import flash.system.LoaderContext; + import org.flixel.FlxG; + import org.flixel.FlxState; + + public class AG extends FlxState + { + + private static var AG:Class = AG_AG; + + private var len:Number = 220; + + private var zoomFactor:int = 1; + + private var movie:Loader; + + public function AG() + { + super(); + } + + override public function create() : void + { + this.movie = new Loader(); + var _loc1_:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain); + this.movie.loadBytes(new AG(),_loc1_); + this.movie.contentLoaderInfo.addEventListener(Event.COMPLETE,this.contentsRetrieve); + } + + private function contentsRetrieve(param1:Event) : void + { + this.movie.scaleX = 1 / this.zoomFactor; + this.movie.scaleY = 1 / this.zoomFactor; + this.movie.x = 10; + this.movie.y = 40; + FlxG.stage.addChildAt(this.movie,0); + this.movie.addEventListener(Event.EXIT_FRAME,this.next); + } + + private function next(param1:Event) : void + { + --this.len; + if(this.len <= 0) + { + FlxG.stage.removeChildAt(0); + SoundMixer.stopAll(); + this.movie.removeEventListener(Event.EXIT_FRAME,this.next); + this.movie.unload(); + FlxG.switchState(new MainMenu()); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/AG_AG.as b/research/inner_decompiled/scripts/com/arc/dh/state/AG_AG.as new file mode 100644 index 0000000..2f31035 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/AG_AG.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.ByteArrayAsset; + + [Embed(source="/_assets/45_com.arc.dh.state.AG_AG.bin", mimeType="application/octet-stream")] + public class AG_AG extends ByteArrayAsset + { + + public function AG_AG() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/Background.as b/research/inner_decompiled/scripts/com/arc/dh/state/Background.as new file mode 100644 index 0000000..11e597d --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/Background.as @@ -0,0 +1,33 @@ +package com.arc.dh.state +{ + import com.arc.flixel.ArcSprite; + + public class Background extends ArcSprite + { + + public var vertical:Boolean = true; + + public function Background(param1:Number = 0, param2:Number = 0, param3:Class = null) + { + super(param1,param2,param3); + } + + override public function draw() : void + { + super.draw(); + if(this.vertical) + { + y += 420; + super.draw(); + y -= 420; + } + else + { + x += 360; + super.draw(); + x -= 360; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/BeginnerTip.as b/research/inner_decompiled/scripts/com/arc/dh/state/BeginnerTip.as new file mode 100644 index 0000000..dc6d29d --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/BeginnerTip.as @@ -0,0 +1,60 @@ +package com.arc.dh.state +{ + import com.arc.dh.util.Data; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxG; + import org.flixel.FlxObject; + + public class BeginnerTip extends ArcSprite + { + + private var _padding:int; + + public function BeginnerTip(param1:Number, param2:Number, param3:Class, param4:int = 0) + { + super(param1,param2,param3); + alpha = 0.5; + this._padding = param4; + } + + override public function update() : void + { + var _loc1_:Number = NaN; + if(alive) + { + _loc1_ = 0.5; + if(!solid) + { + alpha -= FlxG.elapsed * _loc1_ * 2; + if(alpha <= 0) + { + visible = false; + alive = false; + } + } + else if(!immovable) + { + alpha -= FlxG.elapsed * _loc1_; + if(alpha < 0.2) + { + immovable = true; + } + } + else + { + alpha += FlxG.elapsed * _loc1_; + if(alpha >= 0.6) + { + immovable = false; + } + } + if(Data.state.player.y < y + height + 40 - this._padding && Boolean(Data.state.player.wasTouching & FlxObject.DOWN)) + { + solid = false; + } + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/BossButton.as b/research/inner_decompiled/scripts/com/arc/dh/state/BossButton.as new file mode 100644 index 0000000..78d2e85 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/BossButton.as @@ -0,0 +1,82 @@ +package com.arc.dh.state +{ + import com.arc.dh.util.Data; + import com.arc.dh.util.Fonts; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + + public class BossButton extends ArcGroup + { + + private static const buttonSprite:Class = BossButton_buttonSprite; + + private static const lockSprite:Class = BossButton_lockSprite; + + private var _boss:int; + + private var _button:ArcButton; + + private var _text:FlxBitmapText; + + private var _lock:ArcSprite; + + private var _screen:BossScreen; + + public function BossButton(param1:Number, param2:Number, param3:int) + { + var X:Number = param1; + var Y:Number = param2; + var H:int = param3; + super(); + this._boss = H + 1; + this._button = new ArcButton(X,Y,42,16,buttonSprite).selectable(false).callback(function():void + { + if(!FlxG.keys.SHIFT || Data.boss[0] != 0) + { + SoundSystem.fadeOutMusic(); + FlxG.fade(4278190080,0.25,function():void + { + FlxG.mouse.hide(); + FlxG.switchState(new BossMode(FlxG.keys.SHIFT,_boss,true)); + }); + } + }); + this.add(this._button); + this._text = new FlxBitmapText(X,Y + 4,Fonts.font(Fonts.OUTLINE_BLACK_S),"CHAPT " + this._boss,"right",37); + this.add(this._text); + } + + public function setScreen(param1:BossScreen) : void + { + this._screen = param1; + } + + override public function update() : void + { + if(this._button.hover() && this._lock != null) + { + if(this._screen.tooltip == null || this._screen.tooltip.source != this) + { + this._screen.tooltip = new BossModeTooltip(this._button.x + 21,this._button.y,this._boss); + this._screen.tooltip.source = this; + } + this._screen.hovering = true; + } + super.update(); + } + + override public function draw() : void + { + super.draw(); + if(this._lock != null) + { + this._lock.draw(); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/BossButton_buttonSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/BossButton_buttonSprite.as new file mode 100644 index 0000000..367a0ea --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/BossButton_buttonSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/124.png")] + public class BossButton_buttonSprite extends BitmapAsset + { + + public function BossButton_buttonSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/BossButton_lockSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/BossButton_lockSprite.as new file mode 100644 index 0000000..a4c0ff0 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/BossButton_lockSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/270.png")] + public class BossButton_lockSprite extends BitmapAsset + { + + public function BossButton_lockSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/BossMode.as b/research/inner_decompiled/scripts/com/arc/dh/state/BossMode.as new file mode 100644 index 0000000..b201e95 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/BossMode.as @@ -0,0 +1,321 @@ +package com.arc.dh.state +{ + import Playtomic.Log; + import com.arc.dh.entities.Player; + import com.arc.dh.menu.GameOver; + import com.arc.dh.objects.*; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.DataSerializer; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcSprite; + import flash.display.BitmapData; + import flash.geom.Point; + import flash.geom.Rectangle; + import org.flixel.FlxG; + import org.flixel.FlxObject; + import org.flixel.FlxPoint; + import org.flixel.FlxTilemap; + import org.flixel.system.FlxTile; + + public class BossMode extends PlayMode + { + + private static const ESCAPE_HEIGHT:int = 2000; + + private static const ESCAPE_WIDTH:int = 30; + + private static const BOTTOM_PADDING:int = 1; + + private static const PLATFORM_SIZE:int = 3; + + private static const LAVA_TELEPORT_DISTANCE:int = 220; + + private var sourcePixels:BitmapData; + + private var blankOverlay:BitmapData; + + private var _gameOver:GameOver; + + private var _heroic:Boolean = false; + + private var _stage:int = 1; + + private var _practice:Boolean = false; + + public function BossMode(param1:Boolean, param2:int = 1, param3:Boolean = false) + { + super(); + mode = BOSS_MODE; + this._stage = param2; + _ch = param2; + this._heroic = param1; + this._practice = param3; + this.sourcePixels = new BitmapData(30,20,false); + this.blankOverlay = new BitmapData(30,20,false); + } + + public function isHeroic() : Boolean + { + return this._heroic; + } + + public function isPractice() : Boolean + { + return this._practice; + } + + override public function create() : void + { + super.create(); + Log.CustomMetric("BossStart","Modes"); + FlxG.camera.follow(null); + SoundSystem.music(Sound.BOSS_MUSIC); + } + + override protected function getStartX() : int + { + switch(this._stage) + { + case 1: + return 64; + case 2: + return 300; + case 3: + return 210; + case 4: + return 64; + case 5: + return 48; + case 6: + return 64; + case 7: + return 300; + default: + return 64; + } + } + + override protected function getStartY() : int + { + if(this._stage == 5) + { + return 96; + } + return 60; + } + + override public function update() : void + { + if(_complete) + { + this._gameOver.update(); + return; + } + super.update(); + if(inMenu) + { + return; + } + } + + override protected function createLevel() : void + { + tilemap = this.buildLevel(); + tilemap.follow(); + } + + override public function die() : void + { + _dieTimer = 1; + ++Data.deaths; + DataSerializer.save(); + } + + override public function reset() : void + { + _complete = true; + inMenu = false; + SoundSystem.play(Sound.WIN); + this._gameOver = new GameOver(null,null,null).setCallback(function():void + { + FlxG.switchState(new BossMode(_heroic,_practice ? _stage : 1,_practice)); + },function():void + { + FlxG.switchState(new MainMenu(2)); + }); + } + + override public function complete() : void + { + var newTime:Number = NaN; + var index:int = 0; + _complete = true; + inMenu = false; + if(!this._practice && _ch < 7) + { + FlxG.switchState(new BossMode(this._heroic,this._stage + 1)); + DataSerializer.save(); + return; + } + if(!this._practice && _ch == 7) + { + newTime = Math.ceil(Data.ctime) * 1000; + index = this.isHeroic() ? 1 : 0; + if(newTime < Data.boss[1 + 2 * index] || Data.boss[1 + 2 * index] == 0) + { + Data.boss[1 + 2 * index] = newTime; + } + ++Data.boss[2 * index]; + } + DataSerializer.save(); + Data.kong(); + Newgrounds.medals(); + SoundSystem.play(Sound.WIN); + this._gameOver = new GameOver(null,null,duration).setCallback(function():void + { + if(_practice) + { + FlxG.switchState(new BossMode(_heroic,_stage,_practice)); + } + else + { + FlxG.switchState(new BossMode(_heroic,1,_practice)); + } + },function():void + { + FlxG.switchState(new MainMenu(2)); + }); + } + + override public function restart() : void + { + var _loc2_:StoryDialog = null; + var _loc1_:Array = checkpoints[checkpoints.length - 1]; + player.reset(_loc1_[0] * Config.BLOCK_SIZE + 4,_loc1_[1] * Config.BLOCK_SIZE + 12); + FlxG.camera.focusOn(new FlxPoint(player.x,player.y)); + FlxG.camera.follow(player); + boss = 0; + spawner = new Object(); + pixels = mpixels.clone(); + for each(_loc2_ in messages) + { + _loc2_.load(); + } + bullets.clear(); + enemies.clear(); + penemies.clear(); + diamonds.clear(); + powerups.clear(); + damagetexts.clear(); + healthbars.clear(); + objects.clear(); + cobjects.clear(); + spawnTop = this.calcTop(Config.SPAWN_PADDING); + spawnBottom = this.calcBottom(Config.SPAWN_PADDING); + despawnTop = player.y / Config.BLOCK_SIZE; + despawnBottom = player.y / Config.BLOCK_SIZE + 1; + } + + private function createSourcePixels() : void + { + var _loc1_:BitmapData = new ArcSprite(0,0,StoryMode["CH" + this._stage]).pixels; + var _loc2_:Rectangle = new Rectangle(0,0,30,20); + this.sourcePixels.copyPixels(_loc1_,_loc2_,new Point(0,0)); + } + + private function buildLevel() : FlxTilemap + { + var tileArray:Array; + var tileCSV:String; + var waterFunction:Function; + var map:FlxTilemap = null; + this.createSourcePixels(); + tileArray = this.imageToTileArray(this.sourcePixels,this.blankOverlay); + tileCSV = FlxTilemap.arrayToCSV(tileArray,Config.BLOCK_WIDTH); + map = new FlxTilemap(); + map.loadMap(tileCSV,PlayMode["T" + _ch],Config.BLOCK_SIZE,Config.BLOCK_SIZE,0,0,1,80); + map.setTileProperties(52,FlxObject.ANY,function(param1:FlxTile, param2:FlxObject):void + { + if(param2 is Bullet) + { + ArcParticleSystem.emit(Data.state.particles,"wooden_crate",param1.x,param1.y,10,1,5,400,-100,100,-100,-40,param1.width,param1.height); + map.setTileByIndex(param1.mapIndex,0,true); + } + }); + map.setTileProperties(53,FlxObject.ANY,function(param1:FlxTile, param2:FlxObject):void + { + if(param2 is Missile) + { + ArcParticleSystem.emit(Data.state.particles,"steel_crate",param1.x,param1.y,10,1,5,800,-100,100,-200,-80,param1.width,param1.height); + map.setTileByIndex(param1.mapIndex,0,true); + } + }); + waterFunction = function(param1:FlxTile, param2:FlxObject):void + { + var _loc3_:Player = param2 as Player; + if(_loc3_ == null) + { + return; + } + _loc3_.inWater(); + }; + map.setTileProperties(12,FlxObject.NONE,waterFunction,Player); + map.setTileProperties(56,FlxObject.ANY); + return map; + } + + private function imageToTileArray(param1:BitmapData, param2:BitmapData) : Array + { + var _loc5_:int = 0; + var _loc6_:uint = 0; + var _loc7_:int = 0; + this.pixels = param1; + this.overpixels = param2; + var _loc3_:Array = new Array(); + mpixels = param1.clone(); + var _loc4_:int = 0; + while(_loc4_ < param1.height) + { + _loc5_ = 0; + while(_loc5_ < param1.width) + { + _loc6_ = getLayerTile(_loc5_,_loc4_,true); + _loc7_ = colorToTileID(_loc6_,_loc5_,_loc4_); + _loc3_.push(_loc7_); + _loc5_++; + } + _loc4_++; + } + return _loc3_; + } + + override public function draw() : void + { + super.draw(); + if(_complete && this._gameOver != null) + { + this._gameOver.draw(); + } + } + + override protected function calcTop(param1:int) : int + { + return 0; + } + + override protected function calcBottom(param1:int) : int + { + return pixels.height; + } + + override public function setBoss(param1:int) : void + { + boss = 2; + bossHeight = param1; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/BossModeTooltip.as b/research/inner_decompiled/scripts/com/arc/dh/state/BossModeTooltip.as new file mode 100644 index 0000000..13977a5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/BossModeTooltip.as @@ -0,0 +1,78 @@ +package com.arc.dh.state +{ + import com.arc.dh.util.Data; + import com.arc.dh.util.Fonts; + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class BossModeTooltip extends Tooltip + { + + private static const spriteTooltipArrow:Class = BossModeTooltip_spriteTooltipArrow; + + private static const TOOLTIP_WIDTH:int = 120; + + private static const TOOLTIP_TEXT_WIDTH:int = 112; + + public var bsource:ArcButton = null; + + private var _contents:ArcGroup = new ArcGroup(); + + public function BossModeTooltip(param1:Number, param2:Number, param3:int) + { + var _loc6_:FlxBitmapText = null; + var _loc4_:int = param1 - TOOLTIP_WIDTH / 2; + if(_loc4_ < 10) + { + _loc4_ = 10; + } + else if(_loc4_ + TOOLTIP_WIDTH > FlxG.width - 10) + { + _loc4_ = FlxG.width - TOOLTIP_WIDTH - 10; + } + super(_loc4_,param2); + var _loc5_:int = 5; + if(param3 == 1 && Data.boss[0] == 0) + { + _loc6_ = new FlxBitmapText(4,_loc5_,Fonts.font(Fonts.OUTLINE_GRADIENT),"COMPLETE NORMAL BOSS RUSH TO UNLOCK HEROIC BOSS RUSH","center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc6_); + _loc5_ += _loc6_.height + 1; + } + else + { + _loc6_ = new FlxBitmapText(4,_loc5_,Fonts.font(Fonts.OUTLINE_GRADIENT),"BOSS RUSH: " + (param3 == 0 ? "NORMAL" : "HEROIC"),"center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc6_); + _loc5_ += _loc6_.height + 1; + _loc6_ = new FlxBitmapText(4,_loc5_,Fonts.font(Fonts.OUTLINE_BLACK),"BEST TIME: " + Data.duration(0,Data.boss[param3 == 1 ? 3 : 1]),"center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc6_); + _loc5_ += _loc6_.height + 1; + _loc6_ = new FlxBitmapText(4,_loc5_,Fonts.font(Fonts.OUTLINE_GRADIENT),"TIMES COMPLETED: " + Data.boss[param3 == 1 ? 2 : 0],"center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc6_); + _loc5_ += _loc6_.height + 1; + if(param3 == 1) + { + _loc5_ += 6; + _loc6_ = new FlxBitmapText(4,_loc5_,Fonts.font(Fonts.OUTLINE_GRADIENT),"WARNING: VERY DIFFICULT","center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc6_); + _loc5_ += _loc6_.height + 1; + } + } + _loc5_ += 1; + var _loc7_:int = _loc5_ + 2; + var _loc8_:int = param1 - _loc4_ - 8; + var _loc9_:ArcSprite = new ArcSprite(_loc8_,_loc7_ - 2); + _loc9_.loadGraphic(spriteTooltipArrow,false,true,17,10); + this._contents.add(_loc9_); + createBackground(TOOLTIP_WIDTH,_loc7_); + this.add(this._contents); + this._contents.setAll("scrollFactor",new FlxPoint(0,0)); + shift(this._contents,0,-_loc7_ - 5); + shift(_background,0,-_loc7_ - 5); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/BossModeTooltip_spriteTooltipArrow.as b/research/inner_decompiled/scripts/com/arc/dh/state/BossModeTooltip_spriteTooltipArrow.as new file mode 100644 index 0000000..c6f7ac3 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/BossModeTooltip_spriteTooltipArrow.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/68.png")] + public class BossModeTooltip_spriteTooltipArrow extends BitmapAsset + { + + public function BossModeTooltip_spriteTooltipArrow() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/BossScreen.as b/research/inner_decompiled/scripts/com/arc/dh/state/BossScreen.as new file mode 100644 index 0000000..313c04f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/BossScreen.as @@ -0,0 +1,123 @@ +package com.arc.dh.state +{ + import com.arc.dh.util.Data; + import com.arc.dh.util.Fonts; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcButtonGroup; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + + public class BossScreen extends MenuScreen + { + + private static const buttonBackSprite:Class = BossScreen_buttonBackSprite; + + private static const buttonNormalSprite:Class = BossScreen_buttonNormalSprite; + + private static const buttonHeroicSprite:Class = BossScreen_buttonHeroicSprite; + + private static const buttonHeroicLockedSprite:Class = BossScreen_buttonHeroicLockedSprite; + + private var _buttonBack:ArcButton; + + private var _buttonNormal:ArcButton; + + private var _buttonHeroic:ArcButton; + + public var tooltip:BossModeTooltip; + + public var hovering:Boolean = false; + + public function BossScreen(param1:MainMenu) + { + var abg:ArcButtonGroup; + var i:int; + var heroicUnlocked:Boolean = false; + var bb:BossButton = null; + var M:MainMenu = param1; + super(M); + this.add(new InstructionWindow(0,100,FlxG.width,70)); + this.add(new FlxBitmapText(10,104,Fonts.font(Fonts.OUTLINE_GRADIENT),"FACE OFF AGAINST ONE BOSS AFTER ANOTHER IN AN ATTEMPT TO TAKE DOWN THE PROFESSOR\'S MOST POWERFUL CONSTRUCTS. IF YOU MANAGE TO DEFEAT THEM ALL, YOU WILL EARN HEROIC BOSS RUSH, A CHANCE TO TAKE ON A MUCH STRONGER AND MORE ADVANCED VERSION OF EACH BOSS.","center",FlxG.width - 20)); + this._buttonNormal = new ArcButton(85,141,87,26,buttonNormalSprite).callback(function():void + { + SoundSystem.fadeOutMusic(); + FlxG.fade(4278190080,0.25,function():void + { + FlxG.mouse.hide(); + FlxG.switchState(new BossMode(false)); + }); + }).selectable(false); + this.add(this._buttonNormal); + heroicUnlocked = Data.boss[0] > 0; + this._buttonHeroic = new ArcButton(185,141,87,26,heroicUnlocked ? buttonHeroicSprite : buttonHeroicLockedSprite).callback(function():void + { + SoundSystem.fadeOutMusic(); + if(heroicUnlocked) + { + FlxG.fade(4278190080,0.25,function():void + { + FlxG.mouse.hide(); + FlxG.switchState(new BossMode(true)); + }); + } + }).selectable(false); + this.add(this._buttonHeroic); + this._buttonBack = new ArcButton(135,213,87,26,buttonBackSprite).callback(function():void + { + menu.switchScreen(menu.mainScreen); + }).selectable(false); + this.add(this._buttonBack); + this.add(new InstructionWindow(0,180,FlxG.width,30)); + this.add(new FlxBitmapText(9,183,Fonts.font(Fonts.OUTLINE_GRADIENT_S),"PRACTICE SINGLE BOSS:","left",150)); + this.add(new FlxBitmapText(9,183,Fonts.font(Fonts.OUTLINE_BLACK_S),"SHIFT CLICK FOR HEROIC ONCE UNLOCKED","right",FlxG.width - 20)); + abg = new ArcButtonGroup(); + i = 0; + while(i < 7) + { + bb = new BossButton(8 + i * 50,191,i); + bb.setScreen(this); + this.add(bb); + i++; + } + } + + override public function update() : void + { + var _loc2_:ArcButton = null; + super.update(); + var _loc1_:Array = [this._buttonNormal,this._buttonHeroic]; + for each(_loc2_ in _loc1_) + { + if(_loc2_.hover()) + { + if(this.tooltip == null || this.tooltip.bsource != _loc2_) + { + this.tooltip = new BossModeTooltip(_loc2_.x + 43,_loc2_.y,_loc2_ == this._buttonNormal ? 0 : 1); + this.tooltip.bsource = _loc2_; + } + this.hovering = true; + } + } + if(FlxG.keys.justPressed("ESCAPE")) + { + menu.switchScreen(menu.mainScreen); + } + if(!this.hovering && this.tooltip != null) + { + this.tooltip = null; + } + this.hovering = false; + } + + override public function draw() : void + { + super.draw(); + if(this.tooltip != null) + { + this.tooltip.draw(); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/BossScreen_buttonBackSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/BossScreen_buttonBackSprite.as new file mode 100644 index 0000000..ce2e6df --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/BossScreen_buttonBackSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/56.png")] + public class BossScreen_buttonBackSprite extends BitmapAsset + { + + public function BossScreen_buttonBackSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/BossScreen_buttonHeroicLockedSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/BossScreen_buttonHeroicLockedSprite.as new file mode 100644 index 0000000..30fffd8 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/BossScreen_buttonHeroicLockedSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/288_com.arc.dh.state.BossScreen_buttonHeroicLockedSprite.png")] + public class BossScreen_buttonHeroicLockedSprite extends BitmapAsset + { + + public function BossScreen_buttonHeroicLockedSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/BossScreen_buttonHeroicSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/BossScreen_buttonHeroicSprite.as new file mode 100644 index 0000000..9f83842 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/BossScreen_buttonHeroicSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/284_com.arc.dh.state.BossScreen_buttonHeroicSprite.png")] + public class BossScreen_buttonHeroicSprite extends BitmapAsset + { + + public function BossScreen_buttonHeroicSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/BossScreen_buttonNormalSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/BossScreen_buttonNormalSprite.as new file mode 100644 index 0000000..b5fe4c4 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/BossScreen_buttonNormalSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/290_com.arc.dh.state.BossScreen_buttonNormalSprite.png")] + public class BossScreen_buttonNormalSprite extends BitmapAsset + { + + public function BossScreen_buttonNormalSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/Chapter.as b/research/inner_decompiled/scripts/com/arc/dh/state/Chapter.as new file mode 100644 index 0000000..20a5ec3 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/Chapter.as @@ -0,0 +1,104 @@ +package com.arc.dh.state +{ + import com.arc.dh.util.Data; + import com.arc.dh.util.Fonts; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + + public class Chapter extends ArcGroup + { + + private static const sprite:Class = Chapter_sprite; + + public static const badgesSprite:Class = Chapter_badgesSprite; + + private static const FRAMES_PER_CHAPTER:int = 4; + + private var _chapter:int; + + private var _locked:Boolean; + + private var _text:FlxBitmapText; + + private var _image:ArcSprite; + + private var _bar:ArcSprite; + + private var _badge:ArcSprite; + + public function Chapter(param1:int) + { + super(9 + param1 * 50,150); + this._chapter = param1 + 1; + this._locked = this._chapter > 1 && Data.chapters[param1 - 1][0] == 0; + this._image = new ArcSprite(0,0); + this._image.loadGraphic(sprite,true,false,39,39); + this._image.addAnimation("idle",[FRAMES_PER_CHAPTER * param1]); + this._image.addAnimation("hover",[FRAMES_PER_CHAPTER * param1 + 1]); + this._image.addAnimation("locked",[FRAMES_PER_CHAPTER * param1 + 2]); + this._image.addAnimation("locked_hover",[FRAMES_PER_CHAPTER * param1 + 3]); + this._image.play("idle"); + this.add(this._image); + this._text = new FlxBitmapText(-4,-5,Fonts.font(Fonts.OUTLINE_GRADIENT_S),"CHAPTER " + (param1 + 1),"center",49,true); + this.add(this._text); + this._bar = new ArcSprite(1,43); + this._bar.makeGraphic(37,4,2566914048); + this.add(this._bar); + this._badge = new ArcSprite(11,40); + this._badge.loadGraphic(badgesSprite,true,false,16,9); + this._badge.addAnimation("badge",[Data.chapters[param1][1] == 0 ? 4 : Data.chapters[param1][1]]); + this._badge.play("badge"); + this.add(this._badge); + this.update(); + } + + public function hover() : Boolean + { + return this._image.hover(); + } + + public function getX() : int + { + return this._image.x + this._image.width / 2; + } + + public function getY() : int + { + return this._image.y - 1; + } + + override public function update() : void + { + if(this._image.hover()) + { + if(this._image.animation != "locked_hover" && this._image.animation != "hover") + { + SoundSystem.play(Sound.MENU_SELECT); + } + this._image.play(this._locked ? "locked_hover" : "hover"); + if(FlxG.mouse.justPressed()) + { + if(!this._locked) + { + SoundSystem.fadeOutMusic(); + FlxG.fade(4278190080,0.25,function():void + { + FlxG.mouse.hide(); + FlxG.switchState(new StoryMode(_chapter)); + }); + } + } + } + else + { + this._image.play(this._locked ? "locked" : "idle"); + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/Chapter_badgesSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/Chapter_badgesSprite.as new file mode 100644 index 0000000..379c890 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/Chapter_badgesSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/179_com.arc.dh.state.Chapter_badgesSprite.png")] + public class Chapter_badgesSprite extends BitmapAsset + { + + public function Chapter_badgesSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/Chapter_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/Chapter_sprite.as new file mode 100644 index 0000000..61c139d --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/Chapter_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/300_com.arc.dh.state.Chapter_sprite.png")] + public class Chapter_sprite extends BitmapAsset + { + + public function Chapter_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/CreditsScreen.as b/research/inner_decompiled/scripts/com/arc/dh/state/CreditsScreen.as new file mode 100644 index 0000000..9caf6c5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/CreditsScreen.as @@ -0,0 +1,98 @@ +package com.arc.dh.state +{ + import com.arc.dh.util.Config; + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcSprite; + import flash.events.MouseEvent; + import org.flixel.FlxG; + import org.flixel.FlxU; + + public class CreditsScreen extends MenuScreen + { + + private static const sprite:Class = CreditsScreen_sprite; + + private static const buttonHomepageSprite:Class = CreditsScreen_buttonHomepageSprite; + + private var _credits:ArcSprite; + + private var _buttonBack:ArcButton; + + private var _buttonPegas:ArcButton; + + private var _homepageButton:ArcButton; + + public function CreditsScreen(param1:MainMenu) + { + var M:MainMenu = param1; + super(M); + this._buttonBack = new ArcButton(265,210,87,26,StoryScreen.buttonBackSprite).callback(function():void + { + menu.switchScreen(menu.mainScreen); + }).selectable(false); + this.add(this._buttonBack); + this._homepageButton = new ArcButton(2,91,40,28,buttonHomepageSprite).callback(function():void + { + FlxU.openURL("http://iarke.us"); + }).selectable(false); + this.add(this._homepageButton); + if(Config.RELEASE == Config.PEGAS) + { + this._buttonPegas = new ArcButton(245,90,106,46,MainScreen.buttonPegas).callback(function():void + { + }).selectable(false); + this.add(this._buttonPegas); + } + else if(Config.RELEASE == Config.ARMORGAMES) + { + this._buttonPegas = new ArcButton(215,90,133,39,MainScreen.buttonAG).callback(function():void + { + FlxU.openURL("http://armorgames.com"); + }).selectable(false); + this.add(this._buttonPegas); + } + this._credits = new ArcSprite(0,0,sprite); + this.add(this._credits); + } + + public function bindPegas() : void + { + if(Config.RELEASE != Config.PEGAS) + { + return; + } + FlxG.stage.addEventListener(MouseEvent.CLICK,this.pegasCredits); + } + + public function unbindPegas() : void + { + if(Config.RELEASE != Config.PEGAS) + { + return; + } + FlxG.stage.removeEventListener(MouseEvent.CLICK,this.pegasCredits); + } + + private function pegasCredits(param1:*) : void + { + if(Config.RELEASE != Config.PEGAS) + { + return; + } + if(this._buttonPegas.hover()) + { + FlxU.openURL("http://www.pegasgames.com/"); + } + } + + override public function update() : void + { + if(FlxG.keys.justPressed("ESCAPE")) + { + menu.switchScreen(menu.mainScreen); + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/CreditsScreen_buttonHomepageSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/CreditsScreen_buttonHomepageSprite.as new file mode 100644 index 0000000..ba16676 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/CreditsScreen_buttonHomepageSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/186_com.arc.dh.state.CreditsScreen_buttonHomepageSprite.png")] + public class CreditsScreen_buttonHomepageSprite extends BitmapAsset + { + + public function CreditsScreen_buttonHomepageSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/CreditsScreen_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/CreditsScreen_sprite.as new file mode 100644 index 0000000..31f94bf --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/CreditsScreen_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/87_com.arc.dh.state.CreditsScreen_sprite.png")] + public class CreditsScreen_sprite extends BitmapAsset + { + + public function CreditsScreen_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/EscapeButton.as b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeButton.as new file mode 100644 index 0000000..588a2a6 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeButton.as @@ -0,0 +1,112 @@ +package com.arc.dh.state +{ + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Data; + import com.arc.dh.util.DataSerializer; + import com.arc.dh.util.Fonts; + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcButtonGroup; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + + public class EscapeButton extends ArcGroup + { + + private static const buttonSprite:Class = EscapeButton_buttonSprite; + + public static const lockSprite:Class = EscapeButton_lockSprite; + + private var _height:int; + + private var _button:ArcButton; + + private var _text:FlxBitmapText; + + private var _lock:ArcSprite; + + private var _screen:EscapeScreen; + + public function EscapeButton(param1:Number, param2:Number, param3:int, param4:ArcButtonGroup) + { + var index:int = 0; + var cost:int = 0; + var X:Number = param1; + var Y:Number = param2; + var H:int = param3; + var G:ArcButtonGroup = param4; + super(); + this._height = H; + this._button = new ArcButton(X,Y,42,16,buttonSprite); + this.add(this._button); + G.addButton(this._button); + this._text = new FlxBitmapText(X,Y + 4,Fonts.font(Fonts.OUTLINE_BLACK_S),H + "M","right",37); + this.add(this._text); + index = H / 100; + cost = H * 5; + if(Data.escape[index] == 0) + { + this._lock = new ArcSprite(X + 4,Y + 3,lockSprite); + this._button.selectable(false).callback(function():void + { + if(Data.diamonds >= cost && Data.escape[index - 1] == 1) + { + Data.escape[index] = 1; + _lock = null; + _screen.tooltip = null; + _button.callback(null); + _button.selectable(true); + _button.select(); + Data.diamonds -= cost; + AchievementSystem.checkpoints(); + DataSerializer.save(); + } + }); + } + else + { + this._button.selectable(true); + this._button.select(); + } + } + + public function setScreen(param1:EscapeScreen) : void + { + this._screen = param1; + } + + override public function update() : void + { + if(this._button.hover() && this._lock != null) + { + if(this._screen.tooltip == null || this._screen.tooltip.source != this) + { + this._screen.tooltip = new EscapeTooltip(this._button.x + 21,this._button.y,this._height); + this._screen.tooltip.source = this; + } + this._screen.hovering = true; + } + super.update(); + } + + override public function draw() : void + { + super.draw(); + if(this._lock != null) + { + this._lock.draw(); + } + } + + public function get selected() : Boolean + { + return this._button.selected; + } + + public function get start() : int + { + return this._height; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/EscapeButton_buttonSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeButton_buttonSprite.as new file mode 100644 index 0000000..878252b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeButton_buttonSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/124.png")] + public class EscapeButton_buttonSprite extends BitmapAsset + { + + public function EscapeButton_buttonSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/EscapeButton_lockSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeButton_lockSprite.as new file mode 100644 index 0000000..d943916 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeButton_lockSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/270.png")] + public class EscapeButton_lockSprite extends BitmapAsset + { + + public function EscapeButton_lockSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/EscapeMode.as b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeMode.as new file mode 100644 index 0000000..73ee2c9 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeMode.as @@ -0,0 +1,435 @@ +package com.arc.dh.state +{ + import Playtomic.Log; + import com.arc.dh.entities.Player; + import com.arc.dh.menu.GameOver; + import com.arc.dh.objects.*; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.DataSerializer; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcSprite; + import com.arc.flixel.ArcU; + import flash.display.BitmapData; + import flash.geom.Point; + import flash.geom.Rectangle; + import org.flixel.FlxG; + import org.flixel.FlxObject; + import org.flixel.FlxPoint; + import org.flixel.FlxTilemap; + import org.flixel.system.FlxTile; + + public class EscapeMode extends PlayMode + { + + protected static const ESCAPE_SPRITE:Class = EscapeMode_ESCAPE_SPRITE; + + protected static const ESCAPE_OVERLAY_SPRITE:Class = EscapeMode_ESCAPE_OVERLAY_SPRITE; + + protected static const LAVA_SPRITE:Class = EscapeMode_LAVA_SPRITE; + + private static const ESCAPE_HEIGHT:int = 2000; + + private static const ESCAPE_WIDTH:int = 30; + + private static const BOTTOM_PADDING:int = 1; + + private static const PLATFORM_SIZE:int = 3; + + private static const LAVA_TELEPORT_DISTANCE:int = 220; + + private var sourcePixels:BitmapData; + + private var sourceOverlayPixels:BitmapData; + + private var chunks:Array; + + private var lavaStarted:Boolean; + + private var lava:ArcSprite; + + private var _gameOver:GameOver; + + public function EscapeMode(param1:int) + { + super(); + mode = ESCAPE_MODE; + this.sourcePixels = new ArcSprite(0,0,ESCAPE_SPRITE).pixels; + this.sourceOverlayPixels = new ArcSprite(0,0,ESCAPE_OVERLAY_SPRITE).pixels; + startHeight = param1; + _ch = ArcU.rand(1,7); + } + + override public function create() : void + { + super.create(); + Log.CustomMetric("EndlessStart","Modes"); + spawnChance = 50; + this.lava = new ArcSprite(0,80,LAVA_SPRITE); + this.lava.y = player.y + 24; + this.lava.velocity.y = -5; + lavagroup.add(this.lava); + StoryMode.storyMusic(_ch); + } + + override public function update() : void + { + var _loc2_:Boolean = false; + if(_complete) + { + this._gameOver.update(); + showAchievement(); + return; + } + super.update(); + if(inMenu) + { + return; + } + var _loc1_:int = caveHeight; + if(_loc1_ >= 1) + { + if(_loc1_ < 1000) + { + spawnChance = 50 + 50 * (_loc1_ / 1000); + } + else + { + spawnChance = 100; + } + } + if(FlxG.keys.justPressed("R")) + { + FlxG.switchState(new EscapeMode(0)); + } + if(this.lavaStarted) + { + if(_loc1_ < 50) + { + this.lava.velocity.y = -5; + } + else + { + this.lava.velocity.y = (_loc1_ - 50) / -30 - 5; + } + if(this.lava.velocity.y < -60) + { + this.lava.velocity.y = -60; + } + } + else + { + this.lava.velocity.y = -5; + if(player.y < tilemap.height - 80 && Boolean(player.touching & FlxObject.DOWN)) + { + this.lavaStarted = true; + } + } + if(this.lava.getScreenXY().y < -20) + { + this.lava.y = FlxG.camera.scroll.y - 20; + } + if(this.lava.y > player.y + LAVA_TELEPORT_DISTANCE) + { + this.lava.y = player.y + LAVA_TELEPORT_DISTANCE; + } + else if(this.lava.y < player.y) + { + if(Data.moltensuit == 0 || !player.lastHitLava) + { + player.invulnerable = 0; + } + _loc2_ = false; + if(!player.shielded) + { + if(Data.moltensuit == 0 || !player.lastHitLava) + { + player.invulnerable = 0; + } + _loc2_ = player.hit(100,false,true,false,true); + } + if(Data.hp <= 0) + { + AchievementSystem.lava(); + } + if(_loc2_) + { + if(Data.moltensuit == 1) + { + player.invulnerable = 1.5; + } + else + { + player.invulnerable = 0; + } + } + player.inWater(); + } + } + + override protected function createLevel() : void + { + this.chunks = this.buildChunks(); + tilemap = this.buildLevel(); + tilemap.follow(); + } + + override public function die() : void + { + _complete = true; + inMenu = false; + SoundSystem.play(Sound.WIN); + this._gameOver = new GameOver(cdiamonds.toString(),caveHeight.toString() + "M",duration).setCallback(function():void + { + FlxG.mouse.hide(); + FlxG.switchState(new EscapeMode(startHeight)); + },function():void + { + FlxG.mouse.hide(); + FlxG.switchState(new MainMenu(1)); + }); + Log.LevelAverageMetric("EndlessHeight",1,caveHeight); + ++Data.deaths; + DataSerializer.save(); + Data.kong(); + Newgrounds.medals(); + } + + override public function reset() : void + { + } + + override public function restart() : void + { + var _loc2_:StoryDialog = null; + var _loc1_:Array = checkpoints[checkpoints.length - 1]; + player.reset(_loc1_[0] * Config.BLOCK_SIZE + 4,_loc1_[1] * Config.BLOCK_SIZE + 12); + FlxG.camera.focusOn(new FlxPoint(player.x,player.y)); + FlxG.camera.follow(player); + Data.hp = Data.hpm; + boss = 0; + spawner = new Object(); + pixels = mpixels.clone(); + for each(_loc2_ in messages) + { + _loc2_.load(); + } + bullets.clear(); + enemies.clear(); + penemies.clear(); + diamonds.clear(); + powerups.clear(); + damagetexts.clear(); + healthbars.clear(); + objects.clear(); + cobjects.clear(); + spawnTop = calcTop(Config.SPAWN_PADDING); + spawnBottom = calcBottom(Config.SPAWN_PADDING); + despawnTop = player.y / Config.BLOCK_SIZE; + despawnBottom = player.y / Config.BLOCK_SIZE + 1; + } + + private function buildLevel() : FlxTilemap + { + var waterFunction:Function; + var map:FlxTilemap = null; + var tileArray:Array = this.createRandomMap(); + var tileCSV:String = FlxTilemap.arrayToCSV(tileArray,Config.BLOCK_WIDTH); + map = new FlxTilemap(); + map.loadMap(tileCSV,PlayMode["T" + _ch],Config.BLOCK_SIZE,Config.BLOCK_SIZE,0,0,1,80); + map.setTileProperties(52,FlxObject.ANY,function(param1:FlxTile, param2:FlxObject):void + { + var _loc3_:int = 0; + if(param2 is Bullet) + { + ArcParticleSystem.emit(Data.state.particles,"wooden_crate",param1.x,param1.y,10,1,5,400,-100,100,-100,-40,param1.width,param1.height); + map.setTileByIndex(param1.mapIndex,0,true); + _loc3_ = ArcU.rand(0,100); + if(_loc3_ >= 80) + { + if(_loc3_ < 99) + { + addDiamonds(param1.x,param1.y,ArcU.rand(1,2 * _ch)); + } + else + { + createHeart(param1.x,param1.y); + } + } + ++Data.boxes; + SoundSystem.play(Sound.BOX,0.4); + AchievementSystem.boxes(); + } + }); + map.setTileProperties(53,FlxObject.ANY,function(param1:FlxTile, param2:FlxObject):void + { + var _loc3_:int = 0; + if(param2 is Missile) + { + ArcParticleSystem.emit(Data.state.particles,"steel_crate",param1.x,param1.y,10,1,5,800,-100,100,-200,-80,param1.width,param1.height); + map.setTileByIndex(param1.mapIndex,0,true); + _loc3_ = ArcU.rand(0,100); + if(_loc3_ >= 50) + { + if(_loc3_ < 99) + { + addDiamonds(param1.x,param1.y,ArcU.rand(1,2 * _ch)); + } + else + { + createHeart(param1.x,param1.y); + } + } + ++Data.boxes; + SoundSystem.play(Sound.STEELBOX); + AchievementSystem.boxes(); + } + }); + waterFunction = function(param1:FlxTile, param2:FlxObject):void + { + var _loc3_:Player = param2 as Player; + if(_loc3_ == null) + { + return; + } + _loc3_.inWater(); + }; + map.setTileProperties(12,FlxObject.NONE,waterFunction,Player); + map.setTileProperties(56,FlxObject.ANY); + return map; + } + + private function imageToTileArray(param1:BitmapData, param2:BitmapData) : Array + { + var _loc5_:int = 0; + var _loc6_:uint = 0; + var _loc7_:int = 0; + this.pixels = param1; + this.overpixels = param2; + var _loc3_:Array = new Array(); + mpixels = param1.clone(); + var _loc4_:int = 0; + while(_loc4_ < param1.height) + { + _loc5_ = 0; + while(_loc5_ < param1.width) + { + _loc6_ = getLayerTile(_loc5_,_loc4_,true); + _loc7_ = colorToTileID(_loc6_,_loc5_,_loc4_); + _loc3_.push(_loc7_); + _loc5_++; + } + _loc4_++; + } + return _loc3_; + } + + private function createRandomMap() : Array + { + var _loc10_:Array = null; + var _loc11_:Array = null; + var _loc12_:int = 0; + var _loc13_:int = 0; + var _loc14_:int = 0; + var _loc15_:int = 0; + var _loc16_:uint = 0; + var _loc1_:int = 0; + var _loc2_:int = 0; + var _loc3_:int = 0; + var _loc4_:int = ESCAPE_HEIGHT; + var _loc5_:int = 0; + var _loc6_:Array = new Array(); + while(_loc5_ < _loc4_) + { + _loc11_ = this.chunks[ArcU.rand(0,this.chunks.length - 1)] as Array; + _loc6_.push(_loc11_); + _loc5_ += _loc11_[1] as int; + } + var _loc7_:int = _loc5_ + BOTTOM_PADDING + PLATFORM_SIZE; + var _loc8_:BitmapData = new BitmapData(ESCAPE_WIDTH,_loc7_,false); + var _loc9_:BitmapData = new BitmapData(ESCAPE_WIDTH,_loc7_,false); + for each(_loc10_ in _loc6_) + { + _loc12_ = _loc10_[0] as int; + _loc13_ = _loc10_[1] as int; + if(ArcU.rand(0,1) == 0) + { + _loc8_.copyPixels(this.sourcePixels,new Rectangle(1,_loc12_,ESCAPE_WIDTH,_loc13_),new Point(0,_loc1_)); + } + else + { + _loc14_ = 0; + while(_loc14_ < _loc13_) + { + _loc15_ = 0; + while(_loc15_ <= ESCAPE_WIDTH) + { + _loc16_ = this.sourcePixels.getPixel(_loc15_,_loc14_ + _loc12_); + if(_loc16_ == 7766374) + { + _loc16_ = 5069370; + } + else if(_loc16_ == 5069370) + { + _loc16_ = 7766374; + } + _loc8_.setPixel(ESCAPE_WIDTH - _loc15_,_loc14_ + _loc1_,_loc16_); + _loc15_++; + } + _loc14_++; + } + } + _loc1_ += _loc13_; + } + _loc2_ = 2; + while(_loc2_ < ESCAPE_WIDTH - 2) + { + _loc3_ = _loc7_ - PLATFORM_SIZE; + while(_loc3_ < _loc7_) + { + _loc8_.setPixel(_loc2_,_loc3_,_loc3_ == _loc7_ - PLATFORM_SIZE ? 5228053 : 10052885); + _loc9_.setPixel(_loc2_,_loc3_,16777215); + _loc3_++; + } + _loc2_++; + } + return this.imageToTileArray(_loc8_,_loc9_); + } + + private function buildChunks() : Array + { + var _loc4_:uint = 0; + var _loc1_:Array = new Array(); + var _loc2_:int = -1; + var _loc3_:int = 0; + while(_loc3_ < this.sourcePixels.height) + { + _loc4_ = this.sourcePixels.getPixel(0,_loc3_); + if(_loc4_ == 16711920) + { + if(_loc2_ != -1) + { + _loc1_.push([_loc2_,_loc3_ - _loc2_]); + } + _loc2_ = _loc3_; + } + _loc3_++; + } + _loc1_.push([_loc2_,_loc3_ - _loc2_]); + return _loc1_; + } + + override public function draw() : void + { + super.draw(); + if(_complete && this._gameOver != null) + { + this._gameOver.draw(); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/EscapeMode_ESCAPE_OVERLAY_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeMode_ESCAPE_OVERLAY_SPRITE.as new file mode 100644 index 0000000..95dde29 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeMode_ESCAPE_OVERLAY_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/54.png")] + public class EscapeMode_ESCAPE_OVERLAY_SPRITE extends BitmapAsset + { + + public function EscapeMode_ESCAPE_OVERLAY_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/EscapeMode_ESCAPE_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeMode_ESCAPE_SPRITE.as new file mode 100644 index 0000000..1315f60 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeMode_ESCAPE_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/88.png")] + public class EscapeMode_ESCAPE_SPRITE extends BitmapAsset + { + + public function EscapeMode_ESCAPE_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/EscapeMode_LAVA_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeMode_LAVA_SPRITE.as new file mode 100644 index 0000000..fec9dbd --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeMode_LAVA_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/171.png")] + public class EscapeMode_LAVA_SPRITE extends BitmapAsset + { + + public function EscapeMode_LAVA_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/EscapeScreen.as b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeScreen.as new file mode 100644 index 0000000..ae16bf5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeScreen.as @@ -0,0 +1,123 @@ +package com.arc.dh.state +{ + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.Fonts; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcButtonGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + + public class EscapeScreen extends MenuScreen + { + + private static const buttonBackSprite:Class = EscapeScreen_buttonBackSprite; + + private static const startBackSprite:Class = EscapeScreen_startBackSprite; + + private static const escapeSprite:Class = EscapeScreen_escapeSprite; + + public static const diamondsSprite:Class = EscapeScreen_diamondsSprite; + + private var _escapeImage:ArcSprite; + + private var _buttonBack:ArcButton; + + private var _buttonStart:ArcButton; + + public var tooltip:EscapeTooltip; + + public var hovering:Boolean = false; + + public var buttons:Array; + + private var _diamondsText:FlxBitmapText; + + public function EscapeScreen(param1:MainMenu) + { + var startHeight:FlxBitmapText; + var abg:ArcButtonGroup; + var i:int; + var _diamonds:ArcSprite; + var maxHeight:FlxBitmapText; + var eb:EscapeButton = null; + var M:MainMenu = param1; + this.buttons = new Array(); + super(M); + this._buttonBack = new ArcButton(185,208,87,26,buttonBackSprite).callback(function():void + { + menu.switchScreen(menu.mainScreen); + }).selectable(false); + this.add(this._buttonBack); + this._buttonStart = new ArcButton(85,208,87,26,startBackSprite).callback(function():void + { + SoundSystem.fadeOutMusic(); + FlxG.fade(4278190080,0.25,function():void + { + var _loc2_:* = undefined; + var _loc1_:* = 0; + for each(_loc2_ in buttons) + { + if(_loc2_.selected) + { + _loc1_ = _loc2_.start; + } + } + FlxG.mouse.hide(); + FlxG.switchState(new EscapeMode(_loc1_)); + }); + }).selectable(false); + this.add(this._buttonStart); + this._escapeImage = new ArcSprite(0,108,escapeSprite); + this.add(this._escapeImage); + this.add(new InstructionWindow(0,170,FlxG.width,30)); + startHeight = new FlxBitmapText(2,177,Fonts.font(Fonts.OUTLINE_BLACK_S),"STARTING HEIGHT:","center",77); + this.add(startHeight); + abg = new ArcButtonGroup(); + i = 0; + while(i < 6) + { + eb = new EscapeButton(85 + i * 46,177,i * 100,abg); + eb.setScreen(this); + this.add(eb); + this.buttons.push(eb); + i++; + } + _diamonds = new ArcSprite(4,Config.HEIGHT - 14); + _diamonds.loadGraphic(diamondsSprite,true,false,44,12); + this.add(_diamonds); + this._diamondsText = new FlxBitmapText(4,Config.HEIGHT - 11,Fonts.font(Fonts.SMALL_WHITE),Data.diamonds > 99999 ? "99999" : Data.diamonds.toString(),"right",40); + this.add(this._diamondsText); + maxHeight = new FlxBitmapText(2,186,Fonts.font(Fonts.OUTLINE_GRADIENT_S),"MAX: " + Data.maxheight + "M","center",77); + this.add(maxHeight); + this.update(); + } + + override public function update() : void + { + super.update(); + if(FlxG.keys.justPressed("ESCAPE")) + { + menu.switchScreen(menu.mainScreen); + } + this._diamondsText.text = Data.diamonds > 99999 ? "99999" : Data.diamonds.toString(); + if(!this.hovering && this.tooltip != null) + { + this.tooltip = null; + } + this.hovering = false; + } + + override public function draw() : void + { + super.draw(); + if(this.tooltip != null) + { + this.tooltip.draw(); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/EscapeScreen_buttonBackSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeScreen_buttonBackSprite.as new file mode 100644 index 0000000..9227406 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeScreen_buttonBackSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/56.png")] + public class EscapeScreen_buttonBackSprite extends BitmapAsset + { + + public function EscapeScreen_buttonBackSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/EscapeScreen_diamondsSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeScreen_diamondsSprite.as new file mode 100644 index 0000000..f08456f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeScreen_diamondsSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/151_com.arc.dh.state.EscapeScreen_diamondsSprite.png")] + public class EscapeScreen_diamondsSprite extends BitmapAsset + { + + public function EscapeScreen_diamondsSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/EscapeScreen_escapeSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeScreen_escapeSprite.as new file mode 100644 index 0000000..b6851fd --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeScreen_escapeSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/164_com.arc.dh.state.EscapeScreen_escapeSprite.png")] + public class EscapeScreen_escapeSprite extends BitmapAsset + { + + public function EscapeScreen_escapeSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/EscapeScreen_startBackSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeScreen_startBackSprite.as new file mode 100644 index 0000000..cbccf0b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeScreen_startBackSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/59_com.arc.dh.state.EscapeScreen_startBackSprite.png")] + public class EscapeScreen_startBackSprite extends BitmapAsset + { + + public function EscapeScreen_startBackSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/EscapeTooltip.as b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeTooltip.as new file mode 100644 index 0000000..0db6a76 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeTooltip.as @@ -0,0 +1,69 @@ +package com.arc.dh.state +{ + import com.arc.dh.util.Data; + import com.arc.dh.util.Fonts; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class EscapeTooltip extends Tooltip + { + + private static const spriteTooltipArrow:Class = EscapeTooltip_spriteTooltipArrow; + + private static const TOOLTIP_WIDTH:int = 120; + + private static const TOOLTIP_TEXT_WIDTH:int = 112; + + private var _contents:ArcGroup = new ArcGroup(); + + public function EscapeTooltip(param1:Number, param2:Number, param3:int) + { + var _loc7_:FlxBitmapText = null; + var _loc4_:int = param1 - TOOLTIP_WIDTH / 2; + if(_loc4_ < 10) + { + _loc4_ = 10; + } + else if(_loc4_ + TOOLTIP_WIDTH > FlxG.width - 10) + { + _loc4_ = FlxG.width - TOOLTIP_WIDTH - 10; + } + var _loc5_:int = param3 / 100; + super(_loc4_,param2); + var _loc6_:int = 5; + _loc7_ = new FlxBitmapText(4,_loc6_,Fonts.font(Fonts.OUTLINE_GRADIENT),param3 + "M CHECKPOINT","center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc7_); + _loc6_ += _loc7_.height + 1; + _loc7_ = new FlxBitmapText(4,_loc6_,Fonts.font(Fonts.OUTLINE_BLACK),"COST: " + param3 * 5 + " DIAMONDS","center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc7_); + _loc6_ += _loc7_.height + 1; + if(Data.escape[_loc5_ - 1] == 1) + { + _loc7_ = new FlxBitmapText(4,_loc6_,Fonts.font(Fonts.OUTLINE_GRADIENT),"CLICK TO BUY","center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc7_); + _loc6_ += _loc7_.height; + } + else + { + _loc7_ = new FlxBitmapText(4,_loc6_,Fonts.font(Fonts.OUTLINE_GRADIENT),"REQUIRES " + (param3 - 100) + " CHECKPOINT","center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc7_); + _loc6_ += _loc7_.height; + } + _loc6_ += 2; + var _loc8_:int = _loc6_ + 2; + var _loc9_:int = param1 - _loc4_ - 8; + var _loc10_:ArcSprite = new ArcSprite(_loc9_,_loc8_ - 2); + _loc10_.loadGraphic(spriteTooltipArrow,false,true,17,10); + this._contents.add(_loc10_); + createBackground(TOOLTIP_WIDTH,_loc8_); + this.add(this._contents); + this._contents.setAll("scrollFactor",new FlxPoint(0,0)); + shift(this._contents,0,-_loc8_ - 5); + shift(_background,0,-_loc8_ - 5); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/EscapeTooltip_spriteTooltipArrow.as b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeTooltip_spriteTooltipArrow.as new file mode 100644 index 0000000..26f2c85 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/EscapeTooltip_spriteTooltipArrow.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/68.png")] + public class EscapeTooltip_spriteTooltipArrow extends BitmapAsset + { + + public function EscapeTooltip_spriteTooltipArrow() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/FlxKongregate.as b/research/inner_decompiled/scripts/com/arc/dh/state/FlxKongregate.as new file mode 100644 index 0000000..1e3296b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/FlxKongregate.as @@ -0,0 +1,196 @@ +package com.arc.dh.state +{ + import flash.display.DisplayObject; + import flash.display.Loader; + import flash.errors.IOError; + import flash.events.Event; + import flash.events.IOErrorEvent; + import flash.net.URLRequest; + import flash.system.Security; + import org.flixel.*; + + public class FlxKongregate + { + + public static var api:*; + + private static var apiLoader:Loader; + + private static var loadCallback:Function; + + public static var hasLoaded:Boolean = false; + + public static var isLocal:Boolean = false; + + private static var shadowAPI:String = "http://www.kongregate.com/flash/API_AS3_Local.swf"; + + public function FlxKongregate() + { + super(); + } + + public static function init(param1:Function) : void + { + var apiPath:String = null; + var parameters:Object = null; + var callback:Function = param1; + try + { + parameters = FlxG.stage.loaderInfo.parameters; + } + catch(e:Error) + { + throw new Error("FlxKongregate: No access to FlxG.stage - only call this once your game has access to the display list"); + } + if(parameters.kongregate_api_path) + { + Security.allowDomain(parameters.kongregate_api_path); + apiPath = parameters.kongregate_api_path; + } + else + { + Security.allowDomain(shadowAPI); + apiPath = shadowAPI; + isLocal = true; + } + loadCallback = callback; + apiLoader = new Loader(); + apiLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,apiLoadComplete,false,0,true); + apiLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,apiLoadError,false,0,true); + apiLoader.load(new URLRequest(apiPath)); + FlxG.stage.addChild(apiLoader); + } + + public static function disconnect() : void + { + api = null; + hasLoaded = false; + FlxG.stage.removeChild(apiLoader); + } + + private static function apiLoadComplete(param1:Event) : void + { + api = param1.target.content; + hasLoaded = true; + Security.allowDomain(api.loaderInfo.url); + if(loadCallback is Function) + { + loadCallback.call(); + } + } + + private static function apiLoadError(param1:IOError) : void + { + } + + public static function addLoadListener(param1:String, param2:Function) : void + { + api.sharedContent.addLoadListener(param1,param2); + } + + public static function addEventListener(param1:String, param2:Function) : void + { + api.services.addEventListener(param1,param2); + } + + public static function connect() : void + { + if(hasLoaded) + { + api.services.connect(); + } + } + + public static function get isGuest() : Boolean + { + return api.services.isGuest(); + } + + public static function get getUserName() : String + { + return api.services.getUsername(); + } + + public static function get getUserId() : Number + { + try + { + return api.services.getUserId(); + } + catch(e:Error) + { + return 0; + } + } + + public static function get getGameAuthToken() : String + { + return api.services.getGameAuthToken(); + } + + public static function showSignInBox() : void + { + if(api.services.isGuest()) + { + api.services.showSignInBox(); + } + } + + public static function showRegistrationBox() : void + { + if(api.services.isGuest()) + { + api.services.showRegistrationBox(); + } + } + + public static function showShoutBox(param1:String = "") : void + { + if(api.services.isGuest() == false) + { + api.services.showShoutBox(param1); + } + } + + public static function resizeGame(param1:int, param2:int) : void + { + api.services.resizeGame(param1,param2); + } + + public static function submitStats(param1:String, param2:Number) : void + { + api.stats.submit(param1,param2); + } + + public static function purchaseItem(param1:Array, param2:Function) : void + { + api.mtx.purchaseItems(param1,param2); + } + + public static function requestUserItemList(param1:String, param2:Function) : void + { + api.mtx.requestUserItemList(param1,param2); + } + + public static function showKredPurchaseDialog(param1:String) : void + { + api.mtx.showKredPurchaseDialog(param1); + } + + public static function browseSharedContent(param1:String, param2:String = null, param3:String = null) : void + { + api.sharedContent.browse(param1,param2,param3); + } + + public static function saveSharedContent(param1:String, param2:String, param3:Function, param4:DisplayObject = null, param5:String = null) : void + { + api.sharedContent.save(param1,param2,param3,param4,param5); + } + + public static function submitAvatar(param1:DisplayObject, param2:Function) : void + { + api.images.submitAvatar(param1,param2); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/HeartMeter.as b/research/inner_decompiled/scripts/com/arc/dh/state/HeartMeter.as new file mode 100644 index 0000000..628acbc --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/HeartMeter.as @@ -0,0 +1,52 @@ +package com.arc.dh.state +{ + import com.arc.dh.util.Data; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxSprite; + + public class HeartMeter extends ArcSprite + { + + public static const heartFull:Class = HeartMeter_heartFull; + + public static const heartEmpty:Class = HeartMeter_heartEmpty; + + private var empty:FlxSprite; + + private var full:FlxSprite; + + public function HeartMeter(param1:Number, param2:Number) + { + super(param1,param2); + width = 9; + height = 9; + this.empty = new FlxSprite(0,y,heartEmpty); + this.empty.scrollFactor.x = this.empty.scrollFactor.y = 0; + this.full = new FlxSprite(0,y,heartFull); + this.full.scrollFactor.x = this.full.scrollFactor.y = 0; + } + + override public function draw() : void + { + var _loc1_:int = 0; + _loc1_ = 0; + while(_loc1_ < Data.hpm) + { + if(_loc1_ < Data.hp) + { + this.full.x = x + _loc1_ % 10 * width; + this.full.y = y + int(_loc1_ / 10) * height; + this.full.draw(); + } + else + { + this.empty.x = x + _loc1_ % 10 * width; + this.empty.y = y + int(_loc1_ / 10) * height; + this.empty.draw(); + } + _loc1_++; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/HeartMeter_heartEmpty.as b/research/inner_decompiled/scripts/com/arc/dh/state/HeartMeter_heartEmpty.as new file mode 100644 index 0000000..35d8d4b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/HeartMeter_heartEmpty.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/244_com.arc.dh.state.HeartMeter_heartEmpty.png")] + public class HeartMeter_heartEmpty extends BitmapAsset + { + + public function HeartMeter_heartEmpty() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/HeartMeter_heartFull.as b/research/inner_decompiled/scripts/com/arc/dh/state/HeartMeter_heartFull.as new file mode 100644 index 0000000..a005125 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/HeartMeter_heartFull.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/156_com.arc.dh.state.HeartMeter_heartFull.png")] + public class HeartMeter_heartFull extends BitmapAsset + { + + public function HeartMeter_heartFull() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/HelpScreen.as b/research/inner_decompiled/scripts/com/arc/dh/state/HelpScreen.as new file mode 100644 index 0000000..936eaad --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/HelpScreen.as @@ -0,0 +1,39 @@ +package com.arc.dh.state +{ + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxG; + + public class HelpScreen extends MenuScreen + { + + private static const sprite:Class = HelpScreen_sprite; + + private var _help:ArcSprite; + + private var _buttonBack:ArcButton; + + public function HelpScreen(param1:MainMenu) + { + var M:MainMenu = param1; + super(M); + this._buttonBack = new ArcButton(135,210,87,26,StoryScreen.buttonBackSprite).callback(function():void + { + menu.switchScreen(menu.mainScreen); + }).selectable(false); + this.add(this._buttonBack); + this._help = new ArcSprite(0,0,sprite); + this.add(this._help); + } + + override public function update() : void + { + if(FlxG.keys.justPressed("ESCAPE")) + { + menu.switchScreen(menu.mainScreen); + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/HelpScreen_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/HelpScreen_sprite.as new file mode 100644 index 0000000..4df9fe5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/HelpScreen_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/274_com.arc.dh.state.HelpScreen_sprite.png")] + public class HelpScreen_sprite extends BitmapAsset + { + + public function HelpScreen_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/HorizontalMode.as b/research/inner_decompiled/scripts/com/arc/dh/state/HorizontalMode.as new file mode 100644 index 0000000..207e697 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/HorizontalMode.as @@ -0,0 +1,16 @@ +package com.arc.dh.state +{ + import com.arc.dh.objects.Camera; + + public class HorizontalMode extends PlayMode + { + + public var camera:Camera; + + public function HorizontalMode() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/InstructionWindow.as b/research/inner_decompiled/scripts/com/arc/dh/state/InstructionWindow.as new file mode 100644 index 0000000..bcf01d0 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/InstructionWindow.as @@ -0,0 +1,18 @@ +package com.arc.dh.state +{ + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + + public class InstructionWindow extends ArcGroup + { + + public function InstructionWindow(param1:Number, param2:Number, param3:Number, param4:Number) + { + super(param1,param2); + add(new ArcSprite(0,0).makeGraphic(param3,1,3428464384)); + add(new ArcSprite(0,1).makeGraphic(param3,param4 - 2,2583691264)); + add(new ArcSprite(0,param4 - 1).makeGraphic(param3,1,3428464384)); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/Intro.as b/research/inner_decompiled/scripts/com/arc/dh/state/Intro.as new file mode 100644 index 0000000..d04e712 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/Intro.as @@ -0,0 +1,74 @@ +package com.arc.dh.state +{ + import Playtomic.Log; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcSprite; + import flash.ui.Mouse; + import mochi.as3.MochiServices; + import org.flixel.FlxG; + import org.flixel.FlxState; + + public class Intro extends FlxState + { + + private var _logo:ArcSprite; + + private var _fader:Number = 0; + + public function Intro() + { + super(); + } + + public static function kong() : void + { + FlxKongregate.connect(); + } + + override public function create() : void + { + if(Config.externalAPIs()) + { + Log.View(Data.GAMEID,Data.GUID,Data.API_KEY,FlxG.root.loaderInfo.loaderURL); + if(Config.RELEASE == Config.PEGAS) + { + MochiBot.track(FlxG.game,"cc6aac2d"); + MochiServices.connect("ac9b57453916c20f",FlxG.root,this.onConnectError); + } + FlxKongregate.init(Intro.kong); + Newgrounds.connect(); + } + var _loc1_:String = "fc3d1f39c989bd1f"; + } + + public function onConnectError(param1:String) : void + { + } + + override public function update() : void + { + Mouse.hide(); + FlxG.mouse.show(); + if(Config.RELEASE == Config.PEGAS) + { + FlxG.switchState(new Pegas()); + } + else if(Config.RELEASE == Config.ARMORGAMES) + { + FlxG.switchState(new AG()); + } + else if(Config.RELEASE == Config.MAXGAMES) + { + FlxG.switchState(new MaxGames()); + } + else + { + FlxG.switchState(new MainMenu()); + } + this._fader += FlxG.elapsed; + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu.as new file mode 100644 index 0000000..6254f15 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu.as @@ -0,0 +1,307 @@ +package com.arc.dh.state +{ + import com.arc.dh.menu.MenuTooltip; + import com.arc.dh.menu.OptionsMenu; + import com.arc.dh.util.Data; + import com.arc.dh.util.DataSerializer; + import com.arc.dh.util.ParticleSystem; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcSprite; + import com.arc.flixel.ArcU; + import flash.ui.Mouse; + import org.flixel.FlxG; + import org.flixel.FlxState; + + public class MainMenu extends FlxState + { + + private static const titleSprite:Class = MainMenu_titleSprite; + + private static const titleGlowSprite:Class = MainMenu_titleGlowSprite; + + private static const buttonPlay:Class = MainMenu_buttonPlay; + + private static const buttonHelp:Class = MainMenu_buttonHelp; + + private static const soundButton:Class = MainMenu_soundButton; + + protected static const BACKGROUND_SPRITE3:Class = MainMenu_BACKGROUND_SPRITE3; + + protected static const BACKGROUND_SPRITE2:Class = MainMenu_BACKGROUND_SPRITE2; + + protected static const BACKGROUND_SPRITE1:Class = MainMenu_BACKGROUND_SPRITE1; + + protected var bg3:ArcSprite; + + protected var bg2:ArcSprite; + + protected var bg1:ArcSprite; + + protected var title:ArcSprite; + + protected var titleGlow:ArcSprite; + + protected var titleFadeIn:Boolean = false; + + protected var emitters:ArcGroup = new ArcGroup(); + + protected var screen:MenuScreen; + + public var mainScreen:MenuScreen; + + public var storyScreen:MenuScreen; + + public var escapeScreen:MenuScreen; + + public var bossScreen:MenuScreen; + + public var helpScreen:MenuScreen; + + public var creditsScreen:MenuScreen; + + public var minigamesScreen:MenuScreen; + + public var _startScreen:int; + + public var options:OptionsMenu; + + public var inOptions:Boolean = false; + + protected var fader:ArcSprite; + + protected var faderStatus:int = 0; + + public var tooltip:Tooltip; + + public var hovering:Boolean = false; + + public function MainMenu(param1:int = 0) + { + super(); + this._startScreen = param1; + } + + override public function create() : void + { + this.mainScreen = new MainScreen(this); + this.storyScreen = new StoryScreen(this); + this.escapeScreen = new EscapeScreen(this); + this.bossScreen = new BossScreen(this); + this.helpScreen = new HelpScreen(this); + this.creditsScreen = new CreditsScreen(this); + this.minigamesScreen = new MinigameScreen(this); + this.bg3 = new Background(0,0,BACKGROUND_SPRITE3); + this.bg3.scrollFactor.x = this.bg3.scrollFactor.y = 0.4; + this.add(this.bg3); + this.add(this.emitters); + this.bg2 = new Background(0,0,BACKGROUND_SPRITE2); + this.bg2.scrollFactor.x = this.bg2.scrollFactor.y = 0.6; + this.add(this.bg2); + this.bg1 = new Background(0,0,BACKGROUND_SPRITE1); + this.bg1.scrollFactor.x = this.bg1.scrollFactor.y = 0.8; + this.add(this.bg1); + this.titleGlow = new ArcSprite(4,4,titleGlowSprite); + this.titleGlow.scrollFactor.x = this.titleGlow.scrollFactor.y = 0; + this.add(this.titleGlow); + this.title = new ArcSprite(4,4,titleSprite); + this.title.scrollFactor.x = this.title.scrollFactor.y = 0; + this.add(this.title); + ParticleSystem.initialize(); + this.emitters.add(ArcParticleSystem.emitters); + switch(this._startScreen) + { + case 0: + this.switchScreen(this.mainScreen); + break; + case 1: + this.switchScreen(this.escapeScreen); + break; + case 2: + this.switchScreen(this.bossScreen); + break; + case 3: + this.switchScreen(this.storyScreen); + break; + case 4: + this.switchScreen(this.mainScreen); + } + this.options = new OptionsMenu(function():void + { + inOptions = false; + }); + this.fader = new ArcSprite(0,0); + this.fader.makeGraphic(FlxG.width,FlxG.height,4278190080); + this.fader.scrollFactor.x = this.fader.scrollFactor.y = 0; + this.fader.visible = false; + this.add(this.fader); + this.faderStatus = 1; + Mouse.hide(); + FlxG.mouse.show(); + super.create(); + SoundSystem.music(Sound.TITLE_MUSIC,0.5); + Data.kong(); + Newgrounds.medals(); + } + + override public function update() : void + { + var _loc1_:Array = null; + var _loc2_:Array = null; + var _loc3_:int = 0; + var _loc4_:ArcButton = null; + var _loc5_:Array = null; + if(this.faderStatus == 1) + { + this.fader.alpha -= FlxG.elapsed * 3; + if(this.fader.alpha <= 0) + { + this.faderStatus = -1; + } + return; + } + if(ArcU.rand(0,15) == 5) + { + ArcParticleSystem.emit(this.emitters,"diamonds",ArcU.rand(0,360),0,1,1,5,0,0,0,100,300); + } + if(this.titleFadeIn) + { + this.titleGlow.alpha += FlxG.elapsed; + if(this.titleGlow.alpha >= 1) + { + this.titleGlow.alpha = 1; + this.titleFadeIn = false; + } + } + else + { + this.titleGlow.alpha -= FlxG.elapsed; + if(this.titleGlow.alpha <= 0) + { + this.titleGlow.alpha = 0; + this.titleFadeIn = true; + } + } + Data.time += FlxG.elapsed; + this.parallax(); + SoundSystem.update(); + super.update(); + if(this.inOptions) + { + if(FlxG.keys.justPressed("ESCAPE")) + { + FlxG.keys.unJustPressed("ESCAPE"); + this.inOptions = false; + DataSerializer.save(); + } + this.options.update(); + _loc1_ = [this.options.mouse,this.options.kb1,this.options.kb2,this.options.reset]; + _loc2_ = [["Mouse Controls","Use A/D or LEFT/RIGHT to move, W or SPACE or UP to jump, MOUSE to aim, MOUSE BUTTON to shoot."],["Keyboard Controls","Use A/D to move, W or SPACE to jump, ARROWS to aim and shoot."],["Inverse Keyboard","Use LEFT/RIGHT to move, UP or SPACE to jump, A/S/D/W to aim and shoot."],["Reset All Data","This will clear all your saved data and restart you from scratch. Hold shift and click this button to clear data."]]; + _loc3_ = 0; + while(_loc3_ < _loc1_.length) + { + _loc4_ = _loc1_[_loc3_] as ArcButton; + _loc5_ = _loc2_[_loc3_] as Array; + if(_loc4_.hover()) + { + if(this.tooltip == null || this.tooltip.source != _loc4_) + { + this.tooltip = new MenuTooltip(_loc4_.x + _loc4_.width / 2,_loc4_.y,_loc5_[0],_loc5_[1]); + this.tooltip.source = _loc4_; + } + this.hovering = true; + } + _loc3_++; + } + if(!this.hovering && this.tooltip != null) + { + this.tooltip = null; + } + this.hovering = false; + return; + } + if(this.screen == this.helpScreen) + { + this.title.alpha = 0; + this.titleGlow.alpha = 0; + } + else + { + this.title.alpha = 1; + } + this.screen.update(); + if(!this.hovering && this.tooltip != null) + { + this.tooltip = null; + } + this.hovering = false; + } + + override public function draw() : void + { + super.draw(); + this.screen.draw(); + if(this.inOptions) + { + this.options.draw(); + if(this.tooltip != null) + { + this.tooltip.draw(); + } + return; + } + if(this.faderStatus == 1) + { + this.fader.draw(); + } + if(this.tooltip != null) + { + this.tooltip.draw(); + } + } + + protected function parallax() : void + { + var _loc1_:ArcSprite = null; + var _loc2_:int = 0; + for each(_loc1_ in [this.bg1,this.bg2,this.bg3]) + { + _loc1_.y += FlxG.elapsed * 20 * _loc1_.scrollFactor.y; + _loc2_ = _loc1_.getScreenXY().y; + if(_loc2_ < -420) + { + _loc1_.y = FlxG.camera.scroll.y * _loc1_.scrollFactor.y + (_loc2_ > 0 && _loc2_ < 1000 ? _loc2_ : 0); + } + else if(_loc2_ > 0) + { + _loc1_.y = FlxG.camera.scroll.y * _loc1_.scrollFactor.y - 420 + (_loc2_ > 0 && _loc2_ < 1000 ? _loc2_ : 0); + } + } + } + + public function switchScreen(param1:MenuScreen) : void + { + if(this.screen == this.mainScreen) + { + (this.mainScreen as MainScreen).unbindPegas(); + } + else if(param1 == this.mainScreen) + { + (this.mainScreen as MainScreen).bindPegas(); + } + if(this.screen == this.creditsScreen) + { + (this.creditsScreen as CreditsScreen).unbindPegas(); + } + else if(param1 == this.creditsScreen) + { + (this.creditsScreen as CreditsScreen).bindPegas(); + } + this.screen = param1; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_BACKGROUND_SPRITE1.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_BACKGROUND_SPRITE1.as new file mode 100644 index 0000000..f47089e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_BACKGROUND_SPRITE1.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/189.png")] + public class MainMenu_BACKGROUND_SPRITE1 extends BitmapAsset + { + + public function MainMenu_BACKGROUND_SPRITE1() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_BACKGROUND_SPRITE2.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_BACKGROUND_SPRITE2.as new file mode 100644 index 0000000..d4a6883 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_BACKGROUND_SPRITE2.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/199.png")] + public class MainMenu_BACKGROUND_SPRITE2 extends BitmapAsset + { + + public function MainMenu_BACKGROUND_SPRITE2() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_BACKGROUND_SPRITE3.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_BACKGROUND_SPRITE3.as new file mode 100644 index 0000000..39e2481 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_BACKGROUND_SPRITE3.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/196.png")] + public class MainMenu_BACKGROUND_SPRITE3 extends BitmapAsset + { + + public function MainMenu_BACKGROUND_SPRITE3() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_buttonHelp.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_buttonHelp.as new file mode 100644 index 0000000..d0a2712 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_buttonHelp.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/202.png")] + public class MainMenu_buttonHelp extends BitmapAsset + { + + public function MainMenu_buttonHelp() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_buttonPlay.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_buttonPlay.as new file mode 100644 index 0000000..4de8bda --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_buttonPlay.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/187_com.arc.dh.state.MainMenu_buttonPlay.png")] + public class MainMenu_buttonPlay extends BitmapAsset + { + + public function MainMenu_buttonPlay() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_soundButton.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_soundButton.as new file mode 100644 index 0000000..eec2daf --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_soundButton.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/81_com.arc.dh.state.MainMenu_soundButton.png")] + public class MainMenu_soundButton extends BitmapAsset + { + + public function MainMenu_soundButton() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_titleGlowSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_titleGlowSprite.as new file mode 100644 index 0000000..d98e389 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_titleGlowSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/138_com.arc.dh.state.MainMenu_titleGlowSprite.png")] + public class MainMenu_titleGlowSprite extends BitmapAsset + { + + public function MainMenu_titleGlowSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_titleSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_titleSprite.as new file mode 100644 index 0000000..6d7011c --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainMenu_titleSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/101_com.arc.dh.state.MainMenu_titleSprite.png")] + public class MainMenu_titleSprite extends BitmapAsset + { + + public function MainMenu_titleSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen.as new file mode 100644 index 0000000..9419af4 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen.as @@ -0,0 +1,292 @@ +package com.arc.dh.state +{ + import com.arc.dh.menu.MenuTooltip; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.DataSerializer; + import com.arc.dh.util.Fonts; + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcSprite; + import flash.events.MouseEvent; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + import org.flixel.FlxU; + + public class MainScreen extends MenuScreen + { + + private static const buttonStorySprite:Class = MainScreen_buttonStorySprite; + + private static const buttonBossSprite:Class = MainScreen_buttonBossSprite; + + private static const buttonEscapeSprite:Class = MainScreen_buttonEscapeSprite; + + private static const buttonHelpSprite:Class = MainScreen_buttonHelpSprite; + + private static const buttonCreditsSprite:Class = MainScreen_buttonCreditsSprite; + + private static const buttonMinigameSprite:Class = MainScreen_buttonMinigameSprite; + + private static const buttonUnlockSprite:Class = MainScreen_buttonUnlockSprite; + + private static const buttonMoreGames:Class = MainScreen_buttonMoreGames; + + public static const buttonPegas:Class = MainScreen_buttonPegas; + + public static const buttonHost:Class = MainScreen_buttonHost; + + public static const buttonAG:Class = MainScreen_buttonAG; + + public static const buttonLikeAG:Class = MainScreen_buttonLikeAG; + + public static const buttonMG:Class = MainScreen_buttonMG; + + private static const buttonBossLockedSprite:Class = MainScreen_buttonBossLockedSprite; + + private static const buttonEscapeLockedSprite:Class = MainScreen_buttonEscapeLockedSprite; + + private static const buttonOptionsSprite:Class = MainScreen_buttonOptionsSprite; + + private var _buttonStory:ArcButton; + + private var _buttonBoss:ArcButton; + + private var _buttonEscape:ArcButton; + + private var _buttonHelp:ArcButton; + + private var _buttonCredits:ArcButton; + + private var _buttonMinigames:ArcButton; + + private var _buttonUnlock:ArcButton; + + private var _buttonPegas:ArcButton; + + private var _buttonMoreGames:ArcButton; + + private var _buttonHost:ArcButton; + + private var _minigamesBox:ArcSprite; + + private var _minigamesText:FlxBitmapText; + + private var _optionsButton:ArcButton; + + private var _bottomBar:ArcSprite; + + private var _createdText:FlxBitmapText; + + private var _versionText:FlxBitmapText; + + private var bossUnlocked:Boolean; + + private var escapeUnlocked:Boolean; + + public function MainScreen(param1:MainMenu) + { + var agOffset:int = 0; + var M:MainMenu = param1; + super(M); + this._buttonStory = new ArcButton(43,103,87,26,buttonStorySprite).callback(function():void + { + menu.switchScreen(menu.storyScreen); + }).selectable(false); + this.add(this._buttonStory); + this.escapeUnlocked = Data.chapters[1][0] > 0; + this._buttonEscape = new ArcButton(134,103,87,26,this.escapeUnlocked ? buttonEscapeSprite : buttonEscapeLockedSprite).callback(function():void + { + if(escapeUnlocked) + { + menu.switchScreen(menu.escapeScreen); + } + }).selectable(false); + this.add(this._buttonEscape); + this.bossUnlocked = Data.chapters[6][0] > 0; + this._buttonBoss = new ArcButton(43,136,87,26,this.bossUnlocked ? buttonBossSprite : buttonBossLockedSprite).callback(function():void + { + if(bossUnlocked) + { + menu.switchScreen(menu.bossScreen); + } + }).selectable(false); + this.add(this._buttonBoss); + this._buttonMinigames = new ArcButton(134,136,87,26,buttonMinigameSprite).callback(function():void + { + menu.switchScreen(menu.minigamesScreen); + }).selectable(false); + this.add(this._buttonMinigames); + this._buttonHelp = new ArcButton(43,169,87,26,buttonHelpSprite).callback(function():void + { + menu.switchScreen(menu.helpScreen); + }).selectable(false); + this.add(this._buttonHelp); + this._buttonCredits = new ArcButton(134,169,87,26,buttonCreditsSprite).callback(function():void + { + menu.switchScreen(menu.creditsScreen); + }).selectable(false); + this.add(this._buttonCredits); + if(Config.RELEASE == Config.PEGAS) + { + this._buttonPegas = new ArcButton(230,100,106,46,buttonPegas).callback(function():void + { + }).selectable(false); + this.add(this._buttonPegas); + this._buttonMoreGames = new ArcButton(240,145,87,26,buttonMoreGames).callback(function():void + { + }).selectable(false); + this.add(this._buttonMoreGames); + this._buttonHost = new ArcButton(240,170,87,26,buttonHost).callback(function():void + { + }).selectable(false); + this.add(this._buttonHost); + } + else if(Config.RELEASE == Config.ARMORGAMES) + { + this._buttonPegas = new ArcButton(215,100,133,39,buttonAG).callback(function():void + { + FlxU.openURL("http://armorgames.com"); + }).selectable(false); + this.add(this._buttonPegas); + this._buttonMoreGames = new ArcButton(240,144,87,26,buttonMoreGames).callback(function():void + { + FlxU.openURL("http://armorgames.com"); + }).selectable(false); + this.add(this._buttonMoreGames); + this._buttonHost = new ArcButton(240,169,87,26,buttonLikeAG).callback(function():void + { + FlxU.openURL("http://facebook.com/armorgames"); + }).selectable(false); + this.add(this._buttonHost); + agOffset = 20; + this._buttonStory.x -= agOffset; + this._buttonEscape.x -= agOffset; + this._buttonBoss.x -= agOffset; + this._buttonMinigames.x -= agOffset; + this._buttonHelp.x -= agOffset; + this._buttonCredits.x -= agOffset; + } + else if(Config.RELEASE == Config.MAXGAMES) + { + this._buttonPegas = new ArcButton(222,130,139,37,buttonMG).callback(function():void + { + FlxU.openURL("http://maxgames.com"); + }).selectable(false); + this.add(this._buttonPegas); + } + this._bottomBar = new ArcSprite(0,228); + this._bottomBar.makeGraphic(Config.WIDTH,9,2566914048); + this.add(this._bottomBar); + this._createdText = new FlxBitmapText(4,230,Fonts.font(Fonts.SMALL_WHITE),"CREATED BY ARKEUS","left",200); + this._createdText.alpha = 0.6; + this.add(this._createdText); + this._versionText = new FlxBitmapText(Config.WIDTH - 200 - 4,230,Fonts.font(Fonts.SMALL_WHITE),"VERSION " + Config.VERSION + " - " + Config.RELEASE.toUpperCase(),"right",200); + this._versionText.alpha = 0.6; + this.add(this._versionText); + this._optionsButton = new ArcButton(160,213,34,29,buttonOptionsSprite).callback(function():void + { + M.inOptions = true; + }).selectable(false); + this.add(this._optionsButton); + if(Config.RELEASE == Config.FLASHGAMELICENSE || Config.DEBUG) + { + this._buttonUnlock = new ArcButton(134,212,87,26,buttonUnlockSprite).callback(function():void + { + Data.diamonds = 105000; + Data.chapters = [[1,1000000],[1,1000000],[1,1000000],[1,1000000],[1,1000000],[1,1000000],[1,1000000]]; + Data.redDiamonds = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]; + Data.moonboots = 1; + Data.skyboots = 1; + Data.autofirer = 1; + Data.xrayscope = 1; + Data.lasersight = 1; + Data.moltensuit = 1; + Data.spreader = 1; + Data.rebound = 1; + Data.missile = 1; + Data.prime = 1; + Data.escape = [1,1,1,1,1,1]; + Data.heartcrystals = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]; + Data.vitality = 17; + Data.achievements = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]; + Data.boss = [1,1000000,1,1000000]; + DataSerializer.save(); + FlxG.fade(4278190080,0.25,function():void + { + FlxG.mouse.hide(); + FlxG.switchState(new MainMenu()); + }); + }).selectable(false); + this.add(this._buttonUnlock); + } + } + + public function bindPegas() : void + { + if(Config.RELEASE != Config.PEGAS) + { + return; + } + FlxG.stage.addEventListener(MouseEvent.CLICK,this.pegas); + } + + public function unbindPegas() : void + { + if(Config.RELEASE != Config.PEGAS) + { + return; + } + FlxG.stage.removeEventListener(MouseEvent.CLICK,this.pegas); + } + + private function pegas(param1:*) : void + { + if(Config.RELEASE != Config.PEGAS) + { + return; + } + if(menu.inOptions) + { + return; + } + if(this._buttonPegas.hover() || this._buttonMoreGames.hover()) + { + FlxU.openURL("http://www.pegasgames.com/"); + } + if(this._buttonHost.hover()) + { + FlxU.openURL("http://games.mochiads.com/c/g/diamond-hollow-ii/DiamondHollowII.swf"); + } + } + + override public function update() : void + { + if(this._buttonBoss.hover() && !this.bossUnlocked) + { + if(menu.tooltip == null || menu.tooltip.source != this._buttonBoss) + { + menu.tooltip = new MenuTooltip(this._buttonBoss.x + this._buttonBoss.width / 2,this._buttonBoss.y,"Boss Rush Locked","You must complete chapter 7 of story mode to unlock Boss Rush"); + menu.tooltip.source = this._buttonBoss; + } + menu.hovering = true; + } + else if(this._buttonEscape.hover() && !this.escapeUnlocked) + { + if(menu.tooltip == null || menu.tooltip.source != this._buttonEscape) + { + menu.tooltip = new MenuTooltip(this._buttonEscape.x + this._buttonEscape.width / 2,this._buttonEscape.y,"Escape Mode Locked","You must complete chapter 2 of story mode to unlock Escape Mode"); + menu.tooltip.source = this._buttonEscape; + } + menu.hovering = true; + } + if(FlxG.keys.justPressed("L")) + { + FlxG.log("FlxG.stage.root.loaderInfo.loaderURL: " + FlxG.stage.root.loaderInfo.loaderURL); + FlxG.log("FlxG.stage.loaderInfo.loaderURL: " + FlxG.stage.loaderInfo.loaderURL); + FlxG.log("FlxG.root.loaderInfo.loaderURL: " + FlxG.root.loaderInfo.loaderURL); + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonAG.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonAG.as new file mode 100644 index 0000000..4fe1ebc --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonAG.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/246_com.arc.dh.state.MainScreen_buttonAG.png")] + public class MainScreen_buttonAG extends BitmapAsset + { + + public function MainScreen_buttonAG() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonBossLockedSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonBossLockedSprite.as new file mode 100644 index 0000000..b89fafa --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonBossLockedSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/178_com.arc.dh.state.MainScreen_buttonBossLockedSprite.png")] + public class MainScreen_buttonBossLockedSprite extends BitmapAsset + { + + public function MainScreen_buttonBossLockedSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonBossSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonBossSprite.as new file mode 100644 index 0000000..cf8b439 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonBossSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/58_com.arc.dh.state.MainScreen_buttonBossSprite.png")] + public class MainScreen_buttonBossSprite extends BitmapAsset + { + + public function MainScreen_buttonBossSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonCreditsSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonCreditsSprite.as new file mode 100644 index 0000000..ce57012 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonCreditsSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/214_com.arc.dh.state.MainScreen_buttonCreditsSprite.png")] + public class MainScreen_buttonCreditsSprite extends BitmapAsset + { + + public function MainScreen_buttonCreditsSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonEscapeLockedSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonEscapeLockedSprite.as new file mode 100644 index 0000000..dee2174 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonEscapeLockedSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/293_com.arc.dh.state.MainScreen_buttonEscapeLockedSprite.png")] + public class MainScreen_buttonEscapeLockedSprite extends BitmapAsset + { + + public function MainScreen_buttonEscapeLockedSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonEscapeSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonEscapeSprite.as new file mode 100644 index 0000000..25b81fa --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonEscapeSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/255_com.arc.dh.state.MainScreen_buttonEscapeSprite.png")] + public class MainScreen_buttonEscapeSprite extends BitmapAsset + { + + public function MainScreen_buttonEscapeSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonHelpSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonHelpSprite.as new file mode 100644 index 0000000..c6edddb --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonHelpSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/202.png")] + public class MainScreen_buttonHelpSprite extends BitmapAsset + { + + public function MainScreen_buttonHelpSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonHost.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonHost.as new file mode 100644 index 0000000..a8080fe --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonHost.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/294_com.arc.dh.state.MainScreen_buttonHost.png")] + public class MainScreen_buttonHost extends BitmapAsset + { + + public function MainScreen_buttonHost() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonLikeAG.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonLikeAG.as new file mode 100644 index 0000000..089d66a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonLikeAG.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/180_com.arc.dh.state.MainScreen_buttonLikeAG.png")] + public class MainScreen_buttonLikeAG extends BitmapAsset + { + + public function MainScreen_buttonLikeAG() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonMG.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonMG.as new file mode 100644 index 0000000..c6aa8f2 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonMG.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/168_com.arc.dh.state.MainScreen_buttonMG.png")] + public class MainScreen_buttonMG extends BitmapAsset + { + + public function MainScreen_buttonMG() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonMinigameSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonMinigameSprite.as new file mode 100644 index 0000000..8e8ad90 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonMinigameSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/258_com.arc.dh.state.MainScreen_buttonMinigameSprite.png")] + public class MainScreen_buttonMinigameSprite extends BitmapAsset + { + + public function MainScreen_buttonMinigameSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonMoreGames.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonMoreGames.as new file mode 100644 index 0000000..ae5c44d --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonMoreGames.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/122_com.arc.dh.state.MainScreen_buttonMoreGames.png")] + public class MainScreen_buttonMoreGames extends BitmapAsset + { + + public function MainScreen_buttonMoreGames() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonOptionsSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonOptionsSprite.as new file mode 100644 index 0000000..362e0b5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonOptionsSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/84.png")] + public class MainScreen_buttonOptionsSprite extends BitmapAsset + { + + public function MainScreen_buttonOptionsSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonPegas.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonPegas.as new file mode 100644 index 0000000..9e73677 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonPegas.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/160_com.arc.dh.state.MainScreen_buttonPegas.png")] + public class MainScreen_buttonPegas extends BitmapAsset + { + + public function MainScreen_buttonPegas() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonStorySprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonStorySprite.as new file mode 100644 index 0000000..0175f2f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonStorySprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/170_com.arc.dh.state.MainScreen_buttonStorySprite.png")] + public class MainScreen_buttonStorySprite extends BitmapAsset + { + + public function MainScreen_buttonStorySprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonUnlockSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonUnlockSprite.as new file mode 100644 index 0000000..e0bd6a2 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MainScreen_buttonUnlockSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/119_com.arc.dh.state.MainScreen_buttonUnlockSprite.png")] + public class MainScreen_buttonUnlockSprite extends BitmapAsset + { + + public function MainScreen_buttonUnlockSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MaxGames.as b/research/inner_decompiled/scripts/com/arc/dh/state/MaxGames.as new file mode 100644 index 0000000..d6df613 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MaxGames.as @@ -0,0 +1,59 @@ +package com.arc.dh.state +{ + import flash.display.Loader; + import flash.events.Event; + import flash.media.SoundMixer; + import flash.system.ApplicationDomain; + import flash.system.LoaderContext; + import org.flixel.FlxG; + import org.flixel.FlxState; + + public class MaxGames extends FlxState + { + + private static var AG:Class = MaxGames_AG; + + private var len:Number = 180; + + private var zoomFactor:int = 1; + + private var movie:Loader; + + public function MaxGames() + { + super(); + } + + override public function create() : void + { + this.movie = new Loader(); + var _loc1_:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain); + this.movie.loadBytes(new AG(),_loc1_); + this.movie.contentLoaderInfo.addEventListener(Event.COMPLETE,this.contentsRetrieve); + } + + private function contentsRetrieve(param1:Event) : void + { + this.movie.scaleX = 1 / this.zoomFactor; + this.movie.scaleY = 1 / this.zoomFactor; + this.movie.x = 90; + this.movie.y = 40; + FlxG.stage.addChildAt(this.movie,0); + this.movie.addEventListener(Event.EXIT_FRAME,this.next); + } + + private function next(param1:Event) : void + { + --this.len; + if(this.len <= 0) + { + this.movie.removeEventListener(Event.EXIT_FRAME,this.next); + this.movie.unloadAndStop(true); + FlxG.stage.removeChildAt(0); + SoundMixer.stopAll(); + FlxG.switchState(new MainMenu()); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MaxGames_AG.as b/research/inner_decompiled/scripts/com/arc/dh/state/MaxGames_AG.as new file mode 100644 index 0000000..01f7a0e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MaxGames_AG.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.ByteArrayAsset; + + [Embed(source="/_assets/163_com.arc.dh.state.MaxGames_AG.bin", mimeType="application/octet-stream")] + public class MaxGames_AG extends ByteArrayAsset + { + + public function MaxGames_AG() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MenuScreen.as b/research/inner_decompiled/scripts/com/arc/dh/state/MenuScreen.as new file mode 100644 index 0000000..bdff348 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MenuScreen.as @@ -0,0 +1,17 @@ +package com.arc.dh.state +{ + import com.arc.flixel.ArcGroup; + + public class MenuScreen extends ArcGroup + { + + public var menu:MainMenu; + + public function MenuScreen(param1:MainMenu) + { + super(); + this.menu = param1; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MinigameScreen.as b/research/inner_decompiled/scripts/com/arc/dh/state/MinigameScreen.as new file mode 100644 index 0000000..e48994a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MinigameScreen.as @@ -0,0 +1,148 @@ +package com.arc.dh.state +{ + import com.arc.dh.entities.PlayerTadpole; + import com.arc.dh.menu.MenuTooltip; + import com.arc.dh.menu.StatisticsChapter; + import com.arc.dh.util.Data; + import com.arc.dh.util.Fonts; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + + public class MinigameScreen extends MenuScreen + { + + private static const buttonBackSprite:Class = MinigameScreen_buttonBackSprite; + + private static const buttonPlaySprite:Class = MinigameScreen_buttonPlaySprite; + + private static const buttonLockedSprite:Class = MinigameScreen_buttonLockedSprite; + + private static const buttonRunUnlockedSprite:Class = MinigameScreen_buttonRunUnlockedSprite; + + private var _buttonBack:ArcButton; + + private var _buttonRun:ArcButton; + + private var _buttonTadpole:ArcButton; + + private var runUnlocked:Boolean; + + private var tadpoleUnlocked:Boolean; + + public function MinigameScreen(param1:MainMenu) + { + var run:ArcSprite; + var tadpole:ArcSprite; + var heroicUnlocked:Boolean; + var red:ArcSprite; + var M:MainMenu = param1; + super(M); + this.add(new InstructionWindow(0,100,FlxG.width,33)); + this.add(new FlxBitmapText(10,104,Fonts.font(Fonts.OUTLINE_GRADIENT),"As you explore the various environments of story mode, you will find red diamonds hidden in the darkest corners of the cave. In addition to providing you with 100 diamonds, these will unlock the minigames below.".toUpperCase(),"center",FlxG.width - 20)); + this.runUnlocked = Data.redDiamondCount >= 15; + this.tadpoleUnlocked = Data.redDiamondCount >= 25; + this.add(new InstructionWindow(0,140,FlxG.width,30)); + this.add(new InstructionWindow(0,177,FlxG.width,30)); + run = new ArcSprite(10,145); + run.loadGraphic(buttonRunUnlockedSprite,true,false,13,18); + run.frame = 0; + this.add(run); + this.add(new FlxBitmapText(30,142,Fonts.font(Fonts.OUTLINE_GRADIENT),"Runner Mode".toUpperCase(),"center",237)); + this.add(new FlxBitmapText(30,150,Fonts.font(Fonts.OUTLINE_BLACK),"Protect yourself as you run at increasing speeds in an attempt to escape once and for all.".toUpperCase(),"center",237)); + this.add(new FlxBitmapText(30,179,Fonts.font(Fonts.OUTLINE_GRADIENT),"Tadpole Mode".toUpperCase(),"center",237)); + this.add(new FlxBitmapText(30,187,Fonts.font(Fonts.OUTLINE_BLACK),"Control a lone blue tadpole as he swims his way through his venomous brethren.".toUpperCase(),"center",237)); + tadpole = new ArcSprite(10,183); + tadpole.loadGraphic(PlayerTadpole.sprite,true,false,16,16); + tadpole.frame = 0; + this.add(tadpole); + this._buttonRun = new ArcButton(270,142,87,26,this.runUnlocked ? buttonPlaySprite : buttonLockedSprite).callback(function():void + { + if(runUnlocked) + { + SoundSystem.fadeOutMusic(); + FlxG.fade(4278190080,0.25,function():void + { + FlxG.mouse.hide(); + FlxG.switchState(new RunMode()); + }); + } + }).selectable(false); + this.add(this._buttonRun); + heroicUnlocked = Data.boss[0] > 0; + this._buttonTadpole = new ArcButton(270,179,87,26,this.tadpoleUnlocked ? buttonPlaySprite : buttonLockedSprite).callback(function():void + { + if(tadpoleUnlocked) + { + SoundSystem.fadeOutMusic(); + FlxG.fade(4278190080,0.25,function():void + { + FlxG.mouse.hide(); + FlxG.switchState(new TadpoleMode()); + }); + } + }).selectable(false); + this.add(this._buttonTadpole); + this._buttonBack = new ArcButton(135,213,87,26,buttonBackSprite).callback(function():void + { + menu.switchScreen(menu.mainScreen); + }).selectable(false); + this.add(this._buttonBack); + red = new ArcSprite(5,FlxG.height - 15); + red.loadGraphic(StatisticsChapter.redDiamondObtained,true,false,10,10); + red.addAnimation("glow",[0,1,2,3,4,5,4,3,2,1],5,true); + red.play("glow"); + this.add(red); + this.add(new FlxBitmapText(17,FlxG.height - 15 + 2,Fonts.font(Fonts.OUTLINE_BLACK_S),Data.redDiamondCount.toString(),"left",237)); + } + + override public function update() : void + { + super.update(); + if(this._buttonRun.hover()) + { + if(menu.tooltip == null || menu.tooltip.source != this._buttonRun) + { + if(this.runUnlocked) + { + menu.tooltip = new MenuTooltip(this._buttonRun.x + this._buttonRun.width / 2,this._buttonRun.y,"Runner Mode","Max Distance: " + Data.maxRunDistance + "M\n\nJump and shoot while avoiding enemies. Be sure not to fall!"); + } + else + { + menu.tooltip = new MenuTooltip(this._buttonRun.x + this._buttonRun.width / 2,this._buttonRun.y,"Runner Mode","Requires 15 red diamonds to unlock"); + } + menu.tooltip.source = this._buttonRun; + } + menu.hovering = true; + } + else if(this._buttonTadpole.hover()) + { + if(menu.tooltip == null || menu.tooltip.source != this._buttonTadpole) + { + if(this.tadpoleUnlocked) + { + menu.tooltip = new MenuTooltip(this._buttonTadpole.x + this._buttonTadpole.width / 2,this._buttonTadpole.y - 1,"Tadpole Mode","Max Distance: " + Data.maxTadpoleDistance + "M\n\nClick or press space to swim up, release to swim down."); + } + else + { + menu.tooltip = new MenuTooltip(this._buttonTadpole.x + this._buttonTadpole.width / 2,this._buttonTadpole.y - 1,"Tadpole Mode","Requires 25 red diamonds to unlock"); + } + menu.tooltip.source = this._buttonTadpole; + } + menu.hovering = true; + } + if(FlxG.keys.justPressed("ESCAPE")) + { + menu.switchScreen(menu.mainScreen); + } + } + + override public function draw() : void + { + super.draw(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MinigameScreen_buttonBackSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MinigameScreen_buttonBackSprite.as new file mode 100644 index 0000000..1704400 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MinigameScreen_buttonBackSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/56.png")] + public class MinigameScreen_buttonBackSprite extends BitmapAsset + { + + public function MinigameScreen_buttonBackSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MinigameScreen_buttonLockedSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MinigameScreen_buttonLockedSprite.as new file mode 100644 index 0000000..749c610 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MinigameScreen_buttonLockedSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/287_com.arc.dh.state.MinigameScreen_buttonLockedSprite.png")] + public class MinigameScreen_buttonLockedSprite extends BitmapAsset + { + + public function MinigameScreen_buttonLockedSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MinigameScreen_buttonPlaySprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MinigameScreen_buttonPlaySprite.as new file mode 100644 index 0000000..b711f6a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MinigameScreen_buttonPlaySprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/99_com.arc.dh.state.MinigameScreen_buttonPlaySprite.png")] + public class MinigameScreen_buttonPlaySprite extends BitmapAsset + { + + public function MinigameScreen_buttonPlaySprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/MinigameScreen_buttonRunUnlockedSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/MinigameScreen_buttonRunUnlockedSprite.as new file mode 100644 index 0000000..0b52d7a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/MinigameScreen_buttonRunUnlockedSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/268_com.arc.dh.state.MinigameScreen_buttonRunUnlockedSprite.png")] + public class MinigameScreen_buttonRunUnlockedSprite extends BitmapAsset + { + + public function MinigameScreen_buttonRunUnlockedSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/Newgrounds.as b/research/inner_decompiled/scripts/com/arc/dh/state/Newgrounds.as new file mode 100644 index 0000000..3c94ad2 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/Newgrounds.as @@ -0,0 +1,129 @@ +package com.arc.dh.state +{ + import com.arc.dh.util.Data; + import com.newgrounds.API; + import com.newgrounds.Medal; + import org.flixel.FlxG; + + public class Newgrounds + { + + public function Newgrounds() + { + super(); + } + + public static function connect() : void + { + API.connect(FlxG.root,"20663:ioaF01MQ","VvUV6AX4nPAMsy99C3Kss7NEhphnph9u","DH2-1"); + } + + private static function medal(param1:String) : void + { + var _loc2_:Medal = API.getMedal(param1); + if(!_loc2_.unlocked) + { + _loc2_.unlock(); + } + } + + public static function medals() : void + { + if(Data.totaldiamonds >= 100) + { + medal("100 Diamonds"); + } + if(Data.totaldiamonds >= 5000) + { + medal("5000 Diamonds"); + } + if(Data.totaldiamonds >= 25000) + { + medal("25000 Diamonds"); + } + if(Data.chapters[0][0] > 0) + { + medal("Chapter 1"); + } + if(Data.chapters[6][0] > 0) + { + medal("Chapter 7"); + } + if(Data.maxheight >= 500) + { + medal("Escape 500"); + } + if(Data.maxheight >= 1000) + { + medal("Escape 1000"); + } + if(Data.maxheight >= 1500) + { + medal("Escape 1500"); + } + if(Data.maxheight >= 2000) + { + medal("Escape 2000"); + } + var _loc1_:int = 0; + var _loc2_:int = 0; + while(_loc2_ < Data.heartcrystals.length) + { + _loc1_ += Data.heartcrystals[_loc2_]; + _loc2_++; + } + if(_loc1_ >= 5) + { + medal("5 Hearts"); + } + if(_loc1_ >= 17) + { + medal("17 Hearts"); + } + _loc1_ = 0; + _loc2_ = 0; + while(_loc2_ < Data.redDiamonds.length) + { + _loc1_ += Data.redDiamonds[_loc2_]; + _loc2_++; + } + if(_loc1_ >= 5) + { + medal("5 Red Diamonds"); + } + if(_loc1_ >= 15) + { + medal("15 Red Diamonds"); + } + if(_loc1_ >= 35) + { + medal("35 Red Diamonds"); + } + if(Data.enemies >= 300) + { + medal("300 Enemies"); + } + if(Data.enemies >= 1000) + { + medal("1000 Enemies"); + } + if(Data.maxTadpoleDistance >= 1000) + { + medal("Just Keep Swimming"); + } + if(Data.maxRunDistance >= 2000) + { + medal("Tired Yet?"); + } + if(Data.boss[0] > 0) + { + medal("Normalbrine"); + } + if(Data.boss[2] > 0) + { + medal("Herobrine"); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/Pegas.as b/research/inner_decompiled/scripts/com/arc/dh/state/Pegas.as new file mode 100644 index 0000000..b1fcff9 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/Pegas.as @@ -0,0 +1,83 @@ +package com.arc.dh.state +{ + import com.arc.dh.util.Config; + import flash.display.Loader; + import flash.events.Event; + import flash.events.MouseEvent; + import flash.media.SoundMixer; + import flash.system.ApplicationDomain; + import flash.system.LoaderContext; + import org.flixel.FlxG; + import org.flixel.FlxState; + import org.flixel.FlxU; + + public class Pegas extends FlxState + { + + private static var AG:Class = Pegas_AG; + + private var len:Number = Config.DEBUG ? 0 : 330; + + private var zoomFactor:int = 1; + + private var movie:Loader; + + private var _clicked:Boolean = false; + + public function Pegas() + { + super(); + } + + override public function create() : void + { + FlxG.bgColor = 4281545523; + this.movie = new Loader(); + var _loc1_:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain); + this.movie.loadBytes(new AG(),_loc1_); + this.movie.contentLoaderInfo.addEventListener(Event.COMPLETE,this.contentsRetrieve); + FlxG.stage.addEventListener(MouseEvent.CLICK,this.pegasSplash); + } + + private function pegasSplash(param1:*) : void + { + if(!this._clicked) + { + FlxU.openURL("http://www.pegasgames.com/"); + this._clicked = true; + this.len = 10; + } + } + + override public function update() : void + { + super.update(); + } + + private function contentsRetrieve(param1:Event) : void + { + this.movie.scaleX = 1 / this.zoomFactor; + this.movie.scaleY = 1 / this.zoomFactor; + this.movie.x = (FlxG.width * 2 - 550) / 2; + this.movie.y = (FlxG.height * 2 - 400) / 2; + this.movie.opaqueBackground = 3355443; + FlxG.stage.addChildAt(this.movie,0); + this.movie.addEventListener(Event.EXIT_FRAME,this.next); + } + + private function next(param1:Event) : void + { + --this.len; + if(this.len <= 0) + { + FlxG.stage.removeChildAt(0); + SoundMixer.stopAll(); + this.movie.removeEventListener(Event.EXIT_FRAME,this.next); + this.movie.unload(); + FlxG.stage.removeEventListener(MouseEvent.CLICK,this.pegasSplash); + FlxG.switchState(new MainMenu()); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/Pegas_AG.as b/research/inner_decompiled/scripts/com/arc/dh/state/Pegas_AG.as new file mode 100644 index 0000000..bf70364 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/Pegas_AG.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.ByteArrayAsset; + + [Embed(source="/_assets/98_com.arc.dh.state.Pegas_AG.bin", mimeType="application/octet-stream")] + public class Pegas_AG extends ByteArrayAsset + { + + public function Pegas_AG() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode.as new file mode 100644 index 0000000..a64824e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode.as @@ -0,0 +1,2141 @@ +package com.arc.dh.state +{ + import Playtomic.Log; + import com.arc.dh.Color; + import com.arc.dh.Gun; + import com.arc.dh.entities.Entity; + import com.arc.dh.entities.Player; + import com.arc.dh.menu.CompleteWindow; + import com.arc.dh.menu.Menu; + import com.arc.dh.objects.*; + import com.arc.dh.objects.enemies.Bird; + import com.arc.dh.objects.enemies.Blade; + import com.arc.dh.objects.enemies.Blob; + import com.arc.dh.objects.enemies.Boss; + import com.arc.dh.objects.enemies.BouncingSlime; + import com.arc.dh.objects.enemies.CeilingPlant; + import com.arc.dh.objects.enemies.ClimbingSlime; + import com.arc.dh.objects.enemies.Enemy; + import com.arc.dh.objects.enemies.FloorPlant; + import com.arc.dh.objects.enemies.Laser; + import com.arc.dh.objects.enemies.LaserBeam; + import com.arc.dh.objects.enemies.Plant; + import com.arc.dh.objects.enemies.Professor; + import com.arc.dh.objects.enemies.ProfessorShade; + import com.arc.dh.objects.enemies.Seed; + import com.arc.dh.objects.enemies.Slime; + import com.arc.dh.objects.enemies.SlimeKing; + import com.arc.dh.objects.enemies.Snail; + import com.arc.dh.objects.enemies.SnailKing; + import com.arc.dh.objects.enemies.Snake; + import com.arc.dh.objects.enemies.Spider; + import com.arc.dh.objects.enemies.Spike; + import com.arc.dh.objects.enemies.StoneBird; + import com.arc.dh.objects.enemies.Tadpole; + import com.arc.dh.objects.powerups.HeartCrystal; + import com.arc.dh.objects.powerups.Powerup; + import com.arc.dh.objects.powerups.PowerupEquipment; + import com.arc.dh.objects.powerups.PowerupFire; + import com.arc.dh.objects.powerups.PowerupHeart; + import com.arc.dh.objects.powerups.PowerupMagnet; + import com.arc.dh.objects.powerups.PowerupShield; + import com.arc.dh.objects.powerups.RedDiamond; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.AchievementWindow; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.ParticleSystem; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.dh.util.text.Avatar; + import com.arc.dh.util.text.TextSystem; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcSprite; + import com.arc.flixel.ArcU; + import com.arc.flixel.Profiler; + import flash.display.BitmapData; + import flash.ui.Mouse; + import org.flixel.FlxBasic; + import org.flixel.FlxG; + import org.flixel.FlxGroup; + import org.flixel.FlxObject; + import org.flixel.FlxPoint; + import org.flixel.FlxSprite; + import org.flixel.FlxState; + import org.flixel.FlxTilemap; + + public class PlayMode extends FlxState + { + + protected static const BITMAP_SPRITE:Class = PlayMode_BITMAP_SPRITE; + + protected static const CONTROLS_SPRITE:Class = PlayMode_CONTROLS_SPRITE; + + protected static const MENU_TIP_SPRITE:Class = PlayMode_MENU_TIP_SPRITE; + + protected static const UPGRADE_TIP_SPRITE:Class = PlayMode_UPGRADE_TIP_SPRITE; + + protected static const T1:Class = PlayMode_T1; + + protected static const BG3_1:Class = PlayMode_BG3_1; + + protected static const BG2_1:Class = PlayMode_BG2_1; + + protected static const BG1_1:Class = PlayMode_BG1_1; + + protected static const T2:Class = PlayMode_T2; + + protected static const BG3_2:Class = PlayMode_BG3_2; + + protected static const BG2_2:Class = PlayMode_BG2_2; + + protected static const BG1_2:Class = PlayMode_BG1_2; + + protected static const T3:Class = PlayMode_T3; + + protected static const BG3_3:Class = PlayMode_BG3_3; + + protected static const BG2_3:Class = PlayMode_BG2_3; + + protected static const BG1_3:Class = PlayMode_BG1_3; + + protected static const T4:Class = PlayMode_T4; + + protected static const BG3_4:Class = PlayMode_BG3_4; + + protected static const BG2_4:Class = PlayMode_BG2_4; + + protected static const BG1_4:Class = PlayMode_BG1_4; + + protected static const T5:Class = PlayMode_T5; + + protected static const BG3_5:Class = PlayMode_BG3_5; + + protected static const BG2_5:Class = PlayMode_BG2_5; + + protected static const BG1_5:Class = PlayMode_BG1_5; + + protected static const T6:Class = PlayMode_T6; + + protected static const BG3_6:Class = PlayMode_BG3_6; + + protected static const BG2_6:Class = PlayMode_BG2_6; + + protected static const BG1_6:Class = PlayMode_BG1_6; + + protected static const T7:Class = PlayMode_T7; + + protected static const BG3_7:Class = PlayMode_BG3_7; + + protected static const BG2_7:Class = PlayMode_BG2_7; + + protected static const BG1_7:Class = PlayMode_BG1_7; + + private static const xraySprite:Class = PlayMode_xraySprite; + + protected static const START_ROW:int = 999999; + + public static const BULLET_TIME:Number = 0.4; + + public static const STORY_MODE:int = 0; + + public static const BOSS_MODE:int = 1; + + public static const ESCAPE_MODE:int = 2; + + public static const RUN_MODE:int = 3; + + public static const TADPOLE_MODE:int = 3; + + public static var mode:int = STORY_MODE; + + protected static const DIAMOND_VALUES:Array = [1,2,3,4,5,10]; + + public var pixels:BitmapData; + + public var mpixels:BitmapData; + + public var overpixels:BitmapData; + + protected var segments:Array = new Array(); + + protected var row:uint = 999999; + + public var tilemap:FlxTilemap; + + protected var _ch:int = 6; + + public var checkpoints:Array = new Array(); + + protected var objectCounter:int = 2; + + protected var messages:Array = new Array(); + + public var ui:UI; + + public var player:Player; + + public var underblocks:FlxGroup = new FlxGroup(); + + public var overblocks:FlxGroup = new FlxGroup(); + + public var bullets:FlxGroup = new FlxGroup(); + + public var enemies:FlxGroup = new FlxGroup(); + + public var penemies:FlxGroup = new FlxGroup(); + + public var diamonds:FlxGroup = new FlxGroup(); + + public var particles:ArcGroup = new ArcGroup(); + + public var emitters:ArcGroup = new ArcGroup(); + + public var friendly:ArcGroup = new ArcGroup(); + + public var powerups:ArcGroup = new ArcGroup(); + + public var damagetexts:ArcGroup = new ArcGroup(); + + public var healthbars:ArcGroup = new ArcGroup(); + + public var objects:ArcGroup = new ArcGroup(); + + public var cobjects:ArcGroup = new ArcGroup(); + + public var colliders:ArcGroup = new ArcGroup(); + + public var lavagroup:ArcGroup = new ArcGroup(); + + public var xray:ArcSprite; + + protected var entities:FlxGroup = new FlxGroup(); + + protected var hittable:FlxGroup = new FlxGroup(); + + protected var bulletcollide:FlxGroup = new FlxGroup(); + + public var bulletTimer:Number = 0.4; + + public var cameraSpeed:Number = 3; + + protected var starty:int; + + protected var scrolling:Boolean = false; + + protected var startHeight:int = 0; + + protected var _garbage:Number = 2; + + protected var _menu:Menu; + + public var inMenu:Boolean; + + public var cdiamonds:int = 0; + + public var cenemies:int = 0; + + protected var _start:Number; + + protected var _dieTimer:Number = 0; + + protected var bg3:Background; + + protected var bg2:Background; + + protected var bg1:Background; + + protected var i:int; + + protected var j:int; + + public var spawnTop:int = 0; + + public var spawnBottom:int = 0; + + public var despawnTop:int = 0; + + public var despawnBottom:int = 0; + + public var spawner:Object = new Object(); + + public var spawnChance:int = 100; + + protected var fader:ArcSprite; + + public var whitefader:ArcSprite; + + protected var faderStatus:int = 0; + + public var bossHeight:int = -1; + + protected var _complete:Boolean = false; + + protected var _completeWindow:CompleteWindow; + + protected var _red:int = 0; + + protected var _redLocations:Object = new Object(); + + public var controls:ArcSprite; + + public var worldAllFuckedUp:Boolean = false; + + public var controlCharacter:Boolean = true; + + public var boss:int = 0; + + protected const GRASS:uint = 5228053; + + protected const GRASS2:uint = 2652672; + + protected const DIRT:uint = 10052885; + + protected const WATER:uint = 32511; + + protected const LAVA:uint = 14045513; + + protected const WOODEN_CRATE:uint = 7028992; + + protected const STEEL_CRATE:uint = 1579032; + + protected const RED_DIAMOND:uint = 16711932; + + protected const tiles:Array = [this.GRASS,this.GRASS2,this.DIRT,this.WATER,this.LAVA]; + + protected const objectTiles:Array = [this.WOODEN_CRATE,this.STEEL_CRATE]; + + public function PlayMode() + { + super(); + TextSystem.reset(); + } + + override public function create() : void + { + Data.state = this; + Log.Play(); + this.bg3 = new Background(0,0,PlayMode["BG3_" + this._ch]); + this.bg3.scrollFactor.x = this.bg3.scrollFactor.y = 0.4; + this.add(this.bg3); + this.bg2 = new Background(0,0,PlayMode["BG2_" + this._ch]); + this.bg2.scrollFactor.x = this.bg2.scrollFactor.y = 0.6; + this.add(this.bg2); + this.bg1 = new Background(0,0,PlayMode["BG1_" + this._ch]); + this.bg1.scrollFactor.x = this.bg1.scrollFactor.y = 0.8; + this.add(this.bg1); + this.createLevel(); + this.player = new Player(128,this.tilemap.height - 36); + FlxG.camera.follow(this.player); + FlxG.camera.update(); + FlxG.worldBounds.width = Config.WIDTH; + FlxG.worldBounds.height = Config.HEIGHT + (Config.DESPAWN_PADDING * 2 + Config.SPAWN_PADDING * 2) * Config.BLOCK_SIZE; + this.add(this.underblocks); + this.add(this.particles); + this.add(this.emitters); + this.add(this.player); + this.add(this.diamonds); + this.add(this.bullets); + this.add(this.powerups); + this.add(this.objects); + this.add(this.cobjects); + this.add(this.penemies); + this.add(this.enemies); + this.add(this.lavagroup); + this.add(this.tilemap); + this.add(this.healthbars); + this.add(this.overblocks); + this.add(this.damagetexts); + this.entities.add(this.player); + this.entities.add(this.enemies); + this.entities.add(this.diamonds); + this.entities.add(this.bullets); + this.hittable.add(this.enemies); + this.hittable.add(this.diamonds); + this.hittable.add(this.powerups); + this.hittable.add(this.objects); + this.hittable.add(this.cobjects); + this.hittable.add(this.penemies); + this.colliders.add(this.tilemap); + this.colliders.add(this.cobjects); + this.friendly.add(this.player); + this.friendly.add(this.bullets); + this.bulletcollide.add(this.enemies); + this.bulletcollide.add(this.tilemap); + this.xray = new ArcSprite(0,0); + this.xray.offset.y = 512; + this.xray.offset.x = 512; + this.xray.loadGraphic(xraySprite,false,false,1024,1024); + this.xray.blend = "overlay"; + this.add(this.xray); + this.fader = new ArcSprite(0,0); + this.fader.makeGraphic(FlxG.width,FlxG.height,4278190080); + this.fader.scrollFactor.x = this.fader.scrollFactor.y = 0; + this.add(this.fader); + this.faderStatus = 2; + this.ui = new UI(); + this.add(this.ui); + this._menu = new Menu(); + if(!(this is BossMode && this._ch != 1 && !(this as BossMode).isPractice())) + { + Data.hp = Data.hpm; + Data.ctime = 0; + } + this._start = new Date().getTime(); + this.cdiamonds = 0; + this.cenemies = 0; + var _loc1_:int = this.getStartX(); + this.checkpoints.push([_loc1_ / Config.BLOCK_SIZE,(this.tilemap.height - this.getStartY()) / Config.BLOCK_SIZE]); + this.restart(); + if(_loc1_ > 200) + { + this.player.facing = FlxObject.LEFT; + } + if(this._ch == 1 && this is StoryMode) + { + this.add(new BeginnerTip(133,this.tilemap.height - 240 + 86,CONTROLS_SPRITE)); + this.add(new BeginnerTip(20,this.tilemap.height - 533,MENU_TIP_SPRITE,50)); + this.add(new BeginnerTip(58,this.tilemap.height - 960,UPGRADE_TIP_SPRITE,40)); + } + ParticleSystem.initialize(); + this.emitters.add(ArcParticleSystem.emitters); + this.add(TextSystem.instance); + super.create(); + } + + protected function getStartX() : int + { + return 128; + } + + protected function getStartY() : int + { + return 60; + } + + protected function createLevel() : void + { + } + + public function restart() : void + { + } + + public function get caveLevel() : int + { + return this.caveHeight / 50 + 1; + } + + public function get caveHeight() : int + { + if(this.player.maxHeight + this.startHeight > Data.maxheight && this is EscapeMode) + { + Data.maxheight = this.player.maxHeight + this.startHeight; + } + return this.player.maxHeight + this.startHeight; + } + + public function get duration() : String + { + return Data.duration(0,Math.ceil(Data.ctime) * 1000); + } + + protected function garbageCollect(param1:FlxGroup) : void + { + var _loc5_:FlxBasic = null; + var _loc2_:Array = param1.members; + var _loc3_:Array = []; + var _loc4_:int = 0; + while(_loc4_ < _loc2_.length) + { + _loc5_ = _loc2_[_loc4_] as FlxBasic; + if(_loc5_ != null && _loc5_.alive && _loc5_.exists) + { + _loc3_.push(_loc5_); + } + _loc4_++; + } + param1.members = _loc3_; + } + + public function get over() : Boolean + { + return this._dieTimer > 0; + } + + public function setMenu(param1:Boolean) : void + { + this.inMenu = param1; + } + + public function get chapter() : int + { + return this._ch; + } + + protected function updateSpawn() : void + { + this.spawnTop = this.calcTop(Config.SPAWN_PADDING); + if(this.spawnTop < this.despawnTop) + { + while(this.spawnTop < this.despawnTop) + { + this.spawn(this.despawnTop); + --this.despawnTop; + } + } + else if(this.spawnTop - this.despawnTop > Config.DESPAWN_PADDING) + { + this.despawnTop = this.spawnTop - Config.DESPAWN_PADDING; + } + this.spawnBottom = this.calcBottom(Config.SPAWN_PADDING); + if(this.spawnBottom > this.despawnBottom) + { + while(this.spawnBottom > this.despawnBottom) + { + this.spawn(this.despawnBottom); + ++this.despawnBottom; + } + this.despawnBottom = this.spawnBottom; + } + else if(this.despawnBottom - this.spawnBottom > Config.DESPAWN_PADDING) + { + this.despawnBottom = this.spawnBottom + Config.DESPAWN_PADDING; + } + } + + override public function update() : void + { + var p9:Profiler; + var p7:Profiler; + var message:StoryDialog = null; + var enemy:Enemy = null; + Mouse.hide(); + FlxG.mouse.show(); + Data.time += FlxG.elapsed; + Data.ctime += FlxG.elapsed; + this.updateSpawn(); + FlxG.worldBounds.x = FlxG.camera.scroll.x; + FlxG.worldBounds.y = FlxG.camera.scroll.y - (this is HorizontalMode ? 0 : (Config.SPAWN_PADDING + Config.DESPAWN_PADDING) * Config.BLOCK_SIZE); + if(Data.hp > 0 && (FlxG.keys.justPressed("ESCAPE") || FlxG.keys.justPressed("P") || FlxG.keys.justPressed("TAB")) && !this._menu.inConfirmation && !this._menu.inOptions) + { + this._menu.fade(!this.inMenu); + } + if(Data.hp > 0 && FlxG.keys.justPressed("M") && !this.inMenu) + { + this._menu.fade(true,3); + } + if(this._dieTimer > 0 && !(this is HorizontalMode)) + { + this._dieTimer -= FlxG.elapsed; + this.player.alpha -= FlxG.elapsed; + if(this._dieTimer <= 0) + { + this.player.alpha = 0; + this.reset(); + } + } + this.showAchievement(); + if(this.inMenu) + { + this._menu.update(); + return; + } + this.parallax(); + this.gc(); + this.shootBullet(); + if(this.faderStatus == 1) + { + this.fader.alpha += FlxG.elapsed * 3; + if(this.fader.alpha >= 1) + { + this.fader.alpha = 1; + this.restart(); + this.faderStatus = 2; + } + return; + } + if(this.faderStatus == 2) + { + this.fader.alpha -= FlxG.elapsed * 3; + if(this.fader.alpha <= 0) + { + this.faderStatus = 0; + } + return; + } + SoundSystem.update(); + super.update(); + p9 = new Profiler("overlap2"); + FlxG.overlap(this.friendly,this.hittable,function(param1:FlxObject, param2:FlxObject):void + { + var _loc3_:FlxObject = null; + var _loc6_:Boolean = false; + var _loc7_:Boolean = false; + var _loc8_:int = 0; + var _loc9_:int = 0; + var _loc10_:int = 0; + var _loc11_:Number = NaN; + var _loc4_:Player = param1 is Player ? param1 as Player : param2 as Player; + if(_loc4_ != null) + { + _loc3_ = param1 is Player ? param2 : param1; + _loc6_ = _loc3_ is Enemy && (_loc3_ as Enemy).pierce; + if(_loc3_ is Enemy && (player.invulnerable <= 0 || _loc6_ && !player.isHit || _loc3_ is LaserBeam) && (!player.shielded || _loc6_)) + { + if(player.invulnerable <= 0) + { + if(_loc3_.x > player.x) + { + player.velocity.x = -160 + Data.recover * 5; + } + else + { + player.velocity.x = 160 - Data.recover * 5; + } + --player.y; + if(_loc3_ is LaserBeam && ((_loc3_ as LaserBeam).face == 1 || (_loc3_ as LaserBeam).face == 3)) + { + if(player.y < _loc3_.y - 4) + { + player.velocity.y = -300; + player.velocity.x = 0; + } + else + { + player.velocity.y = 100; + player.velocity.x = 0; + } + } + else + { + player.velocity.y = -40; + } + } + if(Data.state is TadpoleMode) + { + (Data.state as TadpoleMode).predie(); + } + _loc7_ = true; + if(_loc3_ is LaserBeam && player.invulnerable > 0) + { + _loc7_ = false; + } + player.hit((_loc3_ as Enemy).level,_loc6_,_loc7_); + if(_loc3_ is Seed) + { + _loc3_.exists = false; + _loc3_.alive = false; + } + return; + } + if(_loc3_ is Diamond) + { + Data.diamonds += (_loc3_ as Diamond).value; + Data.totaldiamonds += (_loc3_ as Diamond).value; + AchievementSystem.diamonds(); + cdiamonds += (_loc3_ as Diamond).value; + (_loc3_ as Diamond).despawn(); + _loc3_.kill(); + ArcParticleSystem.emit(Data.state.particles,(_loc3_ as Diamond).diamondColor,_loc3_.x + _loc3_.width / 2,_loc3_.y + _loc3_.width / 2,3,1,0.5,0,-30,30,-30,30); + switch(ArcU.rand(1,5)) + { + case 1: + SoundSystem.play(Sound.DIAMOND1); + break; + case 2: + SoundSystem.play(Sound.DIAMOND2); + break; + case 3: + SoundSystem.play(Sound.DIAMOND3); + break; + case 4: + SoundSystem.play(Sound.DIAMOND4); + break; + case 5: + SoundSystem.play(Sound.DIAMOND5); + } + return; + } + if(_loc3_ is Powerup) + { + (_loc3_ as Powerup).activate(); + } + } + var _loc5_:Bullet = param1 is Bullet ? param1 as Bullet : param2 as Bullet; + if(_loc5_ != null) + { + _loc3_ = param1 is Bullet ? param2 : param1; + if(_loc3_ is Enemy && !(_loc3_ as Enemy).killable && !(_loc3_ is LaserBeam) && !(_loc3_ is Seed) && (_loc3_ as FlxSprite).alpha == 1) + { + SoundSystem.play(Sound.PLINK,0.1); + } + if(_loc3_ is Enemy && (_loc3_ as Enemy).killable) + { + if(_loc5_ is BulletRebound && Data.reboundgun[Gun.SPECIAL_TWO] == 1) + { + _loc5_.setCollider(_loc3_); + if((_loc5_ as BulletRebound).solidTimer <= 0) + { + _loc5_.kill(); + } + } + else + { + _loc5_.kill(); + } + if(_loc5_ is BulletRebound) + { + if(_loc3_ == (_loc5_ as BulletRebound).lastEnemy) + { + return; + } + (_loc5_ as BulletRebound).lastEnemy = _loc3_ as Enemy; + } + if(_loc5_ is Missile) + { + (_loc3_ as Enemy).hit(_loc5_.velocity.x > 0 ? int(FlxObject.RIGHT) : int(FlxObject.LEFT)); + if(Data.missilegun[Gun.SPECIAL_TWO] == 1) + { + _loc9_ = _loc5_.getMidpoint().x; + _loc10_ = _loc5_.getMidpoint().y; + _loc11_ = 0.3926; + while(_loc11_ < 6.28318) + { + Data.state.bullets.add(BulletFactory.create(_loc9_,_loc10_,Gun.REBOUNDER_SPEED,_loc11_,BulletFragment)); + _loc11_ += 0.78539; + } + } + } + _loc8_ = _loc5_.damage; + if(_loc5_ is BulletPrime && Data.primegun[Gun.SPECIAL_ONE] == 1 && ArcU.rand(1,10) <= 3) + { + _loc8_ *= 1.5; + ArcParticleSystem.emit(Data.state.particles,Color.WHITE,_loc5_.x,_loc5_.y,5,1,1,0,-100,100,-100,100,_loc5_.width,_loc5_.height); + } + (_loc3_ as Enemy).damage(_loc8_,_loc5_); + } + else if(_loc3_ is Seed && _loc5_ is Missile && Data.missilegun[Gun.SPECIAL_ONE] == 1) + { + _loc3_.exists = false; + _loc3_.alive = false; + } + else if(_loc3_ is LaserBeam) + { + _loc5_.mark(0.01); + } + else if(_loc3_ is Pot) + { + ArcParticleSystem.emit(Data.state.particles,"pot",_loc3_.x,_loc3_.y,10,1,5,400,-50,50,-100,-40,_loc3_.width,_loc3_.height); + _loc3_.kill(); + _loc5_.kill(); + } + else if(_loc3_ is WoodenCrate) + { + ArcParticleSystem.emit(Data.state.particles,"wooden_crate",_loc3_.x,_loc3_.y,10,1,5,400,-100,100,-100,-40,_loc3_.width,_loc3_.height); + _loc3_.kill(); + _loc5_.kill(); + } + else if(_loc3_ is SteelCrate) + { + if(_loc5_ is Missile) + { + ArcParticleSystem.emit(Data.state.particles,"steel_crate",_loc3_.x,_loc3_.y,10,1,5,800,-100,100,-200,-80,_loc3_.width,_loc3_.height); + _loc3_.kill(); + } + _loc5_.setCollider(_loc3_); + _loc5_.kill(); + } + else if(_loc3_ is BossDoor) + { + _loc5_.kill(); + } + else if(_loc3_ is Blade && _loc5_ is Missile) + { + _loc3_.kill(); + _loc5_.kill(); + } + } + }); + p9.end(); + p7 = new Profiler("collide"); + FlxG.collide(this.entities,this.colliders,function(param1:FlxObject, param2:FlxObject):void + { + var _loc4_:FlxObject = null; + var _loc5_:int = 0; + var _loc6_:int = 0; + var _loc7_:Number = NaN; + var _loc3_:Bullet = param1 is Bullet ? param1 as Bullet : param2 as Bullet; + if(_loc3_ != null) + { + _loc4_ = param1 is Bullet ? param2 : param1; + if(_loc4_ is FlxTilemap) + { + if(_loc3_ is Missile && Data.missilegun[Gun.SPECIAL_TWO] == 1) + { + _loc5_ = _loc3_.getMidpoint().x; + _loc6_ = _loc3_.getMidpoint().y; + _loc7_ = 0.3926; + while(_loc7_ < 6.28318) + { + Data.state.bullets.add(BulletFactory.create(_loc5_,_loc6_,Gun.REBOUNDER_SPEED,_loc7_,BulletFragment)); + _loc7_ += 0.78539; + } + } + _loc3_.setCollider(_loc4_); + _loc3_.kill(); + } + return; + } + if(Data.state is TadpoleMode && (param1 is Player || param2 is Player)) + { + (Data.state as TadpoleMode).predie(); + } + if(param1 is Entity) + { + (param1 as Entity).handleCollision(param2); + } + else if(param2 is Entity) + { + (param2 as Entity).handleCollision(param1); + } + }); + p7.end(); + if(FlxG.keys.justPressed("F") && Boolean(Data.autofirer)) + { + Data.autofire = !Data.autofire; + } + if(ArcU.rand(1,50) == 2) + { + } + if(FlxG.keys.justPressed("ONE") && Data.prime == 1) + { + Data.gun = this.player.gun = Gun.PRIME; + this.ui.showGuns(); + } + else if(FlxG.keys.justPressed("TWO") && Data.spreader == 1) + { + Data.gun = this.player.gun = Gun.SPREADER; + this.ui.showGuns(); + } + else if(FlxG.keys.justPressed("THREE") && Data.missile == 1) + { + Data.gun = this.player.gun = Gun.MISSILE; + this.ui.showGuns(); + } + else if(FlxG.keys.justPressed("FOUR") && Data.rebound == 1) + { + Data.gun = this.player.gun = Gun.REBOUNDER; + this.ui.showGuns(); + } + if(FlxG.mouse.wheel < 0 || FlxG.keys.justPressed("E")) + { + switch(Data.gun) + { + case Gun.PRIME: + if(Data.spreader == 1) + { + Data.gun = this.player.gun = Gun.SPREADER; + this.ui.showGuns(); + } + break; + case Gun.SPREADER: + if(Data.missile == 1) + { + Data.gun = this.player.gun = Gun.MISSILE; + this.ui.showGuns(); + } + else + { + Data.gun = this.player.gun = Gun.PRIME; + this.ui.showGuns(); + } + break; + case Gun.MISSILE: + if(Data.rebound == 1) + { + Data.gun = this.player.gun = Gun.REBOUNDER; + this.ui.showGuns(); + } + else + { + Data.gun = this.player.gun = Gun.PRIME; + this.ui.showGuns(); + } + break; + case Gun.REBOUNDER: + if(Data.prime == 1) + { + Data.gun = this.player.gun = Gun.PRIME; + this.ui.showGuns(); + } + } + } + else if(FlxG.mouse.wheel > 0 || FlxG.keys.justPressed("Q")) + { + switch(Data.gun) + { + case Gun.PRIME: + if(Data.rebound == 1) + { + Data.gun = this.player.gun = Gun.REBOUNDER; + this.ui.showGuns(); + } + else if(Data.missile == 1) + { + Data.gun = this.player.gun = Gun.MISSILE; + this.ui.showGuns(); + } + else if(Data.spreader == 1) + { + Data.gun = this.player.gun = Gun.SPREADER; + this.ui.showGuns(); + } + break; + case Gun.SPREADER: + if(Data.prime == 1) + { + Data.gun = this.player.gun = Gun.PRIME; + this.ui.showGuns(); + } + break; + case Gun.MISSILE: + if(Data.spreader == 1) + { + Data.gun = this.player.gun = Gun.SPREADER; + this.ui.showGuns(); + } + break; + case Gun.REBOUNDER: + if(Data.missile == 1) + { + Data.gun = this.player.gun = Gun.MISSILE; + this.ui.showGuns(); + } + } + } + if(this.boss == 1) + { + FlxG.camera.scroll.y -= FlxG.elapsed * 50; + if(FlxG.camera.scroll.y <= 0) + { + FlxG.camera.scroll.y = 0; + this.boss = 2; + for each(enemy in this.enemies.members) + { + if(!(enemy is Boss || enemy.bossenemy || enemy is Spike)) + { + enemy.silentKill(); + } + } + } + } + for each(message in this.messages) + { + message.activate(this.player.x,this.player.y); + } + } + + protected function parallax() : void + { + var _loc1_:ArcSprite = null; + var _loc2_:int = 0; + for each(_loc1_ in [this.bg1,this.bg2,this.bg3]) + { + _loc2_ = _loc1_.getScreenXY().y; + if(_loc2_ < -420) + { + _loc1_.y = FlxG.camera.scroll.y * _loc1_.scrollFactor.y + (_loc2_ > 0 && _loc2_ < 1000 ? _loc2_ : 0); + } + else if(_loc2_ > 0) + { + _loc1_.y = FlxG.camera.scroll.y * _loc1_.scrollFactor.y - 420 + (_loc2_ > 0 && _loc2_ < 1000 ? _loc2_ : 0); + } + } + } + + protected function showAchievement() : void + { + var _loc1_:AchievementWindow = AchievementSystem.achievementWindow; + if(_loc1_ != null) + { + _loc1_.update(); + _loc1_.timer -= FlxG.elapsed; + if(_loc1_.timer < 0) + { + _loc1_.alpha = 1 + _loc1_.timer; + if(_loc1_.alpha <= 0) + { + AchievementSystem.achievementWindow = null; + } + } + } + } + + public function toggleMenu() : void + { + this._menu.fade(!this.inMenu); + } + + protected function gc() : void + { + this._garbage -= FlxG.elapsed; + if(this._garbage <= 0) + { + this.garbageCollect(this.underblocks); + this.garbageCollect(this.overblocks); + this.garbageCollect(this.bullets); + this.garbageCollect(this.enemies); + this.garbageCollect(this.diamonds); + this.garbageCollect(this.particles); + this.garbageCollect(this.healthbars); + this._garbage = 5; + } + } + + protected function shootBullet() : void + { + var _loc2_:Number = NaN; + var _loc3_:Bullet = null; + var _loc4_:Bullet = null; + var _loc5_:Bullet = null; + if(Data.hp <= 0 || Data.state.xraying) + { + return; + } + this.bulletTimer -= FlxG.elapsed; + var _loc1_:Boolean = (Data.control == Data.CONTROL_MOUSE && (Data.autofire || FlxG.mouse.pressed()) || Data.control == Data.CONTROL_KEYBOARD && (Data.autofire || FlxG.keys.LEFT || FlxG.keys.RIGHT || FlxG.keys.UP || FlxG.keys.DOWN) || Data.control == Data.CONTROL_KEYBOARDI && (Data.autofire || FlxG.keys.A || FlxG.keys.D || FlxG.keys.W || FlxG.keys.S)) && this.bulletTimer <= 0 && this.player.controllable && Data.prime == 1; + if(_loc1_) + { + if(Data.control == Data.CONTROL_MOUSE) + { + _loc2_ = Math.atan2(FlxG.mouse.y - (this.player.y + this.player.height / 2),FlxG.mouse.x - (this.player.x + this.player.width / 2)); + } + else if(Data.control == Data.CONTROL_KEYBOARD) + { + if(FlxG.keys.LEFT && FlxG.keys.UP) + { + _loc2_ = 5 * Math.PI / 4; + } + else if(FlxG.keys.LEFT && FlxG.keys.DOWN) + { + _loc2_ = 3 * Math.PI / 4; + } + else if(FlxG.keys.LEFT) + { + _loc2_ = 4 * Math.PI / 4; + } + else if(FlxG.keys.RIGHT && FlxG.keys.UP) + { + _loc2_ = 7 * Math.PI / 4; + } + else if(FlxG.keys.RIGHT && FlxG.keys.DOWN) + { + _loc2_ = 1 * Math.PI / 4; + } + else if(FlxG.keys.RIGHT) + { + _loc2_ = 0; + } + else if(FlxG.keys.DOWN) + { + _loc2_ = 2 * Math.PI / 4; + } + else if(FlxG.keys.UP) + { + _loc2_ = 6 * Math.PI / 4; + } + else if(this.player.facing == FlxObject.LEFT) + { + _loc2_ = 4 * Math.PI / 4; + } + else if(this.player.facing == FlxObject.RIGHT) + { + _loc2_ = 0; + } + } + else if(Data.control == Data.CONTROL_KEYBOARDI) + { + if(FlxG.keys.A && FlxG.keys.W) + { + _loc2_ = 5 * Math.PI / 4; + } + else if(FlxG.keys.A && FlxG.keys.S) + { + _loc2_ = 3 * Math.PI / 4; + } + else if(FlxG.keys.A) + { + _loc2_ = 4 * Math.PI / 4; + } + else if(FlxG.keys.D && FlxG.keys.W) + { + _loc2_ = 7 * Math.PI / 4; + } + else if(FlxG.keys.D && FlxG.keys.S) + { + _loc2_ = 1 * Math.PI / 4; + } + else if(FlxG.keys.D) + { + _loc2_ = 0; + } + else if(FlxG.keys.S) + { + _loc2_ = 2 * Math.PI / 4; + } + else if(FlxG.keys.W) + { + _loc2_ = 6 * Math.PI / 4; + } + else if(this.player.facing == FlxObject.LEFT) + { + _loc2_ = 4 * Math.PI / 4; + } + else if(this.player.facing == FlxObject.RIGHT) + { + _loc2_ = 0; + } + } + } + if(this.player.gun == Gun.PRIME && _loc1_ && Data.prime == 1) + { + this.bulletTimer = Gun.PRIME_DELAY[Data.primegun[1]]; + if(Data.primegun[Gun.SPECIAL_TWO] == 1) + { + this.bullets.add(BulletFactory.create(this.player.x + this.player.width / 2,this.player.y + this.player.height / 2,Gun.PRIME_SPEED,_loc2_,BulletPrime).shift(0.008)); + this.bullets.add(BulletFactory.create(this.player.x + this.player.width / 2,this.player.y + this.player.height / 2,Gun.PRIME_SPEED,_loc2_,BulletPrime).shift(0.008,-1)); + } + else + { + this.bullets.add(BulletFactory.create(this.player.x + this.player.width / 2,this.player.y + this.player.height / 2,Gun.PRIME_SPEED,_loc2_,BulletPrime)); + } + } + else if(this.player.gun == Gun.SPREADER && _loc1_) + { + this.bulletTimer = Gun.SPREADER_DELAY[Data.spreadergun[1]]; + if(Data.spreadergun[Gun.SPECIAL_TWO] == 1) + { + _loc3_ = BulletFactory.create(this.player.x + this.player.width / 2,this.player.y + this.player.height / 2,Gun.SPREADER_SPEED,_loc2_,BulletSpreader); + (_loc3_ as BulletSpreader).green(); + this.bullets.add(_loc3_); + } + else + { + this.bullets.add(BulletFactory.create(this.player.x + this.player.width / 2,this.player.y + this.player.height / 2,Gun.SPREADER_SPEED,_loc2_,BulletSpreader)); + } + this.bullets.add(BulletFactory.create(this.player.x + this.player.width / 2,this.player.y + this.player.height / 2,Gun.SPREADER_SPEED,_loc2_ + 0.15,BulletSpreader)); + this.bullets.add(BulletFactory.create(this.player.x + this.player.width / 2,this.player.y + this.player.height / 2,Gun.SPREADER_SPEED,_loc2_ - 0.15,BulletSpreader)); + if(Data.spreadergun[Gun.SPECIAL_ONE] == 1) + { + this.bullets.add(BulletFactory.create(this.player.x + this.player.width / 2,this.player.y + this.player.height / 2,Gun.SPREADER_SPEED,_loc2_ + 0.3,BulletSpreader)); + this.bullets.add(BulletFactory.create(this.player.x + this.player.width / 2,this.player.y + this.player.height / 2,Gun.SPREADER_SPEED,_loc2_ - 0.3,BulletSpreader)); + } + } + else if(this.player.gun == Gun.REBOUNDER && _loc1_) + { + this.bulletTimer = Gun.REBOUND_DELAY[Data.reboundgun[1]]; + _loc4_ = BulletFactory.create(this.player.x,this.player.y + 4,Gun.REBOUNDER_SPEED,_loc2_,BulletRebound); + this.bullets.add(_loc4_); + } + else if(this.player.gun == Gun.MISSILE && _loc1_) + { + this.bulletTimer = Gun.MISSILE_DELAY[Data.missilegun[1]]; + _loc5_ = BulletFactory.create(this.player.x,this.player.y + 4,Gun.MISSILE_SPEED,_loc2_,Missile); + this.bullets.add(_loc5_); + } + if(_loc1_) + { + SoundSystem.play(Sound.SHOOT_SMALL,0.3); + } + } + + public function addDiamonds(param1:int, param2:int, param3:int, param4:int = -1) : void + { + var _loc8_:int = 0; + var _loc9_:int = 0; + var _loc10_:int = 0; + var _loc11_:int = 0; + var _loc12_:* = 0; + var _loc13_:int = 0; + var _loc14_:Diamond = null; + var _loc5_:int = ArcU.rand(3,8); + var _loc6_:int = param3; + var _loc7_:Array = []; + if(param4 == -1) + { + loop1: + while(_loc6_ > 0) + { + if(_loc7_.length < _loc5_) + { + _loc7_.push(DIAMOND_VALUES[0]); + _loc6_ -= DIAMOND_VALUES[0]; + } + else + { + _loc9_ = ArcU.rand(0,_loc7_.length - 1); + _loc10_ = int(_loc7_[_loc9_]); + _loc11_ = 0; + _loc12_ = 0; + while(_loc11_ <= _loc10_) + { + if(_loc12_ >= DIAMOND_VALUES.length) + { + _loc7_[_loc9_] = _loc11_; + break loop1; + } + _loc11_ = int(DIAMOND_VALUES[_loc12_++]); + } + _loc7_[_loc9_] = _loc11_; + _loc6_ = _loc6_ + _loc10_ - _loc11_; + } + } + } + else + { + _loc13_ = 0; + while(_loc13_ < _loc6_) + { + _loc7_.push(10); + _loc13_++; + } + } + for each(_loc8_ in _loc7_) + { + _loc14_ = new Diamond(param1,param2,_loc8_); + if(ArcU.rand(0,1) == 1) + { + _loc14_.velocity.x = ArcU.rand(-50,-20); + } + else + { + _loc14_.velocity.x = ArcU.rand(20,50); + } + _loc14_.velocity.y = ArcU.rand(-100,-50); + _loc14_.drag.x = _loc14_.drag.y = 60; + _loc14_.acceleration.y = 400; + _loc14_.pullDelay = 0.3; + _loc14_.solid = true; + this.diamonds.add(_loc14_); + } + } + + public function createHeart(param1:int, param2:int) : void + { + if(this is TadpoleMode) + { + return; + } + var _loc3_:int = ArcU.rand(1,100); + if(this is StoryMode && _loc3_ < 20 || this is EscapeMode && _loc3_ < 75) + { + return; + } + var _loc4_:Powerup = new PowerupHeart(param1 / Config.BLOCK_SIZE,param2 / Config.BLOCK_SIZE); + this.powerups.add(_loc4_); + } + + public function die() : void + { + } + + public function despawn(param1:int, param2:int) : void + { + this.pixels.setPixel(param1,param2,16777215); + } + + public function checkpoint() : void + { + var _loc1_:StoryDialog = null; + this.mpixels = this.pixels.clone(); + for each(_loc1_ in this.messages) + { + _loc1_.save(); + } + } + + public function complete() : void + { + } + + public function setBoss(param1:int) : void + { + } + + protected function getLayerTile(param1:int, param2:int, param3:Boolean = false) : uint + { + var _loc6_:uint = 0; + var _loc4_:uint = this.pixels.getPixel(param1,param2); + var _loc5_:uint = this.overpixels.getPixel(param1,param2); + for each(_loc6_ in this.tiles) + { + if(_loc4_ == _loc6_ || _loc5_ == _loc6_) + { + return _loc6_; + } + } + if(param3) + { + for each(_loc6_ in this.objectTiles) + { + if(_loc4_ == _loc6_ || _loc5_ == _loc6_) + { + return _loc6_; + } + } + } + return 0; + } + + protected function markRedDiamond(param1:int, param2:int) : void + { + this._redLocations[param1 + "-" + param2] = this._red++; + } + + protected function colorToTileID(param1:uint, param2:int, param3:int, param4:Boolean = false) : int + { + var _loc50_:Boolean = false; + var _loc51_:Boolean = false; + var _loc5_:int = 0; + if(!param4 && this.isTile(this.overpixels.getPixel(param2,param3)) != 0) + { + return 0; + } + var _loc6_:uint = this.getLayerTile(param2,param3 - 1); + var _loc7_:uint = this.getLayerTile(param2 + 1,param3); + var _loc8_:uint = this.getLayerTile(param2,param3 + 1); + var _loc9_:uint = this.getLayerTile(param2 - 1,param3); + var _loc10_:uint = this.getLayerTile(param2 + 1,param3 + 1); + var _loc11_:uint = this.getLayerTile(param2 - 1,param3 + 1); + var _loc12_:uint = this.getLayerTile(param2 + 1,param3 - 1); + var _loc13_:uint = this.getLayerTile(param2 - 1,param3 - 1); + var _loc14_:Boolean = _loc9_ != 0 || param2 == 0; + var _loc15_:Boolean = _loc7_ != 0 || param2 == Config.BLOCK_WIDTH - 1; + var _loc16_:Boolean = _loc6_ != 0; + var _loc17_:Boolean = _loc8_ != 0 || param3 == this.pixels.height - 1; + var _loc18_:Boolean = _loc10_ != 0 || param3 == this.pixels.height - 1 || param2 == Config.BLOCK_WIDTH - 1; + var _loc19_:Boolean = _loc11_ != 0 || param3 == this.pixels.height - 1 || param2 == 0; + var _loc20_:Boolean = _loc9_ == this.WATER; + var _loc21_:Boolean = _loc7_ == this.WATER; + var _loc22_:Boolean = _loc13_ == this.WATER; + var _loc23_:Boolean = _loc12_ == this.WATER; + var _loc24_:Boolean = _loc11_ == this.WATER; + var _loc25_:Boolean = _loc10_ == this.WATER; + var _loc26_:Boolean = _loc8_ == this.WATER; + var _loc27_:Boolean = _loc8_ == this.WATER; + var _loc28_:Boolean = _loc9_ == this.LAVA; + var _loc29_:Boolean = _loc7_ == this.LAVA; + var _loc30_:Boolean = _loc13_ == this.LAVA; + var _loc31_:Boolean = _loc12_ == this.LAVA; + var _loc32_:Boolean = _loc11_ == this.LAVA; + var _loc33_:Boolean = _loc10_ == this.LAVA; + var _loc34_:Boolean = _loc8_ == this.LAVA; + var _loc35_:Boolean = _loc8_ == this.LAVA; + var _loc36_:Boolean = _loc20_ || _loc28_; + var _loc37_:Boolean = _loc21_ || _loc29_; + var _loc38_:Boolean = _loc22_ || _loc30_; + var _loc39_:Boolean = _loc23_ || _loc31_; + var _loc40_:Boolean = _loc24_ || _loc32_; + var _loc41_:Boolean = _loc25_ || _loc33_; + var _loc42_:Boolean = _loc26_ || _loc34_; + var _loc43_:Boolean = _loc27_ || _loc35_; + var _loc44_:Boolean = _loc14_ && !_loc36_; + var _loc45_:Boolean = _loc15_ && !_loc37_; + var _loc46_:Boolean = _loc16_ && !_loc43_; + var _loc47_:Boolean = _loc17_ && !_loc42_; + var _loc48_:Boolean = _loc19_ && !_loc40_; + var _loc49_:Boolean = _loc18_ && !_loc41_; + switch(param1) + { + case this.DIRT: + if(_loc44_ && _loc45_ && _loc47_ && _loc48_ && _loc49_) + { + if(_loc9_ == this.GRASS) + { + _loc5_ = 132; + } + else if(_loc7_ == this.GRASS) + { + _loc5_ = 133; + } + else if(_loc9_ == this.GRASS2) + { + _loc5_ = 134; + } + else if(_loc7_ == this.GRASS2) + { + _loc5_ = 135; + } + else + { + _loc5_ = ArcU.rand(88 + 48,95 + 48 + 16); + } + } + else if(_loc44_ && _loc45_ && _loc47_ && _loc48_ && _loc41_) + { + if(_loc25_) + { + _loc5_ = 101; + } + else if(_loc33_) + { + _loc5_ = 103; + } + } + else if(_loc44_ && _loc45_ && _loc47_ && _loc49_ && _loc40_) + { + if(_loc24_) + { + _loc5_ = 100; + } + else if(_loc32_) + { + _loc5_ = 102; + } + } + else if(_loc44_ && _loc45_ && _loc47_ && _loc19_ && !_loc18_) + { + if(_loc21_) + { + _loc5_ = 117; + } + else if(_loc29_) + { + _loc5_ = 119; + } + else + { + _loc5_ = 86; + } + } + else if(_loc44_ && _loc45_ && _loc47_ && !_loc19_ && _loc18_) + { + if(_loc20_) + { + _loc5_ = 116; + } + else if(_loc28_) + { + _loc5_ = 118; + } + else + { + _loc5_ = 85; + } + } + else if(_loc44_ && _loc47_) + { + if(_loc21_) + { + if(_loc23_) + { + _loc5_ = 117; + } + else + { + _loc5_ = 129; + } + } + else if(_loc29_) + { + if(_loc31_) + { + _loc5_ = 119; + } + else + { + _loc5_ = 131; + } + } + else + { + _loc5_ = 87; + } + } + else if(_loc45_ && _loc47_) + { + if(_loc20_) + { + if(_loc22_) + { + _loc5_ = 116; + } + else + { + _loc5_ = 128; + } + } + else if(_loc28_) + { + if(_loc30_) + { + _loc5_ = 118; + } + else + { + _loc5_ = 130; + } + } + else + { + _loc5_ = 84; + } + } + else if(_loc44_ && _loc45_) + { + if(_loc26_) + { + _loc5_ = ArcU.rand(21,22); + } + else if(_loc34_) + { + _loc5_ = ArcU.rand(25,26); + } + else + { + _loc5_ = ArcU.rand(5,6); + } + } + else if(_loc44_) + { + if(_loc26_) + { + _loc5_ = 23; + } + else if(_loc34_) + { + _loc5_ = 27; + } + else + { + _loc5_ = 7; + } + } + else if(_loc45_) + { + if(_loc26_) + { + _loc5_ = 20; + } + else if(_loc34_) + { + _loc5_ = 24; + } + else + { + _loc5_ = 4; + } + } + break; + case this.GRASS: + if(_loc14_ && _loc15_ && !_loc36_ && !_loc37_) + { + _loc5_ = ArcU.rand(81,82); + } + else if(_loc14_ && !_loc36_) + { + if(_loc23_) + { + _loc5_ = 109; + } + else if(_loc31_) + { + _loc5_ = 111; + } + else if(_loc21_) + { + _loc5_ = 113; + } + else if(_loc29_) + { + _loc5_ = 115; + } + else + { + _loc5_ = 83; + } + } + else if(_loc22_) + { + _loc5_ = 108; + } + else if(_loc30_) + { + _loc5_ = 110; + } + else if(_loc20_) + { + _loc5_ = 112; + } + else if(_loc28_) + { + _loc5_ = 114; + } + else + { + _loc5_ = 80; + } + break; + case this.GRASS2: + if(_loc14_ && _loc15_ && !_loc36_ && !_loc37_) + { + _loc5_ = ArcU.rand(97,98); + } + else if(_loc14_ && !_loc36_) + { + if(_loc23_) + { + _loc5_ = 109 + 12; + } + else if(_loc31_) + { + _loc5_ = 111 + 12; + } + else if(_loc21_) + { + _loc5_ = 113 + 12; + } + else if(_loc29_) + { + _loc5_ = 115 + 12; + } + else + { + _loc5_ = 99; + } + } + else if(_loc22_) + { + _loc5_ = 108 + 12; + } + else if(_loc30_) + { + _loc5_ = 110 + 12; + } + else if(_loc20_) + { + _loc5_ = 112 + 12; + } + else if(_loc28_) + { + _loc5_ = 114 + 12; + } + else + { + _loc5_ = 96; + } + break; + case this.WATER: + _loc50_ = this.overpixels.getPixel(param2,param3 - 1) == 16777215; + if((_loc50_) && this.pixels.getPixel(param2,param3 - 1) != this.DIRT) + { + _loc5_ = 8; + } + else + { + _loc5_ = 12; + } + break; + case this.LAVA: + _loc51_ = this.overpixels.getPixel(param2,param3 - 1) == 16777215; + if((_loc51_) && this.pixels.getPixel(param2,param3 - 1) != this.DIRT) + { + _loc5_ = 9; + } + else + { + _loc5_ = 13; + } + break; + case this.WOODEN_CRATE: + _loc5_ = 52; + break; + case this.STEEL_CRATE: + _loc5_ = 53; + break; + default: + _loc5_ = 0; + } + if(this.pixels.getPixel(param2,param3) == 16777215 && _loc5_ == 0 && !param4 && (_loc8_ == this.DIRT || _loc8_ == this.GRASS)) + { + --this.objectCounter; + if(this.objectCounter <= 0 && _loc11_ != 0 && _loc10_ != 0) + { + _loc5_ = ArcU.rand(68,75); + this.objectCounter = ArcU.rand(5,11); + } + } + return _loc5_; + } + + protected function isTile(param1:uint) : Boolean + { + return param1 == this.GRASS || param1 == this.DIRT; + } + + protected function addMessages(param1:int) : void + { + switch(param1) + { + case 1: + if(Data.prime == 0) + { + this.messages.push(new StoryDialog(15,355,20,20,Avatar.SAGA,"Hey kid, over here to the left! Help me out here!",true)); + } + this.messages.push(new StoryDialog(23,345,3,3,Avatar.SAGA,"I was built by The Professor to help him protect this cave. He tossed me down here when I refused to continue my duty.")); + this.messages.push(new StoryDialog(26,330,1,1,Avatar.SAGA,"That crystal was a Matrix Distortion Time Crystal. You\'ll find that if anything happens to you, you\'ll be able to safely return to that spot. It also fully heals you when you touch it. Think of it as a checkpoint.")); + this.messages.push(new StoryDialog(15,135,3,3,Avatar.SAGA,"It\'s no wonder the monsters are drawn to these diamonds. Their power should be able to enhance my abilities.")); + this.messages.push(new StoryDialog(10,204,3,3,Avatar.SAGA,"Be on the lookout for hidden areas carved into the cave by the monsters. They like to hoard the treasures they find in the areas so the other monsters won\'t steal them.")); + this.messages.push(new StoryDialog(20,204,3,3,Avatar.SAGA,"Those heart crystals were created by The Professor by condensing diamonds under a heated laser. Be on the look out for them as they will enhance your vitality.")); + this.messages.push(new StoryDialog(20,204,3,3,Avatar.SAGA,"Be careful, I sense a strong presence ahead.")); + break; + case 2: + this.messages.push(new StoryDialog(15,300,3,3,Avatar.PROFESSOR,"Why do you bother trying to escape? You\'re so far underground you\'ll never again see the light of day.")); + this.messages.push(new StoryDialog(20,220,3,3,Avatar.SAGA,"You don\'t remember how you got down here? When dealing with The Professor there\'s rarely a reason for anything.")); + this.messages.push(new StoryDialog(20,140,3,3,Avatar.PROFESSOR,"The silly gun is right. You\'re only here because you happened to wander into my path. And now you\'ll die down in that cave like everyone else who has laid eyes on my experiments.")); + this.messages.push(new StoryDialog(20,80,3,3,Avatar.SAGA,"We\'re making good progress. Be on the look out for more extension chips to boost my power. We\'re going to need all the help we can get the closer to the surface we climb.")); + break; + case 3: + this.messages.push(new StoryDialog(14,160,20,3,Avatar.SAGA,"These monsters are the result of The Professor\'s terrible experiments. While they may look cute on the outside, don\'t be fooled.")); + this.messages.push(new StoryDialog(15,270,20,3,Avatar.SAGA,"As we climb higher, you\'ll find we must pass through a variety of environments, each one a test from The Professor to see how his mutants react.")); + break; + case 4: + this.messages.push(new StoryDialog(14,250,20,3,Avatar.PROFESSOR,"You\'re a persistent little one, aren\'t you?")); + this.messages.push(new StoryDialog(14,100,20,3,Avatar.PROFESSOR,"Why don\'t you give up while you\'re ahead? Starvation is a much better death than what awaits you ahead.")); + break; + case 5: + this.messages.push(new StoryDialog(14,300,20,3,Avatar.SAGA,"I can\'t wait to see The Professor\'s face when we show up at his laboratory.")); + this.messages.push(new StoryDialog(14,300,20,3,Avatar.PROFESSOR,"You\'ll never make it here alive you worthless gun.")); + break; + case 6: + this.messages.push(new StoryDialog(14,355,20,19,Avatar.SAGA,"To be honest, the reason The Professor left me down there was because I refused to kill any more humans. I\'m glad you didn\'t come along sooner or you might have been another victim of my ruthless killing.")); + this.messages.push(new StoryDialog(14,300,20,3,Avatar.SAGA,"Don\'t think I won\'t help you defeat these mutants though. These abominations are simply The Professor\'s experiments.")); + this.messages.push(new StoryDialog(14,180,20,3,Avatar.SAGA,"I wonder what an existence without violence would be like. I can\'t wait to get out of this cave and start my new life.")); + break; + case 7: + this.messages.push(new StoryDialog(14,630,20,20,Avatar.PROFESSOR,"Eh heh heh... I\'ve got you right where I want you.")); + this.messages.push(new StoryDialog(14,630,20,20,Avatar.SAGA,"Don\'t be afraid. He never expected us to make it this far and he\'s running out of plans.")); + this.messages.push(new StoryDialog(14,400,20,10,Avatar.SAGA,"Don\'t give up, we\'re almost there. I can see the light of our new lives already...")); + this.messages.push(new StoryDialog(14,200,20,10,Avatar.SAGA,"Almost there...")); + } + } + + public function get level() : int + { + if(this is StoryMode) + { + return (1 - this.player.y / this.tilemap.height) * 10 + 1 + (this._ch - 1) * 10; + } + return this.caveHeight / 25 + 1; + } + + protected function spawn(param1:int) : void + { + var _loc2_:Enemy = null; + var _loc3_:Powerup = null; + var _loc5_:int = 0; + var _loc8_:int = 0; + var _loc9_:int = 0; + var _loc10_:int = 0; + var _loc11_:int = 0; + var _loc12_:uint = 0; + var _loc13_:uint = 0; + var _loc14_:int = 0; + var _loc15_:Boolean = false; + var _loc16_:uint = 0; + var _loc17_:Wall = null; + var _loc18_:Wall = null; + var _loc19_:BossDoor = null; + var _loc20_:int = 0; + var _loc21_:int = 0; + var _loc22_:int = 0; + var _loc23_:FlxPoint = null; + var _loc24_:int = 0; + var _loc25_:int = 0; + var _loc26_:int = 0; + var _loc27_:Diamond = null; + var _loc28_:Checkpoint = null; + var _loc29_:int = 0; + var _loc30_:Pot = null; + var _loc4_:Boolean = false; + if(!(this is HorizontalMode) && param1 > this.pixels.height - 15 && this.spawnChance < 100) + { + return; + } + _loc5_ = this.level; + var _loc6_:int = this is HorizontalMode ? this.pixels.height : this.pixels.width; + var _loc7_:int = 0; + for(; _loc7_ < _loc6_; _loc7_++) + { + _loc8_ = this is HorizontalMode ? param1 : _loc7_; + _loc9_ = this is HorizontalMode ? _loc7_ : param1; + if(Data.state.spawner[_loc8_ + "," + _loc9_] == null) + { + _loc10_ = _loc8_ * Config.BLOCK_SIZE; + _loc11_ = _loc9_ * Config.BLOCK_SIZE; + _loc12_ = this.pixels.getPixel(_loc8_,_loc9_); + _loc13_ = this.overpixels.getPixel(_loc8_,_loc9_); + _loc14_ = this.colorToTileID(_loc13_,_loc8_,_loc9_,true); + _loc15_ = false; + if(_loc14_ > 0 && _loc13_ != this.WATER && _loc13_ != this.LAVA) + { + _loc17_ = new Wall(_loc8_ * Config.BLOCK_SIZE,_loc9_ * Config.BLOCK_SIZE,_loc14_,PlayMode["T" + this._ch],true); + this.overblocks.add(_loc17_); + _loc18_ = new Wall(_loc8_ * Config.BLOCK_SIZE,_loc9_ * Config.BLOCK_SIZE,_loc14_,PlayMode["T" + this._ch]); + _loc18_.color = 3355443; + this.underblocks.add(_loc18_); + _loc15_ = true; + } + if(ArcU.rand(1,100) <= this.spawnChance) + { + switch(_loc12_) + { + case 16711680: + _loc2_ = new Slime(_loc8_,_loc9_,_loc5_); + this.enemies.add(_loc2_); + break; + case 9699328: + _loc2_ = new BouncingSlime(_loc8_,_loc9_,_loc5_); + this.enemies.add(_loc2_); + break; + case 7340032: + _loc2_ = new ClimbingSlime(_loc8_,_loc9_,_loc5_); + this.enemies.add(_loc2_); + break; + case 7766374: + _loc2_ = new Plant(_loc8_,_loc9_,_loc5_,_loc4_ ? int(FlxObject.LEFT) : int(FlxObject.RIGHT)); + this.enemies.add(_loc2_); + break; + case 5069370: + _loc2_ = new Plant(_loc8_,_loc9_,_loc5_,_loc4_ ? int(FlxObject.RIGHT) : int(FlxObject.LEFT)); + this.enemies.add(_loc2_); + break; + case 1427036: + _loc2_ = new CeilingPlant(_loc8_,_loc9_,_loc5_); + this.enemies.add(_loc2_); + break; + case 3207347: + _loc2_ = new FloorPlant(_loc8_,_loc9_,_loc5_); + this.enemies.add(_loc2_); + break; + case 7929600: + _loc2_ = new Bird(_loc8_,_loc9_,_loc5_); + this.enemies.add(_loc2_); + break; + case 9517164: + _loc2_ = new Snail(_loc8_,_loc9_,_loc5_); + this.enemies.add(_loc2_); + break; + case 12221184: + _loc2_ = new Spider(_loc8_,_loc9_,_loc5_); + this.enemies.add(_loc2_); + break; + case 12500670: + _loc2_ = new Spike(_loc8_,_loc9_,_loc5_); + this.enemies.add(_loc2_); + break; + case 7500402: + _loc2_ = new Blade(_loc8_,_loc9_,_loc5_); + this.penemies.add(_loc2_); + break; + case 15763712: + _loc2_ = new Tadpole(_loc8_,_loc9_,_loc5_); + this.enemies.add(_loc2_); + break; + case 8750469: + _loc19_ = new BossDoor(_loc8_,_loc9_,_loc5_); + this.cobjects.add(_loc19_); + break; + case 3289650: + _loc20_ = 0; + _loc21_ = 0; + _loc22_ = 0; + if(this.isTile(this.pixels.getPixel(_loc8_,_loc9_ - 1)) != 0) + { + _loc20_ = 0; + _loc21_ = 0; + _loc22_ = 1; + } + else if(this.isTile(this.pixels.getPixel(_loc8_ + 1,_loc9_)) != 0) + { + _loc20_ = 1; + _loc21_ = -1; + _loc22_ = 0; + } + else if(this.isTile(this.pixels.getPixel(_loc8_,_loc9_ + 1)) != 0) + { + _loc20_ = 2; + _loc21_ = 0; + _loc22_ = -1; + } + else if(this.isTile(this.pixels.getPixel(_loc8_ - 1,_loc9_)) != 0) + { + _loc20_ = 3; + _loc21_ = 1; + _loc22_ = 0; + } + _loc23_ = new FlxPoint(0,0); + _loc24_ = _loc8_ + _loc21_; + _loc25_ = _loc9_ + _loc22_; + while(_loc23_.y == 0) + { + if(this.isTile(this.pixels.getPixel(_loc24_,_loc25_))) + { + _loc23_.y = _loc25_; + _loc23_.x = _loc24_; + } + else + { + _loc24_ += _loc21_; + _loc25_ += _loc22_; + } + } + _loc2_ = new Laser(_loc10_,_loc11_,1,_loc20_,_loc23_); + this.enemies.add(_loc2_); + break; + case 16763904: + _loc26_ = Diamond.valueFromLevel(_loc5_ * (this is EscapeMode ? 1 : 1) * (this is TadpoleMode ? 3 : 1)); + _loc27_ = new Diamond(_loc8_ * Config.BLOCK_SIZE + 1,_loc9_ * Config.BLOCK_SIZE + 1,ArcU.rand(1,_loc26_),_loc15_,_loc8_,_loc9_); + this.diamonds.add(_loc27_); + break; + case 16747367: + if(!(this is EscapeMode && ArcU.rand(0,99) < 50)) + { + _loc3_ = new PowerupFire(_loc8_,_loc9_); + this.powerups.add(_loc3_); + break; + } + continue; + case 6473198: + if(!(this is EscapeMode && ArcU.rand(0,99) < 30)) + { + _loc3_ = new PowerupMagnet(_loc8_,_loc9_); + this.powerups.add(_loc3_); + break; + } + continue; + case 6746111: + if(!(this is EscapeMode && ArcU.rand(0,99) < 50)) + { + _loc3_ = new PowerupShield(_loc8_,_loc9_); + this.powerups.add(_loc3_); + break; + } + continue; + case 8171970: + _loc28_ = new Checkpoint(_loc8_,_loc9_); + this.objects.add(_loc28_); + break; + case 2949120: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,0)); + break; + case 2949121: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,1)); + break; + case 2949122: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,2)); + break; + case 2949123: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,3)); + break; + case 2949124: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,4)); + break; + case 2949125: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,5)); + break; + case 2949126: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,6)); + break; + case 2949127: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,7)); + break; + case 2949128: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,8)); + break; + case 2949129: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,9)); + break; + case 2949136: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,10)); + break; + case 2949137: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,11)); + break; + case 2949138: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,12)); + break; + case 2949139: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,13)); + break; + case 2949140: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,14)); + break; + case 2949141: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,15)); + break; + case 2949142: + this.powerups.add(new HeartCrystal(_loc8_,_loc9_,16)); + break; + case 255: + if(Data.autofirer == 0) + { + this.powerups.add(new PowerupEquipment(_loc8_,_loc9_,0)); + } + break; + case 65791: + if(Data.lasersight == 0) + { + this.powerups.add(new PowerupEquipment(_loc8_,_loc9_,1)); + } + break; + case 131327: + if(Data.skyboots == 0) + { + this.powerups.add(new PowerupEquipment(_loc8_,_loc9_,2)); + } + break; + case 327935: + if(Data.moltensuit == 0) + { + this.powerups.add(new PowerupEquipment(_loc8_,_loc9_,3)); + } + break; + case 459007: + if(Data.moonboots == 0) + { + this.powerups.add(new PowerupEquipment(_loc8_,_loc9_,4)); + } + break; + case 590079: + if(Data.prime == 0) + { + this.powerups.add(new PowerupEquipment(_loc8_,_loc9_,5)); + } + break; + case 196863: + if(Data.spreader == 0) + { + this.powerups.add(new PowerupEquipment(_loc8_,_loc9_,6)); + } + break; + case 262399: + if(Data.missile == 0) + { + this.powerups.add(new PowerupEquipment(_loc8_,_loc9_,7)); + } + break; + case 393471: + if(Data.rebound == 0) + { + this.powerups.add(new PowerupEquipment(_loc8_,_loc9_,8)); + } + break; + case 524543: + if(Data.xrayscope == 0) + { + this.powerups.add(new PowerupEquipment(_loc8_,_loc9_,9)); + } + break; + case 16711932: + this.powerups.add(new RedDiamond(_loc8_,_loc9_,this._redLocations[_loc8_ + "-" + _loc9_])); + break; + case 13369599: + _loc2_ = new SlimeKing(_loc8_,_loc9_); + this.enemies.add(_loc2_); + break; + case 13369855: + _loc2_ = new StoneBird(_loc8_,_loc9_); + this.enemies.add(_loc2_); + break; + case 13370111: + _loc2_ = new SnailKing(_loc8_,_loc9_); + this.enemies.add(_loc2_); + break; + case 13370367: + _loc2_ = new Blob(_loc8_,_loc9_); + this.enemies.add(_loc2_); + break; + case 13370623: + _loc2_ = new Snake(_loc8_,_loc9_); + this.enemies.add(_loc2_); + break; + case 13370879: + _loc2_ = new ProfessorShade(_loc8_,_loc9_); + this.enemies.add(_loc2_); + break; + case 13371135: + _loc2_ = new Professor(_loc8_,_loc9_); + this.enemies.add(_loc2_); + } + } + _loc16_ = this.pixels.getPixel(_loc8_,_loc9_ + 1); + if(_loc16_ == 5228053 && _loc12_ == 16777215 && this.tilemap.getTile(_loc8_,_loc9_) == 0) + { + _loc29_ = ArcU.rand(0,100); + if(_loc29_ < 3) + { + _loc30_ = new Pot(_loc10_,_loc11_,1); + this.objects.add(_loc30_); + } + } + } + } + } + + override public function draw() : void + { + super.draw(); + this.xray.visible = this.xraying; + if(this._complete && this._completeWindow != null) + { + this._completeWindow.draw(); + } + if(this.inMenu) + { + this._menu.draw(); + } + var _loc1_:AchievementWindow = AchievementSystem.achievementWindow; + if(_loc1_ != null) + { + _loc1_.draw(); + } + if(this.whitefader != null) + { + this.whitefader.draw(); + } + } + + protected function calcTop(param1:int) : int + { + return FlxG.camera.scroll.y / Config.BLOCK_SIZE - param1; + } + + protected function calcBottom(param1:int) : int + { + return (FlxG.camera.scroll.y + FlxG.height) / Config.BLOCK_SIZE + param1; + } + + public function reset() : void + { + } + + public function isComplete() : Boolean + { + return this._complete; + } + + public function get xraying() : Boolean + { + return FlxG.keys.SHIFT && this.player.controllable && Data.xrayscope == 1 && !Data.state.isComplete() && !Data.state.inMenu && Data.hp > 0 && (Data.state is StoryMode || Data.state is EscapeMode); + } + + public function get menu() : Menu + { + return this._menu; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_1.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_1.as new file mode 100644 index 0000000..1a72792 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_1.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/189.png")] + public class PlayMode_BG1_1 extends BitmapAsset + { + + public function PlayMode_BG1_1() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_2.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_2.as new file mode 100644 index 0000000..5d3560e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_2.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/189.png")] + public class PlayMode_BG1_2 extends BitmapAsset + { + + public function PlayMode_BG1_2() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_3.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_3.as new file mode 100644 index 0000000..75e4de1 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_3.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/191_com.arc.dh.state.PlayMode_BG1_3.png")] + public class PlayMode_BG1_3 extends BitmapAsset + { + + public function PlayMode_BG1_3() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_4.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_4.as new file mode 100644 index 0000000..bceb167 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_4.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/192_com.arc.dh.state.PlayMode_BG1_4.png")] + public class PlayMode_BG1_4 extends BitmapAsset + { + + public function PlayMode_BG1_4() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_5.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_5.as new file mode 100644 index 0000000..8a6dbf8 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_5.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/183_com.arc.dh.state.PlayMode_BG1_5.png")] + public class PlayMode_BG1_5 extends BitmapAsset + { + + public function PlayMode_BG1_5() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_6.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_6.as new file mode 100644 index 0000000..3a494d6 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_6.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/184_com.arc.dh.state.PlayMode_BG1_6.png")] + public class PlayMode_BG1_6 extends BitmapAsset + { + + public function PlayMode_BG1_6() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_7.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_7.as new file mode 100644 index 0000000..c526aea --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG1_7.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/185_com.arc.dh.state.PlayMode_BG1_7.png")] + public class PlayMode_BG1_7 extends BitmapAsset + { + + public function PlayMode_BG1_7() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_1.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_1.as new file mode 100644 index 0000000..ba32454 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_1.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/199.png")] + public class PlayMode_BG2_1 extends BitmapAsset + { + + public function PlayMode_BG2_1() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_2.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_2.as new file mode 100644 index 0000000..5008a73 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_2.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/199.png")] + public class PlayMode_BG2_2 extends BitmapAsset + { + + public function PlayMode_BG2_2() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_3.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_3.as new file mode 100644 index 0000000..3838f27 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_3.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/204_com.arc.dh.state.PlayMode_BG2_3.png")] + public class PlayMode_BG2_3 extends BitmapAsset + { + + public function PlayMode_BG2_3() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_4.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_4.as new file mode 100644 index 0000000..541d8b7 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_4.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/195_com.arc.dh.state.PlayMode_BG2_4.png")] + public class PlayMode_BG2_4 extends BitmapAsset + { + + public function PlayMode_BG2_4() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_5.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_5.as new file mode 100644 index 0000000..e3c955c --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_5.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/193_com.arc.dh.state.PlayMode_BG2_5.png")] + public class PlayMode_BG2_5 extends BitmapAsset + { + + public function PlayMode_BG2_5() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_6.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_6.as new file mode 100644 index 0000000..a3d50a0 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_6.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/198_com.arc.dh.state.PlayMode_BG2_6.png")] + public class PlayMode_BG2_6 extends BitmapAsset + { + + public function PlayMode_BG2_6() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_7.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_7.as new file mode 100644 index 0000000..8f16b6b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG2_7.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/197_com.arc.dh.state.PlayMode_BG2_7.png")] + public class PlayMode_BG2_7 extends BitmapAsset + { + + public function PlayMode_BG2_7() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_1.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_1.as new file mode 100644 index 0000000..02fd245 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_1.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/196.png")] + public class PlayMode_BG3_1 extends BitmapAsset + { + + public function PlayMode_BG3_1() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_2.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_2.as new file mode 100644 index 0000000..29b6139 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_2.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/196.png")] + public class PlayMode_BG3_2 extends BitmapAsset + { + + public function PlayMode_BG3_2() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_3.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_3.as new file mode 100644 index 0000000..3f3d944 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_3.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/203_com.arc.dh.state.PlayMode_BG3_3.png")] + public class PlayMode_BG3_3 extends BitmapAsset + { + + public function PlayMode_BG3_3() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_4.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_4.as new file mode 100644 index 0000000..a50f6c5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_4.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/200_com.arc.dh.state.PlayMode_BG3_4.png")] + public class PlayMode_BG3_4 extends BitmapAsset + { + + public function PlayMode_BG3_4() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_5.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_5.as new file mode 100644 index 0000000..d7d3471 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_5.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/206_com.arc.dh.state.PlayMode_BG3_5.png")] + public class PlayMode_BG3_5 extends BitmapAsset + { + + public function PlayMode_BG3_5() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_6.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_6.as new file mode 100644 index 0000000..d545e63 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_6.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/205_com.arc.dh.state.PlayMode_BG3_6.png")] + public class PlayMode_BG3_6 extends BitmapAsset + { + + public function PlayMode_BG3_6() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_7.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_7.as new file mode 100644 index 0000000..9622271 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BG3_7.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/209_com.arc.dh.state.PlayMode_BG3_7.png")] + public class PlayMode_BG3_7 extends BitmapAsset + { + + public function PlayMode_BG3_7() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BITMAP_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BITMAP_SPRITE.as new file mode 100644 index 0000000..036650b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_BITMAP_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/259_com.arc.dh.state.PlayMode_BITMAP_SPRITE.png")] + public class PlayMode_BITMAP_SPRITE extends BitmapAsset + { + + public function PlayMode_BITMAP_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_CONTROLS_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_CONTROLS_SPRITE.as new file mode 100644 index 0000000..a66ff4c --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_CONTROLS_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/55_com.arc.dh.state.PlayMode_CONTROLS_SPRITE.png")] + public class PlayMode_CONTROLS_SPRITE extends BitmapAsset + { + + public function PlayMode_CONTROLS_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_MENU_TIP_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_MENU_TIP_SPRITE.as new file mode 100644 index 0000000..c39f40c --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_MENU_TIP_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/235_com.arc.dh.state.PlayMode_MENU_TIP_SPRITE.png")] + public class PlayMode_MENU_TIP_SPRITE extends BitmapAsset + { + + public function PlayMode_MENU_TIP_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T1.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T1.as new file mode 100644 index 0000000..b24263d --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T1.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/127_com.arc.dh.state.PlayMode_T1.png")] + public class PlayMode_T1 extends BitmapAsset + { + + public function PlayMode_T1() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T2.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T2.as new file mode 100644 index 0000000..86cdf45 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T2.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/129_com.arc.dh.state.PlayMode_T2.png")] + public class PlayMode_T2 extends BitmapAsset + { + + public function PlayMode_T2() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T3.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T3.as new file mode 100644 index 0000000..328e1aa --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T3.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/128_com.arc.dh.state.PlayMode_T3.png")] + public class PlayMode_T3 extends BitmapAsset + { + + public function PlayMode_T3() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T4.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T4.as new file mode 100644 index 0000000..0e3f289 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T4.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/131_com.arc.dh.state.PlayMode_T4.png")] + public class PlayMode_T4 extends BitmapAsset + { + + public function PlayMode_T4() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T5.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T5.as new file mode 100644 index 0000000..f64ca41 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T5.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/130_com.arc.dh.state.PlayMode_T5.png")] + public class PlayMode_T5 extends BitmapAsset + { + + public function PlayMode_T5() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T6.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T6.as new file mode 100644 index 0000000..9966d7d --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T6.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/134_com.arc.dh.state.PlayMode_T6.png")] + public class PlayMode_T6 extends BitmapAsset + { + + public function PlayMode_T6() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T7.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T7.as new file mode 100644 index 0000000..6e620b9 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_T7.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/132_com.arc.dh.state.PlayMode_T7.png")] + public class PlayMode_T7 extends BitmapAsset + { + + public function PlayMode_T7() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_UPGRADE_TIP_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_UPGRADE_TIP_SPRITE.as new file mode 100644 index 0000000..c4b4888 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_UPGRADE_TIP_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/281_com.arc.dh.state.PlayMode_UPGRADE_TIP_SPRITE.png")] + public class PlayMode_UPGRADE_TIP_SPRITE extends BitmapAsset + { + + public function PlayMode_UPGRADE_TIP_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_xraySprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_xraySprite.as new file mode 100644 index 0000000..0488a67 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/PlayMode_xraySprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/133_com.arc.dh.state.PlayMode_xraySprite.png")] + public class PlayMode_xraySprite extends BitmapAsset + { + + public function PlayMode_xraySprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/RunMode.as b/research/inner_decompiled/scripts/com/arc/dh/state/RunMode.as new file mode 100644 index 0000000..30573a0 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/RunMode.as @@ -0,0 +1,483 @@ +package com.arc.dh.state +{ + import Playtomic.Log; + import com.arc.dh.entities.Player; + import com.arc.dh.menu.GameOver; + import com.arc.dh.objects.*; + import com.arc.dh.objects.enemies.Seed; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.DataSerializer; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcU; + import flash.display.BitmapData; + import org.flixel.FlxG; + import org.flixel.FlxObject; + import org.flixel.FlxPoint; + import org.flixel.FlxTilemap; + import org.flixel.system.FlxTile; + + public class RunMode extends HorizontalMode + { + + protected static const ESCAPE_SPRITE:Class = RunMode_ESCAPE_SPRITE; + + protected static const ESCAPE_OVERLAY_SPRITE:Class = RunMode_ESCAPE_OVERLAY_SPRITE; + + protected static const LAVA_SPRITE:Class = RunMode_LAVA_SPRITE; + + private static const RUN_WIDTH:int = 4000; + + private static const RUN_HEIGHT:int = 20; + + private static const PLAYER_OFFSET:int = 60; + + private var _gameOver:GameOver; + + public function RunMode() + { + super(); + mode = RUN_MODE; + _ch = ArcU.rand(1,7); + } + + override public function create() : void + { + super.create(); + Log.CustomMetric("RunStart","Modes"); + bg1.vertical = bg2.vertical = bg3.vertical = false; + camera = new Camera(FlxG.width / 2,FlxG.height / 2); + camera.velocity.x = 100; + this.add(camera); + controlCharacter = false; + FlxG.camera.follow(camera); + FlxG.camera.update(); + FlxG.worldBounds.width = pixels.width * Config.BLOCK_SIZE; + FlxG.worldBounds.height = pixels.height * Config.BLOCK_SIZE; + spawnChance = 100; + SoundSystem.music(Sound.PLAY_MUSIC2); + } + + override protected function getStartX() : int + { + return 36; + } + + override protected function getStartY() : int + { + return 48; + } + + override public function update() : void + { + if(_complete) + { + this._gameOver.update(); + showAchievement(); + return; + } + super.update(); + if(inMenu) + { + return; + } + if(camera.velocity.x < 150) + { + camera.velocity.x += FlxG.elapsed * 6; + } + if(camera.velocity.x < 200) + { + camera.velocity.x += FlxG.elapsed * 3; + } + else if(camera.velocity.x < 300) + { + camera.velocity.x += FlxG.elapsed * 2; + } + else + { + camera.velocity.x += FlxG.elapsed; + } + if(camera.velocity.x > 500) + { + camera.velocity.x = 500; + } + if(ArcU.rand(1,100) < 5) + { + } + if(player.x < FlxG.camera.scroll.x + PLAYER_OFFSET - 2) + { + player.velocity.x = camera.velocity.x * 1.2; + } + else if(player.x > FlxG.camera.scroll.x + PLAYER_OFFSET + 2) + { + player.velocity.x = camera.velocity.x * 0.9; + } + else + { + player.velocity.x = camera.velocity.x; + player.x = FlxG.camera.scroll.x + PLAYER_OFFSET; + } + if(player.getScreenXY().x < -player.width) + { + Data.hp = 0; + Data.state.die(); + } + } + + override protected function createLevel() : void + { + tilemap = this.buildLevel(); + tilemap.follow(); + } + + override public function die() : void + { + _complete = true; + inMenu = false; + SoundSystem.play(Sound.WIN); + this._gameOver = new GameOver(cdiamonds.toString(),this.caveHeight.toString() + "M",duration).setCallback(function():void + { + FlxG.mouse.hide(); + FlxG.switchState(new RunMode()); + },function():void + { + FlxG.mouse.hide(); + FlxG.switchState(new MainMenu(0)); + }); + ++Data.deaths; + if(this.caveHeight > Data.maxRunDistance) + { + Data.maxRunDistance = this.caveHeight; + } + DataSerializer.save(); + Data.kong(); + Newgrounds.medals(); + } + + override public function reset() : void + { + } + + override public function restart() : void + { + var _loc2_:StoryDialog = null; + var _loc1_:Array = checkpoints[checkpoints.length - 1]; + player.reset(_loc1_[0] * Config.BLOCK_SIZE + 4,_loc1_[1] * Config.BLOCK_SIZE + 12); + FlxG.camera.focusOn(new FlxPoint(player.x,player.y)); + FlxG.camera.follow(player); + Data.hp = Data.hpm; + boss = 0; + spawner = new Object(); + pixels = mpixels.clone(); + for each(_loc2_ in messages) + { + _loc2_.load(); + } + bullets.clear(); + enemies.clear(); + penemies.clear(); + diamonds.clear(); + powerups.clear(); + damagetexts.clear(); + healthbars.clear(); + objects.clear(); + cobjects.clear(); + spawnTop = this.calcTop(Config.SPAWN_PADDING); + spawnBottom = this.calcBottom(Config.SPAWN_PADDING); + despawnTop = player.y / Config.BLOCK_SIZE; + despawnBottom = player.y / Config.BLOCK_SIZE + 1; + } + + private function buildLevel() : FlxTilemap + { + var waterFunction:Function; + var map:FlxTilemap = null; + var tileArray:Array = this.createRandomMap(); + var tileCSV:String = FlxTilemap.arrayToCSV(tileArray,pixels.width); + map = new FlxTilemap(); + map.loadMap(tileCSV,PlayMode["T" + _ch],Config.BLOCK_SIZE,Config.BLOCK_SIZE,0,0,1,80); + map.setTileProperties(52,FlxObject.ANY,function(param1:FlxTile, param2:FlxObject):void + { + var _loc3_:int = 0; + if(param2 is Bullet) + { + ArcParticleSystem.emit(Data.state.particles,"wooden_crate",param1.x,param1.y,10,1,5,400,-100,100,-100,-40,param1.width,param1.height); + map.setTileByIndex(param1.mapIndex,0,true); + _loc3_ = ArcU.rand(0,100); + if(_loc3_ >= 80) + { + if(_loc3_ < 99) + { + addDiamonds(param1.x,param1.y,ArcU.rand(1,2 * _ch)); + } + else + { + createHeart(param1.x,param1.y); + } + } + ++Data.boxes; + SoundSystem.play(Sound.BOX,0.4); + AchievementSystem.boxes(); + } + }); + map.setTileProperties(53,FlxObject.ANY,function(param1:FlxTile, param2:FlxObject):void + { + var _loc3_:int = 0; + if(param2 is Missile) + { + ArcParticleSystem.emit(Data.state.particles,"steel_crate",param1.x,param1.y,10,1,5,800,-100,100,-200,-80,param1.width,param1.height); + map.setTileByIndex(param1.mapIndex,0,true); + _loc3_ = ArcU.rand(0,100); + if(_loc3_ >= 50) + { + if(_loc3_ < 99) + { + addDiamonds(param1.x,param1.y,ArcU.rand(1,2 * _ch)); + } + else + { + createHeart(param1.x,param1.y); + } + } + ++Data.boxes; + SoundSystem.play(Sound.STEELBOX); + AchievementSystem.boxes(); + } + }); + waterFunction = function(param1:FlxTile, param2:FlxObject):void + { + var _loc3_:Player = param2 as Player; + if(_loc3_ == null) + { + return; + } + _loc3_.inWater(); + }; + map.setTileProperties(12,FlxObject.NONE,waterFunction,Player); + map.setTileProperties(56,FlxObject.ANY); + return map; + } + + private function imageToTileArray(param1:BitmapData, param2:BitmapData) : Array + { + var _loc5_:int = 0; + var _loc6_:uint = 0; + var _loc7_:int = 0; + this.pixels = param1; + this.overpixels = param2; + var _loc3_:Array = new Array(); + mpixels = param1.clone(); + var _loc4_:int = 0; + while(_loc4_ < param1.height) + { + _loc5_ = 0; + while(_loc5_ < param1.width) + { + _loc6_ = getLayerTile(_loc5_,_loc4_,true); + _loc7_ = colorToTileID(_loc6_,_loc5_,_loc4_); + _loc3_.push(_loc7_); + _loc5_++; + } + _loc4_++; + } + return _loc3_; + } + + private function createRandomMap() : Array + { + var _loc3_:int = 0; + var _loc4_:* = 0; + var _loc5_:int = 0; + var _loc10_:int = 0; + var _loc11_:int = 0; + var _loc12_:int = 0; + var _loc1_:BitmapData = new BitmapData(RUN_WIDTH,RUN_HEIGHT,false); + var _loc2_:BitmapData = new BitmapData(RUN_WIDTH,RUN_HEIGHT,false); + _loc3_ = 0; + while(_loc3_ < RUN_WIDTH) + { + _loc1_.setPixel(_loc3_,0,10052885); + _loc1_.setPixel(_loc3_,1,10052885); + if(_loc3_ > 25) + { + _loc5_ = ArcU.rand(1,100); + if(_loc5_ >= 3) + { + if(_loc5_ < 6) + { + _loc1_.setPixel(_loc3_,2,12221184); + } + else if(_loc5_ < 8) + { + _loc1_.setPixel(_loc3_,ArcU.rand(4,16),7929600); + } + else if(_loc5_ < 20) + { + _loc1_.setPixel(_loc3_,ArcU.rand(4,16),15763712); + } + } + } + _loc3_++; + } + var _loc6_:int = -20; + var _loc7_:int = 20; + var _loc8_:int = 2; + var _loc9_:int = 0; + _loc3_ = 0; + while(_loc3_ < RUN_WIDTH) + { + _loc12_ = _loc3_ / 300 * 3 + 1; + if(_loc6_ > 0) + { + if(--_loc6_ == 0) + { + if(_loc7_ < 3) + { + _loc7_ = 3; + } + _loc6_ = -ArcU.rand(10 + _loc12_ * 2,30 + _loc12_ * 2); + } + } + else + { + if(_loc6_ < 0) + { + _loc6_++; + } + else if(_loc6_ == 0) + { + _loc6_ = ArcU.rand(3,8 + _loc12_); + } + if(--_loc7_ <= 0) + { + _loc7_ = ArcU.rand(15,35); + _loc9_ = _loc8_; + _loc11_ = Math.min(10,_loc9_ + 4); + _loc10_ = Math.max(2,_loc9_ - 6); + _loc8_ = ArcU.rand(_loc10_,_loc11_); + if(_loc6_ > -3) + { + _loc6_ = -3; + } + } + _loc4_ = int(RUN_HEIGHT - 1); + for(; _loc4_ >= RUN_HEIGHT - _loc8_; _loc4_--) + { + if(_loc4_ == RUN_HEIGHT - _loc8_) + { + _loc1_.setPixel(_loc3_,_loc4_,5228053); + if(_loc3_ > 25) + { + _loc5_ = ArcU.rand(1,100); + if(_loc1_.getPixel(_loc3_,_loc4_ - 1) != 16777215) + { + continue; + } + if(_loc5_ < 5) + { + _loc1_.setPixel(_loc3_,_loc4_ - 1,9699328); + } + else if(_loc5_ < 7) + { + _loc1_.setPixel(_loc3_,_loc4_ - 1,9517164); + } + else if(_loc5_ < 20) + { + _loc1_.setPixel(_loc3_,_loc4_ - ArcU.rand(1,5),16763904); + } + else if(_loc5_ < 28 && _loc6_ < -2 && _loc7_ > 2) + { + _loc1_.setPixel(_loc3_,_loc4_ - 1,7028992); + if(ArcU.rand(1,8) == 1) + { + _loc1_.setPixel(_loc3_,_loc4_ - 2,7028992); + } + if(ArcU.rand(1,3) == 1) + { + _loc1_.setPixel(_loc3_ + 1,_loc4_ - 1,7028992); + if(ArcU.rand(1,2) == 1) + { + _loc1_.setPixel(_loc3_ + 1,_loc4_ - 2,7028992); + } + if(ArcU.rand(1,3) == 1) + { + _loc1_.setPixel(_loc3_ + 2,_loc4_ - 1,7028992); + if(ArcU.rand(1,7) == 1) + { + _loc1_.setPixel(_loc3_ + 2,_loc4_ - 2,7028992); + } + } + } + } + } + } + else + { + _loc1_.setPixel(_loc3_,_loc4_,10052885); + } + } + } + _loc3_++; + } + return this.imageToTileArray(_loc1_,_loc2_); + } + + override public function draw() : void + { + super.draw(); + if(_complete && this._gameOver != null) + { + this._gameOver.draw(); + } + } + + override protected function parallax() : void + { + var _loc1_:Background = null; + var _loc2_:int = 0; + for each(_loc1_ in [bg1,bg2,bg3]) + { + _loc2_ = _loc1_.getScreenXY().x; + if(_loc2_ < -360) + { + _loc1_.x = FlxG.camera.scroll.x * _loc1_.scrollFactor.x + (_loc2_ > 0 && _loc2_ < 1000 ? _loc2_ : 0); + } + else if(_loc2_ > 0) + { + _loc1_.x = FlxG.camera.scroll.x * _loc1_.scrollFactor.x - 360 + (_loc2_ > 0 && _loc2_ < 1000 ? _loc2_ : 0); + } + } + } + + override public function get caveHeight() : int + { + return player.x / 9; + } + + override protected function calcTop(param1:int) : int + { + return FlxG.camera.scroll.x / Config.BLOCK_SIZE - param1; + } + + override protected function calcBottom(param1:int) : int + { + return (FlxG.camera.scroll.x + FlxG.width) / Config.BLOCK_SIZE + param1; + } + + override protected function spawn(param1:int) : void + { + var _loc2_:Seed = null; + super.spawn(param1); + if(ArcU.rand(1,100) < 6 && param1 > 30) + { + _loc2_ = new Seed(param1 * Config.BLOCK_SIZE + 100,ArcU.rand(4,16) * Config.BLOCK_SIZE,1); + _loc2_.velocity.x = -50; + enemies.add(_loc2_); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/RunMode_ESCAPE_OVERLAY_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/state/RunMode_ESCAPE_OVERLAY_SPRITE.as new file mode 100644 index 0000000..ce00cb9 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/RunMode_ESCAPE_OVERLAY_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/54.png")] + public class RunMode_ESCAPE_OVERLAY_SPRITE extends BitmapAsset + { + + public function RunMode_ESCAPE_OVERLAY_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/RunMode_ESCAPE_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/state/RunMode_ESCAPE_SPRITE.as new file mode 100644 index 0000000..ed45b29 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/RunMode_ESCAPE_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/88.png")] + public class RunMode_ESCAPE_SPRITE extends BitmapAsset + { + + public function RunMode_ESCAPE_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/RunMode_LAVA_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/state/RunMode_LAVA_SPRITE.as new file mode 100644 index 0000000..0c42adb --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/RunMode_LAVA_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/171.png")] + public class RunMode_LAVA_SPRITE extends BitmapAsset + { + + public function RunMode_LAVA_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryDialog.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryDialog.as new file mode 100644 index 0000000..5e172e3 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryDialog.as @@ -0,0 +1,71 @@ +package com.arc.dh.state +{ + import com.arc.dh.util.Config; + import com.arc.dh.util.text.TextSystem; + import com.arc.flixel.ArcSprite; + import com.arc.flixel.ArcU; + + public class StoryDialog + { + + public static const PENDING:int = 0; + + public static const ACTIVATED:int = 1; + + public static const SAVED:int = 2; + + public var x:int; + + public var y:int; + + public var dx:int; + + public var dy:int; + + public var avatar:ArcSprite; + + public var message:String; + + public var state:int = 0; + + public var volatile:Boolean; + + public function StoryDialog(param1:int, param2:int, param3:int, param4:int, param5:ArcSprite, param6:String, param7:Boolean = false) + { + super(); + this.x = param1 * Config.BLOCK_SIZE; + this.y = param2 * Config.BLOCK_SIZE; + this.dx = param3 * Config.BLOCK_SIZE; + this.dy = param4 * Config.BLOCK_SIZE; + this.avatar = param5; + this.message = param6; + this.volatile = param7; + } + + public function activate(param1:int, param2:int) : void + { + if(this.state == PENDING && ArcU.abs(this.x - param1) < this.dx && ArcU.abs(this.y - param2) < this.dy) + { + this.state = ACTIVATED; + TextSystem.display(this.avatar,this.message); + } + } + + public function save() : void + { + if(this.state == ACTIVATED) + { + this.state = SAVED; + } + } + + public function load() : void + { + if(this.state == ACTIVATED && !this.volatile) + { + this.state = PENDING; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode.as new file mode 100644 index 0000000..33c5dc5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode.as @@ -0,0 +1,382 @@ +package com.arc.dh.state +{ + import Playtomic.Log; + import com.arc.dh.entities.Player; + import com.arc.dh.menu.CompleteWindow; + import com.arc.dh.objects.*; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.DataSerializer; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcSprite; + import com.arc.flixel.ArcU; + import org.flixel.FlxG; + import org.flixel.FlxObject; + import org.flixel.FlxPoint; + import org.flixel.FlxTilemap; + import org.flixel.system.FlxTile; + + public class StoryMode extends PlayMode + { + + protected static const STORY_SPRITE:Class = StoryMode_STORY_SPRITE; + + protected static const STORY_OVERLAY_SPRITE:Class = StoryMode_STORY_OVERLAY_SPRITE; + + protected static const PARTICLES:Class = StoryMode_PARTICLES; + + public static const CH1:Class = StoryMode_CH1; + + public static const CH1O:Class = StoryMode_CH1O; + + public static const CH2:Class = StoryMode_CH2; + + public static const CH2O:Class = StoryMode_CH2O; + + public static const CH3:Class = StoryMode_CH3; + + public static const CH3O:Class = StoryMode_CH3O; + + public static const CH4:Class = StoryMode_CH4; + + public static const CH4O:Class = StoryMode_CH4O; + + public static const CH5:Class = StoryMode_CH5; + + public static const CH5O:Class = StoryMode_CH5O; + + public static const CH6:Class = StoryMode_CH6; + + public static const CH6O:Class = StoryMode_CH6O; + + public static const CH7:Class = StoryMode_CH7; + + public static const CH7O:Class = StoryMode_CH7O; + + private static const HEARTS:Array = [[0,1,14],[2,3,15],[4,5,16],[6,7],[8,9],[10,11],[12,13]]; + + private var bossMusicFlag:int = -1; + + public function StoryMode(param1:int) + { + super(); + mode = STORY_MODE; + _ch = param1; + addMessages(_ch); + BulletFactory.nonMissile = false; + } + + public static function storyMusic(param1:int) : void + { + if(param1 % 2 == 1) + { + SoundSystem.music(Sound.PLAY_MUSIC); + } + else + { + SoundSystem.music(Sound.PLAY_MUSIC2); + } + } + + override public function create() : void + { + super.create(); + storyMusic(_ch); + Log.LevelCounterMetric("StoryStart",_ch); + Log.CustomMetric("StoryStart","Modes"); + } + + override protected function getStartX() : int + { + if(_ch == 3 || _ch == 6) + { + return 36; + } + return 128; + } + + override protected function createLevel() : void + { + tilemap = this.buildLevel(); + tilemap.follow(); + } + + override public function setBoss(param1:int) : void + { + boss = 1; + bossHeight = param1; + FlxG.camera.follow(null); + SoundSystem.music(Sound.BOSS_MUSIC,0.7); + AchievementSystem.reachBoss(_ch,cenemies); + } + + override public function complete() : void + { + var _loc3_:int = 0; + var _loc7_:int = 0; + Log.LevelCounterMetric("StoryComplete",_ch); + Log.LevelAverageMetric("StoryTime",_ch,Math.floor(Data.ctime)); + _complete = true; + inMenu = false; + ++Data.chapters[_ch - 1][0]; + var _loc1_:Number = Math.ceil(Data.ctime) * 1000; + if(_loc1_ < Data.chapters[_ch - 1][1] || Data.chapters[_ch - 1][1] == 0) + { + Data.chapters[_ch - 1][1] = _loc1_; + } + AchievementSystem.completeChapter(_ch,_loc1_,cenemies); + var _loc2_:int = 0; + _loc3_ = 0; + while(_loc3_ < 5) + { + _loc2_ += Data.hasRed(_ch,_loc3_) ? 1 : 0; + _loc3_++; + } + var _loc4_:Array = HEARTS[_ch - 1] as Array; + var _loc5_:int = 0; + var _loc6_:int = 0; + for each(_loc7_ in _loc4_) + { + if(Data.heartcrystals[_loc7_] == 1) + { + _loc5_++; + } + _loc6_++; + } + if(!BulletFactory.nonMissile && _ch == 4) + { + AchievementSystem.nonMissile(); + } + SoundSystem.play(Sound.WIN); + _completeWindow = new CompleteWindow(cdiamonds.toString(),cenemies.toString(),duration,_loc5_ + " / " + _loc6_,_loc2_ + " / 5"); + DataSerializer.save(); + Data.kong(); + Newgrounds.medals(); + } + + override public function reset() : void + { + faderStatus = 1; + } + + override public function restart() : void + { + var _loc2_:StoryDialog = null; + var _loc3_:int = 0; + var _loc4_:int = 0; + var _loc5_:uint = 0; + var _loc6_:int = 0; + Log.LevelCounterMetric("StoryDie",_ch); + var _loc1_:Array = checkpoints[checkpoints.length - 1]; + player.reset(_loc1_[0] * Config.BLOCK_SIZE + 4,_loc1_[1] * Config.BLOCK_SIZE + 12); + FlxG.camera.focusOn(new FlxPoint(player.x,player.y)); + FlxG.camera.follow(player); + Data.hp = Data.hpm; + boss = 0; + spawner = new Object(); + pixels = mpixels.clone(); + for each(_loc2_ in messages) + { + _loc2_.load(); + } + bullets.clear(); + enemies.clear(); + penemies.clear(); + diamonds.clear(); + powerups.clear(); + damagetexts.clear(); + healthbars.clear(); + objects.clear(); + cobjects.clear(); + spawnTop = calcTop(Config.SPAWN_PADDING); + spawnBottom = calcBottom(Config.SPAWN_PADDING); + despawnTop = player.y / Config.BLOCK_SIZE; + despawnBottom = player.y / Config.BLOCK_SIZE + 1; + if(SoundSystem.playing == Sound.BOSS_MUSIC) + { + this.bossMusicFlag = player.y; + } + else + { + this.bossMusicFlag = -1; + } + if(worldAllFuckedUp) + { + _loc3_ = 0; + while(_loc3_ < 30) + { + _loc4_ = 0; + while(_loc4_ < 20) + { + _loc5_ = getLayerTile(_loc3_,_loc4_,true); + _loc6_ = colorToTileID(_loc5_,_loc3_,_loc4_); + tilemap.setTile(_loc3_,_loc4_,_loc6_,true); + _loc4_++; + } + _loc3_++; + } + worldAllFuckedUp = false; + } + } + + override public function update() : void + { + if(_complete) + { + _completeWindow.update(); + showAchievement(); + return; + } + if(this.bossMusicFlag > 0 && player.y > this.bossMusicFlag + 48) + { + storyMusic(_ch); + } + super.update(); + } + + private function buildLevel() : FlxTilemap + { + var waterFunction:Function; + var lavaFunction:Function; + var map:FlxTilemap = null; + var tileArray:Array = this.imageToTileArray(); + var tileCSV:String = FlxTilemap.arrayToCSV(tileArray,Config.BLOCK_WIDTH); + map = new FlxTilemap(); + map.loadMap(tileCSV,PlayMode["T" + _ch],Config.BLOCK_SIZE,Config.BLOCK_SIZE,0,0,1,80); + map.setTileProperties(52,FlxObject.ANY,function(param1:FlxTile, param2:FlxObject):void + { + var _loc3_:int = 0; + if(param2 is Bullet) + { + ArcParticleSystem.emit(Data.state.particles,"wooden_crate",param1.x,param1.y,10,1,5,400,-100,100,-100,-40,param1.width,param1.height); + map.setTileByIndex(param1.mapIndex,0,true); + _loc3_ = ArcU.rand(0,100); + if(_loc3_ >= 80) + { + if(_loc3_ < 99) + { + addDiamonds(param1.x,param1.y,ArcU.rand(1,2 * _ch)); + } + else + { + createHeart(param1.x,param1.y); + } + } + ++Data.boxes; + SoundSystem.play(Sound.BOX,0.3); + AchievementSystem.boxes(); + } + }); + map.setTileProperties(53,FlxObject.ANY,function(param1:FlxTile, param2:FlxObject):void + { + var _loc3_:int = 0; + if(param2 is Missile) + { + ArcParticleSystem.emit(Data.state.particles,"steel_crate",param1.x,param1.y,10,1,5,800,-100,100,-200,-80,param1.width,param1.height); + map.setTileByIndex(param1.mapIndex,0,true); + _loc3_ = ArcU.rand(0,100); + if(_loc3_ >= 50) + { + if(_loc3_ < 99) + { + addDiamonds(param1.x,param1.y,ArcU.rand(1,2 * _ch)); + } + else + { + createHeart(param1.x,param1.y); + } + } + ++Data.boxes; + SoundSystem.play(Sound.STEELBOX); + AchievementSystem.boxes(); + } + }); + waterFunction = function(param1:FlxTile, param2:FlxObject):void + { + var _loc3_:Player = param2 as Player; + if(_loc3_ == null) + { + return; + } + _loc3_.inWater(); + }; + map.setTileProperties(12,FlxObject.NONE,waterFunction,Player); + lavaFunction = function(param1:FlxTile, param2:FlxObject):void + { + var _loc3_:Player = param2 as Player; + if(_loc3_ == null) + { + return; + } + var _loc4_:Boolean = false; + if(!_loc3_.shielded) + { + if(Data.moltensuit == 0) + { + _loc3_.invulnerable = 0; + } + _loc4_ = _loc3_.hit(1,false,true,false); + } + if(_loc4_) + { + if(Data.moltensuit == 1) + { + _loc3_.invulnerable = 1.5; + } + else + { + _loc3_.invulnerable = 0; + } + } + _loc3_.inWater(); + }; + map.setTileProperties(13,FlxObject.NONE,lavaFunction,Player); + map.setTileProperties(56,FlxObject.ANY); + return map; + } + + private function imageToTileArray() : Array + { + var _loc7_:int = 0; + var _loc8_:uint = 0; + var _loc9_:int = 0; + var _loc1_:Class = StoryMode["CH" + _ch]; + var _loc2_:Class = StoryMode["CH" + _ch + "O"]; + var _loc3_:Array = new Array(); + var _loc4_:ArcSprite = new ArcSprite(0,0,_loc1_); + pixels = _loc4_.pixels; + mpixels = pixels.clone(); + var _loc5_:ArcSprite = new ArcSprite(0,0,_loc2_); + overpixels = _loc5_.pixels; + var _loc6_:int = 0; + while(_loc6_ < pixels.height) + { + _loc7_ = 0; + while(_loc7_ < pixels.width) + { + if(pixels.getPixel(_loc7_,_loc6_) == RED_DIAMOND) + { + markRedDiamond(_loc7_,_loc6_); + } + _loc8_ = getLayerTile(_loc7_,_loc6_,true); + _loc9_ = colorToTileID(_loc8_,_loc7_,_loc6_); + _loc3_.push(_loc9_); + _loc7_++; + } + _loc6_++; + } + return _loc3_; + } + + override public function die() : void + { + _dieTimer = 1; + ++Data.deaths; + DataSerializer.save(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryModeTooltip.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryModeTooltip.as new file mode 100644 index 0000000..289936a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryModeTooltip.as @@ -0,0 +1,108 @@ +package com.arc.dh.state +{ + import com.arc.dh.menu.StatisticsChapter; + import com.arc.dh.util.Data; + import com.arc.dh.util.Fonts; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class StoryModeTooltip extends Tooltip + { + + private static const spriteTooltipArrow:Class = StoryModeTooltip_spriteTooltipArrow; + + private static const TOOLTIP_WIDTH:int = 120; + + private static const TOOLTIP_TEXT_WIDTH:int = 112; + + private static const HEARTS:Array = [[0,1,14],[2,3,15],[4,5,16],[6,7],[8,9],[10,11],[12,13]]; + + private var _contents:ArcGroup = new ArcGroup(); + + public function StoryModeTooltip(param1:Number, param2:Number, param3:int) + { + var _loc7_:FlxBitmapText = null; + var _loc8_:ArcSprite = null; + var _loc12_:int = 0; + var _loc13_:int = 0; + var _loc14_:Array = null; + var _loc15_:int = 0; + var _loc16_:int = 0; + var _loc17_:int = 0; + var _loc4_:int = param1 - TOOLTIP_WIDTH / 2; + if(_loc4_ < 10) + { + _loc4_ = 10; + } + else if(_loc4_ + TOOLTIP_WIDTH > FlxG.width - 10) + { + _loc4_ = FlxG.width - TOOLTIP_WIDTH - 10; + } + super(_loc4_,param2); + var _loc5_:int = 5; + var _loc6_:Boolean = !(param3 > 0 && Data.chapters[param3 - 1][0] == 0); + if(!_loc6_) + { + _loc7_ = new FlxBitmapText(4,_loc5_,Fonts.font(Fonts.OUTLINE_GRADIENT),"LOCKED","center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc7_); + _loc5_ += _loc7_.height + 1; + } + else + { + _loc7_ = new FlxBitmapText(4,_loc5_,Fonts.font(Fonts.OUTLINE_GRADIENT),"CHAPTER " + (param3 + 1),"center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc7_); + _loc5_ += _loc7_.height + 1; + _loc7_ = new FlxBitmapText(4,_loc5_,Fonts.font(Fonts.OUTLINE_BLACK),"BEST TIME: " + Data.duration(0,Data.chapters[param3][1]),"center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc7_); + _loc5_ += _loc7_.height + 1; + _loc7_ = new FlxBitmapText(4,_loc5_,Fonts.font(Fonts.OUTLINE_GRADIENT),"TIMES COMPLETED: " + Data.chapters[param3][0],"center",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc7_); + _loc5_ += _loc7_.height + 2; + _loc12_ = 0; + _loc13_ = 0; + while(_loc13_ < 5) + { + _loc12_ += Data.hasRed(param3 + 1,_loc13_) ? 1 : 0; + _loc13_++; + } + _loc14_ = HEARTS[param3] as Array; + _loc15_ = 0; + _loc16_ = 0; + for each(_loc17_ in _loc14_) + { + if(Data.heartcrystals[_loc17_] == 1) + { + _loc15_++; + } + _loc16_++; + } + _loc8_ = new ArcSprite(26,_loc5_ - 1,StatisticsChapter.heartCrystalObtained); + this._contents.add(_loc8_); + _loc7_ = new FlxBitmapText(38,_loc5_,Fonts.font(Fonts.OUTLINE_GRADIENT),_loc15_ + "/" + _loc16_,"left",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc7_); + _loc8_ = new ArcSprite(65,_loc5_ - 2); + _loc8_.loadGraphic(StatisticsChapter.redDiamondObtained,true,false,10,10); + _loc8_.frame = 5; + this._contents.add(_loc8_); + _loc7_ = new FlxBitmapText(77,_loc5_,Fonts.font(Fonts.OUTLINE_GRADIENT),_loc12_ + "/5","left",TOOLTIP_TEXT_WIDTH); + this._contents.add(_loc7_); + _loc5_ += _loc7_.height + 1; + } + _loc5_ += 1; + var _loc9_:int = _loc5_ + 2; + var _loc10_:int = param1 - _loc4_ - 8; + var _loc11_:ArcSprite = new ArcSprite(_loc10_,_loc9_ - 2); + _loc11_.loadGraphic(spriteTooltipArrow,false,true,17,10); + this._contents.add(_loc11_); + createBackground(TOOLTIP_WIDTH,_loc9_); + this.add(this._contents); + this._contents.setAll("scrollFactor",new FlxPoint(0,0)); + shift(this._contents,0,-_loc9_ - 5); + shift(_background,0,-_loc9_ - 5); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryModeTooltip_spriteTooltipArrow.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryModeTooltip_spriteTooltipArrow.as new file mode 100644 index 0000000..33ff849 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryModeTooltip_spriteTooltipArrow.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/68.png")] + public class StoryModeTooltip_spriteTooltipArrow extends BitmapAsset + { + + public function StoryModeTooltip_spriteTooltipArrow() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH1.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH1.as new file mode 100644 index 0000000..616289e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH1.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/64_com.arc.dh.state.StoryMode_CH1.png")] + public class StoryMode_CH1 extends BitmapAsset + { + + public function StoryMode_CH1() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH1O.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH1O.as new file mode 100644 index 0000000..c24ca2b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH1O.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/256_com.arc.dh.state.StoryMode_CH1O.png")] + public class StoryMode_CH1O extends BitmapAsset + { + + public function StoryMode_CH1O() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH2.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH2.as new file mode 100644 index 0000000..c3a8d48 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH2.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/69_com.arc.dh.state.StoryMode_CH2.png")] + public class StoryMode_CH2 extends BitmapAsset + { + + public function StoryMode_CH2() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH2O.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH2O.as new file mode 100644 index 0000000..fba69a0 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH2O.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/269_com.arc.dh.state.StoryMode_CH2O.png")] + public class StoryMode_CH2O extends BitmapAsset + { + + public function StoryMode_CH2O() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH3.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH3.as new file mode 100644 index 0000000..dc496c7 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH3.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/66_com.arc.dh.state.StoryMode_CH3.png")] + public class StoryMode_CH3 extends BitmapAsset + { + + public function StoryMode_CH3() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH3O.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH3O.as new file mode 100644 index 0000000..5ba6967 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH3O.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/93_com.arc.dh.state.StoryMode_CH3O.png")] + public class StoryMode_CH3O extends BitmapAsset + { + + public function StoryMode_CH3O() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH4.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH4.as new file mode 100644 index 0000000..7b85766 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH4.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/74_com.arc.dh.state.StoryMode_CH4.png")] + public class StoryMode_CH4 extends BitmapAsset + { + + public function StoryMode_CH4() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH4O.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH4O.as new file mode 100644 index 0000000..32f8ddc --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH4O.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/109_com.arc.dh.state.StoryMode_CH4O.png")] + public class StoryMode_CH4O extends BitmapAsset + { + + public function StoryMode_CH4O() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH5.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH5.as new file mode 100644 index 0000000..94f3985 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH5.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/72_com.arc.dh.state.StoryMode_CH5.png")] + public class StoryMode_CH5 extends BitmapAsset + { + + public function StoryMode_CH5() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH5O.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH5O.as new file mode 100644 index 0000000..f888231 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH5O.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/48_com.arc.dh.state.StoryMode_CH5O.png")] + public class StoryMode_CH5O extends BitmapAsset + { + + public function StoryMode_CH5O() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH6.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH6.as new file mode 100644 index 0000000..7be43a8 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH6.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/78_com.arc.dh.state.StoryMode_CH6.png")] + public class StoryMode_CH6 extends BitmapAsset + { + + public function StoryMode_CH6() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH6O.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH6O.as new file mode 100644 index 0000000..ecd5a46 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH6O.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/67_com.arc.dh.state.StoryMode_CH6O.png")] + public class StoryMode_CH6O extends BitmapAsset + { + + public function StoryMode_CH6O() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH7.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH7.as new file mode 100644 index 0000000..5417174 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH7.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/76_com.arc.dh.state.StoryMode_CH7.png")] + public class StoryMode_CH7 extends BitmapAsset + { + + public function StoryMode_CH7() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH7O.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH7O.as new file mode 100644 index 0000000..8b81fab --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_CH7O.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/161_com.arc.dh.state.StoryMode_CH7O.png")] + public class StoryMode_CH7O extends BitmapAsset + { + + public function StoryMode_CH7O() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_PARTICLES.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_PARTICLES.as new file mode 100644 index 0000000..b7e8423 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_PARTICLES.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/146.png")] + public class StoryMode_PARTICLES extends BitmapAsset + { + + public function StoryMode_PARTICLES() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_STORY_OVERLAY_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_STORY_OVERLAY_SPRITE.as new file mode 100644 index 0000000..6dd1ccf --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_STORY_OVERLAY_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/210_com.arc.dh.state.StoryMode_STORY_OVERLAY_SPRITE.png")] + public class StoryMode_STORY_OVERLAY_SPRITE extends BitmapAsset + { + + public function StoryMode_STORY_OVERLAY_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_STORY_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_STORY_SPRITE.as new file mode 100644 index 0000000..01a21fe --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryMode_STORY_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/143_com.arc.dh.state.StoryMode_STORY_SPRITE.png")] + public class StoryMode_STORY_SPRITE extends BitmapAsset + { + + public function StoryMode_STORY_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryScreen.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryScreen.as new file mode 100644 index 0000000..a9a1e80 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryScreen.as @@ -0,0 +1,70 @@ +package com.arc.dh.state +{ + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxG; + + public class StoryScreen extends MenuScreen + { + + public static const buttonBackSprite:Class = StoryScreen_buttonBackSprite; + + private static const chooseSprite:Class = StoryScreen_chooseSprite; + + private var _chooseImage:ArcSprite; + + private var _buttonBack:ArcButton; + + private var _chapters:Array; + + public function StoryScreen(param1:MainMenu) + { + var i:int; + var chapter:Chapter = null; + var M:MainMenu = param1; + this._chapters = new Array(); + super(M); + this._buttonBack = new ArcButton(135,208,87,26,buttonBackSprite).callback(function():void + { + menu.switchScreen(menu.mainScreen); + }).selectable(false); + this.add(this._buttonBack); + this._chooseImage = new ArcSprite(0,108,chooseSprite); + this.add(this._chooseImage); + i = 0; + while(i < 7) + { + chapter = new Chapter(i); + this.add(chapter); + this._chapters[i] = chapter; + i++; + } + } + + override public function update() : void + { + var _loc2_:Chapter = null; + if(FlxG.keys.justPressed("ESCAPE")) + { + menu.switchScreen(menu.mainScreen); + } + var _loc1_:int = 0; + while(_loc1_ < 7) + { + _loc2_ = this._chapters[_loc1_]; + if(_loc2_.hover()) + { + if(menu.tooltip == null || menu.tooltip.source != _loc2_) + { + menu.tooltip = new StoryModeTooltip(_loc2_.getX(),_loc2_.getY(),_loc1_); + menu.tooltip.source = _loc2_; + } + menu.hovering = true; + } + _loc1_++; + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryScreen_buttonBackSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryScreen_buttonBackSprite.as new file mode 100644 index 0000000..467622f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryScreen_buttonBackSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/56.png")] + public class StoryScreen_buttonBackSprite extends BitmapAsset + { + + public function StoryScreen_buttonBackSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/StoryScreen_chooseSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/StoryScreen_chooseSprite.as new file mode 100644 index 0000000..829f83a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/StoryScreen_chooseSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/57_com.arc.dh.state.StoryScreen_chooseSprite.png")] + public class StoryScreen_chooseSprite extends BitmapAsset + { + + public function StoryScreen_chooseSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/TadpoleMode.as b/research/inner_decompiled/scripts/com/arc/dh/state/TadpoleMode.as new file mode 100644 index 0000000..b4f9ac3 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/TadpoleMode.as @@ -0,0 +1,503 @@ +package com.arc.dh.state +{ + import Playtomic.Log; + import com.arc.dh.Color; + import com.arc.dh.entities.Player; + import com.arc.dh.entities.PlayerTadpole; + import com.arc.dh.menu.GameOver; + import com.arc.dh.objects.*; + import com.arc.dh.objects.enemies.Tadpole; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.DataSerializer; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcParticleSystem; + import com.arc.flixel.ArcU; + import flash.display.BitmapData; + import org.flixel.FlxG; + import org.flixel.FlxObject; + import org.flixel.FlxPoint; + import org.flixel.FlxTilemap; + import org.flixel.system.FlxTile; + + public class TadpoleMode extends HorizontalMode + { + + protected static const ESCAPE_SPRITE:Class = TadpoleMode_ESCAPE_SPRITE; + + protected static const ESCAPE_OVERLAY_SPRITE:Class = TadpoleMode_ESCAPE_OVERLAY_SPRITE; + + protected static const LAVA_SPRITE:Class = TadpoleMode_LAVA_SPRITE; + + private static const RUN_WIDTH:int = 4000; + + private static const RUN_HEIGHT:int = 20; + + private static const PLAYER_OFFSET:int = 60; + + public var tadpole:PlayerTadpole; + + private var _gameOver:GameOver; + + private var lastSeed:int = 0; + + public function TadpoleMode() + { + super(); + Log.CustomMetric("TadpoleStart","Modes"); + mode = TADPOLE_MODE; + _ch = ArcU.rand(1,7); + } + + override public function create() : void + { + super.create(); + bg1.vertical = bg2.vertical = bg3.vertical = false; + camera = new Camera(FlxG.width / 2,FlxG.height / 2); + camera.velocity.x = 100; + this.add(camera); + this.tadpole = new PlayerTadpole(36,120); + this.add(this.tadpole); + this.remove(player); + this.add(player); + player.visible = false; + player.solid = true; + player.controllable = false; + player.width = player.height = 2; + player.offset.x += 4; + player.offset.y += 4; + controlCharacter = false; + FlxG.camera.follow(camera); + FlxG.camera.update(); + FlxG.worldBounds.width = pixels.width * Config.BLOCK_SIZE; + FlxG.worldBounds.height = pixels.height * Config.BLOCK_SIZE; + spawnChance = 100; + SoundSystem.music(Sound.PLAY_MUSIC); + } + + override protected function getStartX() : int + { + return 36; + } + + override protected function getStartY() : int + { + return 48; + } + + override public function update() : void + { + if(_complete) + { + this._gameOver.update(); + showAchievement(); + return; + } + super.update(); + if(inMenu) + { + return; + } + player.x = this.tadpole.x + 6; + player.y = this.tadpole.y - 3; + if(camera.velocity.x < 150) + { + camera.velocity.x += FlxG.elapsed * 8; + } + if(camera.velocity.x < 200) + { + camera.velocity.x += FlxG.elapsed * 5; + } + else if(camera.velocity.x < 300) + { + camera.velocity.x += FlxG.elapsed * 3; + } + else + { + camera.velocity.x += FlxG.elapsed; + } + if(camera.velocity.x > 500) + { + camera.velocity.x = 500; + } + if(ArcU.rand(1,100) < 5) + { + } + if(player.x < FlxG.camera.scroll.x + PLAYER_OFFSET - 2) + { + player.velocity.x = camera.velocity.x * 1.2; + } + else if(player.x > FlxG.camera.scroll.x + PLAYER_OFFSET + 2) + { + player.velocity.x = camera.velocity.x * 0.9; + } + else + { + player.velocity.x = camera.velocity.x; + player.x = FlxG.camera.scroll.x + PLAYER_OFFSET; + } + if(_dieTimer > 0) + { + _dieTimer -= FlxG.elapsed; + this.tadpole.alpha = _dieTimer; + camera.velocity.x = 0; + if(_dieTimer <= 0) + { + this.tadpole.alpha = 0; + this.die(); + } + } + this.tadpole.x = FlxG.camera.scroll.x + PLAYER_OFFSET; + if(player.getScreenXY().x < -player.width) + { + Data.hp = 0; + Data.state.die(); + } + } + + override protected function createLevel() : void + { + tilemap = this.buildLevel(); + tilemap.follow(); + } + + public function predie() : void + { + var _loc1_:FlxPoint = null; + if(!this.tadpole.isDead()) + { + _dieTimer = 1.2; + this.tadpole.die(); + _loc1_ = this.tadpole.getMidpoint(); + ArcParticleSystem.emit(Data.state.particles,Color.BLUE,_loc1_.x,_loc1_.y,20,2,0,0,-200,200,-200,200); + ArcParticleSystem.emit(Data.state.particles,Color.WHITE,_loc1_.x,_loc1_.y,20,2,0,0,-200,200,-200,200); + } + } + + override public function die() : void + { + _complete = true; + inMenu = false; + SoundSystem.play(Sound.WIN); + this._gameOver = new GameOver(cdiamonds.toString(),this.caveHeight.toString() + "M",duration).setCallback(function():void + { + FlxG.mouse.hide(); + FlxG.switchState(new TadpoleMode()); + },function():void + { + FlxG.mouse.hide(); + FlxG.switchState(new MainMenu(0)); + }); + if(this.caveHeight > Data.maxTadpoleDistance) + { + Data.maxTadpoleDistance = this.caveHeight; + } + DataSerializer.save(); + Data.kong(); + Newgrounds.medals(); + } + + override public function reset() : void + { + } + + override public function restart() : void + { + var _loc2_:StoryDialog = null; + var _loc1_:Array = checkpoints[checkpoints.length - 1]; + player.reset(_loc1_[0] * Config.BLOCK_SIZE + 4,_loc1_[1] * Config.BLOCK_SIZE + 12); + FlxG.camera.focusOn(new FlxPoint(player.x,player.y)); + FlxG.camera.follow(player); + Data.hp = Data.hpm; + boss = 0; + spawner = new Object(); + pixels = mpixels.clone(); + for each(_loc2_ in messages) + { + _loc2_.load(); + } + bullets.clear(); + enemies.clear(); + penemies.clear(); + diamonds.clear(); + powerups.clear(); + damagetexts.clear(); + healthbars.clear(); + objects.clear(); + cobjects.clear(); + spawnTop = this.calcTop(Config.SPAWN_PADDING); + spawnBottom = this.calcBottom(Config.SPAWN_PADDING); + despawnTop = player.y / Config.BLOCK_SIZE; + despawnBottom = player.y / Config.BLOCK_SIZE + 1; + } + + private function buildLevel() : FlxTilemap + { + var waterFunction:Function; + var map:FlxTilemap = null; + var tileArray:Array = this.createRandomMap(); + var tileCSV:String = FlxTilemap.arrayToCSV(tileArray,pixels.width); + map = new FlxTilemap(); + map.loadMap(tileCSV,PlayMode["T" + _ch],Config.BLOCK_SIZE,Config.BLOCK_SIZE,0,0,1,80); + map.setTileProperties(52,FlxObject.ANY,function(param1:FlxTile, param2:FlxObject):void + { + var _loc3_:int = 0; + if(param2 is Bullet) + { + ArcParticleSystem.emit(Data.state.particles,"wooden_crate",param1.x,param1.y,10,1,5,400,-100,100,-100,-40,param1.width,param1.height); + map.setTileByIndex(param1.mapIndex,0,true); + _loc3_ = ArcU.rand(0,100); + if(_loc3_ >= 80) + { + if(_loc3_ < 99) + { + addDiamonds(param1.x,param1.y,ArcU.rand(1,2 * _ch)); + } + else + { + createHeart(param1.x,param1.y); + } + } + ++Data.boxes; + SoundSystem.play(Sound.BOX,0.4); + AchievementSystem.boxes(); + } + }); + map.setTileProperties(53,FlxObject.ANY,function(param1:FlxTile, param2:FlxObject):void + { + var _loc3_:int = 0; + if(param2 is Missile) + { + ArcParticleSystem.emit(Data.state.particles,"steel_crate",param1.x,param1.y,10,1,5,800,-100,100,-200,-80,param1.width,param1.height); + map.setTileByIndex(param1.mapIndex,0,true); + _loc3_ = ArcU.rand(0,100); + if(_loc3_ >= 50) + { + if(_loc3_ < 99) + { + addDiamonds(param1.x,param1.y,ArcU.rand(1,2 * _ch)); + } + else + { + createHeart(param1.x,param1.y); + } + } + ++Data.boxes; + SoundSystem.play(Sound.STEELBOX); + AchievementSystem.boxes(); + } + }); + waterFunction = function(param1:FlxTile, param2:FlxObject):void + { + var _loc3_:Player = param2 as Player; + if(_loc3_ == null) + { + return; + } + _loc3_.inWater(); + }; + map.setTileProperties(12,FlxObject.NONE,waterFunction,Player); + map.setTileProperties(56,FlxObject.ANY); + return map; + } + + private function imageToTileArray(param1:BitmapData, param2:BitmapData) : Array + { + var _loc5_:int = 0; + var _loc6_:uint = 0; + var _loc7_:int = 0; + this.pixels = param1; + this.overpixels = param2; + var _loc3_:Array = new Array(); + mpixels = param1.clone(); + var _loc4_:int = 0; + while(_loc4_ < param1.height) + { + _loc5_ = 0; + while(_loc5_ < param1.width) + { + _loc6_ = getLayerTile(_loc5_,_loc4_,true); + _loc7_ = colorToTileID(_loc6_,_loc5_,_loc4_); + _loc3_.push(_loc7_); + _loc5_++; + } + _loc4_++; + } + return _loc3_; + } + + private function createRandomMap() : Array + { + var _loc3_:int = 0; + var _loc4_:int = 0; + var _loc13_:int = 0; + var _loc1_:BitmapData = new BitmapData(RUN_WIDTH,RUN_HEIGHT,false,10052885); + var _loc2_:BitmapData = new BitmapData(RUN_WIDTH,RUN_HEIGHT,false); + var _loc5_:int = 14; + var _loc6_:int = 3; + var _loc7_:Boolean = false; + var _loc8_:Boolean = false; + var _loc9_:int = 0; + var _loc10_:int = 0; + var _loc11_:int = 0; + var _loc12_:int = 0; + _loc3_ = 0; + while(_loc3_ < RUN_WIDTH) + { + _loc10_ = _loc3_ / 9; + _loc4_ = _loc6_; + while(_loc4_ < _loc6_ + _loc5_) + { + _loc1_.setPixel(_loc3_,_loc4_,16777215); + _loc12_ = ArcU.rand(1,10000); + if(_loc4_ < _loc6_ + _loc5_ - 2) + { + if(_loc12_ < 600) + { + _loc1_.setPixel(_loc3_,_loc4_,16763904); + } + else if(_loc12_ >= 1000) + { + if(_loc12_ < 1010 && _loc3_ > 30) + { + _loc1_.setPixel(_loc3_,_loc4_,16747367); + } + else if(_loc12_ < 1012 && _loc3_ > 30) + { + _loc1_.setPixel(_loc3_,_loc4_,6473198); + } + else if(_loc12_ < 1014 && _loc3_ > 30) + { + _loc1_.setPixel(_loc3_,_loc4_,6746111); + } + } + } + _loc4_++; + } + _loc1_.setPixel(_loc3_,_loc4_ - 1,5228053); + if(ArcU.rand(1,100) < 10 && _loc3_ > 30 && _loc11_ < _loc3_ - ArcU.clamp(40 - _loc3_ / 50,10,40)) + { + _loc1_.setPixel(_loc3_,ArcU.rand(_loc6_ + 2,_loc6_ + _loc5_ - 3),15763712); + _loc11_ = _loc3_; + } + _loc13_ = ArcU.rand(-1,1); + if(_loc13_ != 0 && _loc9_ != 0 && _loc13_ != _loc9_) + { + _loc13_ = 0; + } + _loc9_ = _loc13_; + _loc6_ += _loc13_; + _loc6_ = ArcU.clamp(_loc6_,2,18 - _loc5_); + if(_loc10_ < 30) + { + _loc5_ = 14; + } + else if(_loc10_ < 60) + { + _loc5_ = 13; + } + else if(_loc10_ < 110) + { + _loc5_ = 12; + } + else if(_loc10_ < 160) + { + _loc5_ = 11; + } + else if(_loc10_ < 300) + { + _loc5_ = 10; + } + else if(_loc10_ < 500) + { + _loc5_ = 9; + } + else if(_loc10_ < 700) + { + _loc5_ = 8; + } + else if(_loc10_ < 900) + { + _loc5_ = 7; + } + else if(_loc10_ < 1200) + { + _loc5_ = 6; + } + else + { + _loc5_ = 5; + } + _loc3_++; + } + return this.imageToTileArray(_loc1_,_loc2_); + } + + override public function draw() : void + { + var _loc1_:FlxPoint = this.tadpole.getScreenXY(); + var _loc2_:int = _loc1_.x - PLAYER_OFFSET; + this.tadpole.x -= _loc2_; + super.draw(); + if(_complete && this._gameOver != null) + { + this._gameOver.draw(); + } + } + + override protected function parallax() : void + { + var _loc1_:Background = null; + var _loc2_:int = 0; + for each(_loc1_ in [bg1,bg2,bg3]) + { + _loc2_ = _loc1_.getScreenXY().x; + if(_loc2_ < -360) + { + _loc1_.x = FlxG.camera.scroll.x * _loc1_.scrollFactor.x + (_loc2_ > 0 && _loc2_ < 1000 ? _loc2_ : 0); + } + else if(_loc2_ > 0) + { + _loc1_.x = FlxG.camera.scroll.x * _loc1_.scrollFactor.x - 360 + (_loc2_ > 0 && _loc2_ < 1000 ? _loc2_ : 0); + } + } + } + + override public function get caveHeight() : int + { + return player.x / 9; + } + + override protected function calcTop(param1:int) : int + { + return FlxG.camera.scroll.x / Config.BLOCK_SIZE - param1; + } + + override protected function calcBottom(param1:int) : int + { + return (FlxG.camera.scroll.x + FlxG.width) / Config.BLOCK_SIZE + param1; + } + + override protected function spawn(param1:int) : void + { + var _loc3_:Tadpole = null; + super.spawn(param1); + var _loc2_:int = 10 + param1 / 50; + _loc2_ = ArcU.clamp(_loc2_,10,30); + if(ArcU.rand(1,100) < _loc2_ && param1 > 30 && param1 > this.lastSeed + 3) + { + _loc3_ = new Tadpole(param1,ArcU.rand(4,16),1); + _loc3_.loadRotatedGraphic(Tadpole.redSprite,60,-1,true,true); + _loc3_.red = true; + _loc3_.width = _loc3_.height = 10; + _loc3_.offset.x = _loc3_.offset.y = 6; + _loc3_.move(180); + enemies.add(_loc3_); + this.lastSeed = param1; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/TadpoleMode_ESCAPE_OVERLAY_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/state/TadpoleMode_ESCAPE_OVERLAY_SPRITE.as new file mode 100644 index 0000000..2049a8a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/TadpoleMode_ESCAPE_OVERLAY_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/54.png")] + public class TadpoleMode_ESCAPE_OVERLAY_SPRITE extends BitmapAsset + { + + public function TadpoleMode_ESCAPE_OVERLAY_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/TadpoleMode_ESCAPE_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/state/TadpoleMode_ESCAPE_SPRITE.as new file mode 100644 index 0000000..63d0b85 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/TadpoleMode_ESCAPE_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/88.png")] + public class TadpoleMode_ESCAPE_SPRITE extends BitmapAsset + { + + public function TadpoleMode_ESCAPE_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/TadpoleMode_LAVA_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/state/TadpoleMode_LAVA_SPRITE.as new file mode 100644 index 0000000..d008c8f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/TadpoleMode_LAVA_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/171.png")] + public class TadpoleMode_LAVA_SPRITE extends BitmapAsset + { + + public function TadpoleMode_LAVA_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/Tooltip.as b/research/inner_decompiled/scripts/com/arc/dh/state/Tooltip.as new file mode 100644 index 0000000..84515fd --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/Tooltip.as @@ -0,0 +1,50 @@ +package com.arc.dh.state +{ + import com.arc.flixel.ArcGroup; + import org.flixel.FlxBasic; + import org.flixel.FlxPoint; + import org.flixel.FlxSprite; + + public class Tooltip extends ArcGroup + { + + public static const BLACK_BORDER:int = 1; + + public static const WHITE_BORDER:int = 1; + + public static const PADDING:int = 1; + + public var source:FlxBasic; + + protected var _background:ArcGroup; + + public function Tooltip(param1:Number, param2:Number) + { + super(param1,param2); + } + + public function createBackground(param1:int, param2:int) : void + { + var _loc4_:FlxSprite = null; + this._background = new ArcGroup(); + var _loc3_:FlxSprite = new FlxSprite(0,0); + _loc3_.makeGraphic(param1,param2,3422552064); + this._background.add(_loc3_); + _loc4_ = new FlxSprite(BLACK_BORDER,BLACK_BORDER); + _loc4_.makeGraphic(param1 - BLACK_BORDER * 2,WHITE_BORDER,4294967295); + this._background.add(_loc4_); + _loc4_ = new FlxSprite(BLACK_BORDER,BLACK_BORDER); + _loc4_.makeGraphic(WHITE_BORDER,param2 - BLACK_BORDER * 2,4294967295); + this._background.add(_loc4_); + _loc4_ = new FlxSprite(param1 - BLACK_BORDER - WHITE_BORDER,BLACK_BORDER); + _loc4_.makeGraphic(WHITE_BORDER,param2 - BLACK_BORDER * 2,4294967295); + this._background.add(_loc4_); + _loc4_ = new FlxSprite(BLACK_BORDER,param2 - BLACK_BORDER - WHITE_BORDER); + _loc4_.makeGraphic(param1 - BLACK_BORDER * 2,WHITE_BORDER,4294967295); + this._background.add(_loc4_); + this._background.setAll("scrollFactor",new FlxPoint(0,0)); + this.add(this._background); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/Trophy.as b/research/inner_decompiled/scripts/com/arc/dh/state/Trophy.as new file mode 100644 index 0000000..da7e6b7 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/Trophy.as @@ -0,0 +1,91 @@ +package com.arc.dh.state +{ + import com.arc.dh.menu.Menu; + import com.arc.dh.menu.MenuTooltip; + import com.arc.dh.util.Achievement; + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxPoint; + + public class Trophy extends ArcGroup + { + + private static const sprite:Class = Trophy_sprite; + + public static const BRONZE:int = 0; + + public static const SILVER:int = 1; + + public static const GOLD:int = 2; + + public static const PLATINUM:int = 3; + + private var _type:int; + + private var _achievement:Achievement; + + private var _sprite:ArcSprite; + + private var _bg:ArcSprite; + + public function Trophy(param1:Number, param2:Number, param3:int) + { + super(param1,param2); + this._sprite = new ArcSprite(0,0); + this._sprite.loadGraphic(sprite,true,false,16,16); + this._achievement = AchievementSystem.get(param3); + this._type = this._achievement.type; + this._sprite.addAnimation("trophy",[this._type]); + this._sprite.play("trophy"); + this._bg = new ArcSprite(-1,-1); + this._bg.makeGraphic(18,18,4294967295); + this._bg.alpha = 0.1; + this.add(this._bg); + this.add(this._sprite); + setAll("scrollFactor",new FlxPoint(0,0)); + this.sync(); + } + + override public function update() : void + { + if(this._sprite.hover()) + { + this._bg.alpha = 0.3; + if(Menu.tooltip == null || Menu.tooltip.source != this) + { + Menu.tooltip = new MenuTooltip(this._bg.x + this._bg.width / 2,this._bg.y,this._achievement.name.toUpperCase(),this._achievement.description.toUpperCase()); + Menu.tooltip.source = this; + } + Menu.hovering = true; + } + else + { + this._bg.alpha = Data.achievements[this._achievement.id] == 1 ? 0.1 : 0.05; + } + this.sync(); + super.update(); + } + + public function achieved() : Boolean + { + return Data.achievements[this._achievement.id] != 0; + } + + public function sync() : void + { + if(Data.achievements[this._achievement.id] == 1) + { + this._sprite.alpha = 1 * _alpha; + this._bg.alpha = 0.1 * _alpha; + } + else + { + this._sprite.alpha = 0.2 * _alpha; + this._bg.alpha = 0.05 * _alpha; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/Trophy_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/Trophy_sprite.as new file mode 100644 index 0000000..cb355b5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/Trophy_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/282_com.arc.dh.state.Trophy_sprite.png")] + public class Trophy_sprite extends BitmapAsset + { + + public function Trophy_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/UI.as b/research/inner_decompiled/scripts/com/arc/dh/state/UI.as new file mode 100644 index 0000000..9924948 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/UI.as @@ -0,0 +1,160 @@ +package com.arc.dh.state +{ + import com.arc.dh.util.AchievementSystem; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.Fonts; + import com.arc.flixel.ArcButton; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + import org.flixel.FlxU; + + public class UI extends ArcGroup + { + + public static const diamondsSprite:Class = UI_diamondsSprite; + + private static const heightSprite:Class = UI_heightSprite; + + private static const distanceSprite:Class = UI_distanceSprite; + + private static const sButtonSprite:Class = UI_sButtonSprite; + + private static const cButtonSprite:Class = UI_cButtonSprite; + + private static const mButtonSprite:Class = UI_mButtonSprite; + + private static const mg:Class = UI_mg; + + private var _hearts:HeartMeter; + + private var _diamonds:ArcSprite; + + private var _diamondsText:FlxBitmapText; + + private var _height:ArcSprite; + + private var _heightText:FlxBitmapText; + + private var _lastDiamonds:int; + + private var _lastHeight:int; + + private var _gun:WeaponUI; + + private var _characterButton:ArcButton; + + private var _statisticsButton:ArcButton; + + private var _messageButton:ArcButton; + + private var maxgames:ArcButton; + + public function UI() + { + var h:int = 0; + super(); + this._hearts = new HeartMeter(2,2); + if(!(Data.state is TadpoleMode)) + { + this.add(this._hearts); + } + this._diamonds = new ArcSprite(0,Config.HEIGHT - 16); + this._diamonds.loadGraphic(diamondsSprite,true,false,45,16); + this.add(this._diamonds); + this._diamondsText = new FlxBitmapText(-1,Config.HEIGHT - 7,Fonts.font(Fonts.SMALL_WHITE),"0","right",40); + this.add(this._diamondsText); + this._characterButton = new ArcButton(1,Config.HEIGHT - 22,13,12,cButtonSprite).selectable(false).callback(function():void + { + Data.state.menu.fade(!Data.state.inMenu,1); + }); + this.add(this._characterButton); + this._statisticsButton = new ArcButton(14,Config.HEIGHT - 22,13,12,sButtonSprite).selectable(false).callback(function():void + { + Data.state.menu.fade(!Data.state.inMenu,2); + }); + this.add(this._statisticsButton); + this._messageButton = new ArcButton(27,Config.HEIGHT - 22,13,12,mButtonSprite).selectable(false).callback(function():void + { + Data.state.menu.fade(!Data.state.inMenu,3); + }); + this.add(this._messageButton); + this._gun = new WeaponUI(140,0); + if(PlayMode.mode == PlayMode.ESCAPE_MODE || PlayMode.mode == PlayMode.RUN_MODE || PlayMode.mode == PlayMode.TADPOLE_MODE) + { + this._height = new ArcSprite(Config.WIDTH - 45,Config.HEIGHT - 18); + this._height.loadGraphic(PlayMode.mode == PlayMode.ESCAPE_MODE ? heightSprite : distanceSprite,true,false,45,18); + this.add(this._height); + h = Data.state.caveHeight; + this._heightText = new FlxBitmapText(322,Config.HEIGHT - 7,Fonts.font(Fonts.SMALL_WHITE),h + "M","center",34); + this.add(this._heightText); + } + if(Config.RELEASE == Config.MAXGAMES) + { + this.maxgames = new ArcButton(FlxG.width - 80,0,80,15,mg).callback(function():void + { + FlxU.openURL("http://maxgames.com"); + }).hoverable(false).selectable(false); + this.add(this.maxgames); + } + this.update(); + setAll("scrollFactor",new FlxPoint(0,0)); + } + + override public function update() : void + { + if(Data.diamonds != this._lastDiamonds) + { + this._lastDiamonds = Data.diamonds; + this._diamondsText.text = Data.diamonds > 99999 ? "99999" : Data.diamonds.toString(); + } + var _loc1_:int = Data.state.caveHeight; + if(this._heightText != null && _loc1_ != this._lastHeight) + { + if(Data.state is EscapeMode) + { + AchievementSystem.climb(_loc1_); + } + else if(Data.state is TadpoleMode) + { + AchievementSystem.tadpolemode(_loc1_); + } + else if(Data.state is RunMode) + { + AchievementSystem.runmode(_loc1_); + } + this._lastHeight = Data.state.caveHeight; + this._heightText.text = this._lastHeight + "M"; + } + this._gun.update(); + this._characterButton.update(); + this._statisticsButton.update(); + this._messageButton.update(); + if(this.maxgames != null) + { + this.maxgames.update(); + } + } + + public function showGuns(param1:Boolean = false) : void + { + if(!(Data.state is TadpoleMode)) + { + this._gun.show(param1); + } + } + + override public function draw() : void + { + if(!Data.state.inMenu) + { + super.draw(); + this._gun.draw(); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/UI_cButtonSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/UI_cButtonSprite.as new file mode 100644 index 0000000..00b4871 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/UI_cButtonSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/159_com.arc.dh.state.UI_cButtonSprite.png")] + public class UI_cButtonSprite extends BitmapAsset + { + + public function UI_cButtonSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/UI_diamondsSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/UI_diamondsSprite.as new file mode 100644 index 0000000..919d93e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/UI_diamondsSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/43_com.arc.dh.state.UI_diamondsSprite.png")] + public class UI_diamondsSprite extends BitmapAsset + { + + public function UI_diamondsSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/UI_distanceSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/UI_distanceSprite.as new file mode 100644 index 0000000..f4824df --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/UI_distanceSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/142_com.arc.dh.state.UI_distanceSprite.png")] + public class UI_distanceSprite extends BitmapAsset + { + + public function UI_distanceSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/UI_heightSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/UI_heightSprite.as new file mode 100644 index 0000000..c77b644 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/UI_heightSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/139_com.arc.dh.state.UI_heightSprite.png")] + public class UI_heightSprite extends BitmapAsset + { + + public function UI_heightSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/UI_mButtonSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/UI_mButtonSprite.as new file mode 100644 index 0000000..3661ed5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/UI_mButtonSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/219_com.arc.dh.state.UI_mButtonSprite.png")] + public class UI_mButtonSprite extends BitmapAsset + { + + public function UI_mButtonSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/UI_mg.as b/research/inner_decompiled/scripts/com/arc/dh/state/UI_mg.as new file mode 100644 index 0000000..d714a8f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/UI_mg.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/105_com.arc.dh.state.UI_mg.png")] + public class UI_mg extends BitmapAsset + { + + public function UI_mg() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/UI_sButtonSprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/UI_sButtonSprite.as new file mode 100644 index 0000000..f737f86 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/UI_sButtonSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/145_com.arc.dh.state.UI_sButtonSprite.png")] + public class UI_sButtonSprite extends BitmapAsset + { + + public function UI_sButtonSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/WeaponUI.as b/research/inner_decompiled/scripts/com/arc/dh/state/WeaponUI.as new file mode 100644 index 0000000..fbdf4cc --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/WeaponUI.as @@ -0,0 +1,134 @@ +package com.arc.dh.state +{ + import com.arc.dh.Gun; + import com.arc.dh.util.Data; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class WeaponUI extends ArcGroup + { + + private static const sprite:Class = WeaponUI_sprite; + + private static const FADE_SPEED:Number = 3; + + private static const SCROLL_SPEED:Number = 30; + + private var guns:Array = new Array(); + + private var gunMap:Array = [Gun.PRIME,Gun.SPREADER,Gun.MISSILE,Gun.REBOUNDER]; + + private var gunDataMap:Array = ["prime","spreader","missile","rebound"]; + + private var gunSpriteMap:Array = new Array(); + + private var fadeTimer:Number = 2; + + private var fadeState:int = 2; + + public function WeaponUI(param1:Number, param2:Number) + { + var _loc4_:ArcSprite = null; + super(param1,param2); + var _loc3_:int = 0; + while(_loc3_ < 4) + { + _loc4_ = new ArcSprite(_loc3_ * 20,0); + _loc4_.loadGraphic(sprite,true,false,20,18); + _loc4_.frame = Data[this.gunDataMap[_loc3_]] == 1 ? uint(_loc3_) : 4; + _loc4_.y = Data.gun == this.gunMap[_loc3_] ? 0 : -5; + this.add(_loc4_); + this.gunSpriteMap[_loc3_] = _loc4_; + _loc3_++; + } + if(Data.prime == 0 || Data.state is TadpoleMode) + { + alpha = 0; + this.fadeState = 0; + } + setAll("scrollFactor",new FlxPoint(0,0)); + } + + public function show(param1:Boolean = false) : void + { + var _loc2_:int = 0; + var _loc3_:ArcSprite = null; + this.fadeState = 1; + if(param1) + { + _loc2_ = 0; + while(_loc2_ < 4) + { + _loc3_ = this.gunSpriteMap[_loc2_]; + _loc3_.frame = Data[this.gunDataMap[_loc2_]] == 1 ? uint(_loc2_) : 4; + _loc2_++; + } + } + } + + override public function update() : void + { + var _loc2_:ArcSprite = null; + if(this.fadeState == 0) + { + return; + } + if(this.fadeState == 1) + { + alpha += FlxG.elapsed * FADE_SPEED; + if(alpha >= 1) + { + alpha = 1; + this.fadeState = 2; + this.fadeTimer = 2; + } + } + else if(this.fadeState == 2) + { + this.fadeTimer -= FlxG.elapsed; + if(this.fadeTimer <= 0) + { + this.fadeState = 3; + } + } + else if(this.fadeState == 3) + { + alpha -= FlxG.elapsed * FADE_SPEED; + if(alpha <= 0) + { + alpha = 0; + this.fadeState = 0; + } + } + var _loc1_:int = 0; + while(_loc1_ < 4) + { + _loc2_ = this.gunSpriteMap[_loc1_]; + if(Data.gun == this.gunMap[_loc1_]) + { + if(_loc2_.y < 0) + { + _loc2_.y += FlxG.elapsed * SCROLL_SPEED; + if(_loc2_.y > 0) + { + _loc2_.y = 0; + } + } + } + else if(_loc2_.y > -5) + { + _loc2_.y -= FlxG.elapsed * SCROLL_SPEED; + if(_loc2_.y < -5) + { + _loc2_.y = -5; + } + } + _loc1_++; + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/state/WeaponUI_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/state/WeaponUI_sprite.as new file mode 100644 index 0000000..84362aa --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/state/WeaponUI_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.state +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/83_com.arc.dh.state.WeaponUI_sprite.png")] + public class WeaponUI_sprite extends BitmapAsset + { + + public function WeaponUI_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Achievement.as b/research/inner_decompiled/scripts/com/arc/dh/util/Achievement.as new file mode 100644 index 0000000..c6b8258 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Achievement.as @@ -0,0 +1,114 @@ +package com.arc.dh.util +{ + public class Achievement + { + + public static const DIAMONDS_1:int = 0; + + public static const ENEMIES_1:int = 1; + + public static const CHAPTERS_1:int = 2; + + public static const SKILLS_1:int = 3; + + public static const GUNS_1:int = 4; + + public static const CLIMB_1:int = 5; + + public static const HEARTCRYSTAL_1:int = 6; + + public static const REDDIAMONDS_1:int = 7; + + public static const BULLETS:int = 8; + + public static const POWERUP_1:int = 9; + + public static const DIAMONDS_2:int = 10; + + public static const LAVADEATH:int = 11; + + public static const BOXES_1:int = 12; + + public static const POTS_1:int = 13; + + public static const CHECKPOINTS:int = 14; + + public static const DIAMONDS_3:int = 15; + + public static const CLIMB_2:int = 16; + + public static const HEARTCRYSTAL_2:int = 17; + + public static const CHAPTERS_2:int = 18; + + public static const ENEMIES_2:int = 19; + + public static const SKILLS_2:int = 20; + + public static const GUNS_2:int = 21; + + public static const REDDIAMONDS_2:int = 22; + + public static const RUNMODE:int = 23; + + public static const CHAPTER1SPEED:int = 24; + + public static const CHAPTER2SPEED:int = 25; + + public static const CHAPTER1PACIFIST:int = 26; + + public static const SNAILIMMUNE:int = 27; + + public static const CH4MISSILEONLY:int = 28; + + public static const BOSSRUSH:int = 29; + + public static const DIAMONDS_4:int = 30; + + public static const CLIMB_3:int = 31; + + public static const CHAPTERS_3:int = 32; + + public static const ENEMIES_3:int = 33; + + public static const SKILLS_3:int = 34; + + public static const GUNS_3:int = 35; + + public static const REDDIAMONDS_3:int = 36; + + public static const TADPOLEMODE:int = 37; + + public static const GOLDBIRDS:int = 38; + + public static const CLIMB_4:int = 39; + + public static const CLIMB_5:int = 40; + + public static const SKILLSGUNS_4:int = 41; + + public static const HEARTCRYSTAL_3:int = 42; + + public static const REDDIAMONDS_4:int = 43; + + public static const HEROICRUSH:int = 44; + + public var id:int; + + public var name:String; + + public var description:String; + + public var type:int; + + public function Achievement(param1:int, param2:int, param3:String, param4:String) + { + super(); + this.id = param2; + this.name = param3; + this.description = param4; + this.type = param1; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/AchievementSystem.as b/research/inner_decompiled/scripts/com/arc/dh/util/AchievementSystem.as new file mode 100644 index 0000000..eefd1d9 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/AchievementSystem.as @@ -0,0 +1,359 @@ +package com.arc.dh.util +{ + import com.arc.dh.state.Trophy; + + public class AchievementSystem + { + + public static var achievementWindow:AchievementWindow; + + public static var achievements:Array = new Array(); + + achievements[Achievement.DIAMONDS_1] = new Achievement(Trophy.BRONZE,Achievement.DIAMONDS_1,"All Your Diamonds Are Belong To Us","Collect 100 diamonds"); + achievements[Achievement.ENEMIES_1] = new Achievement(Trophy.BRONZE,Achievement.ENEMIES_1,"Will They Blend?","Defeat 50 enemies"); + achievements[Achievement.CHAPTERS_1] = new Achievement(Trophy.BRONZE,Achievement.CHAPTERS_1,"The First Of Many","Complete chapter 1 of story mode"); + achievements[Achievement.SKILLS_1] = new Achievement(Trophy.BRONZE,Achievement.SKILLS_1,"Dunning-Kruger Effect","Buy 5 character upgrades"); + achievements[Achievement.GUNS_1] = new Achievement(Trophy.BRONZE,Achievement.GUNS_1,"Boom Headshot!","Buy 5 gun upgrades"); + achievements[Achievement.CLIMB_1] = new Achievement(Trophy.BRONZE,Achievement.CLIMB_1,"I\'m Going To Space","Climb 100m in Escape Mode"); + achievements[Achievement.HEARTCRYSTAL_1] = new Achievement(Trophy.BRONZE,Achievement.HEARTCRYSTAL_1,"At Least You Don\'t Need Four","Collect a heart crystal"); + achievements[Achievement.REDDIAMONDS_1] = new Achievement(Trophy.BRONZE,Achievement.REDDIAMONDS_1,"Double Diamond All The Way","Collect 2 red diamonds"); + achievements[Achievement.BULLETS] = new Achievement(Trophy.BRONZE,Achievement.BULLETS,"Nuke It From Orbit","Shoot 20,000 bullets"); + achievements[Achievement.POWERUP_1] = new Achievement(Trophy.BRONZE,Achievement.POWERUP_1,"Happy Explosion Day, Gorgeous","Activate 50 powerups"); + achievements[Achievement.LAVADEATH] = new Achievement(Trophy.BRONZE,Achievement.LAVADEATH,"You Dun Goofed","Fall in the lava in Escape Mode"); + achievements[Achievement.DIAMONDS_2] = new Achievement(Trophy.BRONZE,Achievement.DIAMONDS_2,"This Is Sparta","Collect 300 diamonds"); + achievements[Achievement.BOXES_1] = new Achievement(Trophy.BRONZE,Achievement.BOXES_1,"Amazon won\'t be happy","Destroy 1,000 boxes"); + achievements[Achievement.POTS_1] = new Achievement(Trophy.BRONZE,Achievement.POTS_1,"Pots? In my cave?","Destroy 300 clay pots."); + achievements[Achievement.CHECKPOINTS] = new Achievement(Trophy.BRONZE,Achievement.CHECKPOINTS,"Can Has Checkpoints","Buy all 5 checkpoints in Escape Mode"); + achievements[Achievement.DIAMONDS_3] = new Achievement(Trophy.SILVER,Achievement.DIAMONDS_3,"Push Button, Receive Diamond","Collect 2,000 diamonds"); + achievements[Achievement.CLIMB_2] = new Achievement(Trophy.SILVER,Achievement.CLIMB_2,"Gonna Be In Space","Climb 500m in Escape Mode"); + achievements[Achievement.HEARTCRYSTAL_2] = new Achievement(Trophy.SILVER,Achievement.HEARTCRYSTAL_2,"Not Quite An Arc Reactor","Collect 6 heart crystals"); + achievements[Achievement.CHAPTERS_2] = new Achievement(Trophy.SILVER,Achievement.CHAPTERS_2,"Meanwhile In Chapter 4","Complete Chapter 4"); + achievements[Achievement.ENEMIES_2] = new Achievement(Trophy.SILVER,Achievement.ENEMIES_2,"Slimes On A Plane","Defeat 200 enemies"); + achievements[Achievement.SKILLS_2] = new Achievement(Trophy.SILVER,Achievement.SKILLS_2,"Upgrayedd","Buy 20 character upgrades"); + achievements[Achievement.GUNS_2] = new Achievement(Trophy.SILVER,Achievement.GUNS_2,"Gonna Need A Bigger Gun","Buy 25 gun upgrades"); + achievements[Achievement.REDDIAMONDS_2] = new Achievement(Trophy.SILVER,Achievement.REDDIAMONDS_2,"Red Diamonds Are Forever","Collect 10 red diamonds"); + achievements[Achievement.RUNMODE] = new Achievement(Trophy.SILVER,Achievement.RUNMODE,"Can I Bolt?","Reach 2000m in the runner minigame mode"); + achievements[Achievement.CHAPTER1SPEED] = new Achievement(Trophy.SILVER,Achievement.CHAPTER1SPEED,"Leeeroooyyyy Jeennkkiinnsss","Complete chapter 1 in under 1 minute 50 seconds"); + achievements[Achievement.CHAPTER2SPEED] = new Achievement(Trophy.SILVER,Achievement.CHAPTER2SPEED,"Sequence Breaker","Complete chapter 2 in under 2 minutes 10 seconds"); + achievements[Achievement.CHAPTER1PACIFIST] = new Achievement(Trophy.SILVER,Achievement.CHAPTER1PACIFIST,"The First Amendment","Reach the Giant Slime\'s room at the end of chapter 1 without killing a single enemy"); + achievements[Achievement.SNAILIMMUNE] = new Achievement(Trophy.SILVER,Achievement.SNAILIMMUNE,"Do A Barrel Roll!","Defeat the Snail King in Normal Boss Rush or Practice Boss Rush without taking any damage"); + achievements[Achievement.CH4MISSILEONLY] = new Achievement(Trophy.SILVER,Achievement.CH4MISSILEONLY,"Forever Alone","Complete chapter 4 using only the missile gun"); + achievements[Achievement.BOSSRUSH] = new Achievement(Trophy.SILVER,Achievement.BOSSRUSH,"Practice Makes Perfect","Complete Normal Boss Rush"); + achievements[Achievement.DIAMONDS_4] = new Achievement(Trophy.GOLD,Achievement.DIAMONDS_4,"It\'s Over 9000!","Collect 10,000 diamonds"); + achievements[Achievement.CLIMB_3] = new Achievement(Trophy.GOLD,Achievement.CLIMB_3,"Here Come The Space Cops","Climb 1000m in Escape Mode"); + achievements[Achievement.CHAPTERS_3] = new Achievement(Trophy.GOLD,Achievement.CHAPTERS_3,"The Ultimate Showdown","Defeat the Professor in Chapter 7"); + achievements[Achievement.ENEMIES_3] = new Achievement(Trophy.GOLD,Achievement.ENEMIES_3,"Killers Gonna Kill","Defeat 750 enemies"); + achievements[Achievement.SKILLS_3] = new Achievement(Trophy.GOLD,Achievement.SKILLS_3,"Which Skill Will I Take?","Buy 40 character upgrades"); + achievements[Achievement.GUNS_3] = new Achievement(Trophy.GOLD,Achievement.GUNS_3,"Locked And Loaded","Buy 50 gun upgrades"); + achievements[Achievement.REDDIAMONDS_3] = new Achievement(Trophy.GOLD,Achievement.REDDIAMONDS_3,"Rubies?","Collect 20 red diamonds"); + achievements[Achievement.TADPOLEMODE] = new Achievement(Trophy.GOLD,Achievement.TADPOLEMODE,"Just Keep Swimming","Reach 800m in the tadpole minigame mode"); + achievements[Achievement.GOLDBIRDS] = new Achievement(Trophy.GOLD,Achievement.GOLDBIRDS,"Bird! Bird! Bird! It\'s evil!","Have 10 golden birds alive at the same time while fighting the Stone Bird in Boss Rush"); + achievements[Achievement.CLIMB_4] = new Achievement(Trophy.GOLD,Achievement.CLIMB_4,"I\'m The Best At Space","Climb 1500m in Escape Mode"); + achievements[Achievement.CLIMB_5] = new Achievement(Trophy.PLATINUM,Achievement.CLIMB_5,"Fact: Space Does Not Exist","Climb 2,000 meters in Escape Mode\n\nNot required for 100% completion"); + achievements[Achievement.SKILLSGUNS_4] = new Achievement(Trophy.PLATINUM,Achievement.SKILLSGUNS_4,"Upgrade Complete","Buy all gun and\ncharacter upgrades\n\nNot required for 100% completion"); + achievements[Achievement.HEARTCRYSTAL_3] = new Achievement(Trophy.PLATINUM,Achievement.HEARTCRYSTAL_3,"The Hunt For Red October","Find all 17 heart crystals\n\nNot required for 100% completion"); + achievements[Achievement.REDDIAMONDS_4] = new Achievement(Trophy.PLATINUM,Achievement.REDDIAMONDS_4,"The Tickets Are Now Diamonds","Collect all 35 red\ndiamonds\n\nNot required for 100% completion"); + achievements[Achievement.HEROICRUSH] = new Achievement(Trophy.PLATINUM,Achievement.HEROICRUSH,"Herobrine","Complete Heroic Boss Rush\n\nNot required for 100% completion"); + + public function AchievementSystem() + { + super(); + } + + public static function get(param1:int) : Achievement + { + return achievements[param1]; + } + + public static function achieve(param1:int) : void + { + if(Data.achievements[param1] == 0) + { + Data.achievements[param1] = 1; + achievementWindow = new AchievementWindow(get(param1).name.toUpperCase()); + SoundSystem.play(Sound.ACHIEVEMENT); + } + } + + public static function checkpoints() : void + { + var _loc1_:int = 0; + var _loc2_:int = 0; + while(_loc2_ < Data.escape.length) + { + _loc1_ += Data.escape[_loc2_]; + _loc2_++; + } + if(_loc1_ >= 6) + { + AchievementSystem.achieve(Achievement.CHECKPOINTS); + } + } + + public static function lava() : void + { + AchievementSystem.achieve(Achievement.LAVADEATH); + } + + public static function powerups() : void + { + if(Data.powerups >= 50) + { + AchievementSystem.achieve(Achievement.POWERUP_1); + } + } + + public static function heartcrystal() : void + { + var _loc1_:int = 0; + var _loc2_:int = 0; + while(_loc2_ < Data.heartcrystals.length) + { + _loc1_ += Data.heartcrystals[_loc2_]; + _loc2_++; + } + if(_loc1_ >= 1) + { + AchievementSystem.achieve(Achievement.HEARTCRYSTAL_1); + } + if(_loc1_ >= 6) + { + AchievementSystem.achieve(Achievement.HEARTCRYSTAL_2); + } + if(_loc1_ >= 17) + { + AchievementSystem.achieve(Achievement.HEARTCRYSTAL_3); + } + } + + public static function bullets() : void + { + if(Data.bullets >= 20000) + { + AchievementSystem.achieve(Achievement.BULLETS); + } + } + + public static function runmode(param1:int) : void + { + if(param1 > 2000) + { + AchievementSystem.achieve(Achievement.RUNMODE); + } + } + + public static function tadpolemode(param1:int) : void + { + if(param1 > 800) + { + AchievementSystem.achieve(Achievement.TADPOLEMODE); + } + } + + public static function boxes() : void + { + if(Data.boxes >= 1000) + { + AchievementSystem.achieve(Achievement.BOXES_1); + } + } + + public static function pots() : void + { + if(Data.pots >= 300) + { + AchievementSystem.achieve(Achievement.POTS_1); + } + } + + public static function climb(param1:int) : void + { + if(param1 >= 100) + { + AchievementSystem.achieve(Achievement.CLIMB_1); + } + if(param1 >= 500) + { + AchievementSystem.achieve(Achievement.CLIMB_2); + } + if(param1 >= 1000) + { + AchievementSystem.achieve(Achievement.CLIMB_3); + } + if(param1 >= 1500) + { + AchievementSystem.achieve(Achievement.CLIMB_4); + } + if(param1 >= 2000) + { + AchievementSystem.achieve(Achievement.CLIMB_5); + } + } + + public static function skills() : void + { + if(Data.upgrades >= 5) + { + AchievementSystem.achieve(Achievement.SKILLS_1); + } + if(Data.upgrades >= 20) + { + AchievementSystem.achieve(Achievement.SKILLS_2); + } + if(Data.upgrades >= 40) + { + AchievementSystem.achieve(Achievement.SKILLS_3); + } + upgrades(); + } + + public static function guns() : void + { + if(Data.guns >= 5) + { + AchievementSystem.achieve(Achievement.GUNS_1); + } + if(Data.guns >= 25) + { + AchievementSystem.achieve(Achievement.GUNS_2); + } + if(Data.guns >= 50) + { + AchievementSystem.achieve(Achievement.GUNS_3); + } + upgrades(); + } + + public static function upgrades() : void + { + if(Data.guns >= 88 && Data.upgrades >= 60) + { + AchievementSystem.achieve(Achievement.SKILLSGUNS_4); + } + } + + public static function enemies() : void + { + if(Data.enemies >= 50) + { + AchievementSystem.achieve(Achievement.ENEMIES_1); + } + if(Data.enemies >= 200) + { + AchievementSystem.achieve(Achievement.ENEMIES_2); + } + if(Data.enemies >= 750) + { + AchievementSystem.achieve(Achievement.ENEMIES_3); + } + } + + public static function diamonds() : void + { + if(Data.totaldiamonds >= 100) + { + AchievementSystem.achieve(Achievement.DIAMONDS_1); + } + if(Data.totaldiamonds >= 300) + { + AchievementSystem.achieve(Achievement.DIAMONDS_2); + } + if(Data.totaldiamonds >= 2000) + { + AchievementSystem.achieve(Achievement.DIAMONDS_3); + } + if(Data.totaldiamonds >= 10000) + { + AchievementSystem.achieve(Achievement.DIAMONDS_4); + } + } + + public static function reddiamonds() : void + { + var _loc1_:int = 0; + var _loc2_:int = 0; + while(_loc2_ < Data.redDiamonds.length) + { + _loc1_ += Data.redDiamonds[_loc2_]; + _loc2_++; + } + if(_loc1_ >= 2) + { + AchievementSystem.achieve(Achievement.REDDIAMONDS_1); + } + if(_loc1_ >= 10) + { + AchievementSystem.achieve(Achievement.REDDIAMONDS_2); + } + if(_loc1_ >= 20) + { + AchievementSystem.achieve(Achievement.REDDIAMONDS_3); + } + if(_loc1_ >= 35) + { + AchievementSystem.achieve(Achievement.REDDIAMONDS_4); + } + } + + public static function completeChapter(param1:int, param2:int, param3:int) : void + { + if(param1 == 1) + { + AchievementSystem.achieve(Achievement.CHAPTERS_1); + } + if(param1 == 4) + { + AchievementSystem.achieve(Achievement.CHAPTERS_2); + } + if(param1 == 7) + { + AchievementSystem.achieve(Achievement.CHAPTERS_3); + } + if(param1 == 1 && param2 <= 110000) + { + AchievementSystem.achieve(Achievement.CHAPTER1SPEED); + } + if(param1 == 2 && param2 <= 130000) + { + AchievementSystem.achieve(Achievement.CHAPTER2SPEED); + } + } + + public static function reachBoss(param1:int, param2:int) : void + { + if(param2 == 0 && param1 == 1) + { + AchievementSystem.achieve(Achievement.CHAPTER1PACIFIST); + } + } + + public static function snailimmune() : void + { + AchievementSystem.achieve(Achievement.SNAILIMMUNE); + } + + public static function birds(param1:int) : void + { + if(param1 >= 10) + { + AchievementSystem.achieve(Achievement.GOLDBIRDS); + } + } + + public static function bossRush() : void + { + AchievementSystem.achieve(Achievement.BOSSRUSH); + } + + public static function bossRushHeroic() : void + { + AchievementSystem.achieve(Achievement.HEROICRUSH); + } + + public static function nonMissile() : void + { + AchievementSystem.achieve(Achievement.CH4MISSILEONLY); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/AchievementWindow.as b/research/inner_decompiled/scripts/com/arc/dh/util/AchievementWindow.as new file mode 100644 index 0000000..dde7fce --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/AchievementWindow.as @@ -0,0 +1,60 @@ +package com.arc.dh.util +{ + import com.arc.dh.util.text.TextSystem; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxPoint; + + public class AchievementWindow extends ArcGroup + { + + private static const sprite:Class = AchievementWindow_sprite; + + public var bg:ArcSprite; + + public var text:FlxBitmapText; + + public var timer:Number = 2; + + public function AchievementWindow(param1:String = "SPAAAAAAAAAAAAACE") + { + super(); + var _loc2_:int = 80; + var _loc3_:int = 200; + this.bg = new ArcSprite(_loc2_,_loc3_,sprite); + this.add(this.bg); + this.text = new FlxBitmapText(_loc2_ + 3,_loc3_ + 18,Fonts.font(Fonts.SMALL_WHITE),param1,"center",199); + this.add(this.text); + if(TextSystem.active()) + { + this.bg.y = 176; + this.text.y = this.bg.y + 18; + } + else + { + this.bg.y = 200; + this.text.y = this.bg.y + 18; + } + setAll("scrollFactor",new FlxPoint(0,0)); + } + + override public function update() : void + { + this.bg.alpha = alpha; + this.text.alpha = alpha; + if(TextSystem.active()) + { + this.bg.y = 176; + this.text.y = this.bg.y + 18; + } + else + { + this.bg.y = 200; + this.text.y = this.bg.y + 18; + } + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/AchievementWindow_sprite.as b/research/inner_decompiled/scripts/com/arc/dh/util/AchievementWindow_sprite.as new file mode 100644 index 0000000..366f6a8 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/AchievementWindow_sprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/228_com.arc.dh.util.AchievementWindow_sprite.png")] + public class AchievementWindow_sprite extends BitmapAsset + { + + public function AchievementWindow_sprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Config.as b/research/inner_decompiled/scripts/com/arc/dh/util/Config.as new file mode 100644 index 0000000..3fc9d55 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Config.as @@ -0,0 +1,74 @@ +package com.arc.dh.util +{ + public class Config + { + + public static const DEBUG:Boolean = false; + + public static const KONGREGATE:String = "Kongregate"; + + public static const ARMORGAMES:String = "Armor Games"; + + public static const FLASHGAMELICENSE:String = "FGL"; + + public static const PERSONAL:String = "Personal"; + + public static const DISTRIBUTION:String = "Distribution"; + + public static const MAXGAMES:String = "MaxGames"; + + public static const PEGAS:String = "Pegas Games"; + + public static const BLOCK_SIZE:int = 12; + + public static const WIDTH:int = 360; + + public static const HEIGHT:int = 240; + + public static const BLOCK_WIDTH:int = WIDTH / BLOCK_SIZE; + + public static const BLOCK_HEIGHT:int = HEIGHT / BLOCK_SIZE; + + public static const RELEASE:String = PEGAS; + + public static const VERSION:String = "1.21"; + + public static const SPAWN_PADDING:int = 6; + + public static const DESPAWN_PADDING:int = 12; + + public function Config() + { + super(); + } + + public static function getSiteLock() : String + { + switch(RELEASE) + { + case KONGREGATE: + return "kongregate.com"; + case ARMORGAMES: + return "armorgames.com"; + case FLASHGAMELICENSE: + return "flashgamelicense.com"; + case PERSONAL: + return "iarke.us"; + case DISTRIBUTION: + return ""; + default: + return null; + } + } + + public static function externalAPIs() : Boolean + { + if(RELEASE == ARMORGAMES) + { + return false; + } + return true; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Data.as b/research/inner_decompiled/scripts/com/arc/dh/util/Data.as new file mode 100644 index 0000000..d3a9763 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Data.as @@ -0,0 +1,358 @@ +package com.arc.dh.util +{ + import com.arc.dh.Gun; + import com.arc.dh.state.FlxKongregate; + import com.arc.dh.state.PlayMode; + + public class Data + { + + public static var state:PlayMode; + + public static const DEBUG:Boolean = false; + + private static var _hpm:int = 3; + + public static var vitality:int = 0; + + public static var hp:int = hpm; + + public static var heartcrystals:Array = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; + + public static var diamonds:int = 0; + + public static var totaldiamonds:int = 0; + + public static var agility:int = 0; + + public static var jump:int = 0; + + public static var attract:int = 0; + + public static var recover:int = 0; + + public static var aegis:int = 0; + + public static var defense:int = 0; + + public static var primegun:Array = [0,0,0,0]; + + public static var spreadergun:Array = [0,0,0,0]; + + public static var missilegun:Array = [0,0,0,0]; + + public static var reboundgun:Array = [0,0,0,0]; + + public static var prime:int = 0; + + public static var spreader:int = 0; + + public static var missile:int = 0; + + public static var rebound:int = 0; + + public static var autofirer:int = 0; + + public static var lasersight:int = 0; + + public static var skyboots:int = 0; + + public static var moltensuit:int = 0; + + public static var moonboots:int = 0; + + public static var xrayscope:int = 0; + + public static var gun:String = Gun.PRIME; + + public static var maxheight:int = 0; + + public static var enemies:int = 0; + + public static var deaths:int = 0; + + public static var bullets:int = 0; + + public static var time:Number = 0; + + public static var ctime:Number = 0; + + public static var boxes:int = 0; + + public static var pots:int = 0; + + public static var powerups:int = 0; + + public static var maxRunDistance:int = 0; + + public static var maxTadpoleDistance:int = 0; + + public static const CONTROL_MOUSE:int = 0; + + public static const CONTROL_KEYBOARD:int = 1; + + public static const CONTROL_KEYBOARDI:int = 2; + + public static var control:int = CONTROL_MOUSE; + + public static const SPEED_SLOW:int = 0; + + public static const SPEED_MED:int = 1; + + public static const SPEED_FAST:int = 2; + + public static var textspeed:int = SPEED_MED; + + public static const ON:int = 0; + + public static const OFF:int = 1; + + public static var sound:int = ON; + + public static var music:int = ON; + + public static var escape:Array = [1,0,0,0,0,0]; + + public static var boss:Array = [0,0,0,0]; + + public static var redDiamonds:Array = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; + + public static var chapters:Array = [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]; + + public static var achievements:Array = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; + + public static var autofire:Boolean = false; + + public static const GAMEID:int = 4357; + + public static const GUID:String = "04f5a410aedc4d46"; + + public static const API_KEY:String = "55d1b5c4fb01405883aab993346490"; + + if(DEBUG) + { + agility = jump = attract = recover = aegis = defense = 10; + primegun = [10,10,1,1]; + prime = 1; + chapters = [[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0]]; + boss = [1,1,0,0]; + vitality = 17; + moonboots = 1; + skyboots = 1; + } + + public function Data() + { + super(); + } + + public static function get completion() : String + { + var _loc1_:Number = 0; + var _loc2_:Number = 0; + _loc1_ += getAchievementCount(false); + _loc2_ += 40; + _loc1_ += upgrades; + _loc2_ += 60; + _loc1_ += guns; + _loc2_ += 88; + _loc1_ += vitality * 2; + _loc2_ += 17 * 2; + _loc1_ += chapterCount * 3; + _loc2_ += 7 * 3; + _loc1_ += redDiamondCount * 2; + _loc2_ += 35 * 2; + return (_loc1_ / _loc2_ * 100).toFixed(2); + } + + public static function get redDiamondCount() : int + { + var _loc1_:int = 0; + var _loc2_:int = 0; + while(_loc2_ < redDiamonds.length) + { + _loc1_ += redDiamonds[_loc2_]; + _loc2_++; + } + return _loc1_; + } + + public static function get chapterCount() : int + { + var _loc1_:int = 0; + var _loc2_:int = 0; + while(_loc2_ < chapters.length) + { + _loc1_ += chapters[_loc2_][0] > 0 ? 1 : 0; + _loc2_++; + } + return _loc1_; + } + + public static function get upgrades() : int + { + return agility + jump + attract + recover + aegis + defense; + } + + public static function get guns() : int + { + return primegun[0] + primegun[1] + primegun[2] + primegun[3] + spreadergun[0] + spreadergun[1] + spreadergun[2] + spreadergun[3] + missilegun[0] + missilegun[1] + missilegun[2] + missilegun[3] + reboundgun[0] + reboundgun[1] + reboundgun[2] + reboundgun[3]; + } + + public static function getAchievementCount(param1:Boolean = true) : int + { + var _loc2_:int = 0; + var _loc3_:int = 0; + while(_loc3_ < achievements.length) + { + if(param1 || _loc3_ < 40) + { + _loc2_ += achievements[_loc3_]; + } + _loc3_++; + } + return _loc2_; + } + + public static function get hpm() : int + { + return _hpm + vitality; + } + + public static function duration(param1:int, param2:int) : String + { + var _loc3_:int = (param2 - param1) / 1000; + var _loc4_:Number = _loc3_ % 60; + _loc3_ /= 60; + var _loc5_:Number = _loc3_ % 60; + _loc3_ /= 60; + var _loc6_:Number = _loc3_; + return (_loc6_ < 10 ? "0" + _loc6_ : _loc6_.toString()) + ":" + (_loc5_ < 10 ? "0" + _loc5_ : _loc5_.toString()) + ":" + (_loc4_ < 10 ? "0" + _loc4_ : _loc4_.toString()); + } + + public static function hasRed(param1:int, param2:int) : Boolean + { + return redDiamonds[(param1 - 1) * 5 + param2] == 1; + } + + public static function obtainRed(param1:int, param2:int) : void + { + redDiamonds[(param1 - 1) * 5 + param2] = 1; + } + + public static function reset() : void + { + vitality = 0; + hp = hpm; + heartcrystals = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; + diamonds = 0; + totaldiamonds = 0; + agility = 0; + jump = 0; + attract = 0; + recover = 0; + aegis = 0; + defense = 0; + primegun = [0,0,0,0]; + spreadergun = [0,0,0,0]; + missilegun = [0,0,0,0]; + reboundgun = [0,0,0,0]; + prime = 0; + spreader = 0; + missile = 0; + rebound = 0; + autofirer = 0; + lasersight = 0; + skyboots = 0; + moltensuit = 0; + moonboots = 0; + xrayscope = 0; + maxheight = 0; + enemies = 0; + deaths = 0; + bullets = 0; + time = 0; + ctime = 0; + boxes = 0; + pots = 0; + powerups = 0; + control = CONTROL_MOUSE; + textspeed = SPEED_MED; + sound = ON; + music = ON; + escape = [1,0,0,0,0,0]; + boss = [0,0,0,0]; + maxRunDistance = 0; + maxTadpoleDistance = 0; + redDiamonds = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; + chapters = [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]; + achievements = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; + autofire = false; + } + + public static function kong() : void + { + var _loc6_:int = 0; + if(!Config.externalAPIs()) + { + return; + } + var _loc1_:int = 0; + var _loc2_:int = 0; + while(_loc2_ < 7) + { + if(Data.chapters[_loc2_][0] > 0) + { + _loc1_ = _loc2_ + 1; + } + _loc2_++; + } + FlxKongregate.submitStats("chapters_complete",_loc1_); + FlxKongregate.submitStats("escape_height",Data.maxheight); + FlxKongregate.submitStats("run_distance",Data.maxRunDistance); + FlxKongregate.submitStats("tadpole_distance",Data.maxTadpoleDistance); + FlxKongregate.submitStats("enemies_killed",Data.enemies); + _loc1_ = 0; + _loc2_ = 0; + while(_loc2_ < Data.heartcrystals.length) + { + _loc1_ += Data.heartcrystals[_loc2_]; + _loc2_++; + } + FlxKongregate.submitStats("heart_crystals",_loc1_); + FlxKongregate.submitStats("num_upgrades",Data.guns + Data.upgrades); + FlxKongregate.submitStats("total_diamonds",Data.totaldiamonds); + _loc1_ = 0; + _loc2_ = 0; + while(_loc2_ < Data.redDiamonds.length) + { + _loc1_ += Data.redDiamonds[_loc2_]; + _loc2_++; + } + FlxKongregate.submitStats("red_diamonds",_loc1_); + var _loc3_:int = Math.floor(parseFloat(Data.completion)); + FlxKongregate.submitStats("completion_percent_v2",_loc3_); + var _loc4_:int = (Data.boss[1] as int) / 1000; + var _loc5_:int = (Data.boss[3] as int) / 1000; + FlxKongregate.submitStats("normal_boss_time_v2",_loc4_ > 0 ? _loc4_ : 9999); + FlxKongregate.submitStats("heroic_boss_time_v2",_loc5_ > 0 ? _loc5_ : 9999); + _loc1_ = 0; + _loc2_ = 0; + while(_loc2_ < Data.chapters.length) + { + _loc6_ = Data.chapters[_loc2_][1] / 1000; + if(_loc6_ > 0) + { + _loc1_ += _loc6_; + } + else + { + _loc1_ += 9999; + } + _loc2_++; + } + FlxKongregate.submitStats("chapter_speed",_loc1_); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/DataSerializer.as b/research/inner_decompiled/scripts/com/arc/dh/util/DataSerializer.as new file mode 100644 index 0000000..91767bb --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/DataSerializer.as @@ -0,0 +1,276 @@ +package com.arc.dh.util +{ + import com.hurlant.crypto.symmetric.BlowFishKey; + import com.hurlant.crypto.symmetric.ECBMode; + import com.hurlant.crypto.symmetric.ICipher; + import com.hurlant.crypto.symmetric.IPad; + import com.hurlant.crypto.symmetric.PKCS5; + import com.hurlant.util.Base64; + import com.hurlant.util.Hex; + import flash.net.SharedObject; + import flash.utils.ByteArray; + + public class DataSerializer + { + + private static var state:Array; + + private static var key:String = "diamond_hollow_2"; + + public function DataSerializer() + { + super(); + } + + public static function reset() : void + { + Data.reset(); + save(); + } + + public static function save() : void + { + var so:SharedObject = null; + var encrypted:String = null; + try + { + so = SharedObject.getLocal("diamondhollow2"); + encrypted = encrypt(serialize()); + if(encrypted != null) + { + so.data.save = encrypted; + } + so.flush(); + } + catch(error:Error) + { + } + } + + public static function load() : void + { + var so:SharedObject = null; + var unencrypted:String = null; + try + { + so = SharedObject.getLocal("diamondhollow2"); + if(so != null && so.data != null && so.data.save != null) + { + unencrypted = decrypt(so.data.save); + if(unencrypted != null) + { + unserialize(unencrypted); + } + } + } + catch(error:Error) + { + } + } + + public static function serialize() : String + { + state = []; + write(Data.vitality); + write(Data.heartcrystals); + write(Data.diamonds); + write(Data.totaldiamonds); + write(Data.agility); + write(Data.jump); + write(Data.attract); + write(Data.recover); + write(Data.aegis); + write(Data.defense); + write(Data.primegun); + write(Data.spreadergun); + write(Data.missilegun); + write(Data.reboundgun); + write(Data.prime); + write(Data.spreader); + write(Data.missile); + write(Data.rebound); + write(Data.autofirer); + write(Data.lasersight); + write(Data.skyboots); + write(Data.moltensuit); + write(Data.moonboots); + write(Data.xrayscope); + write(Data.maxheight); + write(Data.enemies); + write(Data.deaths); + write(Data.bullets); + write(Data.time); + write(Data.boxes); + write(Data.pots); + write(Data.powerups); + write(Data.control); + write(Data.textspeed); + write(Data.sound); + write(Data.music); + write(Data.escape); + write(Data.redDiamonds); + write(Data.achievements); + write(Data.autofire ? 1 : 0); + write(Data.chapters); + write(Data.boss); + write(Data.maxRunDistance); + write(Data.maxTadpoleDistance); + return state.join(","); + } + + public static function unserialize(param1:String) : void + { + var _loc5_:Array = null; + state = param1.split(","); + Data.vitality = read(int); + Data.heartcrystals = read(Array,17); + Data.diamonds = read(int); + Data.totaldiamonds = read(int); + Data.agility = read(int); + Data.jump = read(int); + Data.attract = read(int); + Data.recover = read(int); + Data.aegis = read(int); + Data.defense = read(int); + Data.primegun = read(Array,4); + Data.spreadergun = read(Array,4); + Data.missilegun = read(Array,4); + Data.reboundgun = read(Array,4); + Data.prime = read(int); + Data.spreader = read(int); + Data.missile = read(int); + Data.rebound = read(int); + Data.autofirer = read(int); + Data.lasersight = read(int); + Data.skyboots = read(int); + Data.moltensuit = read(int); + Data.moonboots = read(int); + Data.xrayscope = read(int); + Data.maxheight = read(int); + Data.enemies = read(int); + Data.deaths = read(int); + Data.bullets = read(int); + Data.time = read(int); + Data.boxes = read(int); + Data.pots = read(int); + Data.powerups = read(int); + Data.control = read(int); + Data.textspeed = read(int); + Data.sound = read(int); + Data.music = read(int); + Data.escape = read(Array,6); + Data.redDiamonds = read(Array,35); + Data.achievements = read(Array,45); + Data.autofire = read(int) == 1 ? true : false; + Data.chapters = new Array(); + var _loc2_:int = 0; + while(_loc2_ < 7) + { + _loc5_ = read(Array,2); + Data.chapters[_loc2_] = _loc5_; + _loc2_++; + } + Data.boss = read(Array,4); + Data.maxRunDistance = read(int); + Data.maxTadpoleDistance = read(int); + var _loc3_:int = 0; + var _loc4_:int = 0; + while(_loc4_ < 17) + { + _loc3_ += Data.heartcrystals[_loc4_]; + _loc4_++; + } + Data.vitality = _loc3_; + } + + public static function write(param1:*) : void + { + var _loc2_:* = undefined; + if(param1 is Array) + { + for each(_loc2_ in param1) + { + write(_loc2_); + } + } + else if(param1 is Number || param1 is int || param1 is String) + { + state.push(param1); + } + } + + public static function read(param1:Class, param2:int = 0) : * + { + var _loc3_:Array = null; + var _loc4_:int = 0; + switch(param1) + { + case int: + return parseInt(state.shift()) as int; + case String: + return state.shift() as String; + case Array: + _loc3_ = []; + _loc4_ = 0; + while(_loc4_ < param2) + { + _loc3_.push(parseInt(state.shift())); + _loc4_++; + } + return _loc3_ as Array; + default: + return null; + } + } + + private static function encrypt(param1:String) : String + { + var output:ByteArray = null; + var pad:IPad = null; + var cipher:ICipher = null; + var data:String = param1; + try + { + output = new ByteArray(); + output.writeUTFBytes(data); + pad = new PKCS5(); + cipher = _getCipher(key,pad); + pad.setBlockSize(cipher.getBlockSize()); + cipher.encrypt(output); + return Base64.encodeByteArray(output); + } + catch(error:Error) + { + } + return null; + } + + private static function decrypt(param1:String) : String + { + var input:ByteArray = null; + var pad:IPad = null; + var cipher:ICipher = null; + var data:String = param1; + try + { + input = Base64.decodeToByteArray(data); + pad = new PKCS5(); + cipher = _getCipher(key,pad); + pad.setBlockSize(cipher.getBlockSize()); + cipher.decrypt(input); + input.position = 0; + return input.readUTFBytes(input.length); + } + catch(error:Error) + { + } + return null; + } + + private static function _getCipher(param1:String, param2:IPad) : ICipher + { + return new ECBMode(new BlowFishKey(Hex.toArray(Hex.fromString(param1))),param2); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Fonts.as b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts.as new file mode 100644 index 0000000..2b6e6a3 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts.as @@ -0,0 +1,77 @@ +package com.arc.dh.util +{ + import org.flixel.FlxBitmapFont; + + public class Fonts + { + + private static var fontSprite:Class = Fonts_fontSprite; + + private static var fontOutlineBlueSprite:Class = Fonts_fontOutlineBlueSprite; + + private static var fontOutlineBlueSSprite:Class = Fonts_fontOutlineBlueSSprite; + + private static var fontOutlineBrownSprite:Class = Fonts_fontOutlineBrownSprite; + + private static var fontOutlineBlackSprite:Class = Fonts_fontOutlineBlackSprite; + + private static var fontOutlineBlackSSprite:Class = Fonts_fontOutlineBlackSSprite; + + private static var fontBevelBlueSprite:Class = Fonts_fontBevelBlueSprite; + + private static var fontBevelGraySprite:Class = Fonts_fontBevelGraySprite; + + private static var fontBevelYellowSprite:Class = Fonts_fontBevelYellowSprite; + + private static var fontOutlineGradientSprite:Class = Fonts_fontOutlineGradientSprite; + + private static var fontOutlineGradientSSprite:Class = Fonts_fontOutlineGradientSSprite; + + public static const SMALL_WHITE:String = "small_white"; + + public static const OUTLINE_BLUE:String = "outline_white"; + + public static const OUTLINE_BLUE_S:String = "outline_blue_s"; + + public static const OUTLINE_BROWN:String = "outline_brown"; + + public static const OUTLINE_BLACK:String = "outline_black"; + + public static const OUTLINE_BLACK_S:String = "outline_black_s"; + + public static const BEVEL_BLUE:String = "bevel_blue"; + + public static const BEVEL_GRAY:String = "bevel_gray"; + + public static const BEVEL_YELLOW:String = "bevel_yellow"; + + public static const OUTLINE_GRADIENT:String = "outline_gradient"; + + public static const OUTLINE_GRADIENT_S:String = "outline_gradient_s"; + + private static var FONTS:Object = new Object(); + + FONTS[SMALL_WHITE] = new FlxBitmapFont(fontSprite,0,7,1,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()"); + FONTS[OUTLINE_BROWN] = new FlxBitmapFont(fontOutlineBrownSprite,0,8,0,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()"); + FONTS[OUTLINE_BLUE] = new FlxBitmapFont(fontOutlineBlueSprite,0,8,0,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()"); + FONTS[OUTLINE_BLUE_S] = new FlxBitmapFont(fontOutlineBlueSSprite,0,8,-1,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()"); + FONTS[OUTLINE_BLACK] = new FlxBitmapFont(fontOutlineBlackSprite,0,8,0,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()"); + FONTS[OUTLINE_BLACK_S] = new FlxBitmapFont(fontOutlineBlackSSprite,0,8,-1,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()"); + FONTS[BEVEL_BLUE] = new FlxBitmapFont(fontBevelBlueSprite,0,9,-1,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()"); + FONTS[BEVEL_GRAY] = new FlxBitmapFont(fontBevelGraySprite,0,9,-1,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()"); + FONTS[BEVEL_YELLOW] = new FlxBitmapFont(fontBevelYellowSprite,0,9,-1,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()"); + FONTS[OUTLINE_GRADIENT] = new FlxBitmapFont(fontOutlineGradientSprite,0,8,0,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()"); + FONTS[OUTLINE_GRADIENT_S] = new FlxBitmapFont(fontOutlineGradientSSprite,0,8,-1,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()"); + + public function Fonts() + { + super(); + } + + public static function font(param1:String) : FlxBitmapFont + { + return FONTS[param1]; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontBevelBlueSprite.as b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontBevelBlueSprite.as new file mode 100644 index 0000000..6c47102 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontBevelBlueSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/162_com.arc.dh.util.Fonts_fontBevelBlueSprite.png")] + public class Fonts_fontBevelBlueSprite extends BitmapAsset + { + + public function Fonts_fontBevelBlueSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontBevelGraySprite.as b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontBevelGraySprite.as new file mode 100644 index 0000000..b26805b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontBevelGraySprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/208_com.arc.dh.util.Fonts_fontBevelGraySprite.png")] + public class Fonts_fontBevelGraySprite extends BitmapAsset + { + + public function Fonts_fontBevelGraySprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontBevelYellowSprite.as b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontBevelYellowSprite.as new file mode 100644 index 0000000..35617f5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontBevelYellowSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/147_com.arc.dh.util.Fonts_fontBevelYellowSprite.png")] + public class Fonts_fontBevelYellowSprite extends BitmapAsset + { + + public function Fonts_fontBevelYellowSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineBlackSSprite.as b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineBlackSSprite.as new file mode 100644 index 0000000..098160f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineBlackSSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/289_com.arc.dh.util.Fonts_fontOutlineBlackSSprite.png")] + public class Fonts_fontOutlineBlackSSprite extends BitmapAsset + { + + public function Fonts_fontOutlineBlackSSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineBlackSprite.as b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineBlackSprite.as new file mode 100644 index 0000000..cee33fc --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineBlackSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/141_com.arc.dh.util.Fonts_fontOutlineBlackSprite.png")] + public class Fonts_fontOutlineBlackSprite extends BitmapAsset + { + + public function Fonts_fontOutlineBlackSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineBlueSSprite.as b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineBlueSSprite.as new file mode 100644 index 0000000..c7a0f0f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineBlueSSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/237_com.arc.dh.util.Fonts_fontOutlineBlueSSprite.png")] + public class Fonts_fontOutlineBlueSSprite extends BitmapAsset + { + + public function Fonts_fontOutlineBlueSSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineBlueSprite.as b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineBlueSprite.as new file mode 100644 index 0000000..0918c2e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineBlueSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/120_com.arc.dh.util.Fonts_fontOutlineBlueSprite.png")] + public class Fonts_fontOutlineBlueSprite extends BitmapAsset + { + + public function Fonts_fontOutlineBlueSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineBrownSprite.as b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineBrownSprite.as new file mode 100644 index 0000000..3946c6f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineBrownSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/52_com.arc.dh.util.Fonts_fontOutlineBrownSprite.png")] + public class Fonts_fontOutlineBrownSprite extends BitmapAsset + { + + public function Fonts_fontOutlineBrownSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineGradientSSprite.as b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineGradientSSprite.as new file mode 100644 index 0000000..9bffa62 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineGradientSSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/77_com.arc.dh.util.Fonts_fontOutlineGradientSSprite.png")] + public class Fonts_fontOutlineGradientSSprite extends BitmapAsset + { + + public function Fonts_fontOutlineGradientSSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineGradientSprite.as b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineGradientSprite.as new file mode 100644 index 0000000..4b0806e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontOutlineGradientSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/234_com.arc.dh.util.Fonts_fontOutlineGradientSprite.png")] + public class Fonts_fontOutlineGradientSprite extends BitmapAsset + { + + public function Fonts_fontOutlineGradientSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontSprite.as b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontSprite.as new file mode 100644 index 0000000..7b792ef --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Fonts_fontSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/148_com.arc.dh.util.Fonts_fontSprite.png")] + public class Fonts_fontSprite extends BitmapAsset + { + + public function Fonts_fontSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem.as b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem.as new file mode 100644 index 0000000..07b883a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem.as @@ -0,0 +1,68 @@ +package com.arc.dh.util +{ + import com.arc.dh.Color; + import com.arc.flixel.ArcParticleSystem; + + public class ParticleSystem + { + + public static var p_black:Class = ParticleSystem_p_black; + + public static var p_red:Class = ParticleSystem_p_red; + + public static var p_blue:Class = ParticleSystem_p_blue; + + public static var p_green:Class = ParticleSystem_p_green; + + public static var p_yellow:Class = ParticleSystem_p_yellow; + + public static var p_purple:Class = ParticleSystem_p_purple; + + public static var p_cyan:Class = ParticleSystem_p_cyan; + + public static var p_white:Class = ParticleSystem_p_white; + + public static var p_prime:Class = ParticleSystem_p_prime; + + public static var p_rebound:Class = ParticleSystem_p_rebound; + + public static var p_diamonds:Class = ParticleSystem_p_diamonds; + + public static var p_pot:Class = ParticleSystem_p_pot; + + public static var p_woodenCrate:Class = ParticleSystem_p_woodenCrate; + + public static var p_steelCrate:Class = ParticleSystem_p_steelCrate; + + private static var _initialized:Boolean = false; + + public function ParticleSystem() + { + super(); + } + + public static function initialize() : void + { + if(_initialized) + { + return; + } + ArcParticleSystem.registerEmitter(Color.RED,p_red,100,false); + ArcParticleSystem.registerEmitter(Color.BLUE,p_blue,100,false); + ArcParticleSystem.registerEmitter(Color.GREEN,p_green,100,false); + ArcParticleSystem.registerEmitter(Color.YELLOW,p_yellow,100,false); + ArcParticleSystem.registerEmitter(Color.PURPLE,p_purple,100,false); + ArcParticleSystem.registerEmitter(Color.BLACK,p_black,100,false); + ArcParticleSystem.registerEmitter(Color.CYAN,p_cyan,100,false); + ArcParticleSystem.registerEmitter(Color.WHITE,p_white,100,false); + ArcParticleSystem.registerEmitter("prime",p_prime,100,true); + ArcParticleSystem.registerEmitter("rebound",p_rebound,100,true); + ArcParticleSystem.registerEmitter("diamonds",p_diamonds,100,true); + ArcParticleSystem.registerEmitter("pot",p_pot,50,true); + ArcParticleSystem.registerEmitter("wooden_crate",p_woodenCrate,50,true); + ArcParticleSystem.registerEmitter("steel_crate",p_steelCrate,50,true); + _initialized = true; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_black.as b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_black.as new file mode 100644 index 0000000..8cee6ad --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_black.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/42_com.arc.dh.util.ParticleSystem_p_black.png")] + public class ParticleSystem_p_black extends BitmapAsset + { + + public function ParticleSystem_p_black() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_blue.as b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_blue.as new file mode 100644 index 0000000..d34336c --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_blue.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/85_com.arc.dh.util.ParticleSystem_p_blue.png")] + public class ParticleSystem_p_blue extends BitmapAsset + { + + public function ParticleSystem_p_blue() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_cyan.as b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_cyan.as new file mode 100644 index 0000000..ddc26c6 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_cyan.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/79_com.arc.dh.util.ParticleSystem_p_cyan.png")] + public class ParticleSystem_p_cyan extends BitmapAsset + { + + public function ParticleSystem_p_cyan() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_diamonds.as b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_diamonds.as new file mode 100644 index 0000000..ae27b0a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_diamonds.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/146.png")] + public class ParticleSystem_p_diamonds extends BitmapAsset + { + + public function ParticleSystem_p_diamonds() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_green.as b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_green.as new file mode 100644 index 0000000..a195beb --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_green.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/220_com.arc.dh.util.ParticleSystem_p_green.png")] + public class ParticleSystem_p_green extends BitmapAsset + { + + public function ParticleSystem_p_green() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_pot.as b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_pot.as new file mode 100644 index 0000000..371b43a --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_pot.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/94_com.arc.dh.util.ParticleSystem_p_pot.png")] + public class ParticleSystem_p_pot extends BitmapAsset + { + + public function ParticleSystem_p_pot() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_prime.as b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_prime.as new file mode 100644 index 0000000..dd5f288 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_prime.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/239_com.arc.dh.util.ParticleSystem_p_prime.png")] + public class ParticleSystem_p_prime extends BitmapAsset + { + + public function ParticleSystem_p_prime() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_purple.as b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_purple.as new file mode 100644 index 0000000..09312e1 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_purple.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/299_com.arc.dh.util.ParticleSystem_p_purple.png")] + public class ParticleSystem_p_purple extends BitmapAsset + { + + public function ParticleSystem_p_purple() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_rebound.as b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_rebound.as new file mode 100644 index 0000000..dd65971 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_rebound.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/53_com.arc.dh.util.ParticleSystem_p_rebound.png")] + public class ParticleSystem_p_rebound extends BitmapAsset + { + + public function ParticleSystem_p_rebound() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_red.as b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_red.as new file mode 100644 index 0000000..57ee0e6 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_red.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/103_com.arc.dh.util.ParticleSystem_p_red.png")] + public class ParticleSystem_p_red extends BitmapAsset + { + + public function ParticleSystem_p_red() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_steelCrate.as b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_steelCrate.as new file mode 100644 index 0000000..868c0d5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_steelCrate.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/271_com.arc.dh.util.ParticleSystem_p_steelCrate.png")] + public class ParticleSystem_p_steelCrate extends BitmapAsset + { + + public function ParticleSystem_p_steelCrate() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_white.as b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_white.as new file mode 100644 index 0000000..5e08658 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_white.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/238_com.arc.dh.util.ParticleSystem_p_white.png")] + public class ParticleSystem_p_white extends BitmapAsset + { + + public function ParticleSystem_p_white() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_woodenCrate.as b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_woodenCrate.as new file mode 100644 index 0000000..c6edf6e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_woodenCrate.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/117_com.arc.dh.util.ParticleSystem_p_woodenCrate.png")] + public class ParticleSystem_p_woodenCrate extends BitmapAsset + { + + public function ParticleSystem_p_woodenCrate() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_yellow.as b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_yellow.as new file mode 100644 index 0000000..be95535 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/ParticleSystem_p_yellow.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/227_com.arc.dh.util.ParticleSystem_p_yellow.png")] + public class ParticleSystem_p_yellow extends BitmapAsset + { + + public function ParticleSystem_p_yellow() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound.as new file mode 100644 index 0000000..28746ca --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound.as @@ -0,0 +1,88 @@ +package com.arc.dh.util +{ + public class Sound + { + + public static const TITLE_MUSIC:Class = Sound_TITLE_MUSIC; + + public static const PLAY_MUSIC:Class = Sound_PLAY_MUSIC; + + public static const PLAY_MUSIC2:Class = Sound_PLAY_MUSIC2; + + public static const BOSS_MUSIC:Class = Sound_BOSS_MUSIC; + + public static const DIAMOND1:Class = Sound_DIAMOND1; + + public static const DIAMOND2:Class = Sound_DIAMOND2; + + public static const DIAMOND3:Class = Sound_DIAMOND3; + + public static const DIAMOND4:Class = Sound_DIAMOND4; + + public static const DIAMOND5:Class = Sound_DIAMOND5; + + public static const SHOOT_SMALL:Class = Sound_SHOOT_SMALL; + + public static const MENU_SELECT:Class = Sound_MENU_SELECT; + + public static const MENU_CLICK:Class = Sound_MENU_CLICK; + + public static const PLAYER_DIE:Class = Sound_PLAYER_DIE; + + public static const ENEMY_DIE:Class = Sound_ENEMY_DIE; + + public static const ACHIEVEMENT:Class = Sound_ACHIEVEMENT; + + public static const CHECKPOINT:Class = Sound_CHECKPOINT; + + public static const POWERUP:Class = Sound_POWERUP; + + public static const WIN:Class = Sound_WIN; + + public static const HURT:Class = Sound_HURT; + + public static const HEART:Class = Sound_HEART; + + public static const RED_DIAMOND:Class = Sound_RED_DIAMOND; + + public static const HEART_CRYSTAL:Class = Sound_HEART_CRYSTAL; + + public static const EQUIPMENT:Class = Sound_EQUIPMENT; + + public static const BUY:Class = Sound_BUY; + + public static const TEXT:Class = Sound_TEXT; + + public static const PLINK:Class = Sound_PLINK; + + public static const JUMP0:Class = Sound_JUMP0; + + public static const JUMP1:Class = Sound_JUMP1; + + public static const JUMP2:Class = Sound_JUMP2; + + public static const JUMP3:Class = Sound_JUMP3; + + public static const POT:Class = Sound_POT; + + public static const BOX:Class = Sound_BOX; + + public static const STEELBOX:Class = Sound_STEELBOX; + + public static const EXPLODE1:Class = Sound_EXPLODE1; + + public static const EXPLODE2:Class = Sound_EXPLODE2; + + public static const EXPLODE3:Class = Sound_EXPLODE3; + + public static const EXPLODE4:Class = Sound_EXPLODE4; + + public static const EXPLODE5:Class = Sound_EXPLODE5; + + public function Sound() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/SoundSystem.as b/research/inner_decompiled/scripts/com/arc/dh/util/SoundSystem.as new file mode 100644 index 0000000..4b78af8 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/SoundSystem.as @@ -0,0 +1,90 @@ +package com.arc.dh.util +{ + import org.flixel.FlxG; + import org.flixel.FlxSound; + + public class SoundSystem + { + + public static var playing:Class; + + public static var wasPlaying:FlxSound; + + public static var playingVolume:Number; + + public function SoundSystem() + { + super(); + } + + public static function music(param1:Class, param2:Number = 1, param3:Number = 0) : void + { + if(playing != param1) + { + if(Data.music == Data.ON) + { + if(playing != null) + { + if(wasPlaying != null && wasPlaying.active) + { + wasPlaying.stop(); + } + wasPlaying = FlxG.music; + wasPlaying.fadeOut(2); + FlxG.music = null; + } + FlxG.playMusic(param1,0.5,param3); + FlxG.music.fadeIn(2); + } + playing = param1; + playingVolume = param2; + } + } + + public static function update() : void + { + if(wasPlaying != null && wasPlaying.active) + { + wasPlaying.update(); + } + } + + public static function fadeOutMusic(param1:Number = 0.5) : void + { + if(FlxG.music != null) + { + } + } + + public static function play(param1:Class, param2:Number = 1) : void + { + if(Data.sound == Data.ON) + { + FlxG.play(param1,param2); + } + } + + public static function mute() : void + { + FlxG.music.stop(); + Data.music = Data.OFF; + } + + public static function unmute() : void + { + FlxG.playMusic(playing,playingVolume); + Data.music = Data.ON; + } + + public static function muteSounds() : void + { + Data.sound = Data.OFF; + } + + public static function unmuteSounds() : void + { + Data.sound = Data.ON; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_ACHIEVEMENT.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_ACHIEVEMENT.as new file mode 100644 index 0000000..c872666 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_ACHIEVEMENT.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/32_com.arc.dh.util.Sound_ACHIEVEMENT_com.arc.dh.util.Sound_ACHIEVEMENT.mp3")] + public class Sound_ACHIEVEMENT extends SoundAsset + { + + public function Sound_ACHIEVEMENT() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_BOSS_MUSIC.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_BOSS_MUSIC.as new file mode 100644 index 0000000..48b7e36 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_BOSS_MUSIC.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/7_com.arc.dh.util.Sound_BOSS_MUSIC_com.arc.dh.util.Sound_BOSS_MUSIC.mp3")] + public class Sound_BOSS_MUSIC extends SoundAsset + { + + public function Sound_BOSS_MUSIC() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_BOX.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_BOX.as new file mode 100644 index 0000000..a7f744e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_BOX.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/8_com.arc.dh.util.Sound_BOX_com.arc.dh.util.Sound_BOX.mp3")] + public class Sound_BOX extends SoundAsset + { + + public function Sound_BOX() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_BUY.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_BUY.as new file mode 100644 index 0000000..eec7b41 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_BUY.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/38_com.arc.dh.util.Sound_BUY_com.arc.dh.util.Sound_BUY.mp3")] + public class Sound_BUY extends SoundAsset + { + + public function Sound_BUY() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_CHECKPOINT.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_CHECKPOINT.as new file mode 100644 index 0000000..beda4e1 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_CHECKPOINT.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/12_com.arc.dh.util.Sound_CHECKPOINT_com.arc.dh.util.Sound_CHECKPOINT.mp3")] + public class Sound_CHECKPOINT extends SoundAsset + { + + public function Sound_CHECKPOINT() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_DIAMOND1.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_DIAMOND1.as new file mode 100644 index 0000000..e53167d --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_DIAMOND1.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/14_com.arc.dh.util.Sound_DIAMOND1_com.arc.dh.util.Sound_DIAMOND1.mp3")] + public class Sound_DIAMOND1 extends SoundAsset + { + + public function Sound_DIAMOND1() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_DIAMOND2.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_DIAMOND2.as new file mode 100644 index 0000000..9df5fc9 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_DIAMOND2.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/13_com.arc.dh.util.Sound_DIAMOND2_com.arc.dh.util.Sound_DIAMOND2.mp3")] + public class Sound_DIAMOND2 extends SoundAsset + { + + public function Sound_DIAMOND2() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_DIAMOND3.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_DIAMOND3.as new file mode 100644 index 0000000..4c706a2 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_DIAMOND3.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/17_com.arc.dh.util.Sound_DIAMOND3_com.arc.dh.util.Sound_DIAMOND3.mp3")] + public class Sound_DIAMOND3 extends SoundAsset + { + + public function Sound_DIAMOND3() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_DIAMOND4.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_DIAMOND4.as new file mode 100644 index 0000000..213638f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_DIAMOND4.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/15_com.arc.dh.util.Sound_DIAMOND4_com.arc.dh.util.Sound_DIAMOND4.mp3")] + public class Sound_DIAMOND4 extends SoundAsset + { + + public function Sound_DIAMOND4() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_DIAMOND5.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_DIAMOND5.as new file mode 100644 index 0000000..57cfb3f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_DIAMOND5.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/26_com.arc.dh.util.Sound_DIAMOND5_com.arc.dh.util.Sound_DIAMOND5.mp3")] + public class Sound_DIAMOND5 extends SoundAsset + { + + public function Sound_DIAMOND5() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_ENEMY_DIE.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_ENEMY_DIE.as new file mode 100644 index 0000000..a403497 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_ENEMY_DIE.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/5_com.arc.dh.util.Sound_ENEMY_DIE_com.arc.dh.util.Sound_ENEMY_DIE.mp3")] + public class Sound_ENEMY_DIE extends SoundAsset + { + + public function Sound_ENEMY_DIE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EQUIPMENT.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EQUIPMENT.as new file mode 100644 index 0000000..0226423 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EQUIPMENT.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/11_com.arc.dh.util.Sound_EQUIPMENT_com.arc.dh.util.Sound_EQUIPMENT.mp3")] + public class Sound_EQUIPMENT extends SoundAsset + { + + public function Sound_EQUIPMENT() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EXPLODE1.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EXPLODE1.as new file mode 100644 index 0000000..e20302f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EXPLODE1.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/18_com.arc.dh.util.Sound_EXPLODE1_com.arc.dh.util.Sound_EXPLODE1.mp3")] + public class Sound_EXPLODE1 extends SoundAsset + { + + public function Sound_EXPLODE1() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EXPLODE2.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EXPLODE2.as new file mode 100644 index 0000000..2b4eb5c --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EXPLODE2.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/23_com.arc.dh.util.Sound_EXPLODE2_com.arc.dh.util.Sound_EXPLODE2.mp3")] + public class Sound_EXPLODE2 extends SoundAsset + { + + public function Sound_EXPLODE2() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EXPLODE3.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EXPLODE3.as new file mode 100644 index 0000000..a75c387 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EXPLODE3.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/25_com.arc.dh.util.Sound_EXPLODE3_com.arc.dh.util.Sound_EXPLODE3.mp3")] + public class Sound_EXPLODE3 extends SoundAsset + { + + public function Sound_EXPLODE3() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EXPLODE4.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EXPLODE4.as new file mode 100644 index 0000000..a6bdebe --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EXPLODE4.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/19_com.arc.dh.util.Sound_EXPLODE4_com.arc.dh.util.Sound_EXPLODE4.mp3")] + public class Sound_EXPLODE4 extends SoundAsset + { + + public function Sound_EXPLODE4() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EXPLODE5.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EXPLODE5.as new file mode 100644 index 0000000..ee553dd --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_EXPLODE5.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/21_com.arc.dh.util.Sound_EXPLODE5_com.arc.dh.util.Sound_EXPLODE5.mp3")] + public class Sound_EXPLODE5 extends SoundAsset + { + + public function Sound_EXPLODE5() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_HEART.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_HEART.as new file mode 100644 index 0000000..037f677 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_HEART.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/28_com.arc.dh.util.Sound_HEART_com.arc.dh.util.Sound_HEART.mp3")] + public class Sound_HEART extends SoundAsset + { + + public function Sound_HEART() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_HEART_CRYSTAL.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_HEART_CRYSTAL.as new file mode 100644 index 0000000..32365c6 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_HEART_CRYSTAL.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/37_com.arc.dh.util.Sound_HEART_CRYSTAL_com.arc.dh.util.Sound_HEART_CRYSTAL.mp3")] + public class Sound_HEART_CRYSTAL extends SoundAsset + { + + public function Sound_HEART_CRYSTAL() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_HURT.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_HURT.as new file mode 100644 index 0000000..b7799fa --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_HURT.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/35_com.arc.dh.util.Sound_HURT_com.arc.dh.util.Sound_HURT.mp3")] + public class Sound_HURT extends SoundAsset + { + + public function Sound_HURT() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_JUMP0.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_JUMP0.as new file mode 100644 index 0000000..f9b7cf1 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_JUMP0.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/27_com.arc.dh.util.Sound_JUMP0_com.arc.dh.util.Sound_JUMP0.mp3")] + public class Sound_JUMP0 extends SoundAsset + { + + public function Sound_JUMP0() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_JUMP1.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_JUMP1.as new file mode 100644 index 0000000..2d7ec22 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_JUMP1.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/20_com.arc.dh.util.Sound_JUMP1_com.arc.dh.util.Sound_JUMP1.mp3")] + public class Sound_JUMP1 extends SoundAsset + { + + public function Sound_JUMP1() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_JUMP2.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_JUMP2.as new file mode 100644 index 0000000..3bc2d84 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_JUMP2.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/22_com.arc.dh.util.Sound_JUMP2_com.arc.dh.util.Sound_JUMP2.mp3")] + public class Sound_JUMP2 extends SoundAsset + { + + public function Sound_JUMP2() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_JUMP3.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_JUMP3.as new file mode 100644 index 0000000..60266a7 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_JUMP3.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/24_com.arc.dh.util.Sound_JUMP3_com.arc.dh.util.Sound_JUMP3.mp3")] + public class Sound_JUMP3 extends SoundAsset + { + + public function Sound_JUMP3() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_MENU_CLICK.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_MENU_CLICK.as new file mode 100644 index 0000000..a033cd9 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_MENU_CLICK.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/33_com.arc.dh.util.Sound_MENU_CLICK_com.arc.dh.util.Sound_MENU_CLICK.mp3")] + public class Sound_MENU_CLICK extends SoundAsset + { + + public function Sound_MENU_CLICK() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_MENU_SELECT.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_MENU_SELECT.as new file mode 100644 index 0000000..5471b36 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_MENU_SELECT.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/36_com.arc.dh.util.Sound_MENU_SELECT_com.arc.dh.util.Sound_MENU_SELECT.mp3")] + public class Sound_MENU_SELECT extends SoundAsset + { + + public function Sound_MENU_SELECT() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_PLAYER_DIE.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_PLAYER_DIE.as new file mode 100644 index 0000000..4e57f6f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_PLAYER_DIE.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/10_com.arc.dh.util.Sound_PLAYER_DIE_com.arc.dh.util.Sound_PLAYER_DIE.mp3")] + public class Sound_PLAYER_DIE extends SoundAsset + { + + public function Sound_PLAYER_DIE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_PLAY_MUSIC.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_PLAY_MUSIC.as new file mode 100644 index 0000000..29df6ad --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_PLAY_MUSIC.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/9_com.arc.dh.util.Sound_PLAY_MUSIC_com.arc.dh.util.Sound_PLAY_MUSIC.mp3")] + public class Sound_PLAY_MUSIC extends SoundAsset + { + + public function Sound_PLAY_MUSIC() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_PLAY_MUSIC2.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_PLAY_MUSIC2.as new file mode 100644 index 0000000..e8b486e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_PLAY_MUSIC2.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/4_com.arc.dh.util.Sound_PLAY_MUSIC2_com.arc.dh.util.Sound_PLAY_MUSIC2.mp3")] + public class Sound_PLAY_MUSIC2 extends SoundAsset + { + + public function Sound_PLAY_MUSIC2() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_PLINK.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_PLINK.as new file mode 100644 index 0000000..9731851 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_PLINK.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/30_com.arc.dh.util.Sound_PLINK_com.arc.dh.util.Sound_PLINK.mp3")] + public class Sound_PLINK extends SoundAsset + { + + public function Sound_PLINK() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_POT.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_POT.as new file mode 100644 index 0000000..c808aed --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_POT.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/34_com.arc.dh.util.Sound_POT_com.arc.dh.util.Sound_POT.mp3")] + public class Sound_POT extends SoundAsset + { + + public function Sound_POT() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_POWERUP.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_POWERUP.as new file mode 100644 index 0000000..0589afc --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_POWERUP.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/3_com.arc.dh.util.Sound_POWERUP_com.arc.dh.util.Sound_POWERUP.mp3")] + public class Sound_POWERUP extends SoundAsset + { + + public function Sound_POWERUP() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_RED_DIAMOND.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_RED_DIAMOND.as new file mode 100644 index 0000000..d7f308e --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_RED_DIAMOND.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/31_com.arc.dh.util.Sound_RED_DIAMOND_com.arc.dh.util.Sound_RED_DIAMOND.mp3")] + public class Sound_RED_DIAMOND extends SoundAsset + { + + public function Sound_RED_DIAMOND() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_SHOOT_SMALL.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_SHOOT_SMALL.as new file mode 100644 index 0000000..3bbbcb3 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_SHOOT_SMALL.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/6_com.arc.dh.util.Sound_SHOOT_SMALL_com.arc.dh.util.Sound_SHOOT_SMALL.mp3")] + public class Sound_SHOOT_SMALL extends SoundAsset + { + + public function Sound_SHOOT_SMALL() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_STEELBOX.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_STEELBOX.as new file mode 100644 index 0000000..78242c8 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_STEELBOX.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/29_com.arc.dh.util.Sound_STEELBOX_com.arc.dh.util.Sound_STEELBOX.mp3")] + public class Sound_STEELBOX extends SoundAsset + { + + public function Sound_STEELBOX() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_TEXT.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_TEXT.as new file mode 100644 index 0000000..66f43be --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_TEXT.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/40_com.arc.dh.util.Sound_TEXT_com.arc.dh.util.Sound_TEXT.mp3")] + public class Sound_TEXT extends SoundAsset + { + + public function Sound_TEXT() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_TITLE_MUSIC.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_TITLE_MUSIC.as new file mode 100644 index 0000000..1349229 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_TITLE_MUSIC.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/39_com.arc.dh.util.Sound_TITLE_MUSIC_com.arc.dh.util.Sound_TITLE_MUSIC.mp3")] + public class Sound_TITLE_MUSIC extends SoundAsset + { + + public function Sound_TITLE_MUSIC() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/Sound_WIN.as b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_WIN.as new file mode 100644 index 0000000..f1f9158 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/Sound_WIN.as @@ -0,0 +1,15 @@ +package com.arc.dh.util +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/16_com.arc.dh.util.Sound_WIN_com.arc.dh.util.Sound_WIN.mp3")] + public class Sound_WIN extends SoundAsset + { + + public function Sound_WIN() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/text/Avatar.as b/research/inner_decompiled/scripts/com/arc/dh/util/text/Avatar.as new file mode 100644 index 0000000..c1ec97b --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/text/Avatar.as @@ -0,0 +1,26 @@ +package com.arc.dh.util.text +{ + import com.arc.flixel.ArcSprite; + + public class Avatar + { + + public static const SAGA_SPRITE:Class = Avatar_SAGA_SPRITE; + + public static const PROFESSOR_SPRITE:Class = Avatar_PROFESSOR_SPRITE; + + public static const X:int = 57; + + public static const Y:int = 223; + + public static const SAGA:ArcSprite = new ArcSprite(0,0,SAGA_SPRITE); + + public static const PROFESSOR:ArcSprite = new ArcSprite(0,0,PROFESSOR_SPRITE); + + public function Avatar() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/text/Avatar_PROFESSOR_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/util/text/Avatar_PROFESSOR_SPRITE.as new file mode 100644 index 0000000..9988d7d --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/text/Avatar_PROFESSOR_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.util.text +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/265_com.arc.dh.util.text.Avatar_PROFESSOR_SPRITE.png")] + public class Avatar_PROFESSOR_SPRITE extends BitmapAsset + { + + public function Avatar_PROFESSOR_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/text/Avatar_SAGA_SPRITE.as b/research/inner_decompiled/scripts/com/arc/dh/util/text/Avatar_SAGA_SPRITE.as new file mode 100644 index 0000000..288e7a3 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/text/Avatar_SAGA_SPRITE.as @@ -0,0 +1,15 @@ +package com.arc.dh.util.text +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/116_com.arc.dh.util.text.Avatar_SAGA_SPRITE.png")] + public class Avatar_SAGA_SPRITE extends BitmapAsset + { + + public function Avatar_SAGA_SPRITE() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/text/TextFrame.as b/research/inner_decompiled/scripts/com/arc/dh/util/text/TextFrame.as new file mode 100644 index 0000000..10f5e43 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/text/TextFrame.as @@ -0,0 +1,91 @@ +package com.arc.dh.util.text +{ + import com.arc.dh.util.Config; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxG; + + public class TextFrame extends ArcGroup + { + + private static const frameSprite:Class = TextFrame_frameSprite; + + private static const SCROLL_IN:int = 0; + + private static const SHOWING:int = 1; + + private static const SCROLL_OUT:int = 2; + + private static const HIDING:int = 3; + + private static const TARGET_Y:Number = Config.HEIGHT - 21; + + public static const SCROLL_SPEED:Number = 50; + + private var _frame:ArcSprite; + + private var _state:int = 3; + + public function TextFrame(param1:Number = 0, param2:Number = 0) + { + super(param1,param2); + this._frame = new ArcSprite(0,0,frameSprite); + add(this._frame); + } + + public function reset() : void + { + this._state = HIDING; + this._frame.y = Config.HEIGHT; + } + + public function get ready() : Boolean + { + return this._state == SHOWING; + } + + public function get hidden() : Boolean + { + return this._state == HIDING; + } + + override public function update() : void + { + if(this._state == SCROLL_IN) + { + this._frame.y -= FlxG.elapsed * SCROLL_SPEED; + if(this._frame.y < TARGET_Y) + { + this._frame.y = TARGET_Y; + this._state = SHOWING; + } + } + else if(this._state != SHOWING) + { + if(this._state == SCROLL_OUT) + { + this._frame.y += FlxG.elapsed * SCROLL_SPEED; + if(this._frame.y > Config.HEIGHT) + { + this._frame.y = Config.HEIGHT; + visible = false; + this._state = HIDING; + } + } + } + super.update(); + } + + public function show() : void + { + visible = true; + this._state = SCROLL_IN; + } + + public function hide() : void + { + this._state = SCROLL_OUT; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/text/TextFrame_frameSprite.as b/research/inner_decompiled/scripts/com/arc/dh/util/text/TextFrame_frameSprite.as new file mode 100644 index 0000000..04160e2 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/text/TextFrame_frameSprite.as @@ -0,0 +1,15 @@ +package com.arc.dh.util.text +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/149_com.arc.dh.util.text.TextFrame_frameSprite.png")] + public class TextFrame_frameSprite extends BitmapAsset + { + + public function TextFrame_frameSprite() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/text/TextLine.as b/research/inner_decompiled/scripts/com/arc/dh/util/text/TextLine.as new file mode 100644 index 0000000..2dddc0f --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/text/TextLine.as @@ -0,0 +1,117 @@ +package com.arc.dh.util.text +{ + import org.flixel.FlxBitmapFont; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + + public class TextLine extends FlxBitmapText + { + + private var _offset:int = 0; + + private var _fulltext:String; + + private var _textOffset:int = 0; + + private var _delay:Number = 0.02; + + private var _active:Boolean = false; + + private var _done:Boolean = false; + + private var _targety:int = 0; + + private var _vy:Number = 0; + + private var _fading:Boolean = false; + + public function TextLine(param1:int, param2:FlxBitmapFont, param3:String = " ", param4:String = "left", param5:Number = 0, param6:Boolean = false) + { + super(TextSystem.FRAME_OFFSET + TextSystem.TEXT_OFFSET,223 + param1 * 8,param2,"",param4,param5,param6); + this._fulltext = param3; + this._offset = param1; + alpha = 0.7; + visible = false; + solid = false; + } + + public function push() : void + { + this._targety = y - 8; + this._vy = -20; + --this._offset; + if(this._offset == -1) + { + this._fading = true; + } + } + + public function show() : void + { + visible = true; + } + + override public function update() : void + { + if(!this._done && this._active) + { + this._delay -= FlxG.elapsed; + if(this._delay <= 0) + { + this._delay = TextSystem.TYPE_SPEED * TextSystem.speed; + this.addCharacter(); + } + } + if(this._vy != 0) + { + y += this._vy * FlxG.elapsed; + if(y <= this._targety) + { + y = this._targety; + this._vy = 0; + } + } + if(this._fading) + { + alpha -= FlxG.elapsed * TextSystem.FADE_SPEED; + if(alpha <= 0) + { + exists = false; + visible = false; + alive = false; + } + } + super.update(); + } + + private function addCharacter() : void + { + ++this._textOffset; + text = this._fulltext.substr(0,this._textOffset); + if(this._fulltext.charAt(this._textOffset - 1) == ".") + { + this._delay = TextSystem.FULL_STOP_DELAY * TextSystem.speed; + } + else if(this._fulltext.charAt(this._textOffset - 1) == ",") + { + this._delay = TextSystem.HALF_STOP_DELAY * TextSystem.speed; + } + if(this._textOffset == this._fulltext.length) + { + this._done = true; + } + } + + public function get done() : Boolean + { + return this._done; + } + + public function activate() : void + { + this._active = true; + this.show(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/text/TextSet.as b/research/inner_decompiled/scripts/com/arc/dh/util/text/TextSet.as new file mode 100644 index 0000000..7226d4c --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/text/TextSet.as @@ -0,0 +1,120 @@ +package com.arc.dh.util.text +{ + import com.arc.dh.util.Fonts; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxBitmapText; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + + public class TextSet extends ArcGroup + { + + private var _avatar:ArcSprite; + + private var _text:String; + + private var _activeText:TextLine; + + private var _textQueue:Array = new Array(); + + private var _numShown:int = 0; + + private var _textDelay:Number = 0; + + private var _textMembers:Array = new Array(); + + private var _hiding:Boolean = false; + + public function TextSet(param1:Array) + { + var _loc5_:TextLine = null; + super(); + this._avatar = param1[0]; + this._text = param1[1].toUpperCase(); + var _loc2_:FlxBitmapText = new FlxBitmapText(0,0,Fonts.font(Fonts.OUTLINE_BLUE),this._text,"left",TextSystem.TEXT_WIDTH); + var _loc3_:Array = _loc2_.lines; + var _loc4_:int = 0; + while(_loc4_ < _loc3_.length) + { + _loc5_ = new TextLine(_loc4_,Fonts.font(Fonts.OUTLINE_BLACK),_loc3_[_loc4_] as String,"left",TextSystem.TEXT_WIDTH + 50,true); + this.add(_loc5_); + this._textQueue.push(_loc5_); + this._textMembers.push(_loc5_); + _loc4_++; + } + this._avatar.x = Avatar.X; + this._avatar.y = Avatar.Y; + this.add(this._avatar); + this.next(); + setAll("scrollFactor",new FlxPoint(0,0)); + } + + override public function update() : void + { + if(this._activeText != null && this._activeText.done) + { + if(this._textDelay <= 0) + { + this.next(); + } + else + { + this._textDelay -= FlxG.elapsed; + } + } + if(this._activeText == null && this._textDelay > 0) + { + this._textDelay -= FlxG.elapsed; + } + if(this._hiding) + { + this._textMembers.forEach(function(param1:TextLine, param2:int, param3:Array):void + { + if(param1.visible) + { + param1.y += FlxG.elapsed * TextFrame.SCROLL_SPEED; + } + }); + this._avatar.y += FlxG.elapsed * TextFrame.SCROLL_SPEED; + } + super.update(); + } + + private function next() : void + { + var _loc1_:TextLine = null; + this._activeText = this._textQueue.shift(); + if(this._activeText != null) + { + this._activeText.activate(); + } + else + { + this._textDelay = TextSystem.TEXT_DELAY * TextSystem.speed; + } + if(++this._numShown >= 3 && this._activeText != null) + { + for each(_loc1_ in this._textMembers) + { + _loc1_.push(); + } + } + if(this._numShown % 2 == 0 && this._numShown > 1) + { + this._textDelay = TextSystem.TEXT_DELAY * TextSystem.speed; + } + } + + public function get done() : Boolean + { + return this._activeText == null && this._textDelay <= 0; + } + + public function hide() : void + { + this._hiding = true; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/dh/util/text/TextSystem.as b/research/inner_decompiled/scripts/com/arc/dh/util/text/TextSystem.as new file mode 100644 index 0000000..13dcaf4 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/dh/util/text/TextSystem.as @@ -0,0 +1,194 @@ +package com.arc.dh.util.text +{ + import com.arc.dh.state.PlayMode; + import com.arc.dh.util.Config; + import com.arc.dh.util.Data; + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import com.arc.flixel.ArcGroup; + import com.arc.flixel.ArcSprite; + import org.flixel.FlxPoint; + + public class TextSystem extends ArcGroup + { + + private static var _instance:TextSystem; + + private static const IDLE:int = 0; + + private static const SCROLL_IN:int = 1; + + private static const SHOWING:int = 2; + + private static const SCROLL_OUT:int = 3; + + public static const FRAME_WIDTH:int = 255; + + public static const FRAME_OFFSET:int = 53; + + public static const TEXT_WIDTH:int = 224; + + public static const TEXT_OFFSET:int = 21; + + public static const TYPE_SPEED:Number = 0.02; + + public static const FADE_SPEED:Number = 5; + + public static const TEXT_DELAY:Number = 2; + + public static const FULL_STOP_DELAY:Number = 0.25; + + public static const HALF_STOP_DELAY:Number = 0.1; + + private var _texts:Array; + + private var _currentText:Array; + + private var _state:int; + + private var _frame:TextFrame; + + private var _textset:TextSet; + + public var recent:Array = new Array(); + + public function TextSystem() + { + super(); + this._texts = new Array(); + this._currentText = new Array(); + this._state = IDLE; + this._frame = new TextFrame(FRAME_OFFSET,Config.HEIGHT + 21); + this.add(this._frame); + setAll("scrollFactor",new FlxPoint(0,0)); + } + + public static function get speed() : Number + { + return Data.textspeed == Data.SPEED_FAST ? 0.5 : (Data.textspeed == Data.SPEED_SLOW ? 2 : 1); + } + + public static function reset() : void + { + if(instance._texts == null) + { + return; + } + instance._texts = new Array(); + instance._currentText = new Array(); + instance._state = IDLE; + instance._frame.reset(); + instance._textset = null; + } + + public static function get instance() : TextSystem + { + return _instance == null ? (_instance = new TextSystem()) : _instance; + } + + public static function display(param1:ArcSprite, param2:String) : void + { + if(PlayMode.mode != PlayMode.STORY_MODE) + { + return; + } + instance._texts.push([param1,param2]); + if(instance.recent.length == 0 || instance.recent[instance.recent.length - 1][1] != param2) + { + instance.recent.push([param1,param2]); + } + } + + public static function active() : Boolean + { + return instance._state != IDLE || _instance._texts.length != 0; + } + + override public function update() : void + { + switch(this._state) + { + case IDLE: + this.idle(); + break; + case SCROLL_IN: + this.scrollIn(); + break; + case SHOWING: + this.showing(); + break; + case SCROLL_OUT: + this.scrollOut(); + } + super.update(); + if(this._textset != null) + { + this._textset.update(); + } + } + + override public function draw() : void + { + super.draw(); + if(this._textset != null) + { + this._textset.draw(); + } + } + + private function idle() : void + { + if(this._texts.length > 0) + { + SoundSystem.play(Sound.TEXT); + this._state = SCROLL_IN; + this._frame.show(); + } + } + + private function scrollIn() : void + { + if(this._frame.ready) + { + this._state = SHOWING; + this.setup(); + } + } + + private function showing() : void + { + if(this._textset.done) + { + if(this._texts.length > 0) + { + this.setup(); + } + else + { + this._state = SCROLL_OUT; + this._textset.hide(); + this._frame.hide(); + } + } + } + + private function scrollOut() : void + { + if(this._frame.hidden) + { + this._state = IDLE; + } + } + + private function setup() : void + { + var _loc1_:Array = this._texts.shift(); + this._textset = new TextSet(_loc1_); + } + + override public function destroy() : void + { + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/flixel/ArcButton.as b/research/inner_decompiled/scripts/com/arc/flixel/ArcButton.as new file mode 100644 index 0000000..85a3c54 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/flixel/ArcButton.as @@ -0,0 +1,129 @@ +package com.arc.flixel +{ + import com.arc.dh.util.Sound; + import com.arc.dh.util.SoundSystem; + import org.flixel.FlxG; + + public class ArcButton extends ArcSprite + { + + private var _state:String = "inactive"; + + private var _group:ArcButtonGroup; + + private var _selectable:Boolean = true; + + private var _callbackFunction:Function; + + private var _updateFunction:Function; + + private var _hoverable:Boolean = true; + + public function ArcButton(param1:Number, param2:Number, param3:int, param4:int, param5:Class) + { + super(param1,param2); + loadGraphic(param5,true,false,param3,param4); + addAnimation("inactive",[0],0,false); + addAnimation("hover",[1],0,false); + addAnimation("selected",[2],0,false); + } + + override public function update() : void + { + if(this._state != ButtonState.SELECTED) + { + if(hover() && exists && alive && visible) + { + if(FlxG.mouse.justPressed()) + { + this.select(true,true); + } + else if(this._hoverable) + { + if(this._state != ButtonState.HOVER) + { + SoundSystem.play(Sound.MENU_SELECT); + } + this._state = ButtonState.HOVER; + } + } + else + { + this._state = ButtonState.INACTIVE; + } + } + play(this._state); + if(this._updateFunction != null) + { + this._updateFunction(); + } + super.update(); + } + + public function hoverable(param1:Boolean) : ArcButton + { + this._hoverable = param1; + return this; + } + + public function select(param1:Boolean = true, param2:Boolean = false) : ArcButton + { + if(!param1) + { + return this; + } + if(this._group != null && this._selectable) + { + this._group.unselect(); + } + if(this._callbackFunction != null && param2) + { + this._callbackFunction(); + } + if(this._selectable) + { + this._state = ButtonState.SELECTED; + } + return this; + } + + public function unselect() : void + { + this._state = ButtonState.INACTIVE; + } + + public function setGroup(param1:ArcButtonGroup, param2:Boolean = false) : ArcButton + { + this._group = param1; + if(param2) + { + param1.addButton(this); + } + return this; + } + + public function selectable(param1:Boolean) : ArcButton + { + this._selectable = param1; + return this; + } + + public function callback(param1:Function) : ArcButton + { + this._callbackFunction = param1; + return this; + } + + public function setUpdate(param1:Function) : ArcButton + { + this._updateFunction = param1; + return this; + } + + public function get selected() : Boolean + { + return this._state == ButtonState.SELECTED; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/flixel/ArcButtonGroup.as b/research/inner_decompiled/scripts/com/arc/flixel/ArcButtonGroup.as new file mode 100644 index 0000000..b108dbf --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/flixel/ArcButtonGroup.as @@ -0,0 +1,30 @@ +package com.arc.flixel +{ + import org.flixel.FlxPoint; + + public class ArcButtonGroup extends ArcGroup + { + + public function ArcButtonGroup() + { + super(); + } + + public function addButton(param1:ArcButton) : void + { + param1.setGroup(this); + this.add(param1); + param1.scrollFactor = new FlxPoint(0,0); + } + + public function unselect() : void + { + var _loc1_:ArcButton = null; + for each(_loc1_ in this.members) + { + _loc1_.unselect(); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/flixel/ArcEmitter.as b/research/inner_decompiled/scripts/com/arc/flixel/ArcEmitter.as new file mode 100644 index 0000000..8ad4d32 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/flixel/ArcEmitter.as @@ -0,0 +1,69 @@ +package com.arc.flixel +{ + import org.flixel.FlxG; + + public class ArcEmitter extends ArcSprite + { + + public static var interval:Number = 0.05; + + private var key:Object = 0; + + private var num:int = 0; + + private var dur:int = 0; + + private var timer:Number = interval; + + private var minX:Number = -100; + + private var maxX:Number = 100; + + private var minY:Number = -100; + + private var maxY:Number = 100; + + private var grav:Number; + + private var lifetime:Number; + + public function ArcEmitter(param1:Object, param2:int, param3:int, param4:int, param5:int, param6:Number, param7:Number, param8:Number, param9:Number, param10:Number, param11:Number, param12:int = 0, param13:int = 0) + { + super(); + this.key = param1; + this.x = param2; + this.y = param3; + this.num = param4; + this.dur = param5; + this.grav = param7; + this.lifetime = param6; + this.visible = false; + this.minX = param8; + this.maxX = param9; + this.minY = param10; + this.maxY = param11; + this.width = param12; + this.height = param13; + } + + override public function update() : void + { + this.timer += FlxG.elapsed; + while(this.timer > interval) + { + this.timer -= interval; + --this.dur; + ArcParticleSystem.emitterMap[this.key].setXSpeed(this.minX,this.maxX); + ArcParticleSystem.emitterMap[this.key].setYSpeed(this.minY,this.maxY); + ArcParticleSystem.emitterMap[this.key].gravity = this.grav; + ArcParticleSystem.emitterMap[this.key].setSize(width,height); + ArcParticleSystem.emitParticles(x,y,this.num,this.key,this.lifetime); + } + if(this.dur <= 0) + { + this.kill(); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/flixel/ArcEmitterGroup.as b/research/inner_decompiled/scripts/com/arc/flixel/ArcEmitterGroup.as new file mode 100644 index 0000000..ba188fa --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/flixel/ArcEmitterGroup.as @@ -0,0 +1,18 @@ +package com.arc.flixel +{ + public class ArcEmitterGroup extends ArcGroup + { + + public function ArcEmitterGroup(param1:Number = 0, param2:Number = 0) + { + super(); + x = param1; + y = param2; + } + + override public function destroy() : void + { + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/flixel/ArcGroup.as b/research/inner_decompiled/scripts/com/arc/flixel/ArcGroup.as new file mode 100644 index 0000000..9ba4720 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/flixel/ArcGroup.as @@ -0,0 +1,74 @@ +package com.arc.flixel +{ + import org.flixel.FlxBasic; + import org.flixel.FlxBitmapText; + import org.flixel.FlxGroup; + import org.flixel.FlxObject; + + public class ArcGroup extends FlxGroup + { + + protected var _alpha:Number = 1; + + protected var x:Number = 0; + + protected var y:Number = 0; + + public function ArcGroup(param1:Number = 0, param2:Number = 0) + { + super(); + this.x = param1; + this.y = param2; + } + + public static function shift(param1:FlxBasic, param2:Number, param3:Number) : void + { + var _loc4_:FlxBasic = null; + if(param1 is FlxObject) + { + param1["x"] += param2; + param1["y"] += param3; + } + else if(param1 is FlxGroup) + { + for each(_loc4_ in (param1 as FlxGroup).members) + { + shift(_loc4_,param2,param3); + } + } + } + + public function set alpha(param1:Number) : void + { + var _loc2_:FlxBasic = null; + this._alpha = param1; + for each(_loc2_ in members) + { + if(_loc2_ is ArcGroup) + { + (_loc2_ as ArcGroup).alpha = param1; + } + else if(_loc2_ is ArcSprite) + { + (_loc2_ as ArcSprite).alpha = param1; + } + else if(_loc2_ is FlxBitmapText) + { + (_loc2_ as FlxBitmapText).alpha = param1; + } + } + } + + public function get alpha() : Number + { + return this._alpha; + } + + override public function add(param1:FlxBasic) : FlxBasic + { + shift(param1,this.x,this.y); + return super.add(param1); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/flixel/ArcParticleSystem.as b/research/inner_decompiled/scripts/com/arc/flixel/ArcParticleSystem.as new file mode 100644 index 0000000..9cc5dfc --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/flixel/ArcParticleSystem.as @@ -0,0 +1,53 @@ +package com.arc.flixel +{ + import org.flixel.FlxEmitter; + + public class ArcParticleSystem + { + + public static var emitterMap:Object = new Object(); + + public static var emitterGroup:ArcEmitterGroup = new ArcEmitterGroup(); + + public function ArcParticleSystem() + { + super(); + } + + public static function registerEmitter(param1:Object, param2:Class, param3:int = 100, param4:Boolean = false) : void + { + if(emitterMap[param1] != null) + { + return; + } + var _loc5_:FlxEmitter = new FlxEmitter(); + _loc5_.makeParticles(param2,param3,0,param4); + _loc5_.setRotation(); + emitterMap[param1] = _loc5_; + emitterGroup.add(_loc5_); + } + + public static function emit(param1:ArcGroup, param2:Object, param3:int, param4:int, param5:int, param6:int, param7:Number = 1, param8:Number = 400, param9:Number = -100, param10:Number = 100, param11:Number = -100, param12:Number = 100, param13:int = 0, param14:int = 0) : void + { + var _loc15_:ArcEmitter = new ArcEmitter(param2,param3,param4,param5,param6,param7,param8,param9,param10,param11,param12,param13,param14); + param1.add(_loc15_); + } + + public static function get emitters() : ArcGroup + { + return emitterGroup; + } + + public static function emitParticles(param1:int, param2:int, param3:int, param4:Object, param5:Number) : void + { + emitterMap[param4].x = param1; + emitterMap[param4].y = param2; + emitterMap[param4].lifespan = param5; + while(param3-- > 0) + { + emitterMap[param4].emitParticle(); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/flixel/ArcRect.as b/research/inner_decompiled/scripts/com/arc/flixel/ArcRect.as new file mode 100644 index 0000000..a072478 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/flixel/ArcRect.as @@ -0,0 +1,22 @@ +package com.arc.flixel +{ + import org.flixel.FlxG; + import org.flixel.FlxRect; + + public class ArcRect extends FlxRect + { + + public function ArcRect(param1:Number = 0, param2:Number = 0, param3:Number = 0, param4:Number = 0) + { + super(param1,param2,param3,param4); + } + + public function hover() : Boolean + { + var _loc1_:int = FlxG.mouse.screenX; + var _loc2_:int = FlxG.mouse.screenY; + return _loc1_ > left && _loc1_ < right && (_loc2_ > top && _loc2_ < bottom); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/flixel/ArcSprite.as b/research/inner_decompiled/scripts/com/arc/flixel/ArcSprite.as new file mode 100644 index 0000000..15aece8 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/flixel/ArcSprite.as @@ -0,0 +1,70 @@ +package com.arc.flixel +{ + import flash.geom.Rectangle; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + import org.flixel.FlxSprite; + + public class ArcSprite extends FlxSprite + { + + protected var _colorRed:Number = 1; + + protected var _colorGreen:Number = 1; + + protected var _colorBlue:Number = 1; + + protected var _deathTimer:Number = 0; + + public function ArcSprite(param1:Number = 0, param2:Number = 0, param3:Class = null) + { + super(param1,param2,param3); + } + + public function hover() : Boolean + { + var _loc1_:FlxPoint = getScreenXY(); + return new ArcRect(_loc1_.x,_loc1_.y,width,height).hover(); + } + + public function offScreen() : Boolean + { + var _loc1_:FlxPoint = getScreenXY(); + return _loc1_.x < -width || _loc1_.x > FlxG.width || _loc1_.y < -height || _loc1_.y > FlxG.height; + } + + public function get sourceRect() : Rectangle + { + return _flashRect; + } + + public function set sourceRect(param1:Rectangle) : void + { + _flashRect = param1; + } + + public function mark(param1:Number) : void + { + this._deathTimer = param1; + } + + override public function update() : void + { + if(this._deathTimer > 0) + { + this._deathTimer -= FlxG.elapsed; + if(this._deathTimer <= 0) + { + kill(); + } + } + super.update(); + } + + public function get animation() : String + { + return _curAnim.name; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/flixel/ArcU.as b/research/inner_decompiled/scripts/com/arc/flixel/ArcU.as new file mode 100644 index 0000000..4e5f7a4 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/flixel/ArcU.as @@ -0,0 +1,57 @@ +package com.arc.flixel +{ + import flash.external.ExternalInterface; + import flash.net.URLRequest; + import flash.net.navigateToURL; + import org.flixel.FlxG; + + public final class ArcU + { + + public function ArcU() + { + super(); + } + + public static function rand(param1:int, param2:int) : int + { + return Math.floor(Math.random() * (param2 - param1 + 1)) + param1; + } + + public static function abs(param1:Number) : Number + { + if(param1 < 0) + { + param1 = -param1; + } + return param1; + } + + public static function clamp(param1:Number, param2:Number, param3:Number) : Number + { + if(param1 > param3) + { + return param3; + } + if(param1 < param2) + { + return param2; + } + return param1; + } + + public static function link(param1:String) : void + { + var url:String = param1; + try + { + ExternalInterface.call("(function (){var f = document.createElement(\"form\");document.body.appendChild(f);f.style.display=\"none\";f.setAttribute(\"target\",\"_blank\");f.setAttribute(\"method\",\"GET\");f.setAttribute(\"action\",\"" + FlxG.root.loaderInfo.parameters.clickTag + "\");f.submit(); })()"); + } + catch(err:Error) + { + navigateToURL(new URLRequest(url),"_blank"); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/flixel/ButtonState.as b/research/inner_decompiled/scripts/com/arc/flixel/ButtonState.as new file mode 100644 index 0000000..fc5cff5 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/flixel/ButtonState.as @@ -0,0 +1,18 @@ +package com.arc.flixel +{ + public class ButtonState + { + + public static const INACTIVE:String = "inactive"; + + public static const HOVER:String = "hover"; + + public static const SELECTED:String = "selected"; + + public function ButtonState() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/arc/flixel/Profiler.as b/research/inner_decompiled/scripts/com/arc/flixel/Profiler.as new file mode 100644 index 0000000..c5541c7 --- /dev/null +++ b/research/inner_decompiled/scripts/com/arc/flixel/Profiler.as @@ -0,0 +1,52 @@ +package com.arc.flixel +{ + import flash.utils.getTimer; + + public class Profiler + { + + private static const ENABLED:Boolean = false; + + private var name:String; + + private var time:Number = 0; + + public function Profiler(param1:String, param2:String = null) + { + super(); + this.name = "[" + param1 + "]"; + this.start(param2); + } + + public function start(param1:String = null) : void + { + if(param1 == null) + { + param1 = "started"; + } + if(ENABLED) + { + } + this.time = getTimer(); + } + + public function lap(param1:String = null) : void + { + this.end(param1); + this.time = getTimer(); + } + + public function end(param1:String = null) : int + { + if(param1 == null) + { + param1 = "elapsed"; + } + if(ENABLED) + { + } + return getTimer() - this.time; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/BlowFishKey.as b/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/BlowFishKey.as new file mode 100644 index 0000000..f7a4410 --- /dev/null +++ b/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/BlowFishKey.as @@ -0,0 +1,235 @@ +package com.hurlant.crypto.symmetric +{ + import com.hurlant.util.Memory; + import flash.utils.ByteArray; + + public class BlowFishKey implements ISymmetricKey + { + + private static const KP:Array = [608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731]; + + private static const KS0:Array = [3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486 + ,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737 + ,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]; + + private static const KS1:Array = [1266315497,3048417604,3681880366,3289982499,2909710000,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616 + ,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670 + ,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]; + + private static const KS2:Array = [3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280 + ,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629 + ,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]; + + private static const KS3:Array = [976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805 + ,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409000,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506 + ,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]; + + private static const ROUNDS:uint = 16; + + private static const BLOCK_SIZE:uint = 8; + + private static const SBOX_SK:uint = 256; + + private static const P_SZ:uint = ROUNDS + 2; + + private var S0:Array; + + private var S1:Array; + + private var S2:Array; + + private var S3:Array; + + private var P:Array; + + private var key:ByteArray = null; + + public function BlowFishKey(param1:ByteArray) + { + super(); + this.key = param1; + this.setKey(param1); + } + + public function getBlockSize() : uint + { + return BLOCK_SIZE; + } + + public function decrypt(param1:ByteArray, param2:uint = 0) : void + { + this.decryptBlock(param1,param2,param1,param2); + } + + public function dispose() : void + { + var _loc1_:uint = 0; + _loc1_ = 0; + while(_loc1_ < this.S0.length) + { + this.S0[_loc1_] = 0; + _loc1_++; + } + _loc1_ = 0; + while(_loc1_ < this.S1.length) + { + this.S1[_loc1_] = 0; + _loc1_++; + } + _loc1_ = 0; + while(_loc1_ < this.S2.length) + { + this.S2[_loc1_] = 0; + _loc1_++; + } + _loc1_ = 0; + while(_loc1_ < this.S3.length) + { + this.S3[_loc1_] = 0; + _loc1_++; + } + _loc1_ = 0; + while(_loc1_ < this.P.length) + { + this.P[_loc1_] = 0; + _loc1_++; + } + this.S0 = null; + this.S1 = null; + this.S2 = null; + this.S3 = null; + this.P = null; + _loc1_ = 0; + while(_loc1_ < this.key.length) + { + this.key[_loc1_] = 0; + _loc1_++; + } + this.key.length = 0; + this.key = null; + Memory.gc(); + } + + public function encrypt(param1:ByteArray, param2:uint = 0) : void + { + this.encryptBlock(param1,param2,param1,param2); + } + + private function F(param1:uint) : uint + { + return (this.S0[param1 >>> 24] + this.S1[param1 >>> 16 & 0xFF] ^ this.S2[param1 >>> 8 & 0xFF]) + this.S3[param1 & 0xFF]; + } + + private function processTable(param1:uint, param2:uint, param3:Array) : void + { + var _loc6_:uint = 0; + var _loc4_:uint = param3.length; + var _loc5_:uint = 0; + while(_loc5_ < _loc4_) + { + param1 ^= this.P[0]; + _loc6_ = 1; + while(_loc6_ < ROUNDS) + { + param2 ^= this.F(param1) ^ this.P[_loc6_]; + param1 ^= this.F(param2) ^ this.P[_loc6_ + 1]; + _loc6_ += 2; + } + param2 ^= this.P[ROUNDS + 1]; + param3[_loc5_] = param2; + param3[_loc5_ + 1] = param1; + param2 = param1; + param1 = uint(param3[_loc5_]); + _loc5_ += 2; + } + } + + private function setKey(param1:ByteArray) : void + { + var _loc5_:uint = 0; + var _loc6_:uint = 0; + this.S0 = KS0.concat(); + this.S1 = KS1.concat(); + this.S2 = KS2.concat(); + this.S3 = KS3.concat(); + this.P = KP.concat(); + var _loc2_:uint = param1.length; + var _loc3_:uint = 0; + var _loc4_:uint = 0; + while(_loc4_ < P_SZ) + { + _loc5_ = 0; + _loc6_ = 0; + while(_loc6_ < 4) + { + _loc5_ = uint(_loc5_ << 8 | param1[_loc3_++] & 0xFF); + if(_loc3_ >= _loc2_) + { + _loc3_ = 0; + } + _loc6_++; + } + this.P[_loc4_] ^= _loc5_; + _loc4_++; + } + this.processTable(0,0,this.P); + this.processTable(this.P[P_SZ - 2],this.P[P_SZ - 1],this.S0); + this.processTable(this.S0[SBOX_SK - 2],this.S0[SBOX_SK - 1],this.S1); + this.processTable(this.S1[SBOX_SK - 2],this.S1[SBOX_SK - 1],this.S2); + this.processTable(this.S2[SBOX_SK - 2],this.S2[SBOX_SK - 1],this.S3); + } + + private function encryptBlock(param1:ByteArray, param2:uint, param3:ByteArray, param4:uint) : void + { + var _loc5_:uint = this.BytesTo32bits(param1,param2); + var _loc6_:uint = this.BytesTo32bits(param1,param2 + 4); + _loc5_ ^= this.P[0]; + var _loc7_:uint = 1; + while(_loc7_ < ROUNDS) + { + _loc6_ ^= this.F(_loc5_) ^ this.P[_loc7_]; + _loc5_ ^= this.F(_loc6_) ^ this.P[_loc7_ + 1]; + _loc7_ += 2; + } + _loc6_ ^= this.P[ROUNDS + 1]; + this.Bits32ToBytes(_loc6_,param3,param4); + this.Bits32ToBytes(_loc5_,param3,param4 + 4); + } + + private function decryptBlock(param1:ByteArray, param2:uint, param3:ByteArray, param4:uint) : void + { + var _loc5_:uint = this.BytesTo32bits(param1,param2); + var _loc6_:uint = this.BytesTo32bits(param1,param2 + 4); + _loc5_ ^= this.P[ROUNDS + 1]; + var _loc7_:uint = ROUNDS; + while(_loc7_ > 0) + { + _loc6_ ^= this.F(_loc5_) ^ this.P[_loc7_]; + _loc5_ ^= this.F(_loc6_) ^ this.P[_loc7_ - 1]; + _loc7_ -= 2; + } + _loc6_ ^= this.P[0]; + this.Bits32ToBytes(_loc6_,param3,param4); + this.Bits32ToBytes(_loc5_,param3,param4 + 4); + } + + private function BytesTo32bits(param1:ByteArray, param2:uint) : uint + { + return (param1[param2] & 0xFF) << 24 | (param1[param2 + 1] & 0xFF) << 16 | (param1[param2 + 2] & 0xFF) << 8 | param1[param2 + 3] & 0xFF; + } + + private function Bits32ToBytes(param1:uint, param2:ByteArray, param3:uint) : void + { + param2[param3 + 3] = param1; + param2[param3 + 2] = param1 >> 8; + param2[param3 + 1] = param1 >> 16; + param2[param3] = param1 >> 24; + } + + public function toString() : String + { + return "blowfish"; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/ECBMode.as b/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/ECBMode.as new file mode 100644 index 0000000..8ff73ad --- /dev/null +++ b/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/ECBMode.as @@ -0,0 +1,91 @@ +package com.hurlant.crypto.symmetric +{ + import com.hurlant.util.Memory; + import flash.utils.ByteArray; + + public class ECBMode implements IMode, ICipher + { + + private var key:ISymmetricKey; + + private var padding:IPad; + + public function ECBMode(param1:ISymmetricKey, param2:IPad = null) + { + super(); + this.key = param1; + if(param2 == null) + { + param2 = new PKCS5(param1.getBlockSize()); + } + else + { + param2.setBlockSize(param1.getBlockSize()); + } + this.padding = param2; + } + + public function getBlockSize() : uint + { + return this.key.getBlockSize(); + } + + public function encrypt(param1:ByteArray) : void + { + this.padding.pad(param1); + param1.position = 0; + var _loc2_:uint = this.key.getBlockSize(); + var _loc3_:ByteArray = new ByteArray(); + var _loc4_:ByteArray = new ByteArray(); + var _loc5_:uint = 0; + while(_loc5_ < param1.length) + { + _loc3_.length = 0; + param1.readBytes(_loc3_,0,_loc2_); + this.key.encrypt(_loc3_); + _loc4_.writeBytes(_loc3_); + _loc5_ += _loc2_; + } + param1.length = 0; + param1.writeBytes(_loc4_); + } + + public function decrypt(param1:ByteArray) : void + { + param1.position = 0; + var _loc2_:uint = this.key.getBlockSize(); + if(param1.length % _loc2_ != 0) + { + throw new Error("ECB mode cipher length must be a multiple of blocksize " + _loc2_); + } + var _loc3_:ByteArray = new ByteArray(); + var _loc4_:ByteArray = new ByteArray(); + var _loc5_:uint = 0; + while(_loc5_ < param1.length) + { + _loc3_.length = 0; + param1.readBytes(_loc3_,0,_loc2_); + this.key.decrypt(_loc3_); + _loc4_.writeBytes(_loc3_); + _loc5_ += _loc2_; + } + this.padding.unpad(_loc4_); + param1.length = 0; + param1.writeBytes(_loc4_); + } + + public function dispose() : void + { + this.key.dispose(); + this.key = null; + this.padding = null; + Memory.gc(); + } + + public function toString() : String + { + return this.key.toString() + "-ecb"; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/ICipher.as b/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/ICipher.as new file mode 100644 index 0000000..04520bb --- /dev/null +++ b/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/ICipher.as @@ -0,0 +1,19 @@ +package com.hurlant.crypto.symmetric +{ + import flash.utils.ByteArray; + + public interface ICipher + { + + function getBlockSize() : uint; + + function encrypt(param1:ByteArray) : void; + + function decrypt(param1:ByteArray) : void; + + function dispose() : void; + + function toString() : String; + } +} + diff --git a/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/IMode.as b/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/IMode.as new file mode 100644 index 0000000..62cb917 --- /dev/null +++ b/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/IMode.as @@ -0,0 +1,9 @@ +package com.hurlant.crypto.symmetric +{ + public interface IMode extends ICipher + { + + + } +} + diff --git a/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/IPad.as b/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/IPad.as new file mode 100644 index 0000000..0effae1 --- /dev/null +++ b/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/IPad.as @@ -0,0 +1,15 @@ +package com.hurlant.crypto.symmetric +{ + import flash.utils.ByteArray; + + public interface IPad + { + + function pad(param1:ByteArray) : void; + + function unpad(param1:ByteArray) : void; + + function setBlockSize(param1:uint) : void; + } +} + diff --git a/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/ISymmetricKey.as b/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/ISymmetricKey.as new file mode 100644 index 0000000..ece1a15 --- /dev/null +++ b/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/ISymmetricKey.as @@ -0,0 +1,19 @@ +package com.hurlant.crypto.symmetric +{ + import flash.utils.ByteArray; + + public interface ISymmetricKey + { + + function getBlockSize() : uint; + + function encrypt(param1:ByteArray, param2:uint = 0) : void; + + function decrypt(param1:ByteArray, param2:uint = 0) : void; + + function dispose() : void; + + function toString() : String; + } +} + diff --git a/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/PKCS5.as b/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/PKCS5.as new file mode 100644 index 0000000..b22d330 --- /dev/null +++ b/research/inner_decompiled/scripts/com/hurlant/crypto/symmetric/PKCS5.as @@ -0,0 +1,55 @@ +package com.hurlant.crypto.symmetric +{ + import flash.utils.ByteArray; + + public class PKCS5 implements IPad + { + + private var blockSize:uint; + + public function PKCS5(param1:uint = 0) + { + super(); + this.blockSize = param1; + } + + public function pad(param1:ByteArray) : void + { + var _loc2_:uint = this.blockSize - param1.length % this.blockSize; + var _loc3_:uint = 0; + while(_loc3_ < _loc2_) + { + param1[param1.length] = _loc2_; + _loc3_++; + } + } + + public function unpad(param1:ByteArray) : void + { + var _loc4_:uint = 0; + var _loc2_:uint = param1.length % this.blockSize; + if(_loc2_ != 0) + { + throw new Error("PKCS#5::unpad: ByteArray.length isn\'t a multiple of the blockSize"); + } + _loc2_ = uint(param1[param1.length - 1]); + var _loc3_:uint = _loc2_; + while(_loc3_ > 0) + { + _loc4_ = uint(param1[param1.length - 1]); + --param1.length; + if(_loc2_ != _loc4_) + { + throw new Error("PKCS#5:unpad: Invalid padding value. expected [" + _loc2_ + "], found [" + _loc4_ + "]"); + } + _loc3_--; + } + } + + public function setBlockSize(param1:uint) : void + { + this.blockSize = param1; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/hurlant/util/Base64.as b/research/inner_decompiled/scripts/com/hurlant/util/Base64.as new file mode 100644 index 0000000..5b24af2 --- /dev/null +++ b/research/inner_decompiled/scripts/com/hurlant/util/Base64.as @@ -0,0 +1,105 @@ +package com.hurlant.util +{ + import flash.utils.ByteArray; + + public class Base64 + { + + private static const BASE64_CHARS:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + + public static const version:String = "1.0.0"; + + public function Base64() + { + super(); + throw new Error("Base64 class is static container only"); + } + + public static function encode(param1:String) : String + { + var _loc2_:ByteArray = new ByteArray(); + _loc2_.writeUTFBytes(param1); + return encodeByteArray(_loc2_); + } + + public static function encodeByteArray(param1:ByteArray) : String + { + var _loc3_:Array = null; + var _loc5_:uint = 0; + var _loc6_:uint = 0; + var _loc7_:uint = 0; + var _loc2_:String = ""; + var _loc4_:Array = new Array(4); + param1.position = 0; + while(param1.bytesAvailable > 0) + { + _loc3_ = new Array(); + _loc5_ = 0; + while(_loc5_ < 3 && param1.bytesAvailable > 0) + { + _loc3_[_loc5_] = param1.readUnsignedByte(); + _loc5_++; + } + _loc4_[0] = (_loc3_[0] & 0xFC) >> 2; + _loc4_[1] = (_loc3_[0] & 3) << 4 | _loc3_[1] >> 4; + _loc4_[2] = (_loc3_[1] & 0x0F) << 2 | _loc3_[2] >> 6; + _loc4_[3] = _loc3_[2] & 0x3F; + _loc6_ = _loc3_.length; + while(_loc6_ < 3) + { + _loc4_[_loc6_ + 1] = 64; + _loc6_++; + } + _loc7_ = 0; + while(_loc7_ < _loc4_.length) + { + _loc2_ += BASE64_CHARS.charAt(_loc4_[_loc7_]); + _loc7_++; + } + } + return _loc2_; + } + + public static function decode(param1:String) : String + { + var _loc2_:ByteArray = decodeToByteArray(param1); + return _loc2_.readUTFBytes(_loc2_.length); + } + + public static function decodeToByteArray(param1:String) : ByteArray + { + var _loc6_:uint = 0; + var _loc7_:uint = 0; + var _loc2_:ByteArray = new ByteArray(); + var _loc3_:Array = new Array(4); + var _loc4_:Array = new Array(3); + var _loc5_:uint = 0; + while(_loc5_ < param1.length) + { + _loc6_ = 0; + while(_loc6_ < 4 && _loc5_ + _loc6_ < param1.length) + { + _loc3_[_loc6_] = BASE64_CHARS.indexOf(param1.charAt(_loc5_ + _loc6_)); + _loc6_++; + } + _loc4_[0] = (_loc3_[0] << 2) + ((_loc3_[1] & 0x30) >> 4); + _loc4_[1] = ((_loc3_[1] & 0x0F) << 4) + ((_loc3_[2] & 0x3C) >> 2); + _loc4_[2] = ((_loc3_[2] & 3) << 6) + _loc3_[3]; + _loc7_ = 0; + while(_loc7_ < _loc4_.length) + { + if(_loc3_[_loc7_ + 1] == 64) + { + break; + } + _loc2_.writeByte(_loc4_[_loc7_]); + _loc7_++; + } + _loc5_ += 4; + } + _loc2_.position = 0; + return _loc2_; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/hurlant/util/Hex.as b/research/inner_decompiled/scripts/com/hurlant/util/Hex.as new file mode 100644 index 0000000..23e51b9 --- /dev/null +++ b/research/inner_decompiled/scripts/com/hurlant/util/Hex.as @@ -0,0 +1,63 @@ +package com.hurlant.util +{ + import flash.utils.ByteArray; + + public class Hex + { + + public function Hex() + { + super(); + } + + public static function toArray(param1:String) : ByteArray + { + param1 = param1.replace(/\s|:/gm,""); + var _loc2_:ByteArray = new ByteArray(); + if(param1.length & 1 == 1) + { + param1 = "0" + param1; + } + var _loc3_:uint = 0; + while(_loc3_ < param1.length) + { + _loc2_[_loc3_ / 2] = parseInt(param1.substr(_loc3_,2),16); + _loc3_ += 2; + } + return _loc2_; + } + + public static function fromArray(param1:ByteArray, param2:Boolean = false) : String + { + var _loc3_:String = ""; + var _loc4_:uint = 0; + while(_loc4_ < param1.length) + { + _loc3_ += ("0" + param1[_loc4_].toString(16)).substr(-2,2); + if(param2) + { + if(_loc4_ < param1.length - 1) + { + _loc3_ += ":"; + } + } + _loc4_++; + } + return _loc3_; + } + + public static function toString(param1:String) : String + { + var _loc2_:ByteArray = toArray(param1); + return _loc2_.readUTFBytes(_loc2_.length); + } + + public static function fromString(param1:String, param2:Boolean = false) : String + { + var _loc3_:ByteArray = new ByteArray(); + _loc3_.writeUTFBytes(param1); + return fromArray(_loc3_,param2); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/hurlant/util/Memory.as b/research/inner_decompiled/scripts/com/hurlant/util/Memory.as new file mode 100644 index 0000000..95f66e9 --- /dev/null +++ b/research/inner_decompiled/scripts/com/hurlant/util/Memory.as @@ -0,0 +1,32 @@ +package com.hurlant.util +{ + import flash.net.LocalConnection; + import flash.system.System; + + public class Memory + { + + public function Memory() + { + super(); + } + + public static function gc() : void + { + try + { + new LocalConnection().connect("foo"); + new LocalConnection().connect("foo"); + } + catch(e:*) + { + } + } + + public static function get used() : uint + { + return System.totalMemory; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/API.as b/research/inner_decompiled/scripts/com/newgrounds/API.as new file mode 100644 index 0000000..c28e7e3 --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/API.as @@ -0,0 +1,954 @@ +package com.newgrounds +{ + import com.newgrounds.crypto.RC4; + import com.newgrounds.encoders.json.JSON; + import flash.display.DisplayObject; + import flash.display.LoaderInfo; + import flash.events.Event; + import flash.net.SharedObject; + import flash.system.Security; + import flash.text.TextField; + import flash.text.TextFormat; + + public class API + { + + private static var _bridge:Bridge; + + private static var _movieName:String; + + private static var _movieVersion:String; + + private static var _root:DisplayObject; + + private static var _newVersion:Boolean; + + private static var _adFeedURL:String; + + private static var _imageFilePath:String; + + private static var _saveFilePath:String; + + private static var _requestedSaveFileId:uint; + + private static var _requestedSaveGroupId:uint; + + public static const RELEASE_MODE:String = "releaseMode"; + + public static const DEBUG_MODE_LOGGED_IN:String = "debugModeLoggedIn"; + + public static const DEBUG_MODE_LOGGED_OUT:String = "debugModeLoggedOut"; + + public static const DEBUG_MODE_NEW_VERSION:String = "debugModeNewVersion"; + + public static const DEBUG_MODE_HOST_BLOCKED:String = "debugModeHostBlocked"; + + private static const TEST_AD_FEED_URL:String = "http://www.ngads.com/adtest.php"; + + private static var _dispatcher:APIEventDispatcher = new APIEventDispatcher(); + + private static var _connection:APIConnection = new APIConnection(); + + private static var _debugMode:String = DEBUG_MODE_LOGGED_IN; + + private static var _adsApproved:Boolean = false; + + private static var _medals:Object = new Object(); + + private static var _medalsArray:Array = []; + + private static var _scoreBoards:Object = new Object(); + + private static var _scoreBoardsArray:Array = []; + + private static var _saveGroups:Object = new Object(); + + private static var _saveGroupsArray:Array = []; + + private static var _sharedObjects:Object = new Object(); + + public static const VERSION:String = "3.0.4.1 beta AS3"; + + public function API() + { + super(); + } + + public static function get connected() : Boolean + { + return _connection.connected; + } + + public static function get isNetworkHost() : Boolean + { + return _connection.isNetworkHost; + } + + public static function get apiId() : String + { + _connection.assertInitialized(); + return _connection.apiId; + } + + public static function get debugMode() : String + { + return _debugMode; + } + + public static function set debugMode(param1:String) : void + { + _debugMode = param1; + } + + public static function get publisherId() : uint + { + _connection.assertInitialized(); + return _connection.publisherId; + } + + public static function get sessionId() : String + { + _connection.assertInitialized(); + return _connection.sessionId; + } + + public static function get hostDomain() : String + { + _connection.assertInitialized(); + return _connection.hostDomain; + } + + public static function get hostURL() : String + { + _connection.assertInitialized(); + return _connection.hostURL; + } + + public static function get isNewgrounds() : Boolean + { + return _connection.publisherId == 1; + } + + public static function get hasUserSession() : Boolean + { + _connection.assertInitialized(); + return _connection.hasUserSession; + } + + public static function get username() : String + { + _connection.assertInitialized(); + return _connection.username; + } + + public static function get userId() : uint + { + _connection.assertInitialized(); + return _connection.userId; + } + + private static function assertConnected(param1:String = null) : Boolean + { + if(_connection.assertConnected()) + { + return true; + } + if(param1) + { + dispatchEvent(param1,null,APIEvent.ERROR_NOT_CONNECTED); + } + return false; + } + + public static function get adsApproved() : Boolean + { + return _adsApproved; + } + + public static function get adFeedURL() : String + { + return _adFeedURL; + } + + public static function get medals() : Array + { + return _medalsArray; + } + + public static function get scoreBoards() : Array + { + return _scoreBoardsArray; + } + + public static function get saveGroups() : Array + { + return _saveGroupsArray; + } + + public static function connect(param1:DisplayObject, param2:String, param3:String = null, param4:String = "") : void + { + APIEventDispatcher.globalDispatcher = _dispatcher; + Security.loadPolicyFile("http://apifiles.ngfiles.com/crossdomain.xml"); + if(_connection.initialized) + { + Logger.logError("Connection already in progress. Please call API.disconnect() before attempting another connection."); + dispatchEvent(APIEvent.API_CONNECTED,false,APIEvent.ERROR_NOT_CONNECTED); + return; + } + if(!param2 || param2 == "") + { + Logger.logError("No apiId given. Please use the API ID from your API settings page."); + dispatchEvent(APIEvent.API_CONNECTED,false,APIEvent.ERROR_INVALID_ARGUMENT); + return; + } + Logger.logMessage("====== Newgrounds API v" + VERSION + " ======"); + _connection.connectionState = APIConnection.CONNECTING; + _root = param1; + _movieVersion = param4; + _connection.apiId = param2; + var _loc5_:uint = uint(param2.indexOf(":")); + if(_loc5_ != -1) + { + _connection.trackerId = uint(param2.substring(0,_loc5_)); + } + else + { + _connection.trackerId = uint(param2); + } + if(!_connection.trackerId) + { + Logger.logError("Invalid API ID: " + param2); + dispatchEvent(APIEvent.API_CONNECTED,false,APIEvent.ERROR_INVALID_ARGUMENT); + return; + } + _connection.encryptionKey = param3; + _connection.initialized = true; + if(!_root.loaderInfo) + { + Logger.logWarning("The root DisplayObject is currently not on the stage. Connection will be completed once it is added to stage."); + } + _root.addEventListener(Event.ENTER_FRAME,checkRootLoaderInfo); + checkRootLoaderInfo(null); + } + + private static function doConnect(param1:Object) : void + { + if(isNetworkHost && _debugMode != RELEASE_MODE) + { + Logger.logMessage("Live file detected, turning off debug mode."); + _debugMode = RELEASE_MODE; + } + if(Boolean(param1) && Boolean(param1.NewgroundsAPI_SandboxID)) + { + _bridge = new Bridge(param1.NewgroundsAPI_SandboxID); + APICommand.bridge = _bridge; + } + if(_debugMode == RELEASE_MODE) + { + if(param1) + { + if(param1.NewgroundsAPI_UserName) + { + _connection.username = param1.NewgroundsAPI_UserName; + } + if(param1.NewgroundsAPI_UserID) + { + _connection.userId = param1.NewgroundsAPI_UserID; + } + if(param1.NewgroundsAPI_PublisherID) + { + _connection.publisherId = param1.NewgroundsAPI_PublisherID; + } + if(param1.NewgroundsAPI_UserpageFormat) + { + _connection.userpageFormat = param1.NewgroundsAPI_UserpageFormat; + } + if(param1.NewgroundsAPI_SessionID) + { + _connection.sessionId = param1.NewgroundsAPI_SessionID; + } + if(param1.NewgroundsAPI_SaveGroupID) + { + _requestedSaveGroupId = param1.NewgroundsAPI_SaveGroupID; + } + if(param1.NewgroundsAPI_SaveFileID) + { + _requestedSaveFileId = param1.NewgroundsAPI_SaveFileID; + } + } + } + else + { + _connection.debug = true; + if(_debugMode == DEBUG_MODE_LOGGED_IN || _debugMode == DEBUG_MODE_LOGGED_OUT) + { + _connection.publisherId = 1; + } + if(_debugMode == DEBUG_MODE_LOGGED_IN) + { + _connection.sessionId = "D3bu64p1U53R"; + _connection.userId = 10; + _connection.username = "API-Debugger"; + } + } + _connection.sendSimpleCommand("connectMovie",onConnect,{ + "host":_connection.hostDomain, + "movie_version":_movieVersion, + "publisher_id":_connection.publisherId + }); + } + + private static function onConnect(param1:APIEvent) : void + { + var _loc2_:Object = param1.data; + if(!param1.success) + { + Logger.logError("Unable to connect to the API."); + _connection.reset(); + dispatchEvent(APIEvent.API_CONNECTED,param1.data,param1.error); + return; + } + if(debugMode != RELEASE_MODE) + { + _adFeedURL = TEST_AD_FEED_URL; + } + else if(_loc2_.ad_url) + { + _adFeedURL = unescape(_loc2_.ad_url); + } + switch(_loc2_.ad_status) + { + case -1: + Logger.logWarning("Your movie is not approved to run Flash Ads."); + break; + case 0: + Logger.logWarning("Your movie is still awaiting approval to run Flash Ads."); + break; + case 1: + Logger.logMessage("Your movie is approved to run Flash Ads!"); + } + _adsApproved = _loc2_.ad_status == 1; + if(_debugMode == DEBUG_MODE_HOST_BLOCKED || Boolean(_loc2_.deny_host)) + { + Logger.logWarning(_connection.hostDomain + " does not have permission to host this movie!","Update your API configuration to allow this host."); + dispatchEvent(APIEvent.API_CONNECTED,{"officialURL":unescape(_loc2_.movie_url)},APIEvent.ERROR_HOST_BLOCKED); + _connection.reset(); + return; + } + _movieName = _loc2_.movieName ? _loc2_.movieName : ""; + Logger.logMessage("Connecting to the Newgrounds API Gateway...","----- " + _loc2_.movie_name + " -----"); + if(_debugMode == DEBUG_MODE_NEW_VERSION) + { + _loc2_.movie_version = "Debug Mode"; + } + if(_loc2_.movie_version) + { + Logger.logMessage("A new version of this movie is available.","Current version:\t" + _movieVersion,"Newest version:\t" + _loc2_.movie_version,"Use API.loadOfficialVersion() to link to the latest version."); + _newVersion = true; + } + else + { + _newVersion = false; + } + if(_loc2_.request_portal_url) + { + _connection.sendSimpleCommand("setPortalID",null,{"portal_url":_connection.hostURL}); + } + _connection.sendSimpleCommand("preloadSettings",onMetadataLoaded,{ + "publisher_id":_connection.publisherId, + "user_id":_connection.userId + }); + } + + private static function onMetadataLoaded(param1:APIEvent) : void + { + var _loc3_:uint = 0; + var _loc4_:uint = 0; + var _loc6_:Object = null; + var _loc7_:Object = null; + var _loc8_:Boolean = false; + var _loc9_:Boolean = false; + var _loc10_:Medal = null; + var _loc11_:Object = null; + var _loc12_:ScoreBoard = null; + var _loc13_:Object = null; + var _loc14_:Array = null; + var _loc15_:Array = null; + var _loc16_:SaveGroup = null; + var _loc17_:Object = null; + var _loc18_:Object = null; + var _loc2_:Object = param1.data; + if(!param1.success) + { + Logger.logWarning("Unable to load movie metadata."); + disconnect(); + dispatchEvent(APIEvent.API_CONNECTED,null,param1.error); + return; + } + var _loc5_:uint = 0; + if(_loc2_.medals) + { + _loc5_ = uint(_loc2_.medals.length); + if(hasUserSession) + { + _loc6_ = loadLocal("medals_unlocked_" + username); + } + else + { + _loc6_ = loadLocal("medals_unlocked"); + } + _loc3_ = 0; + while(_loc3_ < _loc5_) + { + _loc7_ = _loc2_.medals[_loc3_]; + _loc8_ = Boolean(_loc7_.medal_unlocked); + _loc9_ = Boolean(_loc6_) && Boolean(_loc6_[_loc7_.medal_id]); + _loc10_ = new Medal(_connection,_loc7_.medal_id,_loc7_.medal_name,hasUserSession ? _loc8_ : _loc9_,_loc7_.medal_value,_loc7_.medal_difficulty,_loc7_.medal_icon); + _loc10_.addEventListener(APIEvent.MEDAL_UNLOCKED,onMedalUnlocked,false,0,true); + _loc10_.addEventListener(APIEvent.MEDAL_UNLOCK_CONFIRMED,onMedalUnlockConfirmed,false,0,true); + _medals[_loc10_.name] = _loc10_; + _medalsArray.push(_loc10_); + Logger.logMessage(_loc10_); + if(hasUserSession && _loc9_ && !_loc8_) + { + Logger.logMessage("Server missed the \"" + _loc10_.name + "\" unlock. Resending..."); + _loc10_.unlock(); + } + _loc3_++; + } + } + Logger.logMessage(_loc5_ + " medal" + (_loc5_ != 1 ? "s" : "") + " initialized."); + _loc5_ = 0; + if(_loc2_.score_boards) + { + _loc5_ = uint(_loc2_.score_boards.length); + _loc3_ = 0; + while(_loc3_ < _loc5_) + { + _loc11_ = _loc2_.score_boards[_loc3_]; + _loc12_ = new ScoreBoard(_connection,_loc11_.name,_loc11_.id); + _scoreBoards[_loc12_.name] = _loc12_; + _scoreBoardsArray.push(_loc12_); + Logger.logMessage(_loc12_); + _loc3_++; + } + } + Logger.logMessage(_loc5_ + " scoreboard" + (_loc5_ != 1 ? "s" : "") + " initialized."); + _loc5_ = 0; + if(_loc2_.save_groups) + { + _loc5_ = uint(_loc2_.save_groups.length); + _loc3_ = 0; + while(_loc3_ < _loc5_) + { + _loc13_ = _loc2_.save_groups[_loc3_]; + _loc14_ = []; + if(_loc13_.keys) + { + _loc4_ = 0; + while(_loc4_ < _loc13_.keys.length) + { + _loc17_ = _loc13_.keys[_loc4_]; + _loc14_.push(new SaveKey(_loc17_.name,_loc17_.id,_loc17_.type)); + _loc4_++; + } + } + _loc15_ = []; + if(_loc13_.ratings) + { + _loc3_ = 0; + while(_loc3_ < _loc13_.ratings.length) + { + _loc18_ = _loc13_.ratings[_loc3_]; + _loc15_.push(new SaveRating(_loc18_.name,_loc18_.id,_loc18_.float,_loc18_.min,_loc18_.max)); + _loc3_++; + } + } + _loc16_ = new SaveGroup(_connection,_loc13_.group_name,_loc13_.group_id,_loc13_.group_type,_loc14_,_loc15_); + _saveGroups[_loc16_.name] = _loc16_; + _saveGroupsArray.push(_loc16_); + Logger.logMessage(_loc16_); + _loc3_++; + } + } + Logger.logMessage(_loc5_ + " save group" + (_loc5_ != 1 ? "s" : "") + " initialized."); + if(_loc2_.save_file_path) + { + _saveFilePath = _loc2_.save_file_path + "/"; + SaveFile._saveFilePath = _saveFilePath; + Logger.logInternal("Save file path: " + _saveFilePath); + } + if(_loc2_.image_file_path) + { + _imageFilePath = _loc2_.image_file_path + "/"; + SaveFile._imageFilePath = _imageFilePath; + Logger.logInternal("Image file path: " + _imageFilePath); + } + Logger.logMessage("Connection complete!"); + _connection.connectionState = APIConnection.CONNECTED; + dispatchEvent(APIEvent.API_CONNECTED,{ + "movieName":_movieName, + "newVersion":_newVersion + }); + if(Boolean(_requestedSaveFileId) && Boolean(_requestedSaveGroupId)) + { + API.addEventListener(APIEvent.FILE_LOADED,onRequestedFileLoaded); + API.loadSaveFile(_requestedSaveFileId,false); + } + } + + public static function disconnect() : void + { + var _loc1_:Medal = null; + if(!_connection.connected) + { + Logger.logWarning("The Newgrounds API is already disconnected."); + return; + } + _connection.reset(); + for each(_loc1_ in _medals) + { + _loc1_.removeEventListener(APIEvent.MEDAL_UNLOCKED,onMedalUnlocked); + _loc1_.removeEventListener(APIEvent.MEDAL_UNLOCK_CONFIRMED,onMedalUnlockConfirmed); + } + _newVersion = false; + _medals = new Object(); + _medalsArray = []; + _scoreBoards = new Object(); + _scoreBoardsArray = []; + _saveGroups = new Object(); + _saveGroupsArray = []; + _sharedObjects = new Object(); + _imageFilePath = null; + _saveFilePath = null; + Logger.logMessage("Disconnected from the Newgrounds API."); + } + + public static function loadNewgrounds() : void + { + _connection.loadInBrowser("loadNewgrounds"); + } + + public static function loadOfficialVersion() : void + { + if(_connection.assertInitialized()) + { + _connection.loadInBrowser("loadOfficialVersion",false); + } + } + + public static function loadMySite() : void + { + if(_connection.assertInitialized()) + { + _connection.loadInBrowser("loadMySite"); + } + } + + public static function loadCustomLink(param1:String) : void + { + if(_connection.assertInitialized()) + { + _connection.loadInBrowser("loadCustomLink",true,{"link":param1}); + } + } + + public static function getMedal(param1:String) : Medal + { + return _medals[param1]; + } + + public static function unlockMedal(param1:String) : void + { + if(!assertConnected()) + { + return; + } + var _loc2_:Medal = _medals[param1]; + if(!_loc2_) + { + Logger.logError("No medal named \"" + param1 + "\" was found."); + return; + } + _loc2_.unlock(); + } + + private static function onMedalUnlocked(param1:APIEvent) : void + { + var _loc2_:Medal = null; + var _loc3_:Object = null; + if(param1.success) + { + _loc2_ = Medal(param1.data); + if(hasUserSession) + { + _loc3_ = loadLocal("medals_unlocked_" + username); + if(!_loc3_) + { + _loc3_ = new Object(); + } + _loc3_[_loc2_.id] = true; + saveLocal("medals_unlocked_" + username,_loc3_); + } + else + { + _loc3_ = loadLocal("medals_unlocked"); + if(!_loc3_) + { + _loc3_ = new Object(); + } + _loc3_[Medal(param1.data).id] = true; + saveLocal("medals_unlocked",_loc3_); + Logger.logMessage("User is not logged in. Medal \"" + _loc2_.name + "\" unlocked locally."); + } + } + } + + private static function onMedalUnlockConfirmed(param1:APIEvent) : void + { + var _loc2_:Object = null; + if(hasUserSession) + { + _loc2_ = loadLocal("medals_unlocked_" + username); + if(!_loc2_) + { + _loc2_ = new Object(); + } + else + { + delete _loc2_[Medal(param1.data).id]; + } + saveLocal("medals_unlocked_" + username,_loc2_); + } + } + + public static function getScoreBoard(param1:String) : ScoreBoard + { + if(!assertConnected()) + { + return null; + } + return _scoreBoards[param1]; + } + + public static function loadScores(param1:String, param2:String = "All-Time", param3:uint = 1, param4:uint = 10, param5:String = null) : ScoreBoard + { + if(!assertConnected()) + { + return null; + } + var _loc6_:ScoreBoard = _scoreBoards[param1]; + if(!_loc6_) + { + Logger.logError("No scoreboard named \"" + param1 + "\" was found."); + dispatchEvent(APIEvent.SCORES_LOADED,null,APIEvent.ERROR_INVALID_ARGUMENT); + return null; + } + _loc6_.period = param2; + _loc6_.firstResult = param3; + _loc6_.numResults = param4; + _loc6_.tag = param5; + _loc6_.loadScores(); + return _loc6_; + } + + public static function postScore(param1:String, param2:Number, param3:String = null) : void + { + if(!assertConnected()) + { + return; + } + if(!hasUserSession) + { + Logger.logError("The user must be logged-in to post a score."); + dispatchEvent(APIEvent.SCORES_LOADED,null,APIEvent.ERROR_NOT_LOGGED_IN); + return; + } + var _loc4_:ScoreBoard = _scoreBoards[param1]; + if(!_loc4_) + { + Logger.logError("No scoreboard named \"" + param1 + "\" was found."); + dispatchEvent(APIEvent.SCORES_LOADED,null,APIEvent.ERROR_INVALID_ARGUMENT); + return; + } + _loc4_.postScore(param2,param3); + } + + public static function getSaveGroup(param1:String) : SaveGroup + { + if(!assertConnected()) + { + return null; + } + return _saveGroups[param1]; + } + + private static function getSaveGroupById(param1:uint) : SaveGroup + { + var _loc2_:SaveGroup = null; + for each(_loc2_ in _saveGroups) + { + if(_loc2_.id == param1) + { + return _loc2_; + } + } + return null; + } + + public static function createSaveFile(param1:String) : SaveFile + { + if(!assertConnected()) + { + return null; + } + var _loc2_:SaveGroup = getSaveGroup(param1); + if(!_loc2_) + { + Logger.logError("The save group \"" + param1 + "\" was not found."); + return null; + } + return new SaveFile(_loc2_); + } + + public static function loadSaveFile(param1:uint, param2:Boolean = true) : void + { + _connection.sendSimpleCommand("loadSaveFile",onFileLoaded,{ + "save_id":param1, + "get_contents":param2 + }); + } + + private static function onFileLoaded(param1:APIEvent) : void + { + var _loc2_:SaveFile = null; + if(param1.success) + { + _loc2_ = SaveFile.fromObject(getSaveGroupById(param1.data.group_id),param1.data.file); + if(param1.data.get_contents) + { + _loc2_.load(); + } + else + { + dispatchEvent(APIEvent.FILE_LOADED,_loc2_); + } + } + else + { + Logger.logError("Unable to load file:",param1.error); + dispatchEvent(APIEvent.FILE_LOADED,null,param1.error); + } + } + + public static function createSaveQuery(param1:String) : SaveQuery + { + if(!assertConnected()) + { + return null; + } + var _loc2_:SaveGroup = getSaveGroup(param1); + if(!_loc2_) + { + Logger.logError("The save group \"" + param1 + "\" was not found."); + return null; + } + return new SaveQuery(_loc2_); + } + + public static function createSaveQueryByDate(param1:String, param2:Boolean = true) : SaveQuery + { + var _loc3_:SaveQuery = createSaveQuery(param1); + if(!_loc3_) + { + return null; + } + _loc3_.sortOn(SaveQuery.CREATED_ON,param2); + return _loc3_; + } + + public static function createSaveQueryByName(param1:String, param2:String, param3:Boolean = false, param4:Boolean = true) : SaveQuery + { + var _loc5_:SaveQuery = createSaveQuery(param1); + _loc5_.addCondition(SaveQuery.FILE_NAME,param3 ? SaveQuery.OPERATOR_EQUAL : SaveQuery.OPERATOR_CONTAINS,param2); + return _loc5_; + } + + public static function createSaveQueryByRating(param1:String, param2:String, param3:Boolean = true) : SaveQuery + { + var _loc4_:SaveQuery = createSaveQuery(param1); + _loc4_.sortOn(param2,param3); + return _loc4_; + } + + public static function onRequestedFileLoaded(param1:APIEvent) : void + { + var _loc2_:SaveFile = null; + API.removeEventListener(APIEvent.FILE_LOADED,onRequestedFileLoaded); + if(param1.success) + { + _loc2_ = param1.data as SaveFile; + if(_loc2_) + { + dispatchEvent(APIEvent.FILE_REQUESTED,_loc2_); + } + } + } + + public static function addEventListener(param1:String, param2:Function, param3:Boolean = false, param4:int = 0, param5:Boolean = true) : void + { + _dispatcher.addEventListener(param1,param2,param3,param4,param5); + } + + public static function removeEventListener(param1:String, param2:Function, param3:Boolean = false) : void + { + _dispatcher.removeEventListener(param1,param2); + } + + private static function dispatchEvent(param1:String, param2:* = null, param3:String = null) : void + { + _dispatcher.dispatchEvent(new APIEvent(param1,param2,param3)); + } + + public static function saveLocal(param1:String, param2:Object) : Boolean + { + var sharedObject:SharedObject = null; + var sharedObjectName:String = null; + var saveId:String = param1; + var saveData:Object = param2; + try + { + sharedObjectName = "ng_ap_secure_" + _connection.trackerId + "_" + RC4.encrypt(saveId,_connection.encryptionKey); + if(!_sharedObjects[saveId]) + { + _sharedObjects[saveId] = SharedObject.getLocal(sharedObjectName); + } + sharedObject = _sharedObjects[saveId]; + sharedObject.data.data = encodeData(saveData); + } + catch(error:Error) + { + Logger.logError("Unable to save local data.",error); + return false; + } + return true; + } + + public static function loadLocal(param1:String) : Object + { + var sharedObject:SharedObject = null; + var sharedObjectName:String = null; + var saveId:String = param1; + try + { + sharedObjectName = "ng_ap_secure_" + _connection.trackerId + "_" + RC4.encrypt(saveId,_connection.encryptionKey); + if(!_sharedObjects[saveId]) + { + _sharedObjects[saveId] = SharedObject.getLocal(sharedObjectName); + } + sharedObject = _sharedObjects[saveId]; + if(Boolean(sharedObject) && Boolean(sharedObject.data) && Boolean(sharedObject.data.data)) + { + return decodeData(sharedObject.data.data); + } + return null; + } + catch(error:Error) + { + Logger.logError("Unable to load local data.",error); + } + return null; + } + + public static function logCustomEvent(param1:String) : void + { + if(assertConnected()) + { + Logger.logMessage("Logged event: " + param1); + _connection.sendSimpleCommand("logCustomEvent",null,{"event":param1}); + } + } + + public static function encodeData(param1:Object) : String + { + if(!_connection.assertInitialized()) + { + return null; + } + return RC4.encrypt(com.newgrounds.encoders.json.JSON.encode(param1),_connection.encryptionKey); + } + + public static function decodeData(param1:String) : Object + { + if(!_connection.assertInitialized()) + { + return null; + } + try + { + return com.newgrounds.encoders.json.JSON.decode(RC4.decrypt(param1,_connection.encryptionKey)) as Object; + } + catch(error:Error) + { + } + return null; + } + + public static function stopPendingCommands() : void + { + APICommand.stopPendingCommands(); + Logger.logMessage("Pending commands stopped."); + } + + public static function setFont(param1:TextField, param2:String) : void + { + var _loc3_:TextFormat = null; + var _loc4_:Boolean = false; + var _loc5_:TextFormat = null; + if(Boolean(param1) && Boolean(param2)) + { + _loc3_ = param1.getTextFormat(); + _loc4_ = param1.embedFonts; + _loc5_ = new TextFormat(param2); + param1.defaultTextFormat = _loc5_; + param1.setTextFormat(_loc5_); + param1.embedFonts = true; + if(param1.textWidth == 0) + { + param1.embedFonts = _loc4_; + param1.setTextFormat(_loc3_); + param1.defaultTextFormat = _loc3_; + } + else + { + param1.antiAliasType = "advanced"; + param1.sharpness = 120; + } + } + } + + private static function checkRootLoaderInfo(param1:Event) : void + { + var event:Event = param1; + var loaderInfo:LoaderInfo = _root.loaderInfo; + if(loaderInfo) + { + try + { + while(loaderInfo.loader) + { + loaderInfo = loaderInfo.loader.loaderInfo; + } + } + catch(error:Error) + { + return; + } + _root.removeEventListener(Event.ENTER_FRAME,checkRootLoaderInfo); + _connection.hostURL = loaderInfo.url; + doConnect(loaderInfo.parameters); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/APICommand.as b/research/inner_decompiled/scripts/com/newgrounds/APICommand.as new file mode 100644 index 0000000..c04eafc --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/APICommand.as @@ -0,0 +1,515 @@ +package com.newgrounds +{ + import com.newgrounds.crypto.MD5; + import com.newgrounds.crypto.RC4; + import com.newgrounds.encoders.BaseN; + import com.newgrounds.encoders.json.JSON; + import flash.events.Event; + import flash.events.IOErrorEvent; + import flash.events.ProgressEvent; + import flash.events.SecurityErrorEvent; + import flash.events.TimerEvent; + import flash.net.URLLoader; + import flash.net.URLRequest; + import flash.net.URLRequestMethod; + import flash.net.URLVariables; + import flash.net.navigateToURL; + import flash.utils.ByteArray; + import flash.utils.Endian; + import flash.utils.Timer; + + public class APICommand extends APIEventDispatcher + { + + public static var bridge:Bridge; + + private static const TIMEOUT_INTERVAL:uint = 10000; + + private static const THROTTLE_INTERVAL:uint = 5000; + + private static const THROTTLE_THRESHOLD:uint = 7; + + private static var _throttleCount:uint = 0; + + private static var _commandQueue:Array = []; + + private static const ENCRYPTOR_RADIX:String = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X"; + + private static var _encryptor:BaseN = new BaseN(ENCRYPTOR_RADIX); + + private static var _pendingCommands:Array = []; + + private static const CRLF:String = "\r\n"; + + private static var _throttleTimer:Timer = (function():Timer + { + var _loc1_:* = new Timer(THROTTLE_INTERVAL,0); + _loc1_.addEventListener(TimerEvent.TIMER,onThrottleTimer); + _loc1_.start(); + return _loc1_; + })(); + + private var _command:String; + + private var _parameters:Object; + + private var _secureParameters:Object; + + private var _files:Object; + + private var _preventCache:Boolean; + + private var _hasTimeout:Boolean; + + private var _timeoutTimer:Timer; + + private var _loader:URLLoader; + + public function APICommand(param1:String) + { + super(); + this._command = param1; + this._parameters = new Object(); + this._secureParameters = new Object(); + this._timeoutTimer = new Timer(TIMEOUT_INTERVAL,1); + this._timeoutTimer.addEventListener(TimerEvent.TIMER,this.onTimeout); + this._hasTimeout = true; + } + + public static function stopPendingCommands() : void + { + var _loc1_:APICommand = null; + for each(_loc1_ in _pendingCommands) + { + _loc1_.close(); + } + _pendingCommands = []; + } + + private static function onThrottleTimer(param1:*) : void + { + var _loc2_:Object = null; + if(_throttleCount > 0) + { + --_throttleCount; + } + if(_commandQueue.length) + { + _loc2_ = _commandQueue.shift(); + _loc2_.command.send(_loc2_.connection); + } + } + + private static function encryptHex(param1:String) : String + { + var _loc2_:uint = param1.length % 6; + var _loc3_:String = ""; + var _loc4_:uint = 0; + while(_loc4_ < param1.length) + { + _loc3_ += _encryptor.encodeUint(uint("0x" + param1.substr(_loc4_,6)),4); + _loc4_ += 6; + } + return _loc2_.toString() + _loc3_; + } + + public function get command() : String + { + return this._command; + } + + public function set command(param1:String) : void + { + this._command = param1; + } + + public function get hasTimeout() : Boolean + { + return this._hasTimeout; + } + + public function set hasTimeout(param1:Boolean) : void + { + this._hasTimeout = param1; + } + + public function get parameters() : Object + { + return this._parameters; + } + + public function set parameters(param1:Object) : void + { + var _loc2_:String = null; + this._parameters = new Object(); + if(param1) + { + for(_loc2_ in param1) + { + this._parameters[_loc2_] = param1[_loc2_]; + } + } + } + + public function get preventCache() : Boolean + { + return this._preventCache; + } + + public function set preventCache(param1:Boolean) : void + { + this._preventCache = param1; + } + + public function get secureParameters() : Object + { + return this._secureParameters; + } + + public function set secureParameters(param1:Object) : void + { + var _loc2_:String = null; + this._secureParameters = new Object(); + if(param1) + { + for(_loc2_ in param1) + { + this._secureParameters[_loc2_] = param1[_loc2_]; + } + } + } + + public function get hasSecureParameters() : Boolean + { + var _loc1_:String = null; + var _loc2_:int = 0; + var _loc3_:* = this._secureParameters; + for(_loc1_ in _loc3_) + { + return true; + } + return false; + } + + public function addFile(param1:String, param2:ByteArray, param3:String, param4:String = "application/octet-stream") : void + { + if(!this._files) + { + this._files = new Object(); + } + var _loc5_:Object = { + "filename":param1, + "data":param2, + "dataField":param3, + "contentType":param4 + }; + this._files[param1] = _loc5_; + } + + public function removeFile(param1:String) : void + { + if(this._files) + { + delete this._files[param1]; + } + } + + public function clearFiles() : void + { + this._files = null; + } + + public function close() : void + { + var _loc1_:uint = 0; + if(this._loader) + { + try + { + this._loader.close(); + } + catch(error:Error) + { + } + this._timeoutTimer.stop(); + _loc1_ = 0; + while(_loc1_ < _pendingCommands.length) + { + if(_pendingCommands[_loc1_] == this) + { + _pendingCommands.splice(_loc1_,1); + break; + } + _loc1_++; + } + this._loader = null; + } + } + + public function loadInBrowser(param1:APIConnection, param2:Boolean) : void + { + var _loc4_:String = null; + var _loc5_:String = null; + this._parameters.command_id = this._command; + this._parameters.tracker_id = param1.apiId ? param1.apiId : 1; + if(param1.debug) + { + this._parameters.debug = 1; + } + var _loc3_:String = param1.apiURL + "?host=" + escape(param1.hostDomain); + for(_loc4_ in this._parameters) + { + _loc3_ += "&" + escape(_loc4_) + "=" + escape(this._parameters[_loc4_]); + } + if(param2) + { + _loc5_ = "_blank"; + } + else + { + _loc5_ = "_top"; + } + navigateToURL(new URLRequest(_loc3_),_loc5_); + } + + public function send(param1:APIConnection) : void + { + if(_throttleCount >= THROTTLE_THRESHOLD) + { + _commandQueue.push({ + "connection":param1, + "command":this + }); + } + else + { + this.sendInternal(param1); + } + } + + private function sendInternal(param1:APIConnection) : void + { + var _loc2_:Object = null; + var _loc3_:String = null; + var _loc4_:* = undefined; + var _loc5_:uint = 0; + var _loc6_:String = null; + var _loc7_:Object = null; + var _loc8_:String = null; + var _loc9_:String = null; + var _loc10_:String = null; + var _loc11_:String = null; + _loc2_ = new URLVariables(); + _loc2_.command_id = this._command; + _loc2_.tracker_id = param1.apiId; + if(param1.debug) + { + _loc2_.debug = 1; + } + if(this._preventCache) + { + _loc2_.seed = Math.random(); + } + for(_loc3_ in this._parameters) + { + _loc4_ = this._parameters[_loc3_]; + if(_loc4_ != null) + { + if(_loc4_ is Boolean) + { + _loc2_[_loc3_] = int(_loc4_); + } + else + { + _loc2_[_loc3_] = _loc4_; + } + } + } + if(this.hasSecureParameters) + { + _loc7_ = new Object(); + for(_loc3_ in this._secureParameters) + { + _loc4_ = this._secureParameters[_loc3_]; + if(_loc4_ != null) + { + if(_loc4_ is Boolean) + { + _loc7_[_loc3_] = int(_loc4_); + } + else + { + _loc7_[_loc3_] = _loc4_; + } + } + } + _loc8_ = ""; + _loc5_ = 0; + while(_loc5_ < 16) + { + _loc8_ += ENCRYPTOR_RADIX.charAt(uint(Math.random() * ENCRYPTOR_RADIX.length)); + _loc5_++; + } + _loc2_.command_id = "securePacket"; + _loc7_.command_id = this._command; + _loc7_.as_version = 3; + _loc7_.session_id = param1.sessionId; + _loc7_.user_email = param1.userEmail; + _loc7_.publisher_id = param1.publisherId; + _loc7_.seed = _loc8_; + _loc9_ = MD5.hash(_loc8_); + _loc10_ = RC4.encrypt(com.newgrounds.encoders.json.JSON.encode(_loc7_),param1.encryptionKey); + _loc2_.secure = encryptHex(_loc9_ + _loc10_); + } + Logger.logInternal("Sending packet:",_loc2_); + if(this._files) + { + _loc11_ = ""; + _loc5_ = 0; + while(_loc5_ < 32) + { + _loc11_ += String.fromCharCode(uint(97 + Math.random() * 25)); + _loc5_++; + } + _loc6_ = "multipart/form-data; boundary=\"" + _loc11_ + "\""; + _loc2_ = this.buildMultipartData(_loc11_,_loc2_,this._files); + } + else + { + for(_loc3_ in _loc2_) + { + if(typeof _loc2_[_loc3_] == "object") + { + _loc2_[_loc3_] = com.newgrounds.encoders.json.JSON.encode(_loc2_[_loc3_]); + } + } + _loc6_ = "application/x-www-form-urlencoded"; + } + _pendingCommands.push(this); + ++_throttleCount; + this.startLoader(param1.apiURL,_loc2_,_loc6_); + } + + private function onTimeout(param1:*) : void + { + this.close(); + Logger.logError("Command timed out."); + dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE,null,APIEvent.ERROR_TIMED_OUT)); + } + + private function onError(param1:String) : void + { + Logger.logError("Error when sending command:",param1); + dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE,null,APIEvent.ERROR_UNKNOWN)); + this.close(); + } + + private function onComplete(param1:String) : void + { + var response:Object = null; + var data:String = param1; + try + { + if(!data || data == "") + { + throw new Error(); + } + Logger.logInternal("Received packet:",data); + response = com.newgrounds.encoders.json.JSON.decode(data); + if(!response) + { + throw new Error(); + } + if(bridge) + { + bridge.sendEvent(response.command_id,response); + } + dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE,response,Boolean(response) && Boolean(response.success) ? APIEvent.ERROR_NONE : APIEvent.ERROR_COMMAND_FAILED)); + } + catch(e:*) + { + Logger.logError("Invalid response returned from server: " + data); + dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE,null,APIEvent.ERROR_BAD_RESPONSE)); + } + this.close(); + } + + private function startLoader(param1:String, param2:Object, param3:String) : void + { + var _loc4_:URLRequest = new URLRequest(param1); + _loc4_.data = param2; + _loc4_.method = URLRequestMethod.POST; + _loc4_.contentType = param3; + this._loader = new URLLoader(); + this._loader.addEventListener(Event.COMPLETE,this.as3CompleteHandler); + this._loader.addEventListener(Event.OPEN,this.as3UpdateHandler); + this._loader.addEventListener(ProgressEvent.PROGRESS,this.as3UpdateHandler); + this._loader.addEventListener(IOErrorEvent.IO_ERROR,this.as3ErrorHandler); + this._loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR,this.as3ErrorHandler); + this._loader.load(_loc4_); + if(this._hasTimeout) + { + this._timeoutTimer.start(); + } + } + + private function as3CompleteHandler(param1:Event) : void + { + this.onComplete(this._loader.data); + } + + private function as3UpdateHandler(param1:Event) : void + { + if(this._timeoutTimer.running) + { + this._timeoutTimer.reset(); + this._timeoutTimer.start(); + } + } + + private function as3ErrorHandler(param1:Event) : void + { + this.onError(param1.toString()); + } + + private function buildMultipartData(param1:String, param2:Object, param3:Object) : ByteArray + { + var _loc5_:String = null; + var _loc6_:Object = null; + var _loc4_:ByteArray = new ByteArray(); + _loc4_.endian = Endian.BIG_ENDIAN; + param1 = "--" + param1; + for(_loc5_ in param2) + { + _loc4_.writeUTFBytes(param1 + CRLF); + _loc4_.writeUTFBytes("Content-Disposition: form-data; name=\"" + _loc5_ + "\"" + CRLF); + _loc4_.writeUTFBytes(CRLF); + _loc4_.writeUTFBytes(param2[_loc5_].toString() + CRLF); + } + if(this._files) + { + for each(_loc6_ in param3) + { + _loc4_.writeUTFBytes(param1 + CRLF); + _loc4_.writeUTFBytes("Content-Disposition: form-data; name=\"Filename\"" + CRLF); + _loc4_.writeUTFBytes(CRLF); + _loc4_.writeUTFBytes(_loc6_.filename + CRLF); + _loc4_.writeUTFBytes(param1 + CRLF); + _loc4_.writeUTFBytes("Content-Disposition: form-data; name=\"" + _loc6_.dataField + "\"; filename=\"" + _loc6_.filename + "\"" + CRLF); + _loc4_.writeUTFBytes("Content-Type: " + _loc6_.contentType + CRLF); + _loc4_.writeUTFBytes(CRLF); + _loc4_.writeBytes(_loc6_.data); + _loc4_.writeUTFBytes(CRLF); + } + _loc4_.writeUTFBytes(param1 + CRLF); + _loc4_.writeUTFBytes("Content-Disposition: form-data; name=\"Upload\"" + CRLF); + _loc4_.writeUTFBytes(CRLF); + _loc4_.writeUTFBytes("Submit Query" + CRLF); + } + _loc4_.writeUTFBytes(param1 + "--"); + _loc4_.position = 0; + return _loc4_; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/APIConnection.as b/research/inner_decompiled/scripts/com/newgrounds/APIConnection.as new file mode 100644 index 0000000..d03c6a8 --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/APIConnection.as @@ -0,0 +1,159 @@ +package com.newgrounds +{ + import flash.system.Security; + + public class APIConnection + { + + public static const NOT_CONNECTED:String = "notConnected"; + + public static const CONNECTING:String = "connecting"; + + public static const CONNECTED:String = "connected"; + + public var initialized:Boolean; + + public var connectionState:String = "notConnected"; + + public var apiURL:String = "http://www.ngads.com/gateway_v2.php"; + + public var apiId:String; + + public var debug:Boolean; + + public var trackerId:uint; + + public var publisherId:uint; + + public var encryptionKey:String; + + public var sessionId:String; + + public var userEmail:String; + + public var username:String; + + public var userId:uint; + + public var userpageFormat:uint; + + private var _hostURL:String; + + public var hostDomain:String; + + public function APIConnection() + { + super(); + this.reset(); + } + + public function get hostURL() : String + { + return this._hostURL; + } + + public function set hostURL(param1:String) : void + { + var _loc2_:Array = null; + this._hostURL = param1; + this.hostDomain = null; + if(this._hostURL) + { + _loc2_ = this._hostURL.split("/"); + if(_loc2_[0] != "file:" && this._hostURL != "localhost") + { + this.hostDomain = _loc2_[2]; + } + } + if(!this.hostDomain) + { + this.hostDomain = "localhost"; + } + } + + public function get sandboxType() : String + { + return Security.sandboxType; + } + + public function get isNetworkHost() : Boolean + { + switch(this.sandboxType) + { + case "localWithFile": + case "localWithNetwork": + case "localTrusted": + case "application": + return false; + case "remote": + } + return true; + } + + public function get hasUserSession() : Boolean + { + return this.sessionId != null && this.sessionId != "" && this.publisherId != 0; + } + + public function get connected() : Boolean + { + return this.connectionState == CONNECTED; + } + + public function reset() : void + { + this.connectionState = NOT_CONNECTED; + this.encryptionKey = null; + this.sessionId = null; + this.userEmail = null; + this.username = null; + this.userId = 0; + this.userpageFormat = 0; + } + + public function assertInitialized() : Boolean + { + if(!this.initialized) + { + Logger.logError("You must initialized the API using API.connect() before using this command."); + return false; + } + return true; + } + + public function assertConnected() : Boolean + { + if(!this.connectionState == CONNECTED) + { + Logger.logError("You must establish a connection using API.connect() before using this command."); + return false; + } + return true; + } + + public function sendSimpleCommand(param1:String, param2:Function, param3:Object = null, param4:Object = null) : void + { + var _loc5_:APICommand = new APICommand(param1); + _loc5_.parameters = param3; + _loc5_.secureParameters = param4; + if(param2 != null) + { + _loc5_.addEventListener(APIEvent.COMMAND_COMPLETE,param2); + } + _loc5_.send(this); + } + + public function sendCommand(param1:APICommand) : void + { + param1.send(this); + } + + public function loadInBrowser(param1:String, param2:Boolean = true, param3:Object = null) : void + { + var _loc4_:APICommand = new APICommand(param1); + _loc4_.parameters = param3; + _loc4_.loadInBrowser(this,param2); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/APIEvent.as b/research/inner_decompiled/scripts/com/newgrounds/APIEvent.as new file mode 100644 index 0000000..c6ac5ae --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/APIEvent.as @@ -0,0 +1,108 @@ +package com.newgrounds +{ + import flash.events.Event; + + public class APIEvent extends Event + { + + internal static const COMMAND_COMPLETE:String = "commandComplete"; + + internal static const MEDAL_UNLOCK_CONFIRMED:String = "medalUnlockConfirmed"; + + internal static const ICON_LOADED:String = "iconLoaded"; + + public static const API_CONNECTED:String = "movieConnected"; + + public static const LOG:String = "log"; + + public static const MEDAL_UNLOCKED:String = "medalUnlocked"; + + public static const SCORES_LOADED:String = "scoresLoaded"; + + public static const SCORE_POSTED:String = "scorePosted"; + + public static const QUERY_COMPLETE:String = "queryComplete"; + + public static const FILE_LOADED:String = "fileLoaded"; + + public static const FILE_SAVED:String = "fileSaved"; + + public static const FILE_REQUESTED:String = "fileRequested"; + + public static const VOTE_COMPLETE:String = "voteComplete"; + + public static const ERROR_NONE:String = "noError"; + + public static const ERROR_UNKNOWN:String = "unknownError"; + + public static const ERROR_COMMAND_FAILED:String = "commandFailed"; + + public static const ERROR_NOT_CONNECTED:String = "notConnected"; + + public static const ERROR_INVALID_ARGUMENT:String = "invalidArgument"; + + public static const ERROR_TIMED_OUT:String = "timedOut"; + + public static const ERROR_BAD_FILE:String = "badFile"; + + public static const ERROR_BAD_RESPONSE:String = "badResponse"; + + public static const ERROR_SENDING_COMMAND:String = "errorSendingCommand"; + + public static const ERROR_HOST_BLOCKED:String = "hostBlocked"; + + public static const ERROR_ALREADY_VOTED:String = "alreadyVoted"; + + public static const ERROR_NOT_LOGGED_IN:String = "notLoggedIn"; + + private var _data:*; + + private var _success:Boolean; + + private var _error:String; + + public function APIEvent(param1:String, param2:* = null, param3:String = null) + { + super(param1); + if(!param3 || param3 == "" || param3 == ERROR_NONE) + { + this._error = ERROR_NONE; + this._success = true; + } + else + { + this._error = param3; + this._success = false; + } + if(param2) + { + this._data = param2; + } + else + { + this._data = {}; + } + } + + override public function clone() : Event + { + return new APIEvent(type,this._data,this._error); + } + + public function get success() : Boolean + { + return this._success; + } + + public function get data() : * + { + return this._data; + } + + public function get error() : String + { + return this._error; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/APIEventDispatcher.as b/research/inner_decompiled/scripts/com/newgrounds/APIEventDispatcher.as new file mode 100644 index 0000000..941c18a --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/APIEventDispatcher.as @@ -0,0 +1,77 @@ +package com.newgrounds +{ + import flash.display.Sprite; + import flash.events.Event; + import flash.events.EventDispatcher; + + internal class APIEventDispatcher extends EventDispatcher + { + + private static var _globalDispatcher:EventDispatcher; + + private static var _ticker:Sprite; + + private static var _eventQueue:Array = initEventQueue(); + + public function APIEventDispatcher() + { + super(); + } + + public static function get globalDispatcher() : EventDispatcher + { + return _globalDispatcher; + } + + public static function set globalDispatcher(param1:EventDispatcher) : void + { + _globalDispatcher = param1; + } + + private static function initEventQueue() : Array + { + _ticker = new Sprite(); + _ticker.addEventListener(Event.ENTER_FRAME,runEventQueue); + return []; + } + + private static function runEventQueue(param1:*) : void + { + var _loc3_:Array = null; + var _loc4_:uint = 0; + var _loc5_:Object = null; + var _loc2_:uint = _eventQueue.length; + if(_loc2_) + { + _loc3_ = _eventQueue; + _eventQueue = []; + _loc4_ = 0; + while(_loc4_ < _loc2_) + { + _loc5_ = _loc3_[_loc4_]; + _loc5_.dispatcher.actualDispatchEvent(_loc5_.event); + _loc4_++; + } + } + } + + override public function dispatchEvent(param1:Event) : Boolean + { + _eventQueue.push({ + "dispatcher":this, + "event":param1 + }); + return true; + } + + private function actualDispatchEvent(param1:Event) : void + { + var _loc2_:Boolean = super.dispatchEvent(param1); + if(Boolean(_globalDispatcher) && this != _globalDispatcher) + { + _globalDispatcher.dispatchEvent(param1); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/BitmapLoader.as b/research/inner_decompiled/scripts/com/newgrounds/BitmapLoader.as new file mode 100644 index 0000000..31b5d5d --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/BitmapLoader.as @@ -0,0 +1,150 @@ +package com.newgrounds +{ + import flash.display.Bitmap; + import flash.display.BitmapData; + import flash.display.DisplayObjectContainer; + import flash.display.Loader; + import flash.display.Sprite; + import flash.events.Event; + import flash.events.IOErrorEvent; + import flash.net.URLRequest; + import flash.net.URLRequestMethod; + import flash.system.LoaderContext; + + public class BitmapLoader extends APIEventDispatcher + { + + internal static var _cacheSeed:uint = 0; + + private static const LOADER_CONTEXT:LoaderContext = new LoaderContext(true); + + private var _url:String; + + private var _bitmapData:BitmapData; + + private var _loaded:Boolean = true; + + private var _loader:Loader; + + public function BitmapLoader(param1:BitmapData, param2:String) + { + super(); + this._bitmapData = param1; + this._url = param2; + } + + public function get url() : String + { + return this._url; + } + + public function set url(param1:String) : void + { + this._loaded = false; + this._url = param1; + } + + public function get bitmapData() : BitmapData + { + return this._bitmapData; + } + + public function set bitmapData(param1:BitmapData) : void + { + this._bitmapData = param1; + this._loaded = true; + } + + public function get loaded() : Boolean + { + return this._loaded; + } + + private function createLoader() : Loader + { + var _loc1_:Loader = new Loader(); + var _loc2_:URLRequest = new URLRequest(this._url); + _loc2_.method = URLRequestMethod.GET; + _loc2_.data = _cacheSeed.toString(); + _loc1_.load(_loc2_,LOADER_CONTEXT); + return _loc1_; + } + + private function disposeLoader() : void + { + if(this._loader) + { + try + { + this._loader.contentLoaderInfo.removeEventListener(Event.COMPLETE,this.onLoadComplete); + this._loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,this.onLoadComplete); + this._loader.unload(); + } + catch(error:*) + { + } + this._loader = null; + } + } + + public function load() : void + { + if(!this._url || this._url == "") + { + this.onLoadComplete(null); + return; + } + this.disposeLoader(); + this._loader = this.createLoader(); + this._loader.contentLoaderInfo.addEventListener(Event.COMPLETE,this.onLoadComplete); + this._loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,this.onLoadComplete); + } + + public function attachBitmap(param1:DisplayObjectContainer) : Sprite + { + var _loc2_:Sprite = new Sprite(); + if(Boolean(!this._loaded) && Boolean(this._url) && this._url != "") + { + if(!this._loader) + { + this.load(); + } + _loc2_.addChild(this.createLoader()); + } + else + { + _loc2_.addChild(new Bitmap(this._bitmapData)); + } + if(param1) + { + param1.addChild(_loc2_); + } + return _loc2_; + } + + private function onLoadComplete(param1:Event) : void + { + var bitmapData:BitmapData = null; + var event:Event = param1; + try + { + if(Boolean(event && event.type == Event.COMPLETE) && Boolean(this._loader) && this._loader.content is Bitmap) + { + bitmapData = Bitmap(this._loader.content).bitmapData; + this._bitmapData = bitmapData; + this._loaded = true; + } + } + catch(error:SecurityError) + { + if(bitmapData) + { + bitmapData.dispose(); + } + } + this.disposeLoader(); + dispatchEvent(new APIEvent(APIEvent.ICON_LOADED,this,this._loaded ? null : APIEvent.ERROR_BAD_FILE)); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/Bridge.as b/research/inner_decompiled/scripts/com/newgrounds/Bridge.as new file mode 100644 index 0000000..d262460 --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/Bridge.as @@ -0,0 +1,63 @@ +package com.newgrounds +{ + import flash.events.Event; + import flash.events.StatusEvent; + import flash.net.LocalConnection; + + public class Bridge + { + + private var _inConnection:LocalConnection; + + private var _outConnection:LocalConnection; + + private var _widgetId:String; + + public function Bridge(param1:String) + { + super(); + this._widgetId = param1; + this._inConnection = new LocalConnection(); + this._outConnection = new LocalConnection(); + this._inConnection.client = this; + try + { + this._inConnection.connect("rec_" + this._widgetId); + } + catch(error:*) + { + } + this._outConnection.addEventListener(StatusEvent.STATUS,this.onStatus); + Logger.addEventListener(APIEvent.LOG,this.onLogMessage); + } + + private function onLogMessage(param1:APIEvent) : void + { + try + { + this._outConnection.send(this._widgetId,"sendEvent","trace",String(param1.data)); + } + catch(error:*) + { + } + } + + public function sendEvent(param1:String, param2:Object) : void + { + if(this._outConnection) + { + param2 = {"data":param2}; + this._outConnection.send(this._widgetId,"sendEvent",param1,param2); + } + } + + public function receiveEvent(param1:String, param2:Object) : void + { + } + + private function onStatus(param1:Event) : void + { + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/Logger.as b/research/inner_decompiled/scripts/com/newgrounds/Logger.as new file mode 100644 index 0000000..4b4699c --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/Logger.as @@ -0,0 +1,76 @@ +package com.newgrounds +{ + import flash.events.EventDispatcher; + + public class Logger + { + + internal static const PRIORITY_INTERNAL:uint = 0; + + public static const PRIORITY_MESSAGE:uint = 1; + + public static const PRIORITY_WARNING:uint = 2; + + public static const PRIORITY_ERROR:uint = 3; + + public static const PRIORITY_MAX:uint = 4; + + private static const HEADER:String = "[Newgrounds API] :: "; + + private static var _eventDispatcher:EventDispatcher = new EventDispatcher(); + + private static var _messageLevel:uint = PRIORITY_MESSAGE; + + private static var _throwLevel:uint = PRIORITY_MAX; + + public function Logger() + { + super(); + } + + internal static function logInternal(... rest) : void + { + log(PRIORITY_INTERNAL,rest); + } + + public static function logMessage(... rest) : void + { + log(PRIORITY_MESSAGE,rest); + } + + public static function logWarning(... rest) : void + { + log(PRIORITY_WARNING,rest); + } + + public static function logError(... rest) : void + { + log(PRIORITY_ERROR,rest); + } + + public static function log(param1:uint = 1, param2:Array = null) : void + { + var _loc3_:uint = 0; + if(param1 >= _messageLevel) + { + _loc3_ = 0; + while(_loc3_ < param2.length) + { + trace(HEADER + param2[_loc3_]); + _eventDispatcher.dispatchEvent(new APIEvent(APIEvent.LOG,param2[_loc3_])); + _loc3_++; + } + } + if(param1 >= _throwLevel) + { + throw new Error(param2.join("\n")); + } + } + + public static function addEventListener(param1:String, param2:Function) : void + { + _eventDispatcher.addEventListener(param1,param2,false,0,false); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/Medal.as b/research/inner_decompiled/scripts/com/newgrounds/Medal.as new file mode 100644 index 0000000..b5675d3 --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/Medal.as @@ -0,0 +1,123 @@ +package com.newgrounds +{ + import com.newgrounds.assets.DefaultMedalIcon; + import flash.display.BitmapData; + import flash.display.DisplayObjectContainer; + import flash.display.Sprite; + + public class Medal extends APIEventDispatcher + { + + public static const ICON_WIDTH:uint = 50; + + public static const ICON_HEIGHT:uint = 50; + + public static const DIFFICULTY_EASY:String = "Easy"; + + public static const DIFFICULTY_MODERATE:String = "Moderate"; + + public static const DIFFICULTY_CHALLENGING:String = "Challenging"; + + public static const DIFFICULTY_DIFFICULT:String = "Difficult"; + + public static const DIFFICULTY_BRUTAL:String = "Brutal"; + + private static const DIFFICULTIES:Array = ["Unknown",DIFFICULTY_EASY,DIFFICULTY_MODERATE,DIFFICULTY_CHALLENGING,DIFFICULTY_DIFFICULT,DIFFICULTY_BRUTAL]; + + public static const DEFAULT_ICON:BitmapData = new DefaultMedalIcon(ICON_WIDTH,ICON_HEIGHT); + + private var _connection:APIConnection; + + private var _name:String; + + private var _id:uint; + + private var _value:uint; + + private var _unlocked:Boolean; + + private var _difficulty:String; + + private var _iconLoader:BitmapLoader; + + public function Medal(param1:APIConnection, param2:uint, param3:String, param4:Boolean, param5:uint, param6:uint, param7:String) + { + super(); + this._connection = param1; + this._id = param2; + this._name = param3; + this._unlocked = param4; + this._value = param5; + this._difficulty = DIFFICULTIES[param6]; + this._iconLoader = new BitmapLoader(DEFAULT_ICON,param7); + this._iconLoader.load(); + } + + public function get difficulty() : String + { + return this._difficulty; + } + + public function get icon() : BitmapData + { + return this._iconLoader.bitmapData; + } + + public function get id() : uint + { + return this._id; + } + + public function get name() : String + { + return this._name; + } + + public function get unlocked() : Boolean + { + return this._unlocked; + } + + public function get value() : uint + { + return this._value; + } + + override public function toString() : String + { + return "Medal: " + this._name + "\t\t(" + (this._unlocked ? "unlocked, " : "locked, ") + this._value + "pts, " + this._difficulty + ")"; + } + + public function attachIcon(param1:DisplayObjectContainer) : Sprite + { + return this._iconLoader.attachBitmap(param1); + } + + public function unlock() : void + { + if(!this._connection.debug && this._unlocked) + { + Logger.logWarning("Medal \"" + this._name + "\" is already unlocked."); + return; + } + Logger.logMessage("Unlocking medal \"" + this.name + "\"..."); + this._unlocked = true; + this._connection.sendSimpleCommand("unlockMedal",this.onUnlockConfirmed,null,{"medal_id":this.id}); + dispatchEvent(new APIEvent(APIEvent.MEDAL_UNLOCKED,this)); + } + + private function onUnlockConfirmed(param1:APIEvent) : void + { + if(param1.success) + { + Logger.logMessage("Medal \"" + this.name + "\" unlocked."); + } + else + { + Logger.logError("Failed to unlock \"" + this.name + "\"!"); + } + dispatchEvent(new APIEvent(APIEvent.MEDAL_UNLOCK_CONFIRMED,this,param1.error)); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/SaveFile.as b/research/inner_decompiled/scripts/com/newgrounds/SaveFile.as new file mode 100644 index 0000000..b4dadd2 --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/SaveFile.as @@ -0,0 +1,691 @@ +package com.newgrounds +{ + import com.newgrounds.assets.DefaultSaveIcon; + import com.newgrounds.encoders.PNGEncoder; + import flash.display.BitmapData; + import flash.display.DisplayObject; + import flash.display.DisplayObjectContainer; + import flash.display.IBitmapDrawable; + import flash.display.Sprite; + import flash.events.Event; + import flash.events.IOErrorEvent; + import flash.events.SecurityErrorEvent; + import flash.geom.Matrix; + import flash.geom.Rectangle; + import flash.net.URLLoader; + import flash.net.URLLoaderDataFormat; + import flash.net.URLRequest; + import flash.utils.ByteArray; + import flash.utils.getQualifiedClassName; + + public class SaveFile extends APIEventDispatcher + { + + private static var _currentFile:SaveFile; + + public static const ICON_WIDTH:uint = 90; + + public static const ICON_HEIGHT:uint = 90; + + private static const STATUS_PRIVATE:uint = 0; + + private static const STATUS_SHARED:uint = 1; + + private static const STATUS_UNAPPROVED:uint = 2; + + private static const STATUS_APPROVED:uint = 3; + + internal static var _imageFilePath:String = ""; + + internal static var _saveFilePath:String = ""; + + public static const DEFAULT_ICON:BitmapData = new DefaultSaveIcon(ICON_WIDTH,ICON_HEIGHT); + + private var _group:SaveGroup; + + private var _name:String; + + private var _id:uint; + + private var _description:String; + + private var _authorId:uint; + + private var _authorName:String; + + private var _createdDate:String; + + private var _modifiedDate:String; + + private var _views:uint; + + private var _readOnly:Boolean; + + private var _public:Boolean; + + private var _approved:Boolean; + + private var _draft:Boolean; + + private var _iconLoader:BitmapLoader; + + private var _keys:Object = new Object(); + + private var _ratings:Object = new Object(); + + private var _dataURL:String; + + private var _data:*; + + private var _dataLoaded:Boolean; + + private var _encodedData:*; + + private var _encoderQueue:Array; + + private var _encoding:Boolean; + + private var _encodingParent:Object; + + private var _encodingProperty:String; + + private var _fileSize:uint; + + private var _dataLoader:URLLoader; + + public function SaveFile(param1:SaveGroup) + { + super(); + this._iconLoader = new BitmapLoader(DEFAULT_ICON,null); + this._group = param1; + } + + public static function get currentFile() : SaveFile + { + return _currentFile; + } + + internal static function fromObject(param1:SaveGroup, param2:Object) : SaveFile + { + var _loc4_:Object = null; + var _loc5_:Object = null; + var _loc6_:SaveKey = null; + var _loc7_:SaveRating = null; + var _loc3_:SaveFile = new SaveFile(param1); + _loc3_._name = param2.filename; + _loc3_._description = param2.description; + _loc3_._id = param2.save_id; + _loc3_._authorId = param2.user_id; + _loc3_._authorName = param2.user_name; + _loc3_._createdDate = param2.created; + _loc3_._modifiedDate = param2.last_update; + _loc3_._views = param2.views; + if(Boolean(param2.thumb) && param2.thumb != "") + { + _loc3_._iconLoader.url = _imageFilePath + param2.thumb; + } + _loc3_._dataURL = _saveFilePath + param2.file; + _loc3_._fileSize = param2.file_size; + _loc3_._approved = param2.status != STATUS_UNAPPROVED; + _loc3_._readOnly = false; + _loc3_._public = param2.status != STATUS_PRIVATE && param2.status != STATUS_UNAPPROVED; + for each(_loc4_ in param2.keys) + { + _loc6_ = param1.getKeyById(_loc4_.id); + if(_loc6_) + { + _loc3_._keys[_loc6_.name] = _loc6_.validateValue(_loc4_.value); + } + } + for each(_loc5_ in param2.ratings) + { + _loc7_ = param1.getRatingById(_loc5_.id); + if(_loc7_) + { + _loc3_._ratings[_loc7_.name] = _loc7_.validateValue(_loc5_.score); + } + } + return _loc3_; + } + + public function get group() : SaveGroup + { + return this._group; + } + + public function get name() : String + { + return this._name; + } + + public function set name(param1:String) : void + { + this._name = param1; + } + + public function get description() : String + { + return this._description; + } + + public function set description(param1:String) : void + { + this._description = param1; + } + + public function get id() : uint + { + return this._id; + } + + public function get data() : Object + { + return this._data; + } + + public function set data(param1:Object) : void + { + this._data = param1; + } + + public function get bytesLoaded() : uint + { + if(this._data) + { + return this.bytesTotal; + } + if(!this._dataLoader) + { + return 0; + } + return this._dataLoader.bytesLoaded; + } + + public function get bytesTotal() : uint + { + return this._fileSize; + } + + public function get readOnly() : Boolean + { + return this._readOnly; + } + + public function get draft() : Boolean + { + return this._draft; + } + + public function set draft(param1:Boolean) : void + { + this._draft = param1; + } + + public function get authorId() : uint + { + return this._authorId; + } + + public function get authorName() : String + { + return this._authorName; + } + + public function get keys() : Object + { + return this._keys; + } + + public function get ratings() : Object + { + return this._ratings; + } + + public function get views() : uint + { + return this._views; + } + + public function get createdDate() : String + { + return this._createdDate; + } + + public function get updatedDate() : String + { + return this._modifiedDate; + } + + override public function toString() : String + { + return "Save File: " + this._name; + } + + public function get icon() : BitmapData + { + return this._iconLoader.bitmapData; + } + + public function set icon(param1:BitmapData) : void + { + this.createIcon(param1); + } + + public function get iconLoaded() : Boolean + { + return this._iconLoader.loaded; + } + + public function createIcon(param1:IBitmapDrawable) : void + { + var _loc3_:Number = NaN; + var _loc4_:Number = NaN; + var _loc8_:Number = NaN; + var _loc9_:Rectangle = null; + var _loc2_:BitmapData = new BitmapData(ICON_WIDTH,ICON_HEIGHT,false,0); + var _loc5_:Number = 0; + var _loc6_:Number = 0; + _loc3_ = Number(Object(param1).width); + _loc4_ = Number(Object(param1).height); + if(param1 is DisplayObject) + { + _loc9_ = DisplayObject(param1).getBounds(null); + _loc5_ = _loc9_.left; + _loc6_ = _loc9_.top; + } + var _loc7_:Matrix = new Matrix(); + _loc8_ = Math.min(ICON_WIDTH / _loc3_,ICON_HEIGHT / _loc4_); + _loc7_.translate(-_loc5_,-_loc6_); + _loc7_.scale(_loc8_,_loc8_); + _loc7_.translate((ICON_WIDTH - _loc3_ * _loc8_) / 2,(ICON_HEIGHT - _loc4_ * _loc8_) / 2); + _loc2_.draw(param1,_loc7_); + this._iconLoader.bitmapData = _loc2_; + } + + public function attachIcon(param1:DisplayObjectContainer) : Sprite + { + if(this._iconLoader) + { + return this._iconLoader.attachBitmap(param1); + } + Logger.logError("No icon available for this sumbission."); + return null; + } + + public function save() : void + { + if(!this._group.connection.hasUserSession) + { + Logger.logError("The user must be logged-in to save a file."); + dispatchEvent(new APIEvent(APIEvent.FILE_SAVED,null,APIEvent.ERROR_NOT_LOGGED_IN)); + return; + } + ++BitmapLoader._cacheSeed; + _currentFile = this; + this.encodeData(true); + } + + private function doSave() : void + { + var _loc3_:String = null; + var _loc4_:Array = null; + var _loc5_:String = null; + var _loc6_:SaveKey = null; + var _loc7_:SaveRating = null; + var _loc8_:ByteArray = null; + var _loc1_:APICommand = new APICommand("saveFile"); + _loc1_.secureParameters.group = this._group.id; + _loc1_.secureParameters.user_name = this._group.connection.username; + _loc1_.secureParameters.filename = this._name; + _loc1_.secureParameters.description = this._description; + if(this._draft) + { + _loc1_.secureParameters.draft = true; + } + if(Boolean(this._id) && !this._readOnly) + { + _loc1_.secureParameters.overwrite = 1; + _loc1_.secureParameters.save_id = this._id; + } + var _loc2_:Array = []; + for(_loc3_ in this._keys) + { + _loc6_ = this._group.getKey(_loc3_); + if(_loc6_) + { + _loc2_.push({ + "id":_loc6_.id, + "value":_loc6_.validateValue(this._keys[_loc3_]) + }); + } + else + { + Logger.logError("No key named \"" + _loc3_ + "\" in save group \"" + this._group.name + "\"."); + } + } + _loc1_.secureParameters.keys = _loc2_; + _loc4_ = []; + for(_loc5_ in this._ratings) + { + _loc7_ = this._group.getRating(_loc5_); + if(_loc7_) + { + _loc4_.push({ + "id":_loc7_.id, + "value":_loc7_.validateValue(this._ratings[_loc5_]) + }); + } + else + { + Logger.logError("No rating named \"" + _loc5_ + "\" in save group \"" + this._group.name + "\"."); + } + } + _loc1_.secureParameters.ratings = _loc4_; + _loc8_ = new ByteArray(); + _loc8_.writeObject(this._encodedData); + _loc8_.compress(); + _loc1_.addFile("file",_loc8_,"file"); + if(this.iconLoaded) + { + _loc1_.addFile("thumbnail",PNGEncoder.encode(this.icon),"thumbnail"); + } + _loc1_.addEventListener(APIEvent.COMMAND_COMPLETE,this.onSaveComplete); + this._group.connection.sendCommand(_loc1_); + } + + private function encodeData(param1:Boolean) : void + { + this._encoderQueue = []; + this._encoding = param1; + if(param1) + { + this._encodedData = this._data; + this.preEncodeObject(this,"_encodedData"); + } + else + { + this.preEncodeObject(this,"_data"); + } + this.encodeObject(); + } + + private function preEncodeObject(param1:Object, param2:String) : void + { + var _loc4_:Boolean = false; + var _loc6_:Boolean = false; + var _loc7_:String = null; + var _loc3_:Object = param1[param2]; + try + { + if(this._encoding) + { + _loc4_ = _loc3_ is BitmapData; + } + else + { + _loc4_ = _loc3_.type == "__bitmap"; + } + } + catch(error:*) + { + } + var _loc5_:Object = _loc3_; + _loc6_ = _loc3_ is ByteArray; + if(_loc4_) + { + this._encoderQueue.push({ + "parent":param1, + "property":param2 + }); + } + else if(typeof _loc3_ == "object" && !_loc6_) + { + if(this._encoding) + { + if(_loc3_ is Array) + { + _loc5_ = []; + } + else + { + _loc5_ = {}; + } + for(_loc7_ in _loc3_) + { + _loc5_[_loc7_] = _loc3_[_loc7_]; + } + param1[param2] = _loc5_; + } + for(_loc7_ in _loc5_) + { + this.preEncodeObject(_loc5_,_loc7_); + } + } + } + + private function encodeObject() : void + { + var _loc5_:Object = null; + if(!this._encoderQueue.length) + { + if(this._encoding) + { + this.doSave(); + } + else + { + this._dataLoaded = true; + this.checkLoadComplete(); + } + return; + } + var _loc1_:Object = this._encoderQueue.pop(); + var _loc2_:Object = _loc1_.parent; + var _loc3_:String = _loc1_.property; + var _loc4_:Object = _loc2_[_loc3_]; + if(this._encoding) + { + _loc5_ = { + "type":"__bitmap", + "width":_loc4_.width, + "height":_loc4_.height, + "transparent":_loc4_.transparent + }; + _loc2_[_loc3_] = _loc5_; + _loc5_.data = new ByteArray(); + _loc5_.data.writeBytes(_loc4_.getPixels(_loc4_.rect)); + _loc5_.data.position = 0; + } + else + { + _loc5_ = new BitmapData(_loc4_.width,_loc4_.height,_loc4_.transparent); + _loc5_.setPixels(_loc5_.rect,_loc4_.data); + _loc2_[_loc3_] = _loc5_; + } + this.encodeObject(); + } + + private function onIconLoaded(param1:APIEvent) : void + { + if(!param1.success && Boolean(this._iconLoader.url)) + { + Logger.logWarning("Unable to load the icon for this save file."); + } + this._iconLoader.removeEventListener(APIEvent.ICON_LOADED,this.onIconLoaded); + this.checkLoadComplete(); + } + + private function checkLoadComplete() : void + { + if(this._dataLoaded && this.iconLoaded) + { + Logger.logMessage("Data loaded."); + dispatchEvent(new APIEvent(APIEvent.FILE_LOADED,this)); + } + } + + private function onDataLoaded(param1:*) : void + { + var byteArray:ByteArray = null; + var data:* = param1; + try + { + if(data) + { + byteArray = data; + byteArray.uncompress(); + this._data = byteArray.readObject(); + this.encodeData(false); + } + } + catch(error:Error) + { + Logger.logError("Error while loading data:",error); + dispatchEvent(new APIEvent(APIEvent.FILE_LOADED,this,APIEvent.ERROR_BAD_FILE)); + } + } + + private function onDataError(param1:String) : void + { + Logger.logError("Unable to load data:",param1); + dispatchEvent(new APIEvent(APIEvent.FILE_LOADED,this,APIEvent.ERROR_BAD_FILE)); + } + + private function onSaveComplete(param1:APIEvent) : void + { + if(param1.success) + { + Logger.logMessage("File \"" + this._name + "\" saved!"); + if(param1.data) + { + this._id = param1.data.save_id; + this._dataURL = unescape(param1.data.file_url); + } + dispatchEvent(new APIEvent(APIEvent.FILE_SAVED,this)); + } + else + { + Logger.logError("Error saving file \"" + this._name + "\":",param1.error); + dispatchEvent(new APIEvent(APIEvent.FILE_SAVED,this,param1.error)); + } + } + + public function sendVote(param1:String, param2:Number) : void + { + var _loc3_:SaveRating = this._group.getRating(param1); + if(!_loc3_) + { + Logger.logError("No save rating named \"" + param1 + "\" exists for this save group."); + dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE,{},APIEvent.ERROR_INVALID_ARGUMENT)); + return; + } + param2 = _loc3_.validateValue(param2); + if(isNaN(param2)) + { + Logger.logError("Invalid vote (" + param2 + "). " + param1 + " allows a range of " + _loc3_.minimum + "-" + _loc3_.maximum + "."); + dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE,{},APIEvent.ERROR_INVALID_ARGUMENT)); + return; + } + Logger.logMessage("Voting " + param2 + " for " + param1 + " on " + this._name + "..."); + this._group.connection.sendSimpleCommand("rateSaveFile",this.onVoteComplete,null,{ + "group":this._group.id, + "save_id":this._id, + "rating_id":_loc3_.id, + "vote":param2 + }); + } + + private function onVoteComplete(param1:APIEvent) : void + { + var _loc3_:SaveRating = null; + var _loc2_:String = param1.error; + if(param1.data.already_voted) + { + Logger.logError("Vote failed. You\'ve already voted on this rating today."); + _loc2_ = APIEvent.ERROR_ALREADY_VOTED; + } + if(_loc2_ == APIEvent.ERROR_NONE) + { + _loc3_ = this._group.getRatingById(param1.data.rating_id); + if(_loc3_) + { + this._ratings[_loc3_.name] = _loc3_.validateValue(param1.data.score); + } + } + dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE,this,_loc2_)); + } + + public function clone() : SaveFile + { + var _loc2_:String = null; + var _loc1_:SaveFile = new SaveFile(this._group); + _loc1_._data = this._data; + _loc1_._description = this._description; + _loc1_._draft = this._draft; + _loc1_._fileSize = this._fileSize; + _loc1_._iconLoader.bitmapData = this._iconLoader.bitmapData; + for(_loc2_ in this._keys) + { + _loc1_._keys[_loc2_] = this._keys[_loc2_]; + } + for(_loc2_ in this._ratings) + { + _loc1_._ratings[_loc2_] = this._ratings[_loc2_]; + } + _loc1_._name = this._name; + return _loc1_; + } + + public function load() : void + { + _currentFile = this; + this._dataLoaded = false; + this._data = null; + if(!this.iconLoaded) + { + this._iconLoader.addEventListener(APIEvent.ICON_LOADED,this.onIconLoaded); + this._iconLoader.load(); + } + this._dataLoader = new URLLoader(); + this._dataLoader.dataFormat = URLLoaderDataFormat.BINARY; + this._dataLoader.addEventListener(Event.COMPLETE,this.as3DataLoaded); + this._dataLoader.addEventListener(IOErrorEvent.IO_ERROR,this.as3DataError); + this._dataLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR,this.as3DataError); + this._dataLoader.load(new URLRequest(this._dataURL)); + } + + private function as3DataLoaded(param1:Event) : void + { + this.onDataLoaded(this._dataLoader.data); + } + + private function as3DataError(param1:Event) : void + { + this.onDataError(param1.toString()); + } + + private function decodeObject(param1:Object) : Object + { + var _loc2_:BitmapData = null; + var _loc3_:String = null; + if(getQualifiedClassName(param1) == "Object") + { + if(param1.type == "__bitmap") + { + _loc2_ = new BitmapData(param1.width,param1.height,param1.transparent); + _loc2_.setPixels(_loc2_.rect,param1.data); + param1 = _loc2_; + } + else + { + for(_loc3_ in param1) + { + param1[_loc3_] = this.decodeObject(param1[_loc3_]); + } + } + } + return param1; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/SaveGroup.as b/research/inner_decompiled/scripts/com/newgrounds/SaveGroup.as new file mode 100644 index 0000000..0cc4bb4 --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/SaveGroup.as @@ -0,0 +1,126 @@ +package com.newgrounds +{ + public class SaveGroup + { + + public static const TYPE_SYSTEM:uint = 0; + + public static const TYPE_PRIVATE:uint = 1; + + public static const TYPE_PUBLIC:uint = 2; + + public static const TYPE_MODERATED:uint = 3; + + private var _connection:APIConnection; + + private var _name:String; + + private var _id:uint; + + private var _type:uint; + + private var _keysArray:Array; + + private var _ratingsArray:Array; + + private var _keys:Object; + + private var _ratings:Object; + + public function SaveGroup(param1:APIConnection, param2:String, param3:uint, param4:uint, param5:Array, param6:Array) + { + var _loc7_:uint = 0; + var _loc8_:SaveKey = null; + var _loc9_:SaveRating = null; + super(); + this._connection = param1; + this._id = param3; + this._name = param2; + this._type = param4; + this._keysArray = param5; + this._ratingsArray = param6; + this._keys = new Object(); + this._ratings = new Object(); + for each(_loc8_ in param5) + { + this._keys[_loc8_.name] = _loc8_; + } + for each(_loc9_ in param6) + { + this._ratings[_loc9_.name] = _loc9_; + } + } + + public function get connection() : APIConnection + { + return this._connection; + } + + public function get name() : String + { + return this._name; + } + + public function get type() : uint + { + return this._type; + } + + public function get id() : uint + { + return this._id; + } + + public function get keys() : Array + { + return this._keysArray; + } + + public function get ratings() : Array + { + return this._ratingsArray; + } + + public function getKey(param1:String) : SaveKey + { + return this._keys[param1]; + } + + public function getRating(param1:String) : SaveRating + { + return this._ratings[param1]; + } + + public function getKeyById(param1:uint) : SaveKey + { + var _loc2_:SaveKey = null; + for each(_loc2_ in this._keys) + { + if(_loc2_.id == param1) + { + return _loc2_; + } + } + return null; + } + + public function getRatingById(param1:uint) : SaveRating + { + var _loc2_:SaveRating = null; + for each(_loc2_ in this._ratings) + { + if(_loc2_.id == param1) + { + return _loc2_; + } + } + return null; + } + + public function toString() : String + { + return "SaveGroup: " + this.name + " Keys: " + this._keysArray + " Ratings: " + this._ratingsArray; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/SaveKey.as b/research/inner_decompiled/scripts/com/newgrounds/SaveKey.as new file mode 100644 index 0000000..4958cb3 --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/SaveKey.as @@ -0,0 +1,81 @@ +package com.newgrounds +{ + public class SaveKey + { + + public static const TYPE_FLOAT:uint = 1; + + public static const TYPE_INTEGER:uint = 2; + + public static const TYPE_STRING:uint = 3; + + public static const TYPE_BOOLEAN:uint = 4; + + private var _name:String; + + private var _id:uint; + + private var _type:uint; + + public function SaveKey(param1:String, param2:uint, param3:uint) + { + super(); + this._name = param1; + this._id = param2; + this._type = param3; + } + + public function get name() : String + { + return this._name; + } + + public function get id() : uint + { + return this._id; + } + + public function get type() : uint + { + return this._type; + } + + public function validateValue(param1:*) : * + { + var _loc2_:int = 0; + switch(this._type) + { + case TYPE_INTEGER: + param1 = Number(param1); + if(!isNaN(param1)) + { + _loc2_ = int(param1); + if(_loc2_ != param1) + { + Logger.logWarning("Float value " + param1 + " given for integer key \"" + this._name + "\". Clamping to " + _loc2_ + "."); + } + return _loc2_; + } + break; + case TYPE_FLOAT: + param1 = Number(param1); + if(!isNaN(param1)) + { + return isNaN(Number(param1)); + } + break; + case TYPE_BOOLEAN: + return Boolean(param1); + case TYPE_STRING: + return param1 ? param1.toString() : ""; + } + return null; + } + + public function toString() : String + { + return this._name; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/SaveQuery.as b/research/inner_decompiled/scripts/com/newgrounds/SaveQuery.as new file mode 100644 index 0000000..d2c2047 --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/SaveQuery.as @@ -0,0 +1,340 @@ +package com.newgrounds +{ + public class SaveQuery extends APIEventDispatcher + { + + public static const FILE_ID:String = "fileId"; + + public static const AUTHOR_ID:String = "authorId"; + + public static const AUTHOR_NAME:String = "authorName"; + + public static const FILE_NAME:String = "fileName"; + + public static const CREATED_ON:String = "createdOn"; + + public static const UPDATED_ON:String = "updatedOn"; + + public static const FILE_VIEWS:String = "fileViews"; + + public static const FILE_STATUS:String = "fileStatus"; + + private static const FILE_FIELDS:Array = [FILE_ID,AUTHOR_ID,AUTHOR_NAME,FILE_NAME,CREATED_ON,UPDATED_ON,FILE_VIEWS,FILE_STATUS]; + + public static const OPERATOR_EQUAL:String = "="; + + public static const OPERATOR_LESS_THAN:String = "<"; + + public static const OPERATOR_GREATER_THAN:String = ">"; + + public static const OPERATOR_NOT_EQUAL:String = "!="; + + public static const OPERATOR_LESS_OR_EQUAL:String = "<="; + + public static const OPERATOR_GREATER_OR_EQUAL:String = ">="; + + public static const OPERATOR_CONTAINS:String = "*"; + + public static const OPERATOR_NOT_CONTAINS:String = "!*"; + + public static const OPERATOR_NOT_BEGINS_WITH:String = "!*="; + + public static const OPERATOR_NOT_ENDS_WITH:String = "!=*"; + + public static const OPERATOR_BEGINS_WITH:String = "*="; + + public static const OPERATOR_ENDS_WITH:String = "=*"; + + private static const TABLE_FILES:uint = 1; + + private static const TABLE_KEYS:uint = 2; + + private static const TABLE_RATINGS:uint = 3; + + private var _connection:APIConnection; + + private var _group:SaveGroup; + + private var _page:uint = 1; + + private var _resultsPerPage:uint = 10; + + private var _isRandomized:Boolean = false; + + private var _files:Array = []; + + private var _totalResults:uint; + + private var _lookupKeys:Array = []; + + private var _lookupRatings:Array = []; + + private var _fileConditions:Array = []; + + private var _keyConditions:Array = []; + + private var _ratingConditions:Array = []; + + private var _sortFields:Array = []; + + public function SaveQuery(param1:SaveGroup) + { + super(); + this._group = param1; + this._connection = param1.connection; + this.includeAllFields(); + } + + public function get group() : SaveGroup + { + return this._group; + } + + public function get resultsPerPage() : uint + { + return this._resultsPerPage; + } + + public function set resultsPerPage(param1:uint) : void + { + this._resultsPerPage = Math.min(Math.max(param1,1),100); + } + + public function get page() : uint + { + return this._page; + } + + public function set page(param1:uint) : void + { + this._page = Math.max(param1,1); + } + + public function prevPage() : void + { + --this.page; + } + + public function nextPage() : void + { + ++this.page; + } + + public function get isRandomized() : Boolean + { + return this._isRandomized; + } + + public function set isRandomized(param1:Boolean) : void + { + this._isRandomized = param1; + } + + public function get files() : Array + { + return this._files; + } + + public function reset() : void + { + this._page = 1; + this._resultsPerPage = 10; + this._isRandomized = false; + this._lookupKeys = []; + this._lookupRatings = []; + this._fileConditions = []; + this._keyConditions = []; + this._ratingConditions = []; + this._files = []; + this.includeAllFields(); + } + + public function clone() : SaveQuery + { + var _loc1_:SaveQuery = new SaveQuery(this._group); + _loc1_._page = this._page; + _loc1_._resultsPerPage = this._resultsPerPage; + _loc1_._isRandomized = this._isRandomized; + _loc1_._lookupKeys = this._lookupKeys.concat(); + _loc1_._lookupRatings = this._lookupRatings.concat(); + _loc1_._fileConditions = this._fileConditions.concat(); + _loc1_._keyConditions = this._keyConditions.concat(); + _loc1_._ratingConditions = this._ratingConditions.concat(); + return _loc1_; + } + + private function includeAllFields() : void + { + var _loc1_:SaveKey = null; + var _loc2_:SaveRating = null; + for each(_loc1_ in this._group.keys) + { + this._lookupKeys.push(_loc1_.id); + } + for each(_loc2_ in this._group.ratings) + { + this._lookupRatings.push(_loc2_.id); + } + } + + public function addCondition(param1:String, param2:String, param3:*) : void + { + var _loc4_:int = 0; + var _loc5_:SaveKey = null; + var _loc6_:Array = null; + var _loc7_:SaveRating = null; + _loc4_ = FILE_FIELDS.indexOf(param1); + if(_loc4_ >= 0) + { + this._fileConditions.push({ + "field":_loc4_, + "operator":param2, + "value":param3 + }); + } + else + { + _loc5_ = this._group.getKey(param1); + if(_loc5_) + { + param3 = _loc5_.validateValue(param3); + this._keyConditions.push({ + "key_id":_loc5_.id, + "operator":param2, + "value":param3 + }); + return; + } + _loc6_ = param1.split("."); + _loc7_ = this._group.getRating(_loc6_[0]); + if(_loc7_) + { + param3 = _loc7_.validateValue(param3); + this._ratingConditions.push({ + "rating_id":_loc7_.id, + "operator":param2, + "value":param3, + "column":(_loc6_[1] ? _loc6_[1] : "score") + }); + return; + } + Logger.logError("The save group \"" + this._group.name + "\" does not have a field named \"" + param1 + "\"."); + } + } + + public function sortOn(param1:String, param2:Boolean = false) : void + { + var _loc3_:int = 0; + var _loc4_:SaveKey = null; + var _loc5_:Array = null; + var _loc6_:SaveRating = null; + _loc3_ = FILE_FIELDS.indexOf(param1); + if(_loc3_ >= 0) + { + this._sortFields.push({ + "table":TABLE_FILES, + "field":_loc3_, + "desc":param2 + }); + } + else + { + _loc4_ = this._group.getKey(param1); + if(_loc4_) + { + this._sortFields.push({ + "table":TABLE_KEYS, + "field":_loc4_.id, + "desc":param2 + }); + return; + } + _loc5_ = param1.split("."); + _loc6_ = this._group.getRating(_loc5_[0]); + if(_loc6_) + { + this._sortFields.push({ + "table":TABLE_RATINGS, + "field":_loc6_.id, + "desc":param2, + "extra":(_loc5_[1] ? _loc5_[1] : "score") + }); + return; + } + Logger.logError("The save group \"" + this._group.name + "\" does not have a field named \"" + param1 + "\"."); + } + } + + public function execute() : void + { + var _loc1_:Object = {}; + _loc1_.page = this._page; + _loc1_.num_results = this._resultsPerPage; + if(this._isRandomized) + { + _loc1_.randomize = 1; + } + if(Boolean(this._lookupKeys) && Boolean(this._lookupKeys.length)) + { + _loc1_.lookup_keys = this._lookupKeys; + } + if(Boolean(this._lookupRatings) && Boolean(this._lookupRatings.length)) + { + _loc1_.lookup_ratings = this._lookupRatings; + } + if(Boolean(this._fileConditions) && Boolean(this._fileConditions.length)) + { + _loc1_.file_conditions = this._fileConditions; + } + if(Boolean(this._keyConditions) && Boolean(this._keyConditions.length)) + { + _loc1_.key_conditions = this._keyConditions; + } + if(Boolean(this._ratingConditions) && Boolean(this._ratingConditions.length)) + { + _loc1_.rating_conditions = this._ratingConditions; + } + if(Boolean(this._sortFields) && Boolean(this._sortFields.length)) + { + _loc1_.sort_conditions = this._sortFields; + } + this._connection.sendSimpleCommand("lookupSaveFiles",this.onQueryComplete,{ + "publisher_id":this._connection.publisherId, + "group_id":this._group.id, + "query":_loc1_ + }); + } + + private function onQueryComplete(param1:APIEvent) : void + { + var _loc2_:Object = null; + var _loc3_:uint = 0; + var _loc4_:SaveFile = null; + if(param1.success) + { + _loc2_ = param1.data; + this._files = []; + if(_loc2_.files) + { + _loc3_ = 0; + while(_loc3_ < _loc2_.files.length) + { + _loc4_ = SaveFile.fromObject(this._group,_loc2_.files[_loc3_]); + if(_loc4_) + { + this._files.push(_loc4_); + } + _loc3_++; + } + } + dispatchEvent(new APIEvent(APIEvent.QUERY_COMPLETE,this)); + } + else + { + Logger.logError("Query failed: " + param1.error); + dispatchEvent(new APIEvent(APIEvent.QUERY_COMPLETE,this,param1.error)); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/SaveRating.as b/research/inner_decompiled/scripts/com/newgrounds/SaveRating.as new file mode 100644 index 0000000..f7d0fe7 --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/SaveRating.as @@ -0,0 +1,88 @@ +package com.newgrounds +{ + public class SaveRating + { + + private var _name:String; + + private var _id:uint; + + private var _isFloat:Boolean; + + private var _minimum:Number; + + private var _maximum:Number; + + public function SaveRating(param1:String, param2:uint, param3:Boolean, param4:Number, param5:Number) + { + super(); + this._name = param1; + this._id = param2; + this._isFloat = param3; + this._minimum = param4; + this._maximum = param5; + } + + public function get name() : String + { + return this._name; + } + + public function get id() : uint + { + return this._id; + } + + public function get isFloat() : Boolean + { + return this._isFloat; + } + + public function get minimum() : Number + { + return this._minimum; + } + + public function get maximum() : Number + { + return this._maximum; + } + + public function validateValue(param1:*) : Number + { + var _loc3_:int = 0; + var _loc2_:Number = Number(param1); + if(isNaN(_loc2_)) + { + Logger.logError("Invalid value for rating \"" + this._name + "\"."); + return NaN; + } + if(_loc2_ < this._minimum) + { + Logger.logWarning(_loc2_ + " is out of acceptable range for rating \"" + this._name + "\". Clamping to " + this._minimum + "."); + return this._minimum; + } + if(_loc2_ > this._maximum) + { + Logger.logWarning(_loc2_ + " is out of acceptable range for rating \"" + this._name + "\". Clamping to " + this._maximum + "."); + return this._maximum; + } + if(!this.isFloat) + { + _loc3_ = int(_loc2_); + if(_loc3_ != _loc2_) + { + Logger.logWarning("Float value " + _loc2_ + " given for integer rating \"" + this._name + "\". Clamping to " + _loc3_ + "."); + } + return _loc3_; + } + return _loc2_; + } + + public function toString() : String + { + return this._name; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/Score.as b/research/inner_decompiled/scripts/com/newgrounds/Score.as new file mode 100644 index 0000000..bb94ecf --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/Score.as @@ -0,0 +1,57 @@ +package com.newgrounds +{ + public class Score + { + + private var _numericValue:Number; + + private var _rank:uint; + + private var _username:String; + + private var _score:String; + + private var _tag:String; + + public function Score(param1:uint, param2:String, param3:String, param4:Number, param5:String) + { + super(); + this._rank = param1; + this._username = param2; + this._score = param3; + this._numericValue = param4; + this._tag = param5; + } + + public function get numericValue() : Number + { + return this._numericValue; + } + + public function get rank() : uint + { + return this._rank; + } + + public function get score() : String + { + return this._score; + } + + public function get tag() : String + { + return this._tag; + } + + public function get username() : String + { + return this._username; + } + + public function toString() : String + { + return this._rank + ".\t" + this._username + "\t" + this._score; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/ScoreBoard.as b/research/inner_decompiled/scripts/com/newgrounds/ScoreBoard.as new file mode 100644 index 0000000..9a6f294 --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/ScoreBoard.as @@ -0,0 +1,194 @@ +package com.newgrounds +{ + public class ScoreBoard extends APIEventDispatcher + { + + public static const TODAY:String = "Today"; + + public static const THIS_WEEK:String = "This Week"; + + public static const THIS_MONTH:String = "This Month"; + + public static const THIS_YEAR:String = "This Year"; + + public static const ALL_TIME:String = "All-Time"; + + private var _connection:APIConnection; + + private var _name:String; + + private var _id:uint; + + private var _period:String = "All-Time"; + + private var _firstResult:uint = 1; + + private var _numResults:uint = 10; + + private var _tag:String; + + private var _scores:Array; + + public function ScoreBoard(param1:APIConnection, param2:String, param3:uint) + { + super(); + this._connection = param1; + this._name = param2; + this._id = param3; + } + + public function get name() : String + { + return this._name; + } + + public function get scores() : Array + { + return this._scores; + } + + public function get period() : String + { + return this._period; + } + + public function set period(param1:String) : void + { + this._period = param1; + } + + public function get firstResult() : uint + { + return this._firstResult; + } + + public function set firstResult(param1:uint) : void + { + this._firstResult = Math.max(1,param1); + } + + public function get numResults() : uint + { + return this._numResults; + } + + public function set numResults(param1:uint) : void + { + this._numResults = param1; + } + + public function get tag() : String + { + return this._tag; + } + + public function set tag(param1:String) : void + { + this._tag = param1; + } + + public function get page() : uint + { + return Math.ceil((this._firstResult - 1) / this._numResults) + 1; + } + + public function prevPage() : void + { + if(this.firstResult > this._numResults) + { + this.firstResult -= this._numResults; + } + } + + public function nextPage() : void + { + this.firstResult += this._numResults; + } + + public function loadScores() : void + { + this._connection.sendSimpleCommand("loadScores",this.onScoresLoaded,{ + "publisher_id":this._connection.publisherId, + "board":this._id, + "page":(this._firstResult - 1) / this._numResults + 1, + "num_results":this._numResults, + "period":this._period, + "tag":this._tag + }); + } + + public function postScore(param1:Number, param2:String = null) : void + { + if(isNaN(param1)) + { + Logger.logError("Cannot post invalid score: " + param1); + dispatchEvent(new APIEvent(APIEvent.SCORE_POSTED,null,APIEvent.ERROR_INVALID_ARGUMENT)); + return; + } + Logger.logMessage("Posting a score of " + param1 + " by " + this._connection.username + " to scoreboard \"" + this._name + "\"..."); + this._connection.sendSimpleCommand("postScore",this.onScorePosted,null,{ + "user_name":this._connection.username, + "board":this._id, + "value":param1, + "tag":param2 + }); + } + + private function onScoresLoaded(param1:APIEvent) : void + { + var _loc3_:uint = 0; + var _loc4_:uint = 0; + var _loc5_:Object = null; + var _loc2_:Object = param1.data; + this._scores = []; + if(_loc2_.first_result) + { + _loc3_ = uint(_loc2_.first_result); + } + else + { + _loc3_ = this._firstResult; + } + if(_loc2_.scores) + { + _loc4_ = 0; + while(_loc4_ < _loc2_.scores.length) + { + _loc5_ = _loc2_.scores[_loc4_]; + if(_loc5_) + { + this._scores[_loc4_] = new Score(_loc3_,_loc5_.username,_loc5_.value,_loc5_.numeric_value,_loc5_.tag); + } + _loc4_++; + _loc3_++; + } + } + dispatchEvent(new APIEvent(APIEvent.SCORES_LOADED,this)); + } + + private function onScorePosted(param1:APIEvent) : void + { + var _loc2_:Object = null; + var _loc3_:Object = null; + if(param1.success) + { + Logger.logMessage("Score posted!"); + _loc2_ = param1.data; + _loc3_ = {}; + _loc3_.score = _loc2_.value; + _loc3_.scoreBoard = this; + } + else + { + Logger.logError("Error posting score: " + param1.error); + } + dispatchEvent(new APIEvent(APIEvent.SCORE_POSTED,_loc3_,param1.error)); + } + + override public function toString() : String + { + return "Scoreboard: " + this._name; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/assets/DefaultMedalIcon.as b/research/inner_decompiled/scripts/com/newgrounds/assets/DefaultMedalIcon.as new file mode 100644 index 0000000..ba4dc9e --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/assets/DefaultMedalIcon.as @@ -0,0 +1,15 @@ +package com.newgrounds.assets +{ + import flash.display.BitmapData; + + [Embed(source="/_assets/2_com.newgrounds.assets.DefaultMedalIcon_com.newgrounds.assets.DefaultMedalIcon.png")] + public dynamic class DefaultMedalIcon extends BitmapData + { + + public function DefaultMedalIcon(param1:Number, param2:Number) + { + super(param1,param2); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/assets/DefaultSaveIcon.as b/research/inner_decompiled/scripts/com/newgrounds/assets/DefaultSaveIcon.as new file mode 100644 index 0000000..c10acff --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/assets/DefaultSaveIcon.as @@ -0,0 +1,15 @@ +package com.newgrounds.assets +{ + import flash.display.BitmapData; + + [Embed(source="/_assets/41_com.newgrounds.assets.DefaultSaveIcon_com.newgrounds.assets.DefaultSaveIcon.png")] + public dynamic class DefaultSaveIcon extends BitmapData + { + + public function DefaultSaveIcon(param1:Number, param2:Number) + { + super(param1,param2); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/crypto/MD5.as b/research/inner_decompiled/scripts/com/newgrounds/crypto/MD5.as new file mode 100644 index 0000000..e44995b --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/crypto/MD5.as @@ -0,0 +1,227 @@ +package com.newgrounds.crypto +{ + import flash.utils.ByteArray; + + public class MD5 + { + + public static var digest:ByteArray; + + private static var hexChars:String = "0123456789abcdef"; + + public function MD5() + { + super(); + } + + public static function hash(param1:String) : String + { + var _loc2_:ByteArray = new ByteArray(); + _loc2_.writeUTFBytes(param1); + return hashBinary(_loc2_); + } + + public static function hashBytes(param1:ByteArray) : String + { + return hashBinary(param1); + } + + public static function hashBinary(param1:ByteArray) : String + { + var _loc6_:int = 0; + var _loc7_:int = 0; + var _loc8_:int = 0; + var _loc9_:int = 0; + var _loc2_:int = 1732584193; + var _loc3_:int = -271733879; + var _loc4_:int = -1732584194; + var _loc5_:int = 271733878; + var _loc10_:Array = createBlocks(param1); + var _loc11_:int = int(_loc10_.length); + var _loc12_:int = 0; + while(_loc12_ < _loc11_) + { + _loc6_ = _loc2_; + _loc7_ = _loc3_; + _loc8_ = _loc4_; + _loc9_ = _loc5_; + _loc2_ = ff(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 0)],7,-680876936); + _loc5_ = ff(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 1)],12,-389564586); + _loc4_ = ff(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 2)],17,606105819); + _loc3_ = ff(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 3)],22,-1044525330); + _loc2_ = ff(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 4)],7,-176418897); + _loc5_ = ff(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 5)],12,1200080426); + _loc4_ = ff(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 6)],17,-1473231341); + _loc3_ = ff(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 7)],22,-45705983); + _loc2_ = ff(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 8)],7,1770035416); + _loc5_ = ff(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 9)],12,-1958414417); + _loc4_ = ff(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 10)],17,-42063); + _loc3_ = ff(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 11)],22,-1990404162); + _loc2_ = ff(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 12)],7,1804603682); + _loc5_ = ff(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 13)],12,-40341101); + _loc4_ = ff(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 14)],17,-1502002290); + _loc3_ = ff(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 15)],22,1236535329); + _loc2_ = gg(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 1)],5,-165796510); + _loc5_ = gg(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 6)],9,-1069501632); + _loc4_ = gg(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 11)],14,643717713); + _loc3_ = gg(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 0)],20,-373897302); + _loc2_ = gg(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 5)],5,-701558691); + _loc5_ = gg(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 10)],9,38016083); + _loc4_ = gg(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 15)],14,-660478335); + _loc3_ = gg(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 4)],20,-405537848); + _loc2_ = gg(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 9)],5,568446438); + _loc5_ = gg(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 14)],9,-1019803690); + _loc4_ = gg(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 3)],14,-187363961); + _loc3_ = gg(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 8)],20,1163531501); + _loc2_ = gg(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 13)],5,-1444681467); + _loc5_ = gg(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 2)],9,-51403784); + _loc4_ = gg(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 7)],14,1735328473); + _loc3_ = gg(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 12)],20,-1926607734); + _loc2_ = hh(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 5)],4,-378558); + _loc5_ = hh(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 8)],11,-2022574463); + _loc4_ = hh(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 11)],16,1839030562); + _loc3_ = hh(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 14)],23,-35309556); + _loc2_ = hh(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 1)],4,-1530992060); + _loc5_ = hh(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 4)],11,1272893353); + _loc4_ = hh(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 7)],16,-155497632); + _loc3_ = hh(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 10)],23,-1094730640); + _loc2_ = hh(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 13)],4,681279174); + _loc5_ = hh(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 0)],11,-358537222); + _loc4_ = hh(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 3)],16,-722521979); + _loc3_ = hh(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 6)],23,76029189); + _loc2_ = hh(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 9)],4,-640364487); + _loc5_ = hh(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 12)],11,-421815835); + _loc4_ = hh(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 15)],16,530742520); + _loc3_ = hh(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 2)],23,-995338651); + _loc2_ = ii(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 0)],6,-198630844); + _loc5_ = ii(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 7)],10,1126891415); + _loc4_ = ii(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 14)],15,-1416354905); + _loc3_ = ii(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 5)],21,-57434055); + _loc2_ = ii(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 12)],6,1700485571); + _loc5_ = ii(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 3)],10,-1894986606); + _loc4_ = ii(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 10)],15,-1051523); + _loc3_ = ii(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 1)],21,-2054922799); + _loc2_ = ii(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 8)],6,1873313359); + _loc5_ = ii(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 15)],10,-30611744); + _loc4_ = ii(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 6)],15,-1560198380); + _loc3_ = ii(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 13)],21,1309151649); + _loc2_ = ii(_loc2_,_loc3_,_loc4_,_loc5_,_loc10_[int(_loc12_ + 4)],6,-145523070); + _loc5_ = ii(_loc5_,_loc2_,_loc3_,_loc4_,_loc10_[int(_loc12_ + 11)],10,-1120210379); + _loc4_ = ii(_loc4_,_loc5_,_loc2_,_loc3_,_loc10_[int(_loc12_ + 2)],15,718787259); + _loc3_ = ii(_loc3_,_loc4_,_loc5_,_loc2_,_loc10_[int(_loc12_ + 9)],21,-343485551); + _loc2_ += _loc6_; + _loc3_ += _loc7_; + _loc4_ += _loc8_; + _loc5_ += _loc9_; + _loc12_ += 16; + } + digest = new ByteArray(); + digest.writeInt(_loc2_); + digest.writeInt(_loc3_); + digest.writeInt(_loc4_); + digest.writeInt(_loc5_); + digest.position = 0; + return toHex(_loc2_) + toHex(_loc3_) + toHex(_loc4_) + toHex(_loc5_); + } + + private static function f(param1:int, param2:int, param3:int) : int + { + return param1 & param2 | ~param1 & param3; + } + + private static function g(param1:int, param2:int, param3:int) : int + { + return param1 & param3 | param2 & ~param3; + } + + private static function h(param1:int, param2:int, param3:int) : int + { + return param1 ^ param2 ^ param3; + } + + private static function i(param1:int, param2:int, param3:int) : int + { + return param2 ^ (param1 | ~param3); + } + + private static function transform(param1:Function, param2:int, param3:int, param4:int, param5:int, param6:int, param7:int, param8:int) : int + { + var _loc9_:int = param2 + int(param1(param3,param4,param5)) + param6 + param8; + return rol(_loc9_,param7) + param3; + } + + private static function ff(param1:int, param2:int, param3:int, param4:int, param5:int, param6:int, param7:int) : int + { + return transform(f,param1,param2,param3,param4,param5,param6,param7); + } + + private static function gg(param1:int, param2:int, param3:int, param4:int, param5:int, param6:int, param7:int) : int + { + return transform(g,param1,param2,param3,param4,param5,param6,param7); + } + + private static function hh(param1:int, param2:int, param3:int, param4:int, param5:int, param6:int, param7:int) : int + { + return transform(h,param1,param2,param3,param4,param5,param6,param7); + } + + private static function ii(param1:int, param2:int, param3:int, param4:int, param5:int, param6:int, param7:int) : int + { + return transform(i,param1,param2,param3,param4,param5,param6,param7); + } + + private static function createBlocks(param1:ByteArray) : Array + { + var _loc2_:Array = new Array(); + var _loc3_:int = param1.length * 8; + var _loc4_:int = 255; + var _loc5_:int = 0; + while(_loc5_ < _loc3_) + { + _loc2_[int(_loc5_ >> 5)] = _loc2_[int(_loc5_ >> 5)] | (param1[_loc5_ / 8] & _loc4_) << _loc5_ % 32; + _loc5_ += 8; + } + _loc2_[int(_loc3_ >> 5)] = _loc2_[int(_loc3_ >> 5)] | 128 << _loc3_ % 32; + _loc2_[int((_loc3_ + 64 >>> 9 << 4) + 14)] = _loc3_; + return _loc2_; + } + + public static function rol(param1:int, param2:int) : int + { + return param1 << param2 | param1 >>> 32 - param2; + } + + public static function ror(param1:int, param2:int) : uint + { + var _loc3_:int = 32 - param2; + return param1 << _loc3_ | param1 >>> 32 - _loc3_; + } + + public static function toHex(param1:int, param2:Boolean = false) : String + { + var _loc4_:int = 0; + var _loc5_:int = 0; + var _loc3_:String = ""; + if(param2) + { + _loc4_ = 0; + while(_loc4_ < 4) + { + _loc3_ += hexChars.charAt(param1 >> (3 - _loc4_) * 8 + 4 & 0x0F) + hexChars.charAt(param1 >> (3 - _loc4_) * 8 & 0x0F); + _loc4_++; + } + } + else + { + _loc5_ = 0; + while(_loc5_ < 4) + { + _loc3_ += hexChars.charAt(param1 >> _loc5_ * 8 + 4 & 0x0F) + hexChars.charAt(param1 >> _loc5_ * 8 & 0x0F); + _loc5_++; + } + } + return _loc3_; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/crypto/RC4.as b/research/inner_decompiled/scripts/com/newgrounds/crypto/RC4.as new file mode 100644 index 0000000..ef1eef0 --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/crypto/RC4.as @@ -0,0 +1,138 @@ +package com.newgrounds.crypto +{ + public class RC4 + { + + private static var sbox:Array = new Array(255); + + private static var mykey:Array = new Array(255); + + public function RC4() + { + super(); + } + + public static function encrypt(param1:String, param2:String) : String + { + var _loc3_:Array = strToChars(param1); + var _loc4_:Array = strToChars(param2); + var _loc5_:Array = calculate(_loc3_,_loc4_); + return charsToHex(_loc5_); + } + + public static function encryptbin(param1:String, param2:String) : Array + { + var _loc3_:Array = strToChars(param1); + var _loc4_:Array = strToChars(param2); + return calculate(_loc3_,_loc4_); + } + + public static function decrypt(param1:String, param2:String) : String + { + var _loc3_:Array = hexToChars(param1); + var _loc4_:Array = strToChars(param2); + var _loc5_:Array = calculate(_loc3_,_loc4_); + return charsToStr(_loc5_); + } + + private static function initialize(param1:Array) : void + { + var _loc3_:uint = 0; + var _loc2_:uint = 0; + var _loc4_:uint = param1.length; + var _loc5_:uint = 0; + while(_loc5_ <= 255) + { + mykey[_loc5_] = param1[_loc5_ % _loc4_]; + sbox[_loc5_] = _loc5_; + _loc5_++; + } + _loc5_ = 0; + while(_loc5_ <= 255) + { + _loc2_ = (_loc2_ + sbox[_loc5_] + mykey[_loc5_]) % 256; + _loc3_ = uint(sbox[_loc5_]); + sbox[_loc5_] = sbox[_loc2_]; + sbox[_loc2_] = _loc3_; + _loc5_++; + } + } + + private static function calculate(param1:Array, param2:Array) : Array + { + var _loc6_:uint = 0; + var _loc7_:uint = 0; + var _loc8_:uint = 0; + var _loc10_:uint = 0; + initialize(param2); + var _loc3_:uint = 0; + var _loc4_:uint = 0; + var _loc5_:Array = new Array(); + var _loc9_:uint = 0; + while(_loc9_ < param1.length) + { + _loc3_ = (_loc3_ + 1) % 256; + _loc4_ = (_loc4_ + sbox[_loc3_]) % 256; + _loc7_ = uint(sbox[_loc3_]); + sbox[_loc3_] = sbox[_loc4_]; + sbox[_loc4_] = _loc7_; + _loc10_ = (sbox[_loc3_] + sbox[_loc4_]) % 256; + _loc6_ = uint(sbox[_loc10_]); + _loc8_ = uint(param1[_loc9_] ^ _loc6_); + _loc5_.push(_loc8_); + _loc9_++; + } + return _loc5_; + } + + private static function charsToHex(param1:Array) : String + { + var _loc2_:String = new String(""); + var _loc3_:Array = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"); + var _loc4_:uint = 0; + while(_loc4_ < param1.length) + { + _loc2_ += _loc3_[param1[_loc4_] >> 4] + _loc3_[param1[_loc4_] & 0x0F]; + _loc4_++; + } + return _loc2_; + } + + private static function hexToChars(param1:String) : Array + { + var _loc2_:Array = new Array(); + var _loc3_:uint = param1.substr(0,2) == "0x" ? 2 : 0; + while(_loc3_ < param1.length) + { + _loc2_.push(parseInt(param1.substr(_loc3_,2),16)); + _loc3_ += 2; + } + return _loc2_; + } + + private static function charsToStr(param1:Array) : String + { + var _loc2_:String = new String(""); + var _loc3_:uint = 0; + while(_loc3_ < param1.length) + { + _loc2_ += String.fromCharCode(param1[_loc3_]); + _loc3_++; + } + return _loc2_; + } + + private static function strToChars(param1:String) : Array + { + var _loc2_:Array = new Array(); + var _loc3_:uint = 0; + while(_loc3_ < param1.length) + { + _loc2_.push(param1.charCodeAt(_loc3_)); + _loc3_++; + } + return _loc2_; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/encoders/BaseN.as b/research/inner_decompiled/scripts/com/newgrounds/encoders/BaseN.as new file mode 100644 index 0000000..03fcf2f --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/encoders/BaseN.as @@ -0,0 +1,67 @@ +package com.newgrounds.encoders +{ + import flash.utils.Dictionary; + + public class BaseN + { + + private static const DEFAULT_HASH:String = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/"; + + private var _hash:String; + + private var _base:uint; + + private var _reverseHash:Dictionary; + + public function BaseN(param1:String) + { + super(); + if(param1) + { + this._hash = param1; + } + else + { + this._hash = DEFAULT_HASH; + } + this._base = this._hash.length; + this._reverseHash = new Dictionary(); + var _loc2_:uint = 0; + while(_loc2_ < this._hash.length) + { + this._reverseHash[this._hash.charAt(_loc2_)] = _loc2_; + _loc2_++; + } + } + + public function encodeUint(param1:uint, param2:uint = 1) : String + { + var _loc3_:String = ""; + var _loc4_:uint = param1; + while(_loc4_ != 0) + { + _loc3_ = this._hash.charAt(_loc4_ % this._base) + _loc3_; + _loc4_ /= this._base; + } + while(_loc3_.length < param2) + { + _loc3_ = this._hash.charAt(0) + _loc3_; + } + return _loc3_; + } + + public function decodeUint(param1:String) : uint + { + var _loc2_:uint = 0; + var _loc3_:uint = 0; + while(_loc3_ < param1.length) + { + _loc2_ *= this._base; + _loc2_ += this._reverseHash[param1.charAt(_loc3_)]; + _loc3_++; + } + return _loc2_; + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/encoders/PNGEncoder.as b/research/inner_decompiled/scripts/com/newgrounds/encoders/PNGEncoder.as new file mode 100644 index 0000000..7432fad --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/encoders/PNGEncoder.as @@ -0,0 +1,122 @@ +package com.newgrounds.encoders +{ + import flash.display.BitmapData; + import flash.geom.*; + import flash.utils.ByteArray; + + public class PNGEncoder + { + + private static var crcTable:Array; + + private static var crcTableComputed:Boolean = false; + + public function PNGEncoder() + { + super(); + } + + public static function encode(param1:BitmapData) : ByteArray + { + var _loc6_:uint = 0; + var _loc7_:int = 0; + var _loc2_:ByteArray = new ByteArray(); + _loc2_.writeUnsignedInt(2303741511); + _loc2_.writeUnsignedInt(218765834); + var _loc3_:ByteArray = new ByteArray(); + _loc3_.writeInt(param1.width); + _loc3_.writeInt(param1.height); + _loc3_.writeUnsignedInt(134610944); + _loc3_.writeByte(0); + writeChunk(_loc2_,1229472850,_loc3_); + var _loc4_:ByteArray = new ByteArray(); + var _loc5_:int = 0; + while(_loc5_ < param1.height) + { + _loc4_.writeByte(0); + if(!param1.transparent) + { + _loc7_ = 0; + while(_loc7_ < param1.width) + { + _loc6_ = param1.getPixel(_loc7_,_loc5_); + _loc4_.writeUnsignedInt(uint((_loc6_ & 0xFFFFFF) << 8 | 0xFF)); + _loc7_++; + } + } + else + { + _loc7_ = 0; + while(_loc7_ < param1.width) + { + _loc6_ = param1.getPixel32(_loc7_,_loc5_); + _loc4_.writeUnsignedInt(uint((_loc6_ & 0xFFFFFF) << 8 | _loc6_ >>> 24)); + _loc7_++; + } + } + _loc5_++; + } + _loc4_.compress(); + writeChunk(_loc2_,1229209940,_loc4_); + writeChunk(_loc2_,1229278788,null); + return _loc2_; + } + + private static function writeChunk(param1:ByteArray, param2:uint, param3:ByteArray) : void + { + var _loc8_:uint = 0; + var _loc9_:uint = 0; + var _loc10_:uint = 0; + if(!crcTableComputed) + { + crcTableComputed = true; + crcTable = []; + _loc9_ = 0; + while(_loc9_ < 256) + { + _loc8_ = _loc9_; + _loc10_ = 0; + while(_loc10_ < 8) + { + if(_loc8_ & 1) + { + _loc8_ = uint(uint(3988292384) ^ uint(_loc8_ >>> 1)); + } + else + { + _loc8_ = uint(_loc8_ >>> 1); + } + _loc10_++; + } + crcTable[_loc9_] = _loc8_; + _loc9_++; + } + } + var _loc4_:uint = 0; + if(param3 != null) + { + _loc4_ = param3.length; + } + param1.writeUnsignedInt(_loc4_); + var _loc5_:uint = param1.position; + param1.writeUnsignedInt(param2); + if(param3 != null) + { + param1.writeBytes(param3); + } + var _loc6_:uint = param1.position; + param1.position = _loc5_; + _loc8_ = 4294967295; + var _loc7_:int = 0; + while(_loc7_ < _loc6_ - _loc5_) + { + _loc8_ = uint(crcTable[(_loc8_ ^ param1.readUnsignedByte()) & uint(255)] ^ uint(_loc8_ >>> 8)); + _loc7_++; + } + _loc8_ = uint(_loc8_ ^ uint(4294967295)); + param1.position = _loc6_; + param1.writeUnsignedInt(_loc8_); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/encoders/json/JSON.as b/research/inner_decompiled/scripts/com/newgrounds/encoders/json/JSON.as new file mode 100644 index 0000000..2ac4765 --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/encoders/json/JSON.as @@ -0,0 +1,22 @@ +package com.newgrounds.encoders.json +{ + public class JSON + { + + public function JSON() + { + super(); + } + + public static function encode(param1:Object) : String + { + return encodeJson(param1); + } + + public static function decode(param1:String) : Object + { + return decodeJson(param1); + } + } +} + diff --git a/research/inner_decompiled/scripts/com/newgrounds/encoders/json/decodeJson.as b/research/inner_decompiled/scripts/com/newgrounds/encoders/json/decodeJson.as new file mode 100644 index 0000000..bb1ac29 --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/encoders/json/decodeJson.as @@ -0,0 +1,320 @@ +package com.newgrounds.encoders.json +{ + public const decodeJson:Function = initDecodeJson(); +} + +import com.newgrounds.encoders.json.§com.newgrounds.encoders.json.decodeJson§; +import flash.utils.ByteArray; + +function initDecodeJson():Function +{ + var i:int; + var parseStringEscaped:Function; + var position:uint = 0; + var byteInput:ByteArray = null; + var char:uint = 0; + var charConvert:ByteArray = null; + var isNumberChar:ByteArray = null; + var stringHelper:ByteArray = null; + var isWhitespace:ByteArray = null; + var parseNumber:Function = null; + var parseWhitespace:Function = null; + var parse:Object = null; + charConvert = new ByteArray(); + charConvert.length = 256; + charConvert[34] = 34; + charConvert[92] = 92; + charConvert[47] = 47; + charConvert[98] = 8; + charConvert[102] = 12; + charConvert[110] = 10; + charConvert[114] = 13; + charConvert[116] = 9; + isNumberChar = new ByteArray(); + isNumberChar.length = 256; + isNumberChar[43] = 1; + isNumberChar[45] = 1; + isNumberChar[46] = 1; + isNumberChar[48] = 1; + isNumberChar[49] = 1; + isNumberChar[50] = 1; + isNumberChar[51] = 1; + isNumberChar[52] = 1; + isNumberChar[53] = 1; + isNumberChar[54] = 1; + isNumberChar[55] = 1; + isNumberChar[56] = 1; + isNumberChar[57] = 1; + isNumberChar[69] = 1; + isNumberChar[101] = 1; + stringHelper = new ByteArray(); + stringHelper.length = 256; + i = 0; + while(i < 256) + { + stringHelper[i++] = 1; + } + stringHelper[34] = 0; + stringHelper[92] = 0; + isWhitespace = new ByteArray(); + isWhitespace.length = 256; + isWhitespace[9] = 1; + isWhitespace[10] = 1; + isWhitespace[13] = 1; + isWhitespace[32] = 1; + parseNumber = function():Number + { + if(position === 1) + { + byteInput.position = 0; + return parseFloat(byteInput.readUTFBytes(byteInput.length)); + } + byteInput.position = position - 1; + while(isNumberChar[byteInput[position++]]) + { + } + return Number(byteInput.readUTFBytes(position-- - byteInput.position - 1)); + }; + parseWhitespace = function():Object + { + while(isWhitespace[byteInput[position]]) + { + position++; + } + return parse[byteInput[position++]](); + }; + parseStringEscaped = function(param1:String):String + { + while(true) + { + if((char = byteInput[position++]) === 117) + { + byteInput.position = position; + char = parseInt(byteInput.readUTFBytes(4),16); + position = position + 4; + } + else + { + if(!(char = charConvert[char])) + { + break; + } + byteInput.position = position; + } + param1 = param1 + String.fromCharCode(char); + while(stringHelper[byteInput[position++]]) + { + } + if(position - 1 > byteInput.position) + { + param1 = param1 + byteInput.readUTFBytes(position - 1 - byteInput.position); + } + if(byteInput[position - 1] !== 92) + { + return param1; + } + } + throw new Error("Unknown escaped character encountered at position " + (position - 1)); + }; + parse = { + 34:function():String + { + if(stringHelper[byteInput[position++]]) + { + byteInput.position = position - 1; + while(stringHelper[byteInput[position++]]) + { + } + if(byteInput[position - 1] === 92) + { + return parseStringEscaped(byteInput.readUTFBytes(position - 1 - byteInput.position)); + } + return byteInput.readUTFBytes(position - 1 - byteInput.position); + } + if(byteInput[position - 1] === 92) + { + return parseStringEscaped(""); + } + return ""; + }, + 123:function():Object + { + var _loc2_:* = undefined; + while(isWhitespace[byteInput[position]]) + { + position++; + } + if(byteInput[position] === 125) + { + position++; + return {}; + } + var _loc1_:* = {}; + loop1: + while(true) + { + do + { + _loc2_ = parse[byteInput[position++]](); + if(byteInput[position] !== 58) + { + while(isWhitespace[byteInput[position]]) + { + position++; + } + if(byteInput[position++] !== 58) + { + break loop1; + } + } + else + { + position++; + } + _loc1_[_loc2_] = parse[byteInput[position++]](); + } + while(byteInput[position++] === 44); + if(byteInput[position - 1] === 125) + { + return _loc1_; + } + while(isWhitespace[byteInput[position]]) + { + position++; + } + if(byteInput[position++] !== 44) + { + if(byteInput[position - 1] !== 125) + { + throw new Error("Expected , or } at " + (position - 1)); + } + return _loc1_; + } + } + throw new Error("Expected : at " + (position - 1)); + }, + 91:function():Object + { + while(isWhitespace[byteInput[position]]) + { + position++; + } + if(byteInput[position] === 93) + { + position++; + return []; + } + var _loc1_:* = []; + while(true) + { + do + { + _loc1_[_loc1_.length] = parse[byteInput[position++]](); + } + while(byteInput[position++] === 44); + if(byteInput[position - 1] === 93) + { + break; + } + position--; + while(isWhitespace[byteInput[position]]) + { + position++; + } + if(byteInput[position++] !== 44) + { + if(byteInput[position - 1] !== 93) + { + throw new Error("Expected , or ] at " + (position - 1)); + } + return _loc1_; + } + } + return _loc1_; + }, + 116:function():Boolean + { + if(byteInput[position] === 114 && byteInput[position + 1] === 117 && byteInput[position + 2] === 101) + { + position = position + 3; + return true; + } + throw new Error("Expected \"true\" at position " + position); + }, + 102:function():Boolean + { + if(byteInput[position] === 97 && byteInput[position + 1] === 108 && byteInput[position + 2] === 115 && byteInput[position + 3] === 101) + { + position = position + 4; + return false; + } + throw new Error("Expected \"false\" at position " + (position - 1)); + }, + 110:function():Object + { + if(byteInput[position] === 117 && byteInput[position + 1] === 108 && byteInput[position + 2] === 108) + { + position = position + 3; + return null; + } + throw new Error("Expected \"null\" at position " + position); + }, + 110:function():void + { + throw new Error("Unexpected end of array at " + position); + }, + 125:function():void + { + throw new Error("Unexpected end of object at " + position); + }, + 44:function():void + { + throw new Error("Unexpected comma at " + position); + }, + 45:parseNumber, + 48:parseNumber, + 49:parseNumber, + 50:parseNumber, + 51:parseNumber, + 52:parseNumber, + 53:parseNumber, + 54:parseNumber, + 55:parseNumber, + 56:parseNumber, + 57:parseNumber, + 13:parseWhitespace, + 10:parseWhitespace, + 9:parseWhitespace, + 32:parseWhitespace + }; + return function(param1:*):Object + { + var input:* = param1; + if(input is String) + { + byteInput = new ByteArray(); + byteInput.writeUTFBytes(input as String); + } + else + { + if(!(input is ByteArray)) + { + throw new Error("Unexpected input <" + input + ">"); + } + byteInput = input as ByteArray; + } + position = 0; + try + { + return parse[byteInput[position++]](); + } + catch(e:TypeError) + { + if(position - 1 < byteInput.length) + { + e.message = "Unexpected character " + String.fromCharCode(byteInput[position - 1]) + " (0x" + byteInput[position - 1].toString(16) + ")" + " at position " + (position - 1) + " (" + e.message + ")"; + } + throw e; + } + }; +} diff --git a/research/inner_decompiled/scripts/com/newgrounds/encoders/json/encodeJson.as b/research/inner_decompiled/scripts/com/newgrounds/encoders/json/encodeJson.as new file mode 100644 index 0000000..ff783ef --- /dev/null +++ b/research/inner_decompiled/scripts/com/newgrounds/encoders/json/encodeJson.as @@ -0,0 +1,237 @@ +package com.newgrounds.encoders.json +{ + public const encodeJson:Function = initDecodeJson(); +} + +import com.newgrounds.encoders.json.§com.newgrounds.encoders.json.encodeJson§; +import flash.utils.ByteArray; +import flash.utils.IDataOutput; + +function initDecodeJson():Function +{ + var parseArray:Function; + var result:IDataOutput = null; + var i:int = 0; + var j:int = 0; + var strLen:int = 0; + var str:String = null; + var char:int = 0; + var tempBytes:ByteArray = null; + var blockNonFiniteNumbers:Boolean = false; + var charConvert:Array = null; + var parseString:Function = null; + var parse:Object = null; + tempBytes = new ByteArray(); + charConvert = new Array(256); + j = 0; + while(j < 10) + { + charConvert[j] = j + 48 | 0x30303000; + j++; + } + while(j < 16) + { + charConvert[j] = j + 55 | 0x30303000; + j++; + } + while(j < 26) + { + charConvert[j] = j + 32 | 0x30303100; + j++; + } + while(j < 32) + { + charConvert[j] = j + 39 | 0x30303100; + j++; + } + while(j < 256) + { + charConvert[j] = j; + j++; + } + charConvert[10] = 23662; + charConvert[13] = 23666; + charConvert[9] = 23668; + charConvert[8] = 23650; + charConvert[12] = 23654; + charConvert[8] = 23650; + charConvert[34] = 23586; + charConvert[92] = 23644; + charConvert[127] = 808466246; + parseArray = function(param1:Array):void + { + result.writeByte(91); + var _loc2_:* = 0; + var _loc3_:int = param1.length - 1; + if(_loc3_ >= 0) + { + while(_loc2_ < _loc3_) + { + parse[typeof param1[_loc2_]](param1[_loc2_]); + result.writeByte(44); + _loc2_++; + } + parse[typeof param1[_loc2_]](param1[_loc2_]); + } + result.writeByte(93); + }; + parseString = function(param1:String):void + { + result.writeByte(34); + tempBytes.position = 0; + tempBytes.length = 0; + tempBytes.writeUTFBytes(param1); + i = 0; + j = 0; + strLen = tempBytes.length; + while(j < strLen) + { + char = charConvert[tempBytes[j++]]; + if(char > 256) + { + if(j - 1 > i) + { + result.writeBytes(tempBytes,i,j - 1 - i); + } + if(char > 65536) + { + result.writeShort(23669); + result.writeUnsignedInt(char); + } + else + { + result.writeShort(char); + } + i = j; + } + } + if(strLen > i) + { + result.writeBytes(tempBytes,i,strLen - i); + } + result.writeByte(34); + }; + parse = { + "object":function(param1:Object):void + { + var _loc2_:* = undefined; + if(param1) + { + if(param1 is Array) + { + parseArray(param1); + } + else + { + result.writeByte(123); + _loc2_ = true; + for(str in param1) + { + if(_loc2_) + { + _loc2_ = false; + } + else + { + result.writeByte(44); + } + parseString(str); + result.writeByte(58); + parse[typeof param1[str]](param1[str]); + } + result.writeByte(125); + } + } + else + { + result.writeUnsignedInt(1853189228); + } + }, + "string":parseString, + "number":function(param1:Number):void + { + if(blockNonFiniteNumbers && !isFinite(param1)) + { + throw new Error("Number " + param1 + " is not encodable"); + } + result.writeUTFBytes(String(param1)); + }, + "boolean":function(param1:Boolean):void + { + if(param1) + { + result.writeUnsignedInt(1953658213); + } + else + { + result.writeByte(102); + result.writeUnsignedInt(1634497381); + } + }, + "xml":function(param1:Object):void + { + if(!param1.toXMLString is Function || (param1 = param1.toXMLString() as String) == null) + { + throw new Error("unserializable XML object encountered"); + } + parseString(param1); + }, + "undefined":function(param1:Boolean):void + { + result.writeUnsignedInt(1853189228); + } + }; + return function(param1:Object, param2:IDataOutput = null, param3:Boolean = false):String + { + var byteOutput:* = undefined; + var input:Object = param1; + var writeTo:IDataOutput = param2; + var strictNumberSupport:Boolean = param3; + blockNonFiniteNumbers = strictNumberSupport; + try + { + if(writeTo) + { + result = writeTo; + result.endian = "bigEndian"; + parse[typeof input](input); + byteOutput.position = 0; + return byteOutput.readUTFBytes(byteOutput.length); + } + switch(typeof input) + { + case "xml": + if(!input.toXMLString is Function || (input = input.toXMLString() as String) == null) + { + throw new Error("unserializable XML object encountered"); + } + break; + case "object": + case "string": + break; + case "number": + if(blockNonFiniteNumbers && !isFinite(input as Number)) + { + throw new Error("Number " + input + " is not encodable"); + } + return String(input); + break; + case "boolean": + return input ? "true" : "false"; + case "undefined": + return "null"; + default: + throw new Error("Unexpected type \"" + typeof input + "\" encountered"); + } + result = byteOutput = new ByteArray(); + result.endian = "bigEndian"; + parse[typeof input](input); + byteOutput.position = 0; + return byteOutput.readUTFBytes(byteOutput.length); + } + catch(e:TypeError) + { + throw new Error("Unexpected type encountered"); + } + }; +} diff --git a/research/inner_decompiled/scripts/mochi/as3/MochiCoins.as b/research/inner_decompiled/scripts/mochi/as3/MochiCoins.as new file mode 100644 index 0000000..23d68a0 --- /dev/null +++ b/research/inner_decompiled/scripts/mochi/as3/MochiCoins.as @@ -0,0 +1,107 @@ +package mochi.as3 +{ + public class MochiCoins + { + + public static var _inventory:MochiInventory; + + public static const STORE_SHOW:String = "StoreShow"; + + public static const STORE_HIDE:String = "StoreHide"; + + public static const ITEM_OWNED:String = "ItemOwned"; + + public static const ITEM_NEW:String = "ItemNew"; + + public static const STORE_ITEMS:String = "StoreItems"; + + public static const ERROR:String = "Error"; + + public static const IO_ERROR:String = "IOError"; + + public static const NO_USER:String = "NoUser"; + + private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher(); + + addEventListener(MochiSocial.LOGGED_IN,function(param1:Object):void + { + _inventory = new MochiInventory(); + }); + addEventListener(MochiSocial.LOGGED_OUT,function(param1:Object):void + { + _inventory = null; + }); + + public function MochiCoins() + { + super(); + } + + public static function get inventory() : MochiInventory + { + return _inventory; + } + + public static function getVersion() : String + { + return MochiServices.getVersion(); + } + + public static function showStore(param1:Object = null) : void + { + MochiServices.setContainer(); + MochiServices.bringToTop(); + MochiServices.send("coins_showStore",{"options":param1},null,null); + } + + public static function showItem(param1:Object = null) : void + { + if(!param1 || typeof param1.item != "string") + { + return; + } + MochiServices.setContainer(); + MochiServices.bringToTop(); + MochiServices.send("coins_showItem",{"options":param1},null,null); + } + + public static function showVideo(param1:Object = null) : void + { + if(!param1 || typeof param1.item != "string") + { + return; + } + MochiServices.setContainer(); + MochiServices.bringToTop(); + MochiServices.send("coins_showVideo",{"options":param1},null,null); + } + + public static function getStoreItems() : void + { + MochiServices.send("coins_getStoreItems"); + } + + public static function requestFunding(param1:Object = null) : void + { + MochiServices.setContainer(); + MochiServices.bringToTop(); + MochiServices.send("social_requestFunding",param1); + } + + public static function addEventListener(param1:String, param2:Function) : void + { + _dispatcher.addEventListener(param1,param2); + } + + public static function triggerEvent(param1:String, param2:Object) : void + { + _dispatcher.triggerEvent(param1,param2); + } + + public static function removeEventListener(param1:String, param2:Function) : void + { + _dispatcher.removeEventListener(param1,param2); + } + } +} + diff --git a/research/inner_decompiled/scripts/mochi/as3/MochiDigits.as b/research/inner_decompiled/scripts/mochi/as3/MochiDigits.as new file mode 100644 index 0000000..ae2ab72 --- /dev/null +++ b/research/inner_decompiled/scripts/mochi/as3/MochiDigits.as @@ -0,0 +1,67 @@ +package mochi.as3 +{ + public final class MochiDigits + { + + private var Fragment:Number; + + private var Sibling:MochiDigits; + + private var Encoder:Number; + + public function MochiDigits(param1:Number = 0, param2:uint = 0) + { + super(); + this.Encoder = 0; + this.setValue(param1,param2); + } + + public function get value() : Number + { + return Number(this.toString()); + } + + public function set value(param1:Number) : void + { + this.setValue(param1); + } + + public function addValue(param1:Number) : void + { + this.value += param1; + } + + public function setValue(param1:Number = 0, param2:uint = 0) : void + { + var _loc3_:String = param1.toString(); + this.Fragment = _loc3_.charCodeAt(param2++) ^ this.Encoder; + if(param2 < _loc3_.length) + { + this.Sibling = new MochiDigits(param1,param2); + } + else + { + this.Sibling = null; + } + this.reencode(); + } + + public function reencode() : void + { + var _loc1_:uint = uint(int(2147483647 * Math.random())); + this.Fragment ^= _loc1_ ^ this.Encoder; + this.Encoder = _loc1_; + } + + public function toString() : String + { + var _loc1_:String = String.fromCharCode(this.Fragment ^ this.Encoder); + if(this.Sibling != null) + { + _loc1_ += this.Sibling.toString(); + } + return _loc1_; + } + } +} + diff --git a/research/inner_decompiled/scripts/mochi/as3/MochiEventDispatcher.as b/research/inner_decompiled/scripts/mochi/as3/MochiEventDispatcher.as new file mode 100644 index 0000000..4b1b65f --- /dev/null +++ b/research/inner_decompiled/scripts/mochi/as3/MochiEventDispatcher.as @@ -0,0 +1,51 @@ +package mochi.as3 +{ + public class MochiEventDispatcher + { + + private var eventTable:Object; + + public function MochiEventDispatcher() + { + super(); + this.eventTable = {}; + } + + public function addEventListener(param1:String, param2:Function) : void + { + this.removeEventListener(param1,param2); + this.eventTable[param1].push(param2); + } + + public function removeEventListener(param1:String, param2:Function) : void + { + var _loc3_:Object = null; + if(this.eventTable[param1] == undefined) + { + this.eventTable[param1] = []; + return; + } + for(_loc3_ in this.eventTable[param1]) + { + if(this.eventTable[param1][_loc3_] == param2) + { + this.eventTable[param1].splice(Number(_loc3_),1); + } + } + } + + public function triggerEvent(param1:String, param2:Object) : void + { + var _loc3_:Object = null; + if(this.eventTable[param1] == undefined) + { + return; + } + for(_loc3_ in this.eventTable[param1]) + { + this.eventTable[param1][_loc3_](param2); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/mochi/as3/MochiEvents.as b/research/inner_decompiled/scripts/mochi/as3/MochiEvents.as new file mode 100644 index 0000000..64361be --- /dev/null +++ b/research/inner_decompiled/scripts/mochi/as3/MochiEvents.as @@ -0,0 +1,121 @@ +package mochi.as3 +{ + public class MochiEvents + { + + private static var gameStart:Number; + + private static var levelStart:Number; + + public static const ACHIEVEMENTS_OWNED:String = "AchievementOwned"; + + public static const ACHIEVEMENT_NEW:String = "AchievementReceived"; + + public static const GAME_ACHIEVEMENTS:String = "GameAchievements"; + + public static const ERROR:String = "Error"; + + public static const IO_ERROR:String = "IOError"; + + public static const IO_PENDING:String = "IOPending"; + + public static const ALIGN_TOP_LEFT:String = "ALIGN_TL"; + + public static const ALIGN_TOP:String = "ALIGN_T"; + + public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR"; + + public static const ALIGN_LEFT:String = "ALIGN_L"; + + public static const ALIGN_CENTER:String = "ALIGN_C"; + + public static const ALIGN_RIGHT:String = "ALIGN_R"; + + public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL"; + + public static const ALIGN_BOTTOM:String = "ALIGN_B"; + + public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR"; + + public static const FORMAT_SHORT:String = "ShortForm"; + + public static const FORMAT_LONG:String = "LongForm"; + + public static const FORMAT_NONE:String = "NoForm"; + + private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher(); + + public function MochiEvents() + { + super(); + } + + public static function getVersion() : String + { + return MochiServices.getVersion(); + } + + public static function getAchievements(param1:Object = null) : void + { + MochiServices.send("events_getAchievements",param1); + } + + public static function unlockAchievement(param1:Object) : void + { + MochiServices.send("events_unlockAchievement",param1); + } + + public static function startSession(param1:String) : void + { + MochiServices.send("events_beginSession",{"achievementID":param1},null,null); + } + + public static function showAwards(param1:Object = null) : void + { + MochiServices.setContainer(); + MochiServices.stayOnTop(); + MochiServices.send("events_showAwards",param1); + } + + public static function setNotifications(param1:Object) : void + { + MochiServices.setContainer(); + MochiServices.bringToTop(); + MochiServices.send("events_setNotifications",param1,null,null); + } + + public static function addEventListener(param1:String, param2:Function) : void + { + _dispatcher.addEventListener(param1,param2); + } + + public static function triggerEvent(param1:String, param2:Object) : void + { + _dispatcher.triggerEvent(param1,param2); + } + + public static function removeEventListener(param1:String, param2:Function) : void + { + _dispatcher.removeEventListener(param1,param2); + } + + public static function startPlay(param1:String = "gameplay") : void + { + MochiServices.send("events_setRoundID",{"tag":String(param1)},null,null); + } + + public static function endPlay() : void + { + MochiServices.send("events_clearRoundID",null,null,null); + } + + public static function trackEvent(param1:String, param2:* = null) : void + { + MochiServices.send("events_trackEvent",{ + "tag":param1, + "value":param2 + },null,null); + } + } +} + diff --git a/research/inner_decompiled/scripts/mochi/as3/MochiInventory.as b/research/inner_decompiled/scripts/mochi/as3/MochiInventory.as new file mode 100644 index 0000000..36dc928 --- /dev/null +++ b/research/inner_decompiled/scripts/mochi/as3/MochiInventory.as @@ -0,0 +1,288 @@ +package mochi.as3 +{ + import flash.events.Event; + import flash.events.TimerEvent; + import flash.utils.Proxy; + import flash.utils.Timer; + import flash.utils.flash_proxy; + + use namespace flash_proxy; + + public dynamic class MochiInventory extends Proxy + { + + private static const CONSUMER_KEY:String = "MochiConsumables"; + + private static const KEY_SALT:String = " syncMaint\x01"; + + public static const READY:String = "InvReady"; + + public static const WRITTEN:String = "InvWritten"; + + public static const ERROR:String = "Error"; + + public static const IO_ERROR:String = "IoError"; + + public static const VALUE_ERROR:String = "InvValueError"; + + public static const NOT_READY:String = "InvNotReady"; + + private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher(); + + private var _timer:Timer; + + private var _consumableProperties:Object; + + private var _syncPending:Boolean; + + private var _outstandingID:Number; + + private var _syncID:Number; + + private var _names:Array; + + private var _storeSync:Object; + + public function MochiInventory() + { + super(); + MochiCoins.addEventListener(MochiCoins.ITEM_OWNED,this.itemOwned); + MochiCoins.addEventListener(MochiCoins.ITEM_NEW,this.newItems); + MochiSocial.addEventListener(MochiSocial.LOGGED_IN,this.loggedIn); + MochiSocial.addEventListener(MochiSocial.LOGGED_OUT,this.loggedOut); + this._storeSync = new Object(); + this._syncPending = false; + this._outstandingID = 0; + this._syncID = 0; + this._timer = new Timer(1000); + this._timer.addEventListener(TimerEvent.TIMER,this.sync); + this._timer.start(); + if(MochiSocial.loggedIn) + { + this.loggedIn(); + } + else + { + this.loggedOut(); + } + } + + public static function addEventListener(param1:String, param2:Function) : void + { + _dispatcher.addEventListener(param1,param2); + } + + public static function triggerEvent(param1:String, param2:Object) : void + { + _dispatcher.triggerEvent(param1,param2); + } + + public static function removeEventListener(param1:String, param2:Function) : void + { + _dispatcher.removeEventListener(param1,param2); + } + + public function release() : void + { + MochiCoins.removeEventListener(MochiCoins.ITEM_NEW,this.newItems); + MochiSocial.removeEventListener(MochiSocial.LOGGED_IN,this.loggedIn); + MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT,this.loggedOut); + } + + private function loggedOut(param1:Object = null) : void + { + this._consumableProperties = null; + } + + private function loggedIn(param1:Object = null) : void + { + MochiUserData.get(CONSUMER_KEY,this.getConsumableBag); + } + + private function newItems(param1:Object) : void + { + if(!this[param1.id + KEY_SALT]) + { + this[param1.id + KEY_SALT] = 0; + } + if(!this[param1.id]) + { + this[param1.id] = 0; + } + this[param1.id + KEY_SALT] += param1.count; + this[param1.id] += param1.count; + if(Boolean(param1.privateProperties) && Boolean(param1.privateProperties.consumable)) + { + if(!this[param1.privateProperties.tag]) + { + this[param1.privateProperties.tag] = 0; + } + this[param1.privateProperties.tag] += param1.privateProperties.inc * param1.count; + } + } + + private function itemOwned(param1:Object) : void + { + this._storeSync[param1.id] = { + "properties":param1.properties, + "count":param1.count + }; + } + + private function getConsumableBag(param1:MochiUserData) : void + { + var _loc2_:String = null; + var _loc3_:Number = NaN; + if(param1.error) + { + triggerEvent(ERROR,{ + "type":IO_ERROR, + "error":param1.error + }); + return; + } + this._consumableProperties = {}; + this._names = new Array(); + if(param1.data) + { + for(_loc2_ in param1.data) + { + this._names.push(_loc2_); + this._consumableProperties[_loc2_] = new MochiDigits(param1.data[_loc2_]); + } + } + for(_loc2_ in this._storeSync) + { + _loc3_ = Number(this._storeSync[_loc2_].count); + if(this._consumableProperties[_loc2_ + KEY_SALT]) + { + _loc3_ -= this._consumableProperties[_loc2_ + KEY_SALT].value; + } + if(_loc3_ != 0) + { + this.newItems({ + "id":_loc2_, + "count":_loc3_, + "properties":this._storeSync[_loc2_].properties + }); + } + } + triggerEvent(READY,{}); + } + + private function putConsumableBag(param1:MochiUserData) : void + { + this._syncPending = false; + if(param1.error) + { + triggerEvent(ERROR,{ + "type":IO_ERROR, + "error":param1.error + }); + this._outstandingID = -1; + } + triggerEvent(WRITTEN,{}); + } + + private function sync(param1:Event = null) : void + { + var _loc3_:String = null; + if(this._syncPending || this._syncID == this._outstandingID) + { + return; + } + this._outstandingID = this._syncID; + var _loc2_:Object = {}; + for(_loc3_ in this._consumableProperties) + { + _loc2_[_loc3_] = MochiDigits(this._consumableProperties[_loc3_]).value; + } + MochiUserData.put(CONSUMER_KEY,_loc2_,this.putConsumableBag); + this._syncPending = true; + } + + override flash_proxy function getProperty(param1:*) : * + { + if(this._consumableProperties == null) + { + triggerEvent(ERROR,{"type":NOT_READY}); + return -1; + } + if(this._consumableProperties[param1]) + { + return MochiDigits(this._consumableProperties[param1]).value; + } + return undefined; + } + + override flash_proxy function deleteProperty(param1:*) : Boolean + { + if(!this._consumableProperties[param1]) + { + return false; + } + this._names.splice(this._names.indexOf(param1),1); + delete this._consumableProperties[param1]; + return true; + } + + override flash_proxy function hasProperty(param1:*) : Boolean + { + if(this._consumableProperties == null) + { + triggerEvent(ERROR,{"type":NOT_READY}); + return false; + } + if(this._consumableProperties[param1] == undefined) + { + return false; + } + return true; + } + + override flash_proxy function setProperty(param1:*, param2:*) : void + { + var _loc3_:MochiDigits = null; + if(this._consumableProperties == null) + { + triggerEvent(ERROR,{"type":NOT_READY}); + return; + } + if(!(param2 is Number)) + { + triggerEvent(ERROR,{ + "type":VALUE_ERROR, + "error":"Invalid type", + "arg":param2 + }); + return; + } + if(this._consumableProperties[param1]) + { + _loc3_ = MochiDigits(this._consumableProperties[param1]); + if(_loc3_.value == param2) + { + return; + } + _loc3_.value = param2; + } + else + { + this._names.push(param1); + this._consumableProperties[param1] = new MochiDigits(param2); + } + ++this._syncID; + } + + override flash_proxy function nextNameIndex(param1:int) : int + { + return param1 >= this._names.length ? 0 : int(param1 + 1); + } + + override flash_proxy function nextName(param1:int) : String + { + return this._names[param1 - 1]; + } + } +} + diff --git a/research/inner_decompiled/scripts/mochi/as3/MochiServices.as b/research/inner_decompiled/scripts/mochi/as3/MochiServices.as new file mode 100644 index 0000000..5d70696 --- /dev/null +++ b/research/inner_decompiled/scripts/mochi/as3/MochiServices.as @@ -0,0 +1,808 @@ +package mochi.as3 +{ + import flash.display.DisplayObject; + import flash.display.DisplayObjectContainer; + import flash.display.Loader; + import flash.display.LoaderInfo; + import flash.display.MovieClip; + import flash.display.Sprite; + import flash.events.Event; + import flash.events.IOErrorEvent; + import flash.events.TimerEvent; + import flash.geom.Rectangle; + import flash.net.LocalConnection; + import flash.net.URLRequest; + import flash.net.URLVariables; + import flash.system.Capabilities; + import flash.system.Security; + import flash.utils.ByteArray; + import flash.utils.Endian; + import flash.utils.Timer; + + public class MochiServices + { + + private static var _id:String; + + private static var _container:Object; + + private static var _clip:MovieClip; + + private static var _loader:Loader; + + private static var _timer:Timer; + + private static var _preserved:Object; + + private static var _swfVersion:String; + + private static var _sendChannel:LocalConnection; + + private static var _sendChannelName:String; + + public static var onError:Object; + + private static var _mochiLocalConnection:MovieClip; + + private static var _queue:Array; + + private static var _nextCallbackID:Number; + + private static var _callbacks:Object; + + public static const CONNECTED:String = "onConnected"; + + private static var _servURL:String = "http://www.mochiads.com/static/lib/services/"; + + private static var _services:String = "services.swf"; + + private static var _mochiLC:String = "MochiLC.swf"; + + private static var _listenChannelName:String = "__ms_"; + + private static var _connecting:Boolean = false; + + private static var _connected:Boolean = false; + + public static var netup:Boolean = true; + + public static var netupAttempted:Boolean = false; + + public static var widget:Boolean = false; + + private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher(); + + public function MochiServices() + { + super(); + } + + public static function get id() : String + { + return _id; + } + + public static function get clip() : Object + { + return _container; + } + + public static function get childClip() : Object + { + return _clip; + } + + public static function getVersion() : String + { + return "3.9.4 as3"; + } + + public static function allowDomains(param1:String) : String + { + var _loc2_:String = null; + if(Security.sandboxType != "application") + { + Security.allowDomain("*"); + Security.allowInsecureDomain("*"); + } + if(param1.indexOf("http://") != -1) + { + _loc2_ = param1.split("/")[2].split(":")[0]; + if(Security.sandboxType != "application") + { + Security.allowDomain(_loc2_); + Security.allowInsecureDomain(_loc2_); + } + } + return _loc2_; + } + + public static function isNetworkAvailable() : Boolean + { + return Security.sandboxType != "localWithFile"; + } + + public static function set comChannelName(param1:String) : void + { + if(param1 != null) + { + if(param1.length > 3) + { + _sendChannelName = param1 + "_fromgame"; + initComChannels(); + } + } + } + + public static function get connected() : Boolean + { + return _connected; + } + + public static function warnID(param1:String, param2:Boolean) : void + { + param1 = param1.toLowerCase(); + if(param1.length != 16) + { + return; + } + if(param1 == "1e113c7239048b3f") + { + if(param2) + { + } + return; + } + if(param1 == "84993a1de4031cd8") + { + if(param2) + { + } + return; + } + var _loc3_:Number = 0; + while(_loc3_ < param1.length) + { + switch(param1.charAt(_loc3_)) + { + case "0": + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + case "a": + case "b": + case "c": + case "d": + case "e": + case "f": + break; + default: + return; + } + _loc3_++; + } + } + + public static function connect(param1:String, param2:Object, param3:Object = null) : void + { + var id:String = param1; + var clip:Object = param2; + var onError:Object = param3; + warnID(id,false); + if(onError != null) + { + MochiServices.onError = onError; + } + else if(MochiServices.onError == null) + { + MochiServices.onError = function(param1:String):void + { + }; + } + if(clip is DisplayObject) + { + if(clip.stage == null) + { + } + if(!_connected && _clip == null) + { + _connecting = true; + init(id,clip); + } + } + } + + public static function disconnect() : void + { + if(_connected || _connecting) + { + if(_clip != null) + { + if(_clip.parent != null) + { + if(_clip.parent is Sprite) + { + Sprite(_clip.parent).removeChild(_clip); + _clip = null; + } + } + } + _connecting = _connected = false; + flush(true); + try + { + _mochiLocalConnection.close(); + } + catch(error:Error) + { + } + } + if(_timer != null) + { + try + { + _timer.stop(); + _timer.removeEventListener(TimerEvent.TIMER,connectWait); + _timer = null; + } + catch(error:Error) + { + } + } + } + + public static function stayOnTop() : void + { + _container.addEventListener(Event.ENTER_FRAME,MochiServices.bringToTop,false,0,true); + if(_clip != null) + { + _clip.visible = true; + } + } + + public static function doClose() : void + { + _container.removeEventListener(Event.ENTER_FRAME,MochiServices.bringToTop); + } + + public static function bringToTop(param1:Event = null) : void + { + var e:Event = param1; + if(MochiServices.clip != null && MochiServices.childClip != null) + { + try + { + if(MochiServices.clip.numChildren > 1) + { + MochiServices.clip.setChildIndex(MochiServices.childClip,MochiServices.clip.numChildren - 1); + } + } + catch(errorObject:Error) + { + _container.removeEventListener(Event.ENTER_FRAME,MochiServices.bringToTop); + } + } + } + + private static function init(param1:String, param2:Object) : void + { + _id = param1; + if(param2 != null) + { + _container = param2; + loadCommunicator(param1,_container); + } + } + + public static function setContainer(param1:Object = null, param2:Boolean = true) : void + { + if(_clip.parent) + { + _clip.parent.removeChild(_clip); + } + if(param1 != null) + { + if(param1 is DisplayObjectContainer) + { + _container = param1; + } + } + if(param2) + { + if(_container is DisplayObjectContainer) + { + DisplayObjectContainer(_container).addChild(_clip); + } + } + } + + private static function loadCommunicator(param1:String, param2:Object) : MovieClip + { + if(_clip != null) + { + return _clip; + } + if(!MochiServices.isNetworkAvailable()) + { + MochiServices.onError("NotConnected"); + return null; + } + if(urlOptions(param2).servURL) + { + _servURL = urlOptions(param2).servURL; + } + var _loc3_:String = _servURL + _services; + if(urlOptions(param2).servicesURL) + { + _loc3_ = urlOptions(param2).servicesURL; + } + _listenChannelName += Math.floor(new Date().time) + "_" + Math.floor(Math.random() * 99999); + MochiServices.allowDomains(_loc3_); + _clip = new MovieClip(); + loadLCBridge(_clip); + _loader = new Loader(); + _loader.contentLoaderInfo.addEventListener(Event.COMPLETE,detach); + _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,detach); + _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,loadError); + var _loc4_:URLRequest = new URLRequest(_loc3_); + var _loc5_:URLVariables = new URLVariables(); + _loc5_.listenLC = _listenChannelName; + _loc5_.mochiad_options = param2.loaderInfo.parameters.mochiad_options; + _loc5_.api_version = getVersion(); + if(widget) + { + _loc5_.widget = true; + } + _loc4_.data = _loc5_; + _loader.load(_loc4_); + _clip.addChild(_loader); + _sendChannel = new LocalConnection(); + _queue = []; + _nextCallbackID = 0; + _callbacks = {}; + _timer = new Timer(10000,1); + _timer.addEventListener(TimerEvent.TIMER,connectWait); + _timer.start(); + return _clip; + } + + private static function detach(param1:Event) : void + { + var _loc2_:LoaderInfo = LoaderInfo(param1.target); + _loc2_.removeEventListener(Event.COMPLETE,detach); + _loc2_.removeEventListener(IOErrorEvent.IO_ERROR,detach); + _loc2_.removeEventListener(Event.COMPLETE,loadLCBridgeComplete); + _loc2_.removeEventListener(IOErrorEvent.IO_ERROR,loadError); + } + + private static function loadLCBridge(param1:Object) : void + { + var _loc2_:Loader = new Loader(); + var _loc3_:String = _servURL + _mochiLC; + var _loc4_:URLRequest = new URLRequest(_loc3_); + _loc2_.contentLoaderInfo.addEventListener(Event.COMPLETE,detach); + _loc2_.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,detach); + _loc2_.contentLoaderInfo.addEventListener(Event.COMPLETE,loadLCBridgeComplete); + _loc2_.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,loadError); + _loc2_.load(_loc4_); + param1.addChild(_loc2_); + } + + private static function loadLCBridgeComplete(param1:Event) : void + { + var _loc2_:Loader = LoaderInfo(param1.target).loader; + _mochiLocalConnection = MovieClip(_loc2_.content); + listen(); + } + + private static function loadError(param1:Object) : void + { + _clip._mochiad_ctr_failed = true; + MochiServices.disconnect(); + MochiServices.onError("IOError"); + } + + public static function connectWait(param1:TimerEvent) : void + { + if(!_connected) + { + _clip._mochiad_ctr_failed = true; + MochiServices.disconnect(); + MochiServices.onError("IOError"); + } + else + { + _timer.stop(); + _timer.removeEventListener(TimerEvent.TIMER,connectWait); + _timer = null; + } + } + + private static function listen() : void + { + _mochiLocalConnection.connect(_listenChannelName); + _clip.handshake = function(param1:Object):void + { + MochiServices.comChannelName = param1.newChannel; + }; + } + + private static function initComChannels() : void + { + if(!_connected) + { + _connecting = false; + _connected = true; + _mochiLocalConnection.send(_sendChannelName,"onReceive",{"methodName":"handshakeDone"}); + _mochiLocalConnection.send(_sendChannelName,"onReceive",{ + "methodName":"registerGame", + "preserved":_preserved, + "id":_id, + "version":getVersion(), + "parentURL":_container.loaderInfo.loaderURL + }); + _clip.onReceive = onReceive; + _clip.onEvent = onEvent; + _clip.onError = function():void + { + MochiServices.onError("IOError"); + }; + while(_queue.length > 0) + { + _mochiLocalConnection.send(_sendChannelName,"onReceive",_queue.shift()); + } + } + } + + private static function onReceive(param1:Object) : void + { + var method:*; + var methodName:String; + var obj:Object; + var pkg:Object = param1; + var cb:String = pkg.callbackID; + var cblst:Object = _callbacks[cb]; + if(!cblst) + { + return; + } + method = cblst.callbackMethod; + methodName = ""; + obj = cblst.callbackObject; + if(Boolean(obj) && typeof method == "string") + { + methodName = method; + if(obj[method] != null) + { + method = obj[method]; + } + } + if(method != undefined) + { + try + { + method.apply(obj,pkg.args); + } + catch(error:Error) + { + } + } + else if(obj != null) + { + try + { + obj(pkg.args); + } + catch(error:Error) + { + } + } + delete _callbacks[cb]; + } + + private static function onEvent(param1:Object) : void + { + var _loc2_:String = param1.target; + var _loc3_:String = param1.event; + switch(_loc2_) + { + case "services": + MochiServices.triggerEvent(param1.event,param1.args); + break; + case "events": + MochiEvents.triggerEvent(param1.event,param1.args); + break; + case "coins": + MochiCoins.triggerEvent(param1.event,param1.args); + break; + case "social": + MochiSocial.triggerEvent(param1.event,param1.args); + } + } + + private static function flush(param1:Boolean) : void + { + var _loc2_:Object = null; + var _loc3_:Object = null; + if(Boolean(_clip) && Boolean(_queue)) + { + while(_queue.length > 0) + { + _loc2_ = _queue.shift(); + _loc3_ = null; + if(_loc2_ != null) + { + if(_loc2_.callbackID != null) + { + _loc3_ = _callbacks[_loc2_.callbackID]; + } + delete _callbacks[_loc2_.callbackID]; + if(param1 && _loc3_ != null) + { + handleError(_loc2_.args,_loc3_.callbackObject,_loc3_.callbackMethod); + } + } + } + } + } + + private static function handleError(param1:Object, param2:Object, param3:Object) : void + { + var args:Object = param1; + var callbackObject:Object = param2; + var callbackMethod:Object = param3; + if(args != null) + { + if(args.onError != null) + { + args.onError("NotConnected"); + } + if(args.options != null && args.options.onError != null) + { + args.options.onError("NotConnected"); + } + } + if(callbackMethod != null) + { + args = {}; + args.error = true; + args.errorCode = "NotConnected"; + if(callbackObject != null && callbackMethod is String) + { + try + { + callbackObject[callbackMethod](args); + } + catch(error:Error) + { + } + } + else if(callbackMethod != null) + { + try + { + callbackMethod.apply(args); + } + catch(error:Error) + { + } + } + } + } + + public static function send(param1:String, param2:Object = null, param3:Object = null, param4:Object = null) : void + { + if(_connected) + { + _mochiLocalConnection.send(_sendChannelName,"onReceive",{ + "methodName":param1, + "args":param2, + "callbackID":_nextCallbackID + }); + } + else + { + if(_clip == null || !_connecting) + { + handleError(param2,param3,param4); + flush(true); + return; + } + _queue.push({ + "methodName":param1, + "args":param2, + "callbackID":_nextCallbackID + }); + } + if(_clip != null) + { + if(_callbacks != null) + { + _callbacks[_nextCallbackID] = { + "callbackObject":param3, + "callbackMethod":param4 + }; + ++_nextCallbackID; + } + } + } + + private static function urlOptions(param1:Object) : Object + { + var _loc3_:String = null; + var _loc4_:Array = null; + var _loc5_:Number = NaN; + var _loc6_:Array = null; + var _loc2_:Object = {}; + if(param1.stage) + { + _loc3_ = param1.stage.loaderInfo.parameters.mochiad_options; + } + else + { + _loc3_ = param1.loaderInfo.parameters.mochiad_options; + } + if(_loc3_) + { + _loc4_ = _loc3_.split("&"); + _loc5_ = 0; + while(_loc5_ < _loc4_.length) + { + _loc6_ = _loc4_[_loc5_].split("="); + _loc2_[unescape(_loc6_[0])] = unescape(_loc6_[1]); + _loc5_++; + } + } + return _loc2_; + } + + public static function addLinkEvent(param1:String, param2:String, param3:DisplayObjectContainer, param4:Function = null) : void + { + var s:String; + var i:Number; + var avm1Click:DisplayObject = null; + var x:String = null; + var req:URLRequest = null; + var loader:Loader = null; + var setURL:Function = null; + var err:Function = null; + var complete:Function = null; + var url:String = param1; + var burl:String = param2; + var btn:DisplayObjectContainer = param3; + var onClick:Function = param4; + var vars:Object = new Object(); + vars["mav"] = getVersion(); + vars["swfv"] = "9"; + vars["swfurl"] = btn.loaderInfo.loaderURL; + vars["fv"] = Capabilities.version; + vars["os"] = Capabilities.os; + vars["lang"] = Capabilities.language; + vars["scres"] = Capabilities.screenResolutionX + "x" + Capabilities.screenResolutionY; + s = "?"; + i = 0; + for(x in vars) + { + if(i != 0) + { + s += "&"; + } + i++; + s = s + x + "=" + escape(vars[x]); + } + req = new URLRequest("http://link.mochiads.com/linkping.swf"); + loader = new Loader(); + setURL = function(param1:String):void + { + if(avm1Click) + { + btn.removeChild(avm1Click); + } + avm1Click = clickMovie(param1,onClick); + var _loc2_:Rectangle = btn.getBounds(btn); + btn.addChild(avm1Click); + avm1Click.x = _loc2_.x; + avm1Click.y = _loc2_.y; + avm1Click.scaleX = 0.01 * _loc2_.width; + avm1Click.scaleY = 0.01 * _loc2_.height; + }; + err = function(param1:Object):void + { + netup = false; + param1.target.removeEventListener(param1.type,arguments.callee); + setURL(burl); + }; + complete = function(param1:Object):void + { + param1.target.removeEventListener(param1.type,arguments.callee); + }; + if(netup) + { + setURL(url + s); + } + else + { + setURL(burl); + } + if(!(netupAttempted || _connected)) + { + netupAttempted = true; + loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,err); + loader.contentLoaderInfo.addEventListener(Event.COMPLETE,complete); + loader.load(req); + } + } + + public static function clickMovie(param1:String, param2:Function) : MovieClip + { + var _loc4_:int = 0; + var _loc14_:Loader = null; + var _loc3_:Array = [150,21,0,7,1,0,0,0,0,98,116,110,0,7,2,0,0,0,0,116,104,105,115,0,28,150,22,0,0,99,114,101,97,116,101,69,109,112,116,121,77,111,118,105,101,67,108,105,112,0,82,135,1,0,0,23,150,13,0,4,0,0,111,110,82,101,108,101,97,115,101,0,142,8,0,0,0,0,2,42,0,114,0,150,17,0,0,32,0,7,1,0,0,0,8,0,0,115,112,108,105,116,0,82,135,1,0,1,23,150,7,0,4,1,7,0,0,0,0,78,150,8,0,0,95,98,108,97,110,107,0,154,1,0,0,150,7,0,0,99,108,105,99,107,0,150,7,0,4,1,7,1,0,0,0,78,150,27,0,7,2,0,0,0,7,0,0,0,0,0,76,111,99,97,108,67,111,110,110,101,99,116,105,111,110,0,64,150,6,0,0,115,101,110,100,0,82,79,150,15,0,4,0,0,95,97,108,112,104,97,0,7,0,0,0,0,79,150,23,0,7,255,0,255,0,7,1,0,0,0,4,0,0,98,101,103,105,110,70,105,108,108,0,82,23,150,25,0,7,0,0,0,0,7,0,0,0,0,7,2,0,0,0,4,0,0,109,111,118,101,84,111,0,82,23,150,25,0,7,100,0,0,0,7,0,0,0,0,7,2,0,0,0,4,0,0,108,105,110,101,84,111,0,82,23,150,25,0,7,100,0,0,0,7,100,0,0,0,7,2,0,0,0,4,0,0,108,105,110,101,84,111,0,82,23,150,25,0,7,0,0,0,0,7,100,0,0,0,7,2,0,0,0,4,0,0,108 + ,105,110,101,84,111,0,82,23,150,25,0,7,0,0,0,0,7,0,0,0,0,7,2,0,0,0,4,0,0,108,105,110,101,84,111,0,82,23,150,16,0,7,0,0,0,0,4,0,0,101,110,100,70,105,108,108,0,82,23]; + var _loc5_:Array = [104,0,31,64,0,7,208,0,0,12,1,0,67,2,255,255,255,63,3]; + var _loc6_:Array = [0,64,0,0,0]; + var _loc7_:MovieClip = new MovieClip(); + var _loc8_:LocalConnection = new LocalConnection(); + var _loc9_:String = "_click_" + Math.floor(Math.random() * 999999) + "_" + Math.floor(new Date().time); + _loc8_ = new LocalConnection(); + _loc7_.lc = _loc8_; + _loc7_.click = param2; + _loc8_.client = _loc7_; + _loc8_.connect(_loc9_); + var _loc10_:ByteArray = new ByteArray(); + var _loc11_:ByteArray = new ByteArray(); + _loc11_.endian = Endian.LITTLE_ENDIAN; + _loc11_.writeShort(1); + _loc11_.writeUTFBytes(param1 + " " + _loc9_); + _loc11_.writeByte(0); + var _loc12_:uint = _loc3_.length + _loc11_.length + 4; + var _loc13_:uint = _loc12_ + 35; + _loc10_.endian = Endian.LITTLE_ENDIAN; + _loc10_.writeUTFBytes("FWS"); + _loc10_.writeByte(8); + _loc10_.writeUnsignedInt(_loc13_); + for each(_loc4_ in _loc5_) + { + _loc10_.writeByte(_loc4_); + } + _loc10_.writeUnsignedInt(_loc12_); + _loc10_.writeByte(136); + _loc10_.writeShort(_loc11_.length); + _loc10_.writeBytes(_loc11_); + for each(_loc4_ in _loc3_) + { + _loc10_.writeByte(_loc4_); + } + for each(_loc4_ in _loc6_) + { + _loc10_.writeByte(_loc4_); + } + _loc14_ = new Loader(); + _loc14_.loadBytes(_loc10_); + _loc7_.addChild(_loc14_); + return _loc7_; + } + + public static function addEventListener(param1:String, param2:Function) : void + { + _dispatcher.addEventListener(param1,param2); + } + + public static function triggerEvent(param1:String, param2:Object) : void + { + _dispatcher.triggerEvent(param1,param2); + } + + public static function removeEventListener(param1:String, param2:Function) : void + { + _dispatcher.removeEventListener(param1,param2); + } + } +} + diff --git a/research/inner_decompiled/scripts/mochi/as3/MochiSocial.as b/research/inner_decompiled/scripts/mochi/as3/MochiSocial.as new file mode 100644 index 0000000..7a58e37 --- /dev/null +++ b/research/inner_decompiled/scripts/mochi/as3/MochiSocial.as @@ -0,0 +1,163 @@ +package mochi.as3 +{ + public class MochiSocial + { + + public static const LOGGED_IN:String = "LoggedIn"; + + public static const LOGGED_OUT:String = "LoggedOut"; + + public static const LOGIN_SHOW:String = "LoginShow"; + + public static const LOGIN_HIDE:String = "LoginHide"; + + public static const LOGIN_SHOWN:String = "LoginShown"; + + public static const PROFILE_SHOW:String = "ProfileShow"; + + public static const PROFILE_HIDE:String = "ProfileHide"; + + public static const PROPERTIES_SAVED:String = "PropertySaved"; + + public static const WIDGET_LOADED:String = "WidgetLoaded"; + + public static const FRIEND_LIST:String = "FriendsList"; + + public static const PROFILE_DATA:String = "ProfileData"; + + public static const GAMEPLAY_DATA:String = "GameplayData"; + + public static const ACTION_CANCELED:String = "onCancel"; + + public static const ACTION_COMPLETE:String = "onComplete"; + + public static const USER_INFO:String = "UserInfo"; + + public static const ERROR:String = "Error"; + + public static const IO_ERROR:String = "IOError"; + + public static const NO_USER:String = "NoUser"; + + public static const PROPERTIES_SIZE:String = "PropertiesSize"; + + private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher(); + + public static var _user_info:Object = null; + + MochiSocial.addEventListener(MochiSocial.LOGGED_IN,function(param1:Object):void + { + _user_info = param1; + }); + MochiSocial.addEventListener(MochiSocial.LOGGED_OUT,function(param1:Object):void + { + _user_info = null; + }); + + public function MochiSocial() + { + super(); + } + + public static function getVersion() : String + { + return MochiServices.getVersion(); + } + + public static function getAPIURL() : String + { + if(!_user_info) + { + return null; + } + return _user_info.api_url; + } + + public static function getAPIToken() : String + { + if(!_user_info) + { + return null; + } + return _user_info.api_token; + } + + public static function showLoginWidget(param1:Object = null) : void + { + MochiServices.setContainer(); + MochiServices.bringToTop(); + MochiServices.send("social_showLoginWidget",{"options":param1}); + } + + public static function hideLoginWidget() : void + { + MochiServices.send("social_hideLoginWidget"); + } + + public static function requestLogin(param1:Object = null) : void + { + MochiServices.setContainer(); + MochiServices.bringToTop(); + MochiServices.send("social_requestLogin",param1); + } + + public static function showProfile(param1:Object = null) : void + { + MochiServices.setContainer(); + MochiServices.stayOnTop(); + MochiServices.send("social_showProfile",param1); + } + + public static function saveUserProperties(param1:Object) : void + { + MochiServices.send("social_saveUserProperties",param1); + } + + public static function getFriendsList(param1:Object = null) : void + { + MochiServices.send("social_getFriendsList",param1); + } + + public static function postToStream(param1:Object = null) : void + { + MochiServices.setContainer(); + MochiServices.bringToTop(); + MochiServices.send("social_postToStream",param1); + } + + public static function inviteFriends(param1:Object = null) : void + { + MochiServices.setContainer(); + MochiServices.bringToTop(); + MochiServices.send("social_inviteFriends",param1); + } + + public static function requestFan(param1:Object = null) : void + { + MochiServices.setContainer(); + MochiServices.bringToTop(); + MochiServices.send("social_requestFan",param1); + } + + public static function addEventListener(param1:String, param2:Function) : void + { + _dispatcher.addEventListener(param1,param2); + } + + public static function get loggedIn() : Boolean + { + return _user_info != null; + } + + public static function triggerEvent(param1:String, param2:Object) : void + { + _dispatcher.triggerEvent(param1,param2); + } + + public static function removeEventListener(param1:String, param2:Function) : void + { + _dispatcher.removeEventListener(param1,param2); + } + } +} + diff --git a/research/inner_decompiled/scripts/mochi/as3/MochiUserData.as b/research/inner_decompiled/scripts/mochi/as3/MochiUserData.as new file mode 100644 index 0000000..175f12a --- /dev/null +++ b/research/inner_decompiled/scripts/mochi/as3/MochiUserData.as @@ -0,0 +1,196 @@ +package mochi.as3 +{ + import flash.events.Event; + import flash.events.EventDispatcher; + import flash.events.IOErrorEvent; + import flash.events.SecurityErrorEvent; + import flash.net.ObjectEncoding; + import flash.net.URLLoader; + import flash.net.URLLoaderDataFormat; + import flash.net.URLRequest; + import flash.net.URLRequestHeader; + import flash.net.URLRequestMethod; + import flash.net.URLVariables; + import flash.utils.ByteArray; + + public class MochiUserData extends EventDispatcher + { + + public var _loader:URLLoader; + + public var key:String = null; + + public var data:* = null; + + public var error:Event = null; + + public var operation:String = null; + + public var callback:Function = null; + + public function MochiUserData(param1:String = "", param2:Function = null) + { + super(); + this.key = param1; + this.callback = param2; + } + + public static function get(param1:String, param2:Function) : void + { + var _loc3_:MochiUserData = new MochiUserData(param1,param2); + _loc3_.getEvent(); + } + + public static function put(param1:String, param2:*, param3:Function) : void + { + var _loc4_:MochiUserData = new MochiUserData(param1,param3); + _loc4_.putEvent(param2); + } + + public function serialize(param1:*) : ByteArray + { + var _loc2_:ByteArray = new ByteArray(); + _loc2_.objectEncoding = ObjectEncoding.AMF3; + _loc2_.writeObject(param1); + _loc2_.compress(); + return _loc2_; + } + + public function deserialize(param1:ByteArray) : * + { + param1.objectEncoding = ObjectEncoding.AMF3; + param1.uncompress(); + return param1.readObject(); + } + + public function request(param1:String, param2:ByteArray) : void + { + var api_url:String; + var api_token:String; + var args:URLVariables; + var req:URLRequest; + var _operation:String = param1; + var _data:ByteArray = param2; + this.operation = _operation; + api_url = MochiSocial.getAPIURL(); + api_token = MochiSocial.getAPIToken(); + if(api_url == null || api_token == null) + { + this.errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR,false,false,"not logged in")); + return; + } + this._loader = new URLLoader(); + args = new URLVariables(); + args.op = _operation; + args.key = this.key; + req = new URLRequest(MochiSocial.getAPIURL() + "/" + "MochiUserData?" + args.toString()); + req.method = URLRequestMethod.POST; + req.contentType = "application/x-mochi-userdata"; + req.requestHeaders = [new URLRequestHeader("x-mochi-services-version",MochiServices.getVersion()),new URLRequestHeader("x-mochi-api-token",api_token)]; + req.data = _data; + this._loader.dataFormat = URLLoaderDataFormat.BINARY; + this._loader.addEventListener(Event.COMPLETE,this.completeHandler); + this._loader.addEventListener(IOErrorEvent.IO_ERROR,this.errorHandler); + this._loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR,this.securityErrorHandler); + try + { + this._loader.load(req); + } + catch(e:SecurityError) + { + errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR,false,false,"security error: " + e.toString())); + } + } + + public function completeHandler(param1:Event) : void + { + var event:Event = param1; + try + { + if(this._loader.data.length) + { + this.data = this.deserialize(this._loader.data); + } + else + { + this.data = null; + } + } + catch(e:Error) + { + errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR,false,false,"deserialize error: " + e.toString())); + return; + } + if(this.callback != null) + { + this.performCallback(); + } + else + { + dispatchEvent(event); + } + this.close(); + } + + public function errorHandler(param1:IOErrorEvent) : void + { + this.data = null; + this.error = param1; + if(this.callback != null) + { + this.performCallback(); + } + else + { + dispatchEvent(param1); + } + this.close(); + } + + public function securityErrorHandler(param1:SecurityErrorEvent) : void + { + this.errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR,false,false,"security error: " + param1.toString())); + } + + public function performCallback() : void + { + try + { + this.callback(this); + } + catch(e:Error) + { + } + } + + public function close() : void + { + if(this._loader) + { + this._loader.removeEventListener(Event.COMPLETE,this.completeHandler); + this._loader.removeEventListener(IOErrorEvent.IO_ERROR,this.errorHandler); + this._loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR,this.securityErrorHandler); + this._loader.close(); + this._loader = null; + } + this.error = null; + this.callback = null; + } + + public function getEvent() : void + { + this.request("get",this.serialize(null)); + } + + public function putEvent(param1:*) : void + { + this.request("put",this.serialize(param1)); + } + + override public function toString() : String + { + return "[MochiUserData operation=" + this.operation + " key=\"" + this.key + "\" data=" + this.data + " error=\"" + this.error + "\"]"; + } + } +} + diff --git a/research/inner_decompiled/scripts/mx/core/BitmapAsset.as b/research/inner_decompiled/scripts/mx/core/BitmapAsset.as new file mode 100644 index 0000000..816f148 --- /dev/null +++ b/research/inner_decompiled/scripts/mx/core/BitmapAsset.as @@ -0,0 +1,465 @@ +package mx.core +{ + import flash.display.BitmapData; + import flash.display.DisplayObjectContainer; + import flash.events.Event; + import flash.geom.Point; + import flash.system.ApplicationDomain; + + use namespace mx_internal; + + public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject, ILayoutDirectionElement + { + + private static var FlexVersionClass:Class; + + private static var MatrixUtilClass:Class; + + mx_internal static const VERSION:String = "4.1.0.16076"; + + private var layoutFeaturesClass:Class; + + private var layoutFeatures:IAssetLayoutFeatures; + + private var _height:Number; + + private var _layoutDirection:String = "ltr"; + + public function BitmapAsset(param1:BitmapData = null, param2:String = "auto", param3:Boolean = false) + { + var _loc4_:ApplicationDomain = null; + super(param1,param2,param3); + if(FlexVersionClass == null) + { + _loc4_ = ApplicationDomain.currentDomain; + if(_loc4_.hasDefinition("mx.core::FlexVersion")) + { + FlexVersionClass = Class(_loc4_.getDefinition("mx.core::FlexVersion")); + } + } + if(Boolean(FlexVersionClass) && FlexVersionClass["compatibilityVersion"] >= FlexVersionClass["VERSION_4_0"]) + { + this.addEventListener(Event.ADDED,this.addedHandler); + } + } + + override public function get x() : Number + { + return this.layoutFeatures == null ? super.x : this.layoutFeatures.layoutX; + } + + override public function set x(param1:Number) : void + { + if(this.x == param1) + { + return; + } + if(this.layoutFeatures == null) + { + super.x = param1; + } + else + { + this.layoutFeatures.layoutX = param1; + this.validateTransformMatrix(); + } + } + + override public function get y() : Number + { + return this.layoutFeatures == null ? super.y : this.layoutFeatures.layoutY; + } + + override public function set y(param1:Number) : void + { + if(this.y == param1) + { + return; + } + if(this.layoutFeatures == null) + { + super.y = param1; + } + else + { + this.layoutFeatures.layoutY = param1; + this.validateTransformMatrix(); + } + } + + override public function get z() : Number + { + return this.layoutFeatures == null ? super.z : this.layoutFeatures.layoutZ; + } + + override public function set z(param1:Number) : void + { + if(this.z == param1) + { + return; + } + if(this.layoutFeatures == null) + { + super.z = param1; + } + else + { + this.layoutFeatures.layoutZ = param1; + this.validateTransformMatrix(); + } + } + + override public function get width() : Number + { + var _loc1_:Point = null; + if(this.layoutFeatures == null) + { + return super.width; + } + if(MatrixUtilClass != null) + { + _loc1_ = MatrixUtilClass["transformSize"](this.layoutFeatures.layoutWidth,this._height,transform.matrix); + } + return _loc1_ ? _loc1_.x : super.width; + } + + override public function set width(param1:Number) : void + { + if(this.width == param1) + { + return; + } + if(this.layoutFeatures == null) + { + super.width = param1; + } + else + { + this.layoutFeatures.layoutWidth = param1; + this.layoutFeatures.layoutScaleX = this.measuredWidth != 0 ? param1 / this.measuredWidth : 0; + this.validateTransformMatrix(); + } + } + + override public function get height() : Number + { + var _loc1_:Point = null; + if(this.layoutFeatures == null) + { + return super.height; + } + if(MatrixUtilClass != null) + { + _loc1_ = MatrixUtilClass["transformSize"](this.layoutFeatures.layoutWidth,this._height,transform.matrix); + } + return _loc1_ ? _loc1_.y : super.height; + } + + override public function set height(param1:Number) : void + { + if(this.height == param1) + { + return; + } + if(this.layoutFeatures == null) + { + super.height = param1; + } + else + { + this._height = param1; + this.layoutFeatures.layoutScaleY = this.measuredHeight != 0 ? param1 / this.measuredHeight : 0; + this.validateTransformMatrix(); + } + } + + override public function get rotationX() : Number + { + return this.layoutFeatures == null ? super.rotationX : this.layoutFeatures.layoutRotationX; + } + + override public function set rotationX(param1:Number) : void + { + if(this.rotationX == param1) + { + return; + } + if(this.layoutFeatures == null) + { + super.rotationX = param1; + } + else + { + this.layoutFeatures.layoutRotationX = param1; + this.validateTransformMatrix(); + } + } + + override public function get rotationY() : Number + { + return this.layoutFeatures == null ? super.rotationY : this.layoutFeatures.layoutRotationY; + } + + override public function set rotationY(param1:Number) : void + { + if(this.rotationY == param1) + { + return; + } + if(this.layoutFeatures == null) + { + super.rotationY = param1; + } + else + { + this.layoutFeatures.layoutRotationY = param1; + this.validateTransformMatrix(); + } + } + + override public function get rotationZ() : Number + { + return this.layoutFeatures == null ? super.rotationZ : this.layoutFeatures.layoutRotationZ; + } + + override public function set rotationZ(param1:Number) : void + { + if(this.rotationZ == param1) + { + return; + } + if(this.layoutFeatures == null) + { + super.rotationZ = param1; + } + else + { + this.layoutFeatures.layoutRotationZ = param1; + this.validateTransformMatrix(); + } + } + + override public function get rotation() : Number + { + return this.layoutFeatures == null ? super.rotation : this.layoutFeatures.layoutRotationZ; + } + + override public function set rotation(param1:Number) : void + { + if(this.rotation == param1) + { + return; + } + if(this.layoutFeatures == null) + { + super.rotation = param1; + } + else + { + this.layoutFeatures.layoutRotationZ = param1; + this.validateTransformMatrix(); + } + } + + override public function get scaleX() : Number + { + return this.layoutFeatures == null ? super.scaleX : this.layoutFeatures.layoutScaleX; + } + + override public function set scaleX(param1:Number) : void + { + if(this.scaleX == param1) + { + return; + } + if(this.layoutFeatures == null) + { + super.scaleX = param1; + } + else + { + this.layoutFeatures.layoutScaleX = param1; + this.layoutFeatures.layoutWidth = Math.abs(param1) * this.measuredWidth; + this.validateTransformMatrix(); + } + } + + override public function get scaleY() : Number + { + return this.layoutFeatures == null ? super.scaleY : this.layoutFeatures.layoutScaleY; + } + + override public function set scaleY(param1:Number) : void + { + if(this.scaleY == param1) + { + return; + } + if(this.layoutFeatures == null) + { + super.scaleY = param1; + } + else + { + this.layoutFeatures.layoutScaleY = param1; + this._height = Math.abs(param1) * this.measuredHeight; + this.validateTransformMatrix(); + } + } + + override public function get scaleZ() : Number + { + return this.layoutFeatures == null ? super.scaleZ : this.layoutFeatures.layoutScaleZ; + } + + override public function set scaleZ(param1:Number) : void + { + if(this.scaleZ == param1) + { + return; + } + if(this.layoutFeatures == null) + { + super.scaleZ = param1; + } + else + { + this.layoutFeatures.layoutScaleZ = param1; + this.validateTransformMatrix(); + } + } + + public function get layoutDirection() : String + { + return this._layoutDirection; + } + + public function set layoutDirection(param1:String) : void + { + if(param1 == this._layoutDirection) + { + return; + } + this._layoutDirection = param1; + this.invalidateLayoutDirection(); + } + + public function get measuredHeight() : Number + { + if(bitmapData) + { + return bitmapData.height; + } + return 0; + } + + public function get measuredWidth() : Number + { + if(bitmapData) + { + return bitmapData.width; + } + return 0; + } + + public function invalidateLayoutDirection() : void + { + var _loc2_:Boolean = false; + var _loc1_:DisplayObjectContainer = parent; + while(_loc1_) + { + if(_loc1_ is ILayoutDirectionElement) + { + _loc2_ = this._layoutDirection != null && this._layoutDirection != ILayoutDirectionElement(_loc1_).layoutDirection; + if(_loc2_ && this.layoutFeatures == null) + { + this.initAdvancedLayoutFeatures(); + if(this.layoutFeatures != null) + { + this.layoutFeatures.mirror = _loc2_; + this.validateTransformMatrix(); + } + } + else if(!_loc2_ && Boolean(this.layoutFeatures)) + { + this.layoutFeatures.mirror = _loc2_; + this.validateTransformMatrix(); + this.layoutFeatures = null; + } + break; + } + _loc1_ = _loc1_.parent; + } + } + + public function move(param1:Number, param2:Number) : void + { + this.x = param1; + this.y = param2; + } + + public function setActualSize(param1:Number, param2:Number) : void + { + this.width = param1; + this.height = param2; + } + + private function addedHandler(param1:Event) : void + { + this.invalidateLayoutDirection(); + } + + private function initAdvancedLayoutFeatures() : void + { + var _loc1_:ApplicationDomain = null; + var _loc2_:IAssetLayoutFeatures = null; + if(this.layoutFeaturesClass == null) + { + _loc1_ = ApplicationDomain.currentDomain; + if(_loc1_.hasDefinition("mx.core::AdvancedLayoutFeatures")) + { + this.layoutFeaturesClass = Class(_loc1_.getDefinition("mx.core::AdvancedLayoutFeatures")); + } + if(MatrixUtilClass == null) + { + if(_loc1_.hasDefinition("mx.utils::MatrixUtil")) + { + MatrixUtilClass = Class(_loc1_.getDefinition("mx.utils::MatrixUtil")); + } + } + } + if(this.layoutFeaturesClass != null) + { + _loc2_ = new this.layoutFeaturesClass(); + _loc2_.layoutScaleX = this.scaleX; + _loc2_.layoutScaleY = this.scaleY; + _loc2_.layoutScaleZ = this.scaleZ; + _loc2_.layoutRotationX = this.rotationX; + _loc2_.layoutRotationY = this.rotationY; + _loc2_.layoutRotationZ = this.rotation; + _loc2_.layoutX = this.x; + _loc2_.layoutY = this.y; + _loc2_.layoutZ = this.z; + _loc2_.layoutWidth = this.width; + this._height = this.height; + this.layoutFeatures = _loc2_; + } + } + + private function validateTransformMatrix() : void + { + if(this.layoutFeatures != null) + { + if(this.layoutFeatures.is3D) + { + super.transform.matrix3D = this.layoutFeatures.computedMatrix3D; + } + else + { + super.transform.matrix = this.layoutFeatures.computedMatrix; + } + } + } + } +} + diff --git a/research/inner_decompiled/scripts/mx/core/ByteArrayAsset.as b/research/inner_decompiled/scripts/mx/core/ByteArrayAsset.as new file mode 100644 index 0000000..6620a6a --- /dev/null +++ b/research/inner_decompiled/scripts/mx/core/ByteArrayAsset.as @@ -0,0 +1,18 @@ +package mx.core +{ + import flash.utils.ByteArray; + + use namespace mx_internal; + + public class ByteArrayAsset extends ByteArray implements IFlexAsset + { + + mx_internal static const VERSION:String = "4.1.0.16076"; + + public function ByteArrayAsset() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/mx/core/FlexBitmap.as b/research/inner_decompiled/scripts/mx/core/FlexBitmap.as new file mode 100644 index 0000000..f774384 --- /dev/null +++ b/research/inner_decompiled/scripts/mx/core/FlexBitmap.as @@ -0,0 +1,35 @@ +package mx.core +{ + import flash.display.Bitmap; + import flash.display.BitmapData; + import mx.utils.NameUtil; + + use namespace mx_internal; + + public class FlexBitmap extends Bitmap + { + + mx_internal static const VERSION:String = "4.1.0.16076"; + + public function FlexBitmap(param1:BitmapData = null, param2:String = "auto", param3:Boolean = false) + { + var bitmapData:BitmapData = param1; + var pixelSnapping:String = param2; + var smoothing:Boolean = param3; + super(bitmapData,pixelSnapping,smoothing); + try + { + name = NameUtil.createUniqueName(this); + } + catch(e:Error) + { + } + } + + override public function toString() : String + { + return NameUtil.displayObjectToString(this); + } + } +} + diff --git a/research/inner_decompiled/scripts/mx/core/FontAsset.as b/research/inner_decompiled/scripts/mx/core/FontAsset.as new file mode 100644 index 0000000..1843007 --- /dev/null +++ b/research/inner_decompiled/scripts/mx/core/FontAsset.as @@ -0,0 +1,18 @@ +package mx.core +{ + import flash.text.Font; + + use namespace mx_internal; + + public class FontAsset extends Font implements IFlexAsset + { + + mx_internal static const VERSION:String = "4.1.0.16076"; + + public function FontAsset() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/mx/core/IAssetLayoutFeatures.as b/research/inner_decompiled/scripts/mx/core/IAssetLayoutFeatures.as new file mode 100644 index 0000000..80cb3fc --- /dev/null +++ b/research/inner_decompiled/scripts/mx/core/IAssetLayoutFeatures.as @@ -0,0 +1,90 @@ +package mx.core +{ + import flash.geom.Matrix; + import flash.geom.Matrix3D; + + public interface IAssetLayoutFeatures + { + + function set layoutX(param1:Number) : void; + + function get layoutX() : Number; + + function set layoutY(param1:Number) : void; + + function get layoutY() : Number; + + function set layoutZ(param1:Number) : void; + + function get layoutZ() : Number; + + function get layoutWidth() : Number; + + function set layoutWidth(param1:Number) : void; + + function set transformX(param1:Number) : void; + + function get transformX() : Number; + + function set transformY(param1:Number) : void; + + function get transformY() : Number; + + function set transformZ(param1:Number) : void; + + function get transformZ() : Number; + + function set layoutRotationX(param1:Number) : void; + + function get layoutRotationX() : Number; + + function set layoutRotationY(param1:Number) : void; + + function get layoutRotationY() : Number; + + function set layoutRotationZ(param1:Number) : void; + + function get layoutRotationZ() : Number; + + function set layoutScaleX(param1:Number) : void; + + function get layoutScaleX() : Number; + + function set layoutScaleY(param1:Number) : void; + + function get layoutScaleY() : Number; + + function set layoutScaleZ(param1:Number) : void; + + function get layoutScaleZ() : Number; + + function set layoutMatrix(param1:Matrix) : void; + + function get layoutMatrix() : Matrix; + + function set layoutMatrix3D(param1:Matrix3D) : void; + + function get layoutMatrix3D() : Matrix3D; + + function get is3D() : Boolean; + + function get layoutIs3D() : Boolean; + + function get mirror() : Boolean; + + function set mirror(param1:Boolean) : void; + + function get stretchX() : Number; + + function set stretchX(param1:Number) : void; + + function get stretchY() : Number; + + function set stretchY(param1:Number) : void; + + function get computedMatrix() : Matrix; + + function get computedMatrix3D() : Matrix3D; + } +} + diff --git a/research/inner_decompiled/scripts/mx/core/IFlexAsset.as b/research/inner_decompiled/scripts/mx/core/IFlexAsset.as new file mode 100644 index 0000000..424a045 --- /dev/null +++ b/research/inner_decompiled/scripts/mx/core/IFlexAsset.as @@ -0,0 +1,9 @@ +package mx.core +{ + public interface IFlexAsset + { + + + } +} + diff --git a/research/inner_decompiled/scripts/mx/core/IFlexDisplayObject.as b/research/inner_decompiled/scripts/mx/core/IFlexDisplayObject.as new file mode 100644 index 0000000..d428a1d --- /dev/null +++ b/research/inner_decompiled/scripts/mx/core/IFlexDisplayObject.as @@ -0,0 +1,126 @@ +package mx.core +{ + import flash.accessibility.AccessibilityProperties; + import flash.display.DisplayObject; + import flash.display.DisplayObjectContainer; + import flash.display.IBitmapDrawable; + import flash.display.LoaderInfo; + import flash.display.Stage; + import flash.events.IEventDispatcher; + import flash.geom.Point; + import flash.geom.Rectangle; + import flash.geom.Transform; + + public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher + { + + function get root() : DisplayObject; + + function get stage() : Stage; + + function get name() : String; + + function set name(param1:String) : void; + + function get parent() : DisplayObjectContainer; + + function get mask() : DisplayObject; + + function set mask(param1:DisplayObject) : void; + + function get visible() : Boolean; + + function set visible(param1:Boolean) : void; + + function get x() : Number; + + function set x(param1:Number) : void; + + function get y() : Number; + + function set y(param1:Number) : void; + + function get scaleX() : Number; + + function set scaleX(param1:Number) : void; + + function get scaleY() : Number; + + function set scaleY(param1:Number) : void; + + function get mouseX() : Number; + + function get mouseY() : Number; + + function get rotation() : Number; + + function set rotation(param1:Number) : void; + + function get alpha() : Number; + + function set alpha(param1:Number) : void; + + function get width() : Number; + + function set width(param1:Number) : void; + + function get height() : Number; + + function set height(param1:Number) : void; + + function get cacheAsBitmap() : Boolean; + + function set cacheAsBitmap(param1:Boolean) : void; + + function get opaqueBackground() : Object; + + function set opaqueBackground(param1:Object) : void; + + function get scrollRect() : Rectangle; + + function set scrollRect(param1:Rectangle) : void; + + function get filters() : Array; + + function set filters(param1:Array) : void; + + function get blendMode() : String; + + function set blendMode(param1:String) : void; + + function get transform() : Transform; + + function set transform(param1:Transform) : void; + + function get scale9Grid() : Rectangle; + + function set scale9Grid(param1:Rectangle) : void; + + function globalToLocal(param1:Point) : Point; + + function localToGlobal(param1:Point) : Point; + + function getBounds(param1:DisplayObject) : Rectangle; + + function getRect(param1:DisplayObject) : Rectangle; + + function get loaderInfo() : LoaderInfo; + + function hitTestObject(param1:DisplayObject) : Boolean; + + function hitTestPoint(param1:Number, param2:Number, param3:Boolean = false) : Boolean; + + function get accessibilityProperties() : AccessibilityProperties; + + function set accessibilityProperties(param1:AccessibilityProperties) : void; + + function get measuredHeight() : Number; + + function get measuredWidth() : Number; + + function move(param1:Number, param2:Number) : void; + + function setActualSize(param1:Number, param2:Number) : void; + } +} + diff --git a/research/inner_decompiled/scripts/mx/core/ILayoutDirectionElement.as b/research/inner_decompiled/scripts/mx/core/ILayoutDirectionElement.as new file mode 100644 index 0000000..bee789d --- /dev/null +++ b/research/inner_decompiled/scripts/mx/core/ILayoutDirectionElement.as @@ -0,0 +1,13 @@ +package mx.core +{ + public interface ILayoutDirectionElement + { + + function get layoutDirection() : String; + + function set layoutDirection(param1:String) : void; + + function invalidateLayoutDirection() : void; + } +} + diff --git a/research/inner_decompiled/scripts/mx/core/IRepeaterClient.as b/research/inner_decompiled/scripts/mx/core/IRepeaterClient.as new file mode 100644 index 0000000..dfd6622 --- /dev/null +++ b/research/inner_decompiled/scripts/mx/core/IRepeaterClient.as @@ -0,0 +1,23 @@ +package mx.core +{ + public interface IRepeaterClient + { + + function get instanceIndices() : Array; + + function set instanceIndices(param1:Array) : void; + + function get isDocument() : Boolean; + + function get repeaterIndices() : Array; + + function set repeaterIndices(param1:Array) : void; + + function get repeaters() : Array; + + function set repeaters(param1:Array) : void; + + function initializeRepeaterArrays(param1:IRepeaterClient) : void; + } +} + diff --git a/research/inner_decompiled/scripts/mx/core/SoundAsset.as b/research/inner_decompiled/scripts/mx/core/SoundAsset.as new file mode 100644 index 0000000..df568a1 --- /dev/null +++ b/research/inner_decompiled/scripts/mx/core/SoundAsset.as @@ -0,0 +1,18 @@ +package mx.core +{ + import flash.media.Sound; + + use namespace mx_internal; + + public class SoundAsset extends Sound implements IFlexAsset + { + + mx_internal static const VERSION:String = "4.1.0.16076"; + + public function SoundAsset() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/mx/core/mx_internal.as b/research/inner_decompiled/scripts/mx/core/mx_internal.as new file mode 100644 index 0000000..af32887 --- /dev/null +++ b/research/inner_decompiled/scripts/mx/core/mx_internal.as @@ -0,0 +1,5 @@ +package mx.core +{ + public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal"; +} + diff --git a/research/inner_decompiled/scripts/mx/utils/NameUtil.as b/research/inner_decompiled/scripts/mx/utils/NameUtil.as new file mode 100644 index 0000000..b19863a --- /dev/null +++ b/research/inner_decompiled/scripts/mx/utils/NameUtil.as @@ -0,0 +1,97 @@ +package mx.utils +{ + import flash.display.DisplayObject; + import flash.utils.getQualifiedClassName; + import mx.core.IRepeaterClient; + import mx.core.mx_internal; + + use namespace mx_internal; + + public class NameUtil + { + + mx_internal static const VERSION:String = "4.1.0.16076"; + + private static var counter:int = 0; + + public function NameUtil() + { + super(); + } + + public static function createUniqueName(param1:Object) : String + { + if(!param1) + { + return null; + } + var _loc2_:String = getQualifiedClassName(param1); + var _loc3_:int = _loc2_.indexOf("::"); + if(_loc3_ != -1) + { + _loc2_ = _loc2_.substr(_loc3_ + 2); + } + var _loc4_:int = _loc2_.charCodeAt(_loc2_.length - 1); + if(_loc4_ >= 48 && _loc4_ <= 57) + { + _loc2_ += "_"; + } + return _loc2_ + counter++; + } + + public static function displayObjectToString(param1:DisplayObject) : String + { + var result:String = null; + var o:DisplayObject = null; + var s:String = null; + var indices:Array = null; + var displayObject:DisplayObject = param1; + try + { + o = displayObject; + while(o != null) + { + if(Boolean(o.parent) && Boolean(o.stage) && o.parent == o.stage) + { + break; + } + s = "id" in o && Boolean(o["id"]) ? o["id"] : o.name; + if(o is IRepeaterClient) + { + indices = IRepeaterClient(o).instanceIndices; + if(indices) + { + s += "[" + indices.join("][") + "]"; + } + } + result = result == null ? s : s + "." + result; + o = o.parent; + } + } + catch(e:SecurityError) + { + } + return result; + } + + public static function getUnqualifiedClassName(param1:Object) : String + { + var _loc2_:String = null; + if(param1 is String) + { + _loc2_ = param1 as String; + } + else + { + _loc2_ = getQualifiedClassName(param1); + } + var _loc3_:int = _loc2_.indexOf("::"); + if(_loc3_ != -1) + { + _loc2_ = _loc2_.substr(_loc3_ + 2); + } + return _loc2_; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxBasic.as b/research/inner_decompiled/scripts/org/flixel/FlxBasic.as new file mode 100644 index 0000000..115fd9f --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxBasic.as @@ -0,0 +1,94 @@ +package org.flixel +{ + public class FlxBasic + { + + internal static var _ACTIVECOUNT:uint; + + internal static var _VISIBLECOUNT:uint; + + public var ID:int; + + public var exists:Boolean; + + public var active:Boolean; + + public var visible:Boolean; + + public var alive:Boolean; + + public var cameras:Array; + + public var ignoreDrawDebug:Boolean; + + public function FlxBasic() + { + super(); + this.ID = -1; + this.exists = true; + this.active = true; + this.visible = true; + this.alive = true; + this.ignoreDrawDebug = false; + } + + public function destroy() : void + { + } + + public function preUpdate() : void + { + ++_ACTIVECOUNT; + } + + public function update() : void + { + } + + public function postUpdate() : void + { + } + + public function draw() : void + { + var _loc1_:FlxCamera = null; + if(this.cameras == null) + { + this.cameras = FlxG.cameras; + } + var _loc2_:uint = 0; + var _loc3_:uint = this.cameras.length; + while(_loc2_ < _loc3_) + { + _loc1_ = this.cameras[_loc2_++]; + ++_VISIBLECOUNT; + if(FlxG.visualDebug && !this.ignoreDrawDebug) + { + this.drawDebug(_loc1_); + } + } + } + + public function drawDebug(param1:FlxCamera = null) : void + { + } + + public function kill() : void + { + this.alive = false; + this.exists = false; + } + + public function revive() : void + { + this.alive = true; + this.exists = true; + } + + public function toString() : String + { + return FlxU.getClassName(this,true); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxBitmapFont.as b/research/inner_decompiled/scripts/org/flixel/FlxBitmapFont.as new file mode 100644 index 0000000..3cfd549 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxBitmapFont.as @@ -0,0 +1,111 @@ +package org.flixel +{ + import flash.display.BitmapData; + import flash.geom.Rectangle; + + public class FlxBitmapFont + { + + private var imgDefaultFont:Class = FlxBitmapFont_imgDefaultFont; + + public var rects:Array; + + public var horizontalPadding:int; + + public var verticalPadding:int; + + public var pixels:BitmapData; + + public var height:uint; + + private var _alphabet:String; + + public function FlxBitmapFont(param1:Class = null, param2:uint = 0, param3:uint = 5, param4:int = 1, param5:int = 5, param6:String = " !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~") + { + var _loc8_:uint = 0; + var _loc11_:uint = 0; + var _loc12_:uint = 0; + super(); + if(param1 == null) + { + param1 = this.imgDefaultFont; + } + this.pixels = FlxG.addBitmap(param1); + this.height = param3; + this.verticalPadding = param5; + this.horizontalPadding = param4; + this._alphabet = param6; + this.rects = new Array(); + var _loc7_:uint = this.pixels.getPixel(0,0); + if(param2 == 0) + { + _loc8_ = 1; + } + else + { + _loc8_ = 0; + } + var _loc9_:uint = 0; + var _loc10_:Number = 0; + if(param2 == 0) + { + _loc12_ = 0; + loop1: + while(_loc12_ < int(this.pixels.height / this.height)) + { + _loc11_ = 0; + while(true) + { + if(_loc11_ >= this.pixels.width) + { + _loc8_ += this.height + 1; + _loc9_ = 0; + _loc12_++; + continue loop1; + } + if(this.pixels.getPixel(_loc11_,_loc8_ - 1) == _loc7_) + { + this.rects[this._alphabet.charCodeAt(_loc10_ - 1)] = new Rectangle(_loc9_,_loc8_,_loc11_ - _loc9_,this.height); + _loc10_++; + _loc9_ = _loc11_ + 1; + } + if(_loc10_ > this._alphabet.length) + { + break; + } + _loc11_++; + } + return; + } + } + else + { + _loc12_ = 0; + loop0: + while(_loc12_ < int(this.pixels.height / this.height)) + { + _loc11_ = 0; + while(true) + { + if(_loc11_ >= this.pixels.width / param2) + { + _loc8_ += this.height; + _loc9_ = 0; + _loc12_++; + continue loop0; + } + this.rects[this._alphabet.charCodeAt(_loc10_ - 1)] = new Rectangle(_loc9_,_loc8_,param2,this.height); + _loc9_ = _loc11_ * param2; + if(++_loc10_ > this._alphabet.length) + { + break; + } + _loc11_++; + } + return; + } + } + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxBitmapFont_imgDefaultFont.as b/research/inner_decompiled/scripts/org/flixel/FlxBitmapFont_imgDefaultFont.as new file mode 100644 index 0000000..13d36c9 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxBitmapFont_imgDefaultFont.as @@ -0,0 +1,15 @@ +package org.flixel +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/176_org.flixel.FlxBitmapFont_imgDefaultFont.png")] + public class FlxBitmapFont_imgDefaultFont extends BitmapAsset + { + + public function FlxBitmapFont_imgDefaultFont() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxBitmapText.as b/research/inner_decompiled/scripts/org/flixel/FlxBitmapText.as new file mode 100644 index 0000000..942faea --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxBitmapText.as @@ -0,0 +1,359 @@ +package org.flixel +{ + import flash.display.BitmapData; + import flash.geom.ColorTransform; + import flash.geom.Point; + import flash.geom.Rectangle; + + public class FlxBitmapText extends FlxObject + { + + protected static var _defaultFont:FlxBitmapFont; + + protected var _pixels:BitmapData; + + protected var _p:Point; + + protected var _frect:Rectangle; + + protected var _cTransform:ColorTransform = new ColorTransform(); + + protected var _font:FlxBitmapFont; + + protected var _text:String; + + protected var _alignment:String; + + protected var _overrideWidth:int; + + protected var _colorFont:Boolean; + + protected var _lineWrap:Boolean; + + protected var _splitLines:Array; + + protected var _lineWidths:Array; + + protected var _debugRender:Boolean = false; + + public var truewidth:int; + + public function FlxBitmapText(param1:int, param2:int, param3:FlxBitmapFont, param4:String = " ", param5:String = "left", param6:Number = 0, param7:Boolean = false) + { + if(param3 == null) + { + param3 = _defaultFont ? _defaultFont : new FlxBitmapFont(); + } + this._font = param3; + this._alignment = param5.toLowerCase(); + super(); + immovable = true; + x = param1; + y = param2; + width = param6; + this.truewidth = param6; + this._cTransform.alphaMultiplier = 1; + this._lineWrap = true; + this._p = new Point(); + this._colorFont = param7; + this.text = param4; + } + + public function get lines() : Array + { + return this._splitLines; + } + + public function calcFrame() : void + { + var _loc1_:uint = 0; + var _loc2_:uint = 0; + var _loc3_:uint = 0; + if(this._pixels) + { + this._pixels.dispose(); + } + this._pixels = new BitmapData(width,height,true,0); + var _loc4_:uint = 0; + _loc1_ = 0; + while(_loc1_ < this._splitLines.length) + { + switch(this._alignment) + { + case "left": + _loc3_ = 0; + break; + case "center": + _loc3_ = uint(int((width - this._lineWidths[_loc1_]) / 2)); + break; + case "right": + _loc3_ = width - this._lineWidths[_loc1_]; + } + _loc2_ = 0; + while(_loc2_ < this._splitLines[_loc1_].length) + { + if(this._font.rects[this._splitLines[_loc1_].charCodeAt(_loc2_)]) + { + this._p.x = _loc3_ + (this.overrideWidth ? Math.floor((this.overrideWidth - this._font.rects[this._splitLines[_loc1_].charCodeAt(_loc2_)].width) / 2) : 0); + this._p.y = _loc4_; + this._pixels.copyPixels(this._font.pixels,this._font.rects[this._splitLines[_loc1_].charCodeAt(_loc2_)],this._p,null,null,true); + _loc3_ += (this.overrideWidth ? this.overrideWidth : this._font.rects[this._splitLines[_loc1_].charCodeAt(_loc2_)].width) + this._font.horizontalPadding; + } + _loc2_++; + } + _loc4_ += this._font.height + this._font.verticalPadding; + _loc1_++; + } + this._frect = new Rectangle(0,0,width,height); + this._pixels.colorTransform(this._frect,this._cTransform); + } + + protected function charWidth(param1:uint) : int + { + if(this._font.rects[param1] == null) + { + return 0; + } + return (this.overrideWidth ? this.overrideWidth : this._font.rects[param1].width) + this._font.horizontalPadding; + } + + public function splitLines(param1:String, param2:int) : Array + { + var _loc3_:Array = null; + var _loc4_:String = null; + var _loc5_:int = 0; + var _loc6_:String = null; + var _loc7_:int = 0; + var _loc8_:int = 0; + var _loc9_:int = 0; + param1 += " "; + if(this._lineWrap && width > 0) + { + _loc3_ = new Array(); + _loc4_ = ""; + _loc5_ = 0; + _loc6_ = ""; + _loc7_ = 0; + _loc8_ = 0; + while(_loc8_ < param1.length) + { + _loc9_ = param1.charCodeAt(_loc8_); + if(_loc9_ == 32) + { + _loc4_.replace(/^\s+|\s+$/g,""); + if(_loc4_.length) + { + if(_loc7_ + _loc5_ >= param2) + { + _loc3_.push(_loc6_); + _loc6_ = _loc4_; + _loc7_ = _loc5_; + } + else + { + _loc6_ += (_loc6_.length ? " " : "") + _loc4_; + _loc7_ += _loc5_ + (_loc6_.length ? this.charWidth(32) : 0); + } + } + _loc4_ = ""; + _loc5_ = 0; + } + else if(_loc9_ == 10) + { + _loc3_.push(_loc6_ + " " + _loc4_); + _loc6_ = ""; + _loc7_ = 0; + _loc4_ = ""; + _loc5_ = 0; + } + else + { + _loc4_ += String.fromCharCode(_loc9_); + _loc5_ += this.charWidth(_loc9_) + this._font.horizontalPadding; + } + _loc8_++; + } + if(_loc4_.length) + { + _loc3_.push(_loc6_); + _loc6_ = _loc4_; + } + if(_loc6_.length) + { + _loc3_.push(_loc6_); + } + } + else + { + _loc3_ = this._text.split("\n"); + } + return _loc3_; + } + + protected function calcLineWidths() : void + { + var _loc2_:int = 0; + height = 0; + this._lineWidths = new Array(); + var _loc1_:int = 0; + while(_loc1_ < this._splitLines.length) + { + this._lineWidths[_loc1_] = 0; + _loc2_ = 0; + while(_loc2_ < this._splitLines[_loc1_].length) + { + if(this._font.rects[this._splitLines[_loc1_].charCodeAt(_loc2_)]) + { + this._lineWidths[_loc1_] += this.charWidth(this._splitLines[_loc1_].charCodeAt(_loc2_)); + } + _loc2_++; + } + this._lineWidths[_loc1_] -= this._font.horizontalPadding; + if(this._lineWidths[_loc1_] > width) + { + width = this._lineWidths[_loc1_]; + } + height += this._font.height + this._font.verticalPadding; + _loc1_++; + } + height -= this._font.verticalPadding; + if(width < 1 || height < 1) + { + width = 1; + height = 1; + } + } + + override public function draw() : void + { + super.draw(); + getScreenXY(_point); + if(this._debugRender) + { + FlxG.camera.buffer.fillRect(new Rectangle(_point.x,_point.y,width,height),4278255360); + FlxG.camera.buffer.fillRect(new Rectangle(_point.x + 1,_point.y + 1,width - 2,height - 2),0); + } + this._p.x = _point.x; + this._p.y = _point.y; + FlxG.camera.buffer.copyPixels(this._pixels,this._frect,this._p,null,null,true); + } + + public function set text(param1:String) : void + { + width = this.truewidth; + this._text = param1; + this._splitLines = this.splitLines(this._text,width); + this.calcLineWidths(); + this.calcFrame(); + } + + public function get text() : String + { + return this._text; + } + + public function set overrideWidth(param1:int) : void + { + this._overrideWidth = param1; + } + + public function get overrideWidth() : int + { + return this._overrideWidth; + } + + public function set lineWrap(param1:Boolean) : void + { + this._lineWrap = param1; + } + + public function get lineWrap() : Boolean + { + return this._lineWrap; + } + + public function set alignment(param1:String) : void + { + this._alignment = param1.toLowerCase(); + this.calcFrame(); + } + + public function get alignment() : String + { + return this._alignment; + } + + public function set color(param1:uint) : void + { + this._cTransform.color = param1; + this.calcFrame(); + } + + public function get color() : uint + { + return this._cTransform.color; + } + + public function set debugRender(param1:Boolean) : void + { + this._debugRender = param1; + } + + public function set colorFont(param1:Boolean) : void + { + this._colorFont = param1; + this.calcFrame(); + } + + public function get colorFont() : Boolean + { + return this._colorFont; + } + + public function set alpha(param1:Number) : void + { + if(param1 > 1) + { + param1 = 1; + } + if(param1 < 0) + { + param1 = 0; + } + if(param1 == this._cTransform.alphaMultiplier) + { + return; + } + this._cTransform.alphaMultiplier = param1; + this.calcFrame(); + } + + public function get alpha() : Number + { + return this._cTransform.alphaMultiplier; + } + + public function set font(param1:FlxBitmapFont) : void + { + if(param1 == null) + { + param1 = _defaultFont ? _defaultFont : new FlxBitmapFont(); + } + this._font = param1; + this.calcFrame(); + } + + public function get font() : FlxBitmapFont + { + return this._font; + } + + override public function destroy() : void + { + super.destroy(); + this._font = null; + this._pixels.dispose(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxCamera.as b/research/inner_decompiled/scripts/org/flixel/FlxCamera.as new file mode 100644 index 0000000..96733be --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxCamera.as @@ -0,0 +1,542 @@ +package org.flixel +{ + import flash.display.Bitmap; + import flash.display.BitmapData; + import flash.display.Sprite; + import flash.geom.ColorTransform; + import flash.geom.Point; + import flash.geom.Rectangle; + + public class FlxCamera extends FlxBasic + { + + public static var defaultZoom:Number; + + public static const STYLE_LOCKON:uint = 0; + + public static const STYLE_PLATFORMER:uint = 1; + + public static const STYLE_TOPDOWN:uint = 2; + + public static const STYLE_TOPDOWN_TIGHT:uint = 3; + + public static const STYLE_SCREEN_BY_SCREEN:uint = 4; + + public static const SHAKE_BOTH_AXES:uint = 0; + + public static const SHAKE_HORIZONTAL_ONLY:uint = 1; + + public static const SHAKE_VERTICAL_ONLY:uint = 2; + + public var x:Number; + + public var y:Number; + + public var width:uint; + + public var height:uint; + + public var style:uint; + + public var target:FlxObject; + + public var deadzone:FlxRect; + + public var bounds:FlxRect; + + public var scroll:FlxPoint; + + public var buffer:BitmapData; + + public var bgColor:uint; + + public var screen:FlxSprite; + + protected var _zoom:Number; + + protected var _point:FlxPoint; + + protected var _color:uint; + + protected var _flashBitmap:Bitmap; + + internal var _flashSprite:Sprite; + + internal var _flashOffsetX:Number; + + internal var _flashOffsetY:Number; + + protected var _flashRect:Rectangle; + + protected var _flashPoint:Point; + + protected var _fxFlashColor:uint; + + protected var _fxFlashDuration:Number; + + protected var _fxFlashComplete:Function; + + protected var _fxFlashAlpha:Number; + + protected var _fxFadeColor:uint; + + protected var _fxFadeDuration:Number; + + protected var _fxFadeComplete:Function; + + protected var _fxFadeAlpha:Number; + + protected var _fxShakeIntensity:Number; + + protected var _fxShakeDuration:Number; + + protected var _fxShakeComplete:Function; + + protected var _fxShakeOffset:FlxPoint; + + protected var _fxShakeDirection:uint; + + protected var _fill:BitmapData; + + public function FlxCamera(param1:int, param2:int, param3:int, param4:int, param5:Number = 0) + { + super(); + this.x = param1; + this.y = param2; + this.width = param3; + this.height = param4; + this.target = null; + this.deadzone = null; + this.scroll = new FlxPoint(); + this._point = new FlxPoint(); + this.bounds = null; + this.screen = new FlxSprite(); + this.screen.makeGraphic(this.width,this.height,0,true); + this.screen.setOriginToCorner(); + this.buffer = this.screen.pixels; + this.bgColor = FlxG.bgColor; + this._color = 16777215; + this._flashBitmap = new Bitmap(this.buffer); + this._flashBitmap.x = -this.width * 0.5; + this._flashBitmap.y = -this.height * 0.5; + this._flashSprite = new Sprite(); + this.zoom = param5; + this._flashOffsetX = this.width * 0.5 * this.zoom; + this._flashOffsetY = this.height * 0.5 * this.zoom; + this._flashSprite.x = this.x + this._flashOffsetX; + this._flashSprite.y = this.y + this._flashOffsetY; + this._flashSprite.addChild(this._flashBitmap); + this._flashRect = new Rectangle(0,0,this.width,this.height); + this._flashPoint = new Point(); + this._fxFlashColor = 0; + this._fxFlashDuration = 0; + this._fxFlashComplete = null; + this._fxFlashAlpha = 0; + this._fxFadeColor = 0; + this._fxFadeDuration = 0; + this._fxFadeComplete = null; + this._fxFadeAlpha = 0; + this._fxShakeIntensity = 0; + this._fxShakeDuration = 0; + this._fxShakeComplete = null; + this._fxShakeOffset = new FlxPoint(); + this._fxShakeDirection = 0; + this._fill = new BitmapData(this.width,this.height,true,0); + } + + override public function destroy() : void + { + this.screen.destroy(); + this.screen = null; + this.target = null; + this.scroll = null; + this.deadzone = null; + this.bounds = null; + this.buffer = null; + this._flashBitmap = null; + this._flashRect = null; + this._flashPoint = null; + this._fxFlashComplete = null; + this._fxFadeComplete = null; + this._fxShakeComplete = null; + this._fxShakeOffset = null; + this._fill = null; + } + + override public function update() : void + { + var _loc1_:Number = NaN; + var _loc2_:Number = NaN; + var _loc3_:Number = NaN; + if(this.target != null) + { + if(this.deadzone == null) + { + this.focusOn(this.target.getMidpoint(this._point)); + } + else + { + _loc2_ = FlxU.ceil(this.target.x + (this.target.x > 0 ? 1e-7 : -1e-7)); + _loc3_ = FlxU.ceil(this.target.y + (this.target.y > 0 ? 1e-7 : -1e-7)); + if(this.style == STYLE_SCREEN_BY_SCREEN) + { + if(_loc2_ > this.scroll.x + this.width) + { + this.scroll.x += this.width; + } + else if(_loc2_ < this.scroll.x) + { + this.scroll.x -= this.width; + } + if(_loc3_ > this.scroll.y + this.height) + { + this.scroll.y += this.height; + } + else if(_loc3_ < this.scroll.y) + { + this.scroll.y -= this.height; + } + } + else + { + _loc1_ = _loc2_ - this.deadzone.x; + if(this.scroll.x > _loc1_) + { + this.scroll.x = _loc1_; + } + _loc1_ = _loc2_ + this.target.width - this.deadzone.x - this.deadzone.width; + if(this.scroll.x < _loc1_) + { + this.scroll.x = _loc1_; + } + _loc1_ = _loc3_ - this.deadzone.y; + if(this.scroll.y > _loc1_) + { + this.scroll.y = _loc1_; + } + _loc1_ = _loc3_ + this.target.height - this.deadzone.y - this.deadzone.height; + if(this.scroll.y < _loc1_) + { + this.scroll.y = _loc1_; + } + } + } + } + if(this.bounds != null) + { + if(this.scroll.x < this.bounds.left) + { + this.scroll.x = this.bounds.left; + } + if(this.scroll.x > this.bounds.right - this.width) + { + this.scroll.x = this.bounds.right - this.width; + } + if(this.scroll.y < this.bounds.top) + { + this.scroll.y = this.bounds.top; + } + if(this.scroll.y > this.bounds.bottom - this.height) + { + this.scroll.y = this.bounds.bottom - this.height; + } + } + if(this._fxFlashAlpha > 0) + { + this._fxFlashAlpha -= FlxG.elapsed / this._fxFlashDuration; + if(this._fxFlashAlpha <= 0 && this._fxFlashComplete != null) + { + this._fxFlashComplete(); + } + } + if(this._fxFadeAlpha > 0 && this._fxFadeAlpha < 1) + { + this._fxFadeAlpha += FlxG.elapsed / this._fxFadeDuration; + if(this._fxFadeAlpha >= 1) + { + this._fxFadeAlpha = 1; + if(this._fxFadeComplete != null) + { + this._fxFadeComplete(); + } + } + } + if(this._fxShakeDuration > 0) + { + this._fxShakeDuration -= FlxG.elapsed; + if(this._fxShakeDuration <= 0) + { + this._fxShakeOffset.make(); + if(this._fxShakeComplete != null) + { + this._fxShakeComplete(); + } + } + else + { + if(this._fxShakeDirection == SHAKE_BOTH_AXES || this._fxShakeDirection == SHAKE_HORIZONTAL_ONLY) + { + this._fxShakeOffset.x = (FlxG.random() * this._fxShakeIntensity * this.width * 2 - this._fxShakeIntensity * this.width) * this._zoom; + } + if(this._fxShakeDirection == SHAKE_BOTH_AXES || this._fxShakeDirection == SHAKE_VERTICAL_ONLY) + { + this._fxShakeOffset.y = (FlxG.random() * this._fxShakeIntensity * this.height * 2 - this._fxShakeIntensity * this.height) * this._zoom; + } + } + } + } + + public function follow(param1:FlxObject, param2:uint = 0) : void + { + var _loc3_:Number = NaN; + var _loc4_:Number = NaN; + var _loc5_:Number = NaN; + this.style = param2; + this.target = param1; + if(param1 == null) + { + return; + } + switch(param2) + { + case STYLE_PLATFORMER: + _loc4_ = this.width / 8; + _loc5_ = this.height / 3; + this.deadzone = new FlxRect((this.width - _loc4_) / 2,(this.height - _loc5_) / 2 - _loc5_ * 0.25,_loc4_,_loc5_); + break; + case STYLE_TOPDOWN: + _loc3_ = FlxU.max(this.width,this.height) / 4; + this.deadzone = new FlxRect((this.width - _loc3_) / 2,(this.height - _loc3_) / 2,_loc3_,_loc3_); + break; + case STYLE_TOPDOWN_TIGHT: + _loc3_ = FlxU.max(this.width,this.height) / 8; + this.deadzone = new FlxRect((this.width - _loc3_) / 2,(this.height - _loc3_) / 2,_loc3_,_loc3_); + break; + case STYLE_LOCKON: + _loc4_ = this.target.width; + _loc5_ = this.target.height; + this.deadzone = new FlxRect((this.width - _loc4_) / 2,(this.height - _loc5_) / 2 - _loc5_ * 0.25,_loc4_,_loc5_); + break; + case STYLE_SCREEN_BY_SCREEN: + this.deadzone = new FlxRect(0,0,this.width,this.height); + break; + default: + this.deadzone = null; + } + } + + public function focusOn(param1:FlxPoint) : void + { + param1.x += param1.x > 0 ? 1e-7 : -1e-7; + param1.y += param1.y > 0 ? 1e-7 : -1e-7; + this.scroll.make(param1.x - this.width * 0.5,param1.y - this.height * 0.5); + } + + public function setBounds(param1:Number = 0, param2:Number = 0, param3:Number = 0, param4:Number = 0, param5:Boolean = false) : void + { + if(this.bounds == null) + { + this.bounds = new FlxRect(); + } + this.bounds.make(param1,param2,param3,param4); + if(param5) + { + FlxG.worldBounds.copyFrom(this.bounds); + } + this.update(); + } + + public function flash(param1:uint = 4294967295, param2:Number = 1, param3:Function = null, param4:Boolean = false) : void + { + if(!param4 && this._fxFlashAlpha > 0) + { + return; + } + this._fxFlashColor = param1; + if(param2 <= 0) + { + param2 = Number.MIN_VALUE; + } + this._fxFlashDuration = param2; + this._fxFlashComplete = param3; + this._fxFlashAlpha = 1; + } + + public function fade(param1:uint = 4278190080, param2:Number = 1, param3:Function = null, param4:Boolean = false) : void + { + if(!param4 && this._fxFadeAlpha > 0) + { + return; + } + this._fxFadeColor = param1; + if(param2 <= 0) + { + param2 = Number.MIN_VALUE; + } + this._fxFadeDuration = param2; + this._fxFadeComplete = param3; + this._fxFadeAlpha = Number.MIN_VALUE; + } + + public function shake(param1:Number = 0.05, param2:Number = 0.5, param3:Function = null, param4:Boolean = true, param5:uint = 0) : void + { + if(!param4 && (this._fxShakeOffset.x != 0 || this._fxShakeOffset.y != 0)) + { + return; + } + this._fxShakeIntensity = param1; + this._fxShakeDuration = param2; + this._fxShakeComplete = param3; + this._fxShakeDirection = param5; + this._fxShakeOffset.make(); + } + + public function stopFX() : void + { + this._fxFlashAlpha = 0; + this._fxFadeAlpha = 0; + this._fxShakeDuration = 0; + this._flashSprite.x = this.x + this.width * 0.5; + this._flashSprite.y = this.y + this.height * 0.5; + } + + public function copyFrom(param1:FlxCamera) : FlxCamera + { + if(param1.bounds == null) + { + this.bounds = null; + } + else + { + if(this.bounds == null) + { + this.bounds = new FlxRect(); + } + this.bounds.copyFrom(param1.bounds); + } + this.target = param1.target; + if(this.target != null) + { + if(param1.deadzone == null) + { + this.deadzone = null; + } + else + { + if(this.deadzone == null) + { + this.deadzone = new FlxRect(); + } + this.deadzone.copyFrom(param1.deadzone); + } + } + return this; + } + + public function get zoom() : Number + { + return this._zoom; + } + + public function set zoom(param1:Number) : void + { + if(param1 == 0) + { + this._zoom = defaultZoom; + } + else + { + this._zoom = param1; + } + this.setScale(this._zoom,this._zoom); + } + + public function get alpha() : Number + { + return this._flashBitmap.alpha; + } + + public function set alpha(param1:Number) : void + { + this._flashBitmap.alpha = param1; + } + + public function get angle() : Number + { + return this._flashSprite.rotation; + } + + public function set angle(param1:Number) : void + { + this._flashSprite.rotation = param1; + } + + public function get color() : uint + { + return this._color; + } + + public function set color(param1:uint) : void + { + this._color = param1; + var _loc2_:ColorTransform = this._flashBitmap.transform.colorTransform; + _loc2_.redMultiplier = (this._color >> 16) * 0.00392; + _loc2_.greenMultiplier = (this._color >> 8 & 0xFF) * 0.00392; + _loc2_.blueMultiplier = (this._color & 0xFF) * 0.00392; + this._flashBitmap.transform.colorTransform = _loc2_; + } + + public function get antialiasing() : Boolean + { + return this._flashBitmap.smoothing; + } + + public function set antialiasing(param1:Boolean) : void + { + this._flashBitmap.smoothing = param1; + } + + public function getScale() : FlxPoint + { + return this._point.make(this._flashSprite.scaleX,this._flashSprite.scaleY); + } + + public function setScale(param1:Number, param2:Number) : void + { + this._flashSprite.scaleX = param1; + this._flashSprite.scaleY = param2; + } + + public function getContainerSprite() : Sprite + { + return this._flashSprite; + } + + public function fill(param1:uint, param2:Boolean = true) : void + { + this._fill.fillRect(this._flashRect,param1); + this.buffer.copyPixels(this._fill,this._flashRect,this._flashPoint,null,null,param2); + } + + internal function drawFX() : void + { + var _loc1_:Number = NaN; + if(this._fxFlashAlpha > 0) + { + _loc1_ = this._fxFlashColor >> 24; + this.fill((uint((_loc1_ <= 0 ? 255 : _loc1_) * this._fxFlashAlpha) << 24) + (this._fxFlashColor & 0xFFFFFF)); + } + if(this._fxFadeAlpha > 0) + { + _loc1_ = this._fxFadeColor >> 24; + this.fill((uint((_loc1_ <= 0 ? 255 : _loc1_) * this._fxFadeAlpha) << 24) + (this._fxFadeColor & 0xFFFFFF)); + } + if(this._fxShakeOffset.x != 0 || this._fxShakeOffset.y != 0) + { + this._flashSprite.x = this.x + this._flashOffsetX + this._fxShakeOffset.x; + this._flashSprite.y = this.y + this._flashOffsetY + this._fxShakeOffset.y; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxEmitter.as b/research/inner_decompiled/scripts/org/flixel/FlxEmitter.as new file mode 100644 index 0000000..4c6d28e --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxEmitter.as @@ -0,0 +1,275 @@ +package org.flixel +{ + public class FlxEmitter extends FlxGroup + { + + public var x:Number; + + public var y:Number; + + public var width:Number; + + public var height:Number; + + public var minParticleSpeed:FlxPoint; + + public var maxParticleSpeed:FlxPoint; + + public var particleDrag:FlxPoint; + + public var minRotation:Number; + + public var maxRotation:Number; + + public var gravity:Number; + + public var on:Boolean; + + public var frequency:Number; + + public var lifespan:Number; + + public var bounce:Number; + + public var particleClass:Class; + + protected var _quantity:uint; + + protected var _explode:Boolean; + + protected var _timer:Number; + + protected var _counter:uint; + + protected var _point:FlxPoint; + + public function FlxEmitter(param1:Number = 0, param2:Number = 0, param3:Number = 0) + { + super(param3); + this.x = param1; + this.y = param2; + this.width = 0; + this.height = 0; + this.minParticleSpeed = new FlxPoint(-100,-100); + this.maxParticleSpeed = new FlxPoint(100,100); + this.minRotation = -360; + this.maxRotation = 360; + this.gravity = 0; + this.particleClass = null; + this.particleDrag = new FlxPoint(); + this.frequency = 0.1; + this.lifespan = 3; + this.bounce = 0; + this._quantity = 0; + this._counter = 0; + this._explode = true; + this.on = false; + this._point = new FlxPoint(); + } + + override public function destroy() : void + { + this.minParticleSpeed = null; + this.maxParticleSpeed = null; + this.particleDrag = null; + this.particleClass = null; + this._point = null; + super.destroy(); + } + + public function makeParticles(param1:Class, param2:uint = 50, param3:uint = 16, param4:Boolean = false, param5:Number = 0.8) : FlxEmitter + { + var _loc7_:uint = 0; + var _loc8_:FlxParticle = null; + var _loc10_:FlxSprite = null; + maxSize = param2; + var _loc6_:uint = 1; + if(param4) + { + _loc10_ = new FlxSprite(); + _loc10_.loadGraphic(param1,true); + _loc6_ = _loc10_.frames; + _loc10_.destroy(); + } + var _loc9_:uint = 0; + while(_loc9_ < param2) + { + if(this.particleClass == null) + { + _loc8_ = new FlxParticle(); + } + else + { + _loc8_ = new this.particleClass(); + } + if(param4) + { + _loc7_ = FlxG.random() * _loc6_; + if(param3 > 0) + { + _loc8_.loadRotatedGraphic(param1,param3,_loc7_); + } + else + { + _loc8_.loadGraphic(param1,true); + _loc8_.frame = _loc7_; + } + } + else if(param3 > 0) + { + _loc8_.loadRotatedGraphic(param1,param3); + } + else + { + _loc8_.loadGraphic(param1); + } + if(param5 > 0) + { + _loc8_.width *= param5; + _loc8_.height *= param5; + _loc8_.centerOffsets(); + } + else + { + _loc8_.allowCollisions = FlxObject.NONE; + } + _loc8_.exists = false; + add(_loc8_); + _loc9_++; + } + return this; + } + + override public function update() : void + { + var _loc1_:uint = 0; + var _loc2_:uint = 0; + if(this.on) + { + if(this._explode) + { + this.on = false; + _loc1_ = 0; + _loc2_ = this._quantity; + if(_loc2_ <= 0 || _loc2_ > members.length) + { + _loc2_ = members.length; + } + while(_loc1_ < _loc2_) + { + this.emitParticle(); + _loc1_++; + } + this._quantity = 0; + } + else + { + this._timer += FlxG.elapsed; + while(this.frequency > 0 && this._timer > this.frequency && this.on) + { + this._timer -= this.frequency; + this.emitParticle(); + if(this._quantity > 0 && ++this._counter >= this._quantity) + { + this.on = false; + this._quantity = 0; + } + } + } + } + super.update(); + } + + override public function kill() : void + { + this.on = false; + super.kill(); + } + + public function start(param1:Boolean = true, param2:Number = 0, param3:Number = 0.1, param4:uint = 0) : void + { + revive(); + visible = true; + this.on = true; + this._explode = param1; + this.lifespan = param2; + this.frequency = param3; + this._quantity += param4; + this._counter = 0; + this._timer = 0; + } + + public function emitParticle() : void + { + var _loc1_:FlxParticle = recycle(FlxParticle) as FlxParticle; + _loc1_.lifespan = this.lifespan + Math.random() / 2; + _loc1_.elasticity = this.bounce; + _loc1_.reset(this.x - (_loc1_.width >> 1) + FlxG.random() * this.width,this.y - (_loc1_.height >> 1) + FlxG.random() * this.height); + _loc1_.visible = true; + if(this.minParticleSpeed.x != this.maxParticleSpeed.x) + { + _loc1_.velocity.x = this.minParticleSpeed.x + FlxG.random() * (this.maxParticleSpeed.x - this.minParticleSpeed.x); + } + else + { + _loc1_.velocity.x = this.minParticleSpeed.x; + } + if(this.minParticleSpeed.y != this.maxParticleSpeed.y) + { + _loc1_.velocity.y = this.minParticleSpeed.y + FlxG.random() * (this.maxParticleSpeed.y - this.minParticleSpeed.y); + } + else + { + _loc1_.velocity.y = this.minParticleSpeed.y; + } + _loc1_.acceleration.y = this.gravity; + if(this.minRotation != this.maxRotation) + { + _loc1_.angularVelocity = this.minRotation + FlxG.random() * (this.maxRotation - this.minRotation); + } + else + { + _loc1_.angularVelocity = this.minRotation; + } + if(_loc1_.angularVelocity != 0) + { + _loc1_.angle = FlxG.random() * 360 - 180; + } + _loc1_.drag.x = this.particleDrag.x; + _loc1_.drag.y = this.particleDrag.y; + _loc1_.onEmit(); + } + + public function setSize(param1:uint, param2:uint) : void + { + this.width = param1; + this.height = param2; + } + + public function setXSpeed(param1:Number = 0, param2:Number = 0) : void + { + this.minParticleSpeed.x = param1; + this.maxParticleSpeed.x = param2; + } + + public function setYSpeed(param1:Number = 0, param2:Number = 0) : void + { + this.minParticleSpeed.y = param1; + this.maxParticleSpeed.y = param2; + } + + public function setRotation(param1:Number = 0, param2:Number = 0) : void + { + this.minRotation = param1; + this.maxRotation = param2; + } + + public function at(param1:FlxObject) : void + { + param1.getMidpoint(this._point); + this.x = this._point.x - (this.width >> 1); + this.y = this._point.y - (this.height >> 1); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxG.as b/research/inner_decompiled/scripts/org/flixel/FlxG.as new file mode 100644 index 0000000..a8d5b4d --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxG.as @@ -0,0 +1,894 @@ +package org.flixel +{ + import flash.display.BitmapData; + import flash.display.DisplayObject; + import flash.display.Graphics; + import flash.display.Sprite; + import flash.display.Stage; + import flash.geom.Matrix; + import flash.geom.Rectangle; + import org.flixel.plugin.DebugPathDisplay; + import org.flixel.plugin.TimerManager; + import org.flixel.system.FlxQuadTree; + import org.flixel.system.input.*; + + public class FlxG + { + + internal static var _game:FlxGame; + + public static var paused:Boolean; + + public static var debug:Boolean; + + public static var elapsed:Number; + + public static var timeScale:Number; + + public static var width:uint; + + public static var height:uint; + + public static var worldBounds:FlxRect; + + public static var worldDivisions:uint; + + public static var visualDebug:Boolean; + + public static var mobile:Boolean; + + public static var globalSeed:Number; + + public static var levels:Array; + + public static var level:int; + + public static var scores:Array; + + public static var score:int; + + public static var saves:Array; + + public static var save:int; + + public static var mouse:Mouse; + + public static var keys:Keyboard; + + public static var music:FlxSound; + + public static var sounds:FlxGroup; + + public static var mute:Boolean; + + protected static var _volume:Number; + + public static var cameras:Array; + + public static var camera:FlxCamera; + + public static var useBufferLocking:Boolean; + + protected static var _cameraRect:Rectangle; + + public static var plugins:Array; + + public static var volumeHandler:Function; + + public static var flashGfxSprite:Sprite; + + public static var flashGfx:Graphics; + + protected static var _cache:Object; + + public static var LIBRARY_NAME:String = "flixel"; + + public static var LIBRARY_MAJOR_VERSION:uint = 2; + + public static var LIBRARY_MINOR_VERSION:uint = 53; + + public static const DEBUGGER_STANDARD:uint = 0; + + public static const DEBUGGER_MICRO:uint = 1; + + public static const DEBUGGER_BIG:uint = 2; + + public static const DEBUGGER_TOP:uint = 3; + + public static const DEBUGGER_LEFT:uint = 4; + + public static const DEBUGGER_RIGHT:uint = 5; + + public static const RED:uint = 4294901778; + + public static const GREEN:uint = 4278252069; + + public static const BLUE:uint = 4278227177; + + public static const PINK:uint = 4293926655; + + public static const WHITE:uint = 4294967295; + + public static const BLACK:uint = 4278190080; + + public function FlxG() + { + super(); + } + + public static function getLibraryName() : String + { + return FlxG.LIBRARY_NAME + " v" + FlxG.LIBRARY_MAJOR_VERSION + "." + FlxG.LIBRARY_MINOR_VERSION; + } + + public static function log(param1:Object) : void + { + if(_game != null && _game._debugger != null) + { + _game._debugger.log.add(param1 == null ? "ERROR: null object" : param1.toString()); + } + } + + public static function watch(param1:Object, param2:String, param3:String = null) : void + { + if(_game != null && _game._debugger != null) + { + _game._debugger.watch.add(param1,param2,param3); + } + } + + public static function unwatch(param1:Object, param2:String = null) : void + { + if(_game != null && _game._debugger != null) + { + _game._debugger.watch.remove(param1,param2); + } + } + + public static function get framerate() : Number + { + return 1000 / _game._step; + } + + public static function set framerate(param1:Number) : void + { + _game._step = 1000 / param1; + if(_game._maxAccumulation < _game._step) + { + _game._maxAccumulation = _game._step; + } + } + + public static function get flashFramerate() : Number + { + if(_game.root != null) + { + return _game.stage.frameRate; + } + return 0; + } + + public static function set flashFramerate(param1:Number) : void + { + _game._flashFramerate = param1; + if(_game.root != null) + { + _game.stage.frameRate = _game._flashFramerate; + } + _game._maxAccumulation = 2000 / _game._flashFramerate - 1; + if(_game._maxAccumulation < _game._step) + { + _game._maxAccumulation = _game._step; + } + } + + public static function random() : Number + { + return globalSeed = FlxU.srand(globalSeed); + } + + public static function shuffle(param1:Array, param2:uint) : Array + { + var _loc4_:uint = 0; + var _loc5_:uint = 0; + var _loc6_:Object = null; + var _loc3_:uint = 0; + while(_loc3_ < param2) + { + _loc4_ = FlxG.random() * param1.length; + _loc5_ = FlxG.random() * param1.length; + _loc6_ = param1[_loc5_]; + param1[_loc5_] = param1[_loc4_]; + param1[_loc4_] = _loc6_; + _loc3_++; + } + return param1; + } + + public static function getRandom(param1:Array) : Object + { + var _loc2_:uint = 0; + if(param1 != null) + { + _loc2_ = param1.length; + if(_loc2_ > 0) + { + return param1[uint(FlxG.random() * _loc2_)]; + } + } + return null; + } + + public static function loadReplay(param1:String, param2:FlxState = null, param3:Array = null, param4:Number = 0, param5:Function = null) : void + { + _game._replay.load(param1); + if(param2 == null) + { + FlxG.resetGame(); + } + else + { + FlxG.switchState(param2); + } + _game._replayCancelKeys = param3; + _game._replayTimer = param4 * 1000; + _game._replayCallback = param5; + _game._replayRequested = true; + } + + public static function reloadReplay(param1:Boolean = true) : void + { + if(param1) + { + FlxG.resetGame(); + } + else + { + FlxG.resetState(); + } + if(_game._replay.frameCount > 0) + { + _game._replayRequested = true; + } + } + + public static function stopReplay() : void + { + _game._replaying = false; + if(_game._debugger != null) + { + _game._debugger.vcr.stopped(); + } + resetInput(); + } + + public static function recordReplay(param1:Boolean = true) : void + { + if(param1) + { + FlxG.resetGame(); + } + else + { + FlxG.resetState(); + } + _game._recordingRequested = true; + } + + public static function stopRecording() : String + { + _game._recording = false; + if(_game._debugger != null) + { + _game._debugger.vcr.stopped(); + } + return _game._replay.save(); + } + + public static function resetState() : void + { + _game._requestedState = new (FlxU.getClass(FlxU.getClassName(_game._state,false)))(); + } + + public static function resetGame() : void + { + _game._requestedReset = true; + } + + public static function resetInput() : void + { + keys.reset(); + mouse.reset(); + } + + public static function playMusic(param1:Class, param2:Number = 1, param3:Number = 0) : void + { + if(music == null) + { + music = new FlxSound(); + } + else if(music.active) + { + music.stop(); + } + music.loadEmbedded(param1,true); + music.volume = param2; + music.survive = true; + music.play(param3); + } + + public static function play(param1:Class, param2:Number = 1, param3:Boolean = false) : FlxSound + { + var _loc4_:FlxSound = sounds.recycle(FlxSound) as FlxSound; + _loc4_.loadEmbedded(param1,param3); + _loc4_.volume = param2; + _loc4_.play(); + return _loc4_; + } + + public static function stream(param1:String, param2:Number = 1, param3:Boolean = false) : FlxSound + { + var _loc4_:FlxSound = sounds.recycle(FlxSound) as FlxSound; + _loc4_.loadStream(param1,param3); + _loc4_.volume = param2; + _loc4_.play(); + return _loc4_; + } + + public static function get volume() : Number + { + return _volume; + } + + public static function set volume(param1:Number) : void + { + _volume = param1; + if(_volume < 0) + { + _volume = 0; + } + else if(_volume > 1) + { + _volume = 1; + } + if(volumeHandler != null) + { + volumeHandler(FlxG.mute ? 0 : _volume); + } + } + + internal static function destroySounds(param1:Boolean = false) : void + { + var _loc3_:FlxSound = null; + if(music != null && (param1 || !music.survive)) + { + music.destroy(); + music = null; + } + var _loc2_:uint = 0; + var _loc4_:uint = sounds.members.length; + while(_loc2_ < _loc4_) + { + _loc3_ = sounds.members[_loc2_++] as FlxSound; + if(_loc3_ != null && (param1 || !_loc3_.survive)) + { + _loc3_.destroy(); + } + } + } + + internal static function updateSounds() : void + { + if(music != null && music.active) + { + music.update(); + } + if(sounds != null && sounds.active) + { + sounds.update(); + } + } + + public static function pauseSounds() : void + { + var _loc2_:FlxSound = null; + if(music != null && music.exists && music.active) + { + music.pause(); + } + var _loc1_:uint = 0; + var _loc3_:uint = sounds.members.length; + while(_loc1_ < _loc3_) + { + _loc2_ = sounds.members[_loc1_++] as FlxSound; + if(_loc2_ != null && _loc2_.exists && _loc2_.active) + { + _loc2_.pause(); + } + } + } + + public static function playSounds() : void + { + var _loc2_:FlxSound = null; + if(music != null && music.exists) + { + music.play(); + } + var _loc1_:uint = 0; + var _loc3_:uint = sounds.members.length; + while(_loc1_ < _loc3_) + { + _loc2_ = sounds.members[_loc1_++] as FlxSound; + if(_loc2_ != null && _loc2_.exists) + { + _loc2_.play(); + } + } + } + + public static function checkBitmapCache(param1:String) : Boolean + { + return _cache[param1] != undefined && _cache[param1] != null; + } + + public static function createBitmap(param1:uint, param2:uint, param3:uint, param4:Boolean = false, param5:String = null) : BitmapData + { + var _loc6_:uint = 0; + var _loc7_:String = null; + if(param5 == null) + { + param5 = param1 + "x" + param2 + ":" + param3; + if(param4 && checkBitmapCache(param5)) + { + _loc6_ = 0; + do + { + _loc7_ = param5 + _loc6_++; + } + while(checkBitmapCache(_loc7_)); + param5 = _loc7_; + } + } + if(!checkBitmapCache(param5)) + { + _cache[param5] = new BitmapData(param1,param2,true,param3); + } + return _cache[param5]; + } + + public static function addBitmap(param1:Class, param2:Boolean = false, param3:Boolean = false, param4:String = null) : BitmapData + { + var _loc7_:uint = 0; + var _loc8_:String = null; + var _loc9_:BitmapData = null; + var _loc10_:Matrix = null; + var _loc5_:Boolean = false; + if(param4 == null) + { + param4 = String(param1) + (param2 ? "_REVERSE_" : ""); + if(param3 && checkBitmapCache(param4)) + { + _loc7_ = 0; + do + { + _loc8_ = param4 + _loc7_++; + } + while(checkBitmapCache(_loc8_)); + param4 = _loc8_; + } + } + if(!checkBitmapCache(param4)) + { + _cache[param4] = new param1().bitmapData; + if(param2) + { + _loc5_ = true; + } + } + var _loc6_:BitmapData = _cache[param4]; + if(!_loc5_ && param2 && _loc6_.width == new param1().bitmapData.width) + { + _loc5_ = true; + } + if(_loc5_) + { + _loc9_ = new BitmapData(_loc6_.width << 1,_loc6_.height,true,0); + _loc9_.draw(_loc6_); + _loc10_ = new Matrix(); + _loc10_.scale(-1,1); + _loc10_.translate(_loc9_.width,0); + _loc9_.draw(_loc6_,_loc10_); + _loc6_ = _loc9_; + } + return _loc6_; + } + + public static function clearBitmapCache() : void + { + _cache = new Object(); + } + + public static function get stage() : Stage + { + if(_game.root != null) + { + return _game.stage; + } + return null; + } + + public static function get root() : DisplayObject + { + return _game.root; + } + + public static function get state() : FlxState + { + return _game._state; + } + + public static function switchState(param1:FlxState) : void + { + _game._requestedState = param1; + } + + public static function setDebuggerLayout(param1:uint) : void + { + if(_game._debugger != null) + { + _game._debugger.setLayout(param1); + } + } + + public static function resetDebuggerLayout() : void + { + if(_game._debugger != null) + { + _game._debugger.resetLayout(); + } + } + + public static function addCamera(param1:FlxCamera) : FlxCamera + { + FlxG._game.addChildAt(param1._flashSprite,FlxG._game.getChildIndex(FlxG._game._mouse)); + FlxG.cameras.push(param1); + return param1; + } + + public static function removeCamera(param1:FlxCamera, param2:Boolean = true) : void + { + var Camera:FlxCamera = param1; + var Destroy:Boolean = param2; + try + { + FlxG._game.removeChild(Camera._flashSprite); + } + catch(E:Error) + { + FlxG.log("Error removing camera, not part of game."); + } + if(Destroy) + { + Camera.destroy(); + } + } + + public static function resetCameras(param1:FlxCamera = null) : void + { + var _loc2_:FlxCamera = null; + var _loc3_:uint = 0; + var _loc4_:uint = cameras.length; + while(_loc3_ < _loc4_) + { + _loc2_ = FlxG.cameras[_loc3_++] as FlxCamera; + FlxG._game.removeChild(_loc2_._flashSprite); + _loc2_.destroy(); + } + FlxG.cameras.length = 0; + if(param1 == null) + { + param1 = new FlxCamera(0,0,FlxG.width,FlxG.height); + } + FlxG.camera = FlxG.addCamera(param1); + } + + public static function flash(param1:uint = 4294967295, param2:Number = 1, param3:Function = null, param4:Boolean = false) : void + { + var _loc5_:uint = 0; + var _loc6_:uint = FlxG.cameras.length; + while(_loc5_ < _loc6_) + { + (FlxG.cameras[_loc5_++] as FlxCamera).flash(param1,param2,param3,param4); + } + } + + public static function fade(param1:uint = 4294967295, param2:Number = 1, param3:Function = null, param4:Boolean = false) : void + { + var _loc5_:uint = 0; + var _loc6_:uint = FlxG.cameras.length; + while(_loc5_ < _loc6_) + { + (FlxG.cameras[_loc5_++] as FlxCamera).fade(param1,param2,param3,param4); + } + } + + public static function shake(param1:Number = 0.05, param2:Number = 0.5, param3:Function = null, param4:Boolean = true, param5:uint = 0) : void + { + var _loc6_:uint = 0; + var _loc7_:uint = FlxG.cameras.length; + while(_loc6_ < _loc7_) + { + (FlxG.cameras[_loc6_++] as FlxCamera).shake(param1,param2,param3,param4,param5); + } + } + + public static function get bgColor() : uint + { + if(FlxG.camera == null) + { + return 4278190080; + } + return FlxG.camera.bgColor; + } + + public static function set bgColor(param1:uint) : void + { + var _loc2_:uint = 0; + var _loc3_:uint = FlxG.cameras.length; + while(_loc2_ < _loc3_) + { + (FlxG.cameras[_loc2_++] as FlxCamera).bgColor = param1; + } + } + + public static function overlap(param1:FlxBasic = null, param2:FlxBasic = null, param3:Function = null, param4:Function = null) : Boolean + { + if(param1 == null) + { + param1 = FlxG.state; + } + if(param2 === param1) + { + param2 = null; + } + FlxQuadTree.divisions = FlxG.worldDivisions; + var _loc5_:FlxQuadTree = new FlxQuadTree(FlxG.worldBounds.x,FlxG.worldBounds.y,FlxG.worldBounds.width,FlxG.worldBounds.height); + _loc5_.load(param1,param2,param3,param4); + var _loc6_:Boolean = _loc5_.execute(); + _loc5_.destroy(); + return _loc6_; + } + + public static function collide(param1:FlxBasic = null, param2:FlxBasic = null, param3:Function = null) : Boolean + { + return overlap(param1,param2,param3,FlxObject.separate); + } + + public static function addPlugin(param1:FlxBasic) : FlxBasic + { + var _loc2_:Array = FlxG.plugins; + var _loc3_:uint = 0; + var _loc4_:uint = _loc2_.length; + while(_loc3_ < _loc4_) + { + if(_loc2_[_loc3_++].toString() == param1.toString()) + { + return param1; + } + } + _loc2_.push(param1); + return param1; + } + + public static function getPlugin(param1:Class) : FlxBasic + { + var _loc2_:Array = FlxG.plugins; + var _loc3_:uint = 0; + var _loc4_:uint = _loc2_.length; + while(_loc3_ < _loc4_) + { + if(_loc2_[_loc3_] is param1) + { + return plugins[_loc3_]; + } + _loc3_++; + } + return null; + } + + public static function removePlugin(param1:FlxBasic) : FlxBasic + { + var _loc2_:Array = FlxG.plugins; + var _loc3_:* = int(_loc2_.length - 1); + while(_loc3_ >= 0) + { + if(_loc2_[_loc3_] == param1) + { + _loc2_.splice(_loc3_,1); + } + _loc3_--; + } + return param1; + } + + public static function removePluginType(param1:Class) : Boolean + { + var _loc2_:Boolean = false; + var _loc3_:Array = FlxG.plugins; + var _loc4_:* = int(_loc3_.length - 1); + while(_loc4_ >= 0) + { + if(_loc3_[_loc4_] is param1) + { + _loc3_.splice(_loc4_,1); + _loc2_ = true; + } + _loc4_--; + } + return _loc2_; + } + + internal static function init(param1:FlxGame, param2:uint, param3:uint, param4:Number) : void + { + FlxG._game = param1; + FlxG.width = param2; + FlxG.height = param3; + FlxG.mute = false; + FlxG._volume = 0.5; + FlxG.sounds = new FlxGroup(); + FlxG.volumeHandler = null; + FlxG.clearBitmapCache(); + if(flashGfxSprite == null) + { + flashGfxSprite = new Sprite(); + flashGfx = flashGfxSprite.graphics; + } + FlxCamera.defaultZoom = param4; + FlxG._cameraRect = new Rectangle(); + FlxG.cameras = new Array(); + useBufferLocking = false; + plugins = new Array(); + addPlugin(new DebugPathDisplay()); + addPlugin(new TimerManager()); + FlxG.mouse = new Mouse(FlxG._game._mouse); + FlxG.keys = new Keyboard(); + FlxG.mobile = false; + FlxG.levels = new Array(); + FlxG.scores = new Array(); + FlxG.visualDebug = false; + } + + public static function get game() : FlxGame + { + return _game; + } + + internal static function reset() : void + { + FlxG.clearBitmapCache(); + FlxG.resetInput(); + FlxG.destroySounds(true); + FlxG.levels.length = 0; + FlxG.scores.length = 0; + FlxG.level = 0; + FlxG.score = 0; + FlxG.paused = false; + FlxG.timeScale = 1; + FlxG.elapsed = 0; + FlxG.globalSeed = Math.random(); + FlxG.worldBounds = new FlxRect(-10,-10,FlxG.width + 20,FlxG.height + 20); + FlxG.worldDivisions = 6; + var _loc1_:DebugPathDisplay = FlxG.getPlugin(DebugPathDisplay) as DebugPathDisplay; + if(_loc1_ != null) + { + _loc1_.clear(); + } + } + + internal static function updateInput() : void + { + FlxG.keys.update(); + if(!_game._debuggerUp || !_game._debugger.hasMouse) + { + FlxG.mouse.update(FlxG._game.mouseX,FlxG._game.mouseY); + } + } + + internal static function lockCameras() : void + { + var _loc1_:FlxCamera = null; + var _loc2_:Array = FlxG.cameras; + var _loc3_:uint = 0; + var _loc4_:uint = _loc2_.length; + while(_loc3_ < _loc4_) + { + _loc1_ = _loc2_[_loc3_++] as FlxCamera; + if(!(_loc1_ == null || !_loc1_.exists || !_loc1_.visible)) + { + if(useBufferLocking) + { + _loc1_.buffer.lock(); + } + _loc1_.fill(0); + _loc1_.screen.dirty = true; + } + } + } + + internal static function unlockCameras() : void + { + var _loc1_:FlxCamera = null; + var _loc2_:Array = FlxG.cameras; + var _loc3_:uint = 0; + var _loc4_:uint = _loc2_.length; + while(_loc3_ < _loc4_) + { + _loc1_ = _loc2_[_loc3_++] as FlxCamera; + if(!(_loc1_ == null || !_loc1_.exists || !_loc1_.visible)) + { + _loc1_.drawFX(); + if(useBufferLocking) + { + _loc1_.buffer.unlock(); + } + } + } + } + + internal static function updateCameras() : void + { + var _loc1_:FlxCamera = null; + var _loc2_:Array = FlxG.cameras; + var _loc3_:uint = 0; + var _loc4_:uint = _loc2_.length; + while(_loc3_ < _loc4_) + { + _loc1_ = _loc2_[_loc3_++] as FlxCamera; + if(_loc1_ != null && _loc1_.exists) + { + if(_loc1_.active) + { + _loc1_.update(); + } + _loc1_._flashSprite.x = _loc1_.x + _loc1_._flashOffsetX; + _loc1_._flashSprite.y = _loc1_.y + _loc1_._flashOffsetY; + _loc1_._flashSprite.visible = _loc1_.visible; + } + } + } + + internal static function updatePlugins() : void + { + var _loc1_:FlxBasic = null; + var _loc2_:Array = FlxG.plugins; + var _loc3_:uint = 0; + var _loc4_:uint = _loc2_.length; + while(_loc3_ < _loc4_) + { + _loc1_ = _loc2_[_loc3_++] as FlxBasic; + if(_loc1_.exists && _loc1_.active) + { + _loc1_.update(); + } + } + } + + internal static function drawPlugins() : void + { + var _loc1_:FlxBasic = null; + var _loc2_:Array = FlxG.plugins; + var _loc3_:uint = 0; + var _loc4_:uint = _loc2_.length; + while(_loc3_ < _loc4_) + { + _loc1_ = _loc2_[_loc3_++] as FlxBasic; + if(_loc1_.exists && _loc1_.visible) + { + _loc1_.draw(); + } + } + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxGame.as b/research/inner_decompiled/scripts/org/flixel/FlxGame.as new file mode 100644 index 0000000..63f5396 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxGame.as @@ -0,0 +1,627 @@ +package org.flixel +{ + import flash.display.Bitmap; + import flash.display.BitmapData; + import flash.display.Graphics; + import flash.display.Sprite; + import flash.display.StageAlign; + import flash.display.StageScaleMode; + import flash.events.*; + import flash.text.AntiAliasType; + import flash.text.GridFitType; + import flash.text.TextField; + import flash.text.TextFormat; + import flash.ui.Mouse; + import flash.utils.getTimer; + import org.flixel.plugin.TimerManager; + import org.flixel.system.FlxDebugger; + import org.flixel.system.FlxReplay; + + public class FlxGame extends Sprite + { + + protected var junk:String = "FlxGame_junk"; + + protected var SndBeep:Class = FlxGame_SndBeep; + + protected var ImgLogo:Class = FlxGame_ImgLogo; + + public var useSoundHotKeys:Boolean; + + public var forceDebugger:Boolean; + + internal var _state:FlxState; + + internal var _mouse:Sprite; + + protected var _iState:Class; + + protected var _created:Boolean; + + protected var _total:uint; + + protected var _accumulator:int; + + protected var _lostFocus:Boolean; + + internal var _step:uint; + + internal var _flashFramerate:uint; + + internal var _maxAccumulation:uint; + + internal var _requestedState:FlxState; + + internal var _requestedReset:Boolean; + + protected var _focus:Sprite; + + protected var _soundTray:Sprite; + + protected var _soundTrayTimer:Number; + + protected var _soundTrayBars:Array; + + internal var _debugger:FlxDebugger; + + internal var _debuggerUp:Boolean; + + internal var _replay:FlxReplay; + + internal var _replayRequested:Boolean; + + internal var _recordingRequested:Boolean; + + internal var _replaying:Boolean; + + internal var _recording:Boolean; + + internal var _replayCancelKeys:Array; + + internal var _replayTimer:int; + + internal var _replayCallback:Function; + + public function FlxGame(param1:uint, param2:uint, param3:Class, param4:Number = 1, param5:uint = 60, param6:uint = 30) + { + super(); + Mouse.hide(); + this._lostFocus = false; + this._focus = new Sprite(); + this._focus.visible = false; + this._soundTray = new Sprite(); + this._mouse = new Sprite(); + FlxG.init(this,param1,param2,param4); + FlxG.framerate = param5; + FlxG.flashFramerate = param6; + this._accumulator = this._step; + this._total = 0; + this._state = null; + this.useSoundHotKeys = true; + this.forceDebugger = false; + this._debuggerUp = false; + this._replay = new FlxReplay(); + this._replayRequested = false; + this._recordingRequested = false; + this._replaying = false; + this._recording = false; + this._iState = param3; + this._requestedState = null; + this._requestedReset = true; + this._created = false; + addEventListener(Event.ENTER_FRAME,this.create); + } + + internal function showSoundTray(param1:Boolean = false) : void + { + if(!param1) + { + FlxG.play(this.SndBeep); + } + this._soundTrayTimer = 1; + this._soundTray.y = 0; + this._soundTray.visible = true; + var _loc2_:uint = Math.round(FlxG.volume * 10); + if(FlxG.mute) + { + _loc2_ = 0; + } + var _loc3_:uint = 0; + while(_loc3_ < this._soundTrayBars.length) + { + if(_loc3_ < _loc2_) + { + this._soundTrayBars[_loc3_].alpha = 1; + } + else + { + this._soundTrayBars[_loc3_].alpha = 0.5; + } + _loc3_++; + } + } + + protected function onKeyUp(param1:KeyboardEvent) : void + { + if(this._debuggerUp && this._debugger.watch.editing) + { + return; + } + if(!FlxG.mobile) + { + if(this._debugger != null && (param1.keyCode == 192 || param1.keyCode == 220) && FlxG.keys.SHIFT && FlxG.keys.CONTROL) + { + this._debugger.visible = !this._debugger.visible; + this._debuggerUp = this._debugger.visible; + if(this._debugger.visible) + { + Mouse.show(); + } + else + { + Mouse.hide(); + } + return; + } + } + if(this._replaying) + { + return; + } + FlxG.keys.handleKeyUp(param1); + } + + protected function onKeyDown(param1:KeyboardEvent) : void + { + var _loc2_:Boolean = false; + var _loc3_:String = null; + var _loc4_:uint = 0; + var _loc5_:uint = 0; + if(this._debuggerUp && this._debugger.watch.editing) + { + return; + } + if(this._replaying && this._replayCancelKeys != null && this._debugger == null && param1.keyCode != 192 && param1.keyCode != 220) + { + _loc2_ = false; + _loc4_ = 0; + _loc5_ = this._replayCancelKeys.length; + while(_loc4_ < _loc5_) + { + _loc3_ = this._replayCancelKeys[_loc4_++]; + if(_loc3_ == "ANY" || FlxG.keys.getKeyCode(_loc3_) == param1.keyCode) + { + if(this._replayCallback != null) + { + this._replayCallback(); + this._replayCallback = null; + } + else + { + FlxG.stopReplay(); + } + break; + } + } + return; + } + FlxG.keys.handleKeyDown(param1); + } + + protected function onMouseDown(param1:MouseEvent) : void + { + var _loc2_:String = null; + var _loc3_:uint = 0; + var _loc4_:uint = 0; + if(this._debuggerUp) + { + if(this._debugger.hasMouse) + { + return; + } + if(this._debugger.watch.editing) + { + this._debugger.watch.submit(); + } + } + if(this._replaying && this._replayCancelKeys != null) + { + _loc3_ = 0; + _loc4_ = this._replayCancelKeys.length; + while(_loc3_ < _loc4_) + { + _loc2_ = this._replayCancelKeys[_loc3_++] as String; + if(_loc2_ == "MOUSE" || _loc2_ == "ANY") + { + if(this._replayCallback != null) + { + this._replayCallback(); + this._replayCallback = null; + } + else + { + FlxG.stopReplay(); + } + break; + } + } + return; + } + FlxG.mouse.handleMouseDown(param1); + } + + protected function onMouseUp(param1:MouseEvent) : void + { + if(this._debuggerUp && this._debugger.hasMouse || this._replaying) + { + return; + } + FlxG.mouse.handleMouseUp(param1); + } + + protected function onMouseWheel(param1:MouseEvent) : void + { + if(this._debuggerUp && this._debugger.hasMouse || this._replaying) + { + return; + } + FlxG.mouse.handleMouseWheel(param1); + } + + protected function onFocus(param1:Event = null) : void + { + if(!this._debuggerUp) + { + Mouse.hide(); + } + FlxG.resetInput(); + this._lostFocus = this._focus.visible = false; + stage.frameRate = this._flashFramerate; + FlxG.playSounds(); + } + + protected function onFocusLost(param1:Event = null) : void + { + if(x != 0 || y != 0) + { + x = 0; + y = 0; + } + Mouse.show(); + this._lostFocus = this._focus.visible = true; + stage.frameRate = 10; + FlxG.pauseSounds(); + } + + protected function onEnterFrame(param1:Event = null) : void + { + var _loc2_:uint = uint(getTimer()); + var _loc3_:uint = _loc2_ - this._total; + this._total = _loc2_; + this.updateSoundTray(_loc3_); + if(!this._lostFocus) + { + if(this._debugger != null && this._debugger.vcr.paused) + { + if(this._debugger.vcr.stepRequested) + { + this._debugger.vcr.stepRequested = false; + this.step(); + } + } + else + { + this._accumulator += _loc3_; + if(this._accumulator > this._maxAccumulation) + { + this._accumulator = this._maxAccumulation; + } + while(this._accumulator > this._step) + { + this.step(); + this._accumulator -= this._step; + } + } + FlxBasic._VISIBLECOUNT = 0; + this.draw(); + if(this._debuggerUp) + { + this._debugger.perf.flash(_loc3_); + this._debugger.perf.visibleObjects(FlxBasic._VISIBLECOUNT); + this._debugger.perf.update(); + this._debugger.watch.update(); + } + } + } + + protected function switchState() : void + { + FlxG.resetCameras(); + FlxG.resetInput(); + FlxG.destroySounds(); + FlxG.clearBitmapCache(); + if(this._debugger != null) + { + this._debugger.watch.removeAll(); + } + var _loc1_:TimerManager = FlxTimer.manager; + if(_loc1_ != null) + { + _loc1_.clear(); + } + if(this._state != null) + { + this._state.destroy(); + } + this._state = this._requestedState; + this._state.create(); + } + + protected function step() : void + { + if(this._requestedReset) + { + this._requestedReset = false; + this._requestedState = new this._iState(); + this._replayTimer = 0; + this._replayCancelKeys = null; + FlxG.reset(); + } + if(this._recordingRequested) + { + this._recordingRequested = false; + this._replay.create(FlxG.globalSeed); + this._recording = true; + if(this._debugger != null) + { + this._debugger.vcr.recording(); + FlxG.log("FLIXEL: starting new flixel gameplay record."); + } + } + else if(this._replayRequested) + { + this._replayRequested = false; + this._replay.rewind(); + FlxG.globalSeed = this._replay.seed; + if(this._debugger != null) + { + this._debugger.vcr.playing(); + } + this._replaying = true; + } + if(this._state != this._requestedState) + { + this.switchState(); + } + FlxBasic._ACTIVECOUNT = 0; + if(this._replaying) + { + this._replay.playNextFrame(); + if(this._replayTimer > 0) + { + this._replayTimer -= this._step; + if(this._replayTimer <= 0) + { + if(this._replayCallback != null) + { + this._replayCallback(); + this._replayCallback = null; + } + else + { + FlxG.stopReplay(); + } + } + } + if(this._replaying && this._replay.finished) + { + FlxG.stopReplay(); + if(this._replayCallback != null) + { + this._replayCallback(); + this._replayCallback = null; + } + } + if(this._debugger != null) + { + this._debugger.vcr.updateRuntime(this._step); + } + } + else + { + FlxG.updateInput(); + } + if(this._recording) + { + this._replay.recordFrame(); + if(this._debugger != null) + { + this._debugger.vcr.updateRuntime(this._step); + } + } + this.update(); + FlxG.mouse.wheel = 0; + if(this._debuggerUp) + { + this._debugger.perf.activeObjects(FlxBasic._ACTIVECOUNT); + } + } + + protected function updateSoundTray(param1:Number) : void + { + var _loc2_:FlxSave = null; + if(this._soundTray != null) + { + if(this._soundTrayTimer > 0) + { + this._soundTrayTimer -= param1 / 1000; + } + else if(this._soundTray.y > -this._soundTray.height) + { + this._soundTray.y -= param1 / 1000 * FlxG.height * 2; + if(this._soundTray.y <= -this._soundTray.height) + { + this._soundTray.visible = false; + _loc2_ = new FlxSave(); + if(_loc2_.bind("flixel")) + { + if(_loc2_.data.sound == null) + { + _loc2_.data.sound = new Object(); + } + _loc2_.data.sound.mute = FlxG.mute; + _loc2_.data.sound.volume = FlxG.volume; + _loc2_.close(); + } + } + } + } + } + + protected function update() : void + { + var _loc1_:uint = uint(getTimer()); + FlxG.elapsed = FlxG.timeScale * (this._step / 1000); + FlxG.updateSounds(); + FlxG.updatePlugins(); + this._state.update(); + FlxG.updateCameras(); + if(this._debuggerUp) + { + this._debugger.perf.flixelUpdate(getTimer() - _loc1_); + } + } + + protected function draw() : void + { + var _loc1_:uint = uint(getTimer()); + FlxG.lockCameras(); + this._state.draw(); + FlxG.drawPlugins(); + FlxG.unlockCameras(); + if(this._debuggerUp) + { + this._debugger.perf.flixelDraw(getTimer() - _loc1_); + } + } + + protected function create(param1:Event) : void + { + if(root == null) + { + return; + } + removeEventListener(Event.ENTER_FRAME,this.create); + this._total = getTimer(); + stage.scaleMode = StageScaleMode.NO_SCALE; + stage.align = StageAlign.TOP_LEFT; + stage.frameRate = this._flashFramerate; + stage.addEventListener(MouseEvent.MOUSE_DOWN,this.onMouseDown); + stage.addEventListener(MouseEvent.MOUSE_UP,this.onMouseUp); + stage.addEventListener(MouseEvent.MOUSE_WHEEL,this.onMouseWheel); + stage.addEventListener(KeyboardEvent.KEY_DOWN,this.onKeyDown); + stage.addEventListener(KeyboardEvent.KEY_UP,this.onKeyUp); + addChild(this._mouse); + if(!FlxG.mobile) + { + if(FlxG.debug || this.forceDebugger || true) + { + this._debugger = new FlxDebugger(FlxG.width * FlxCamera.defaultZoom,FlxG.height * FlxCamera.defaultZoom); + addChild(this._debugger); + } + this.createSoundTray(); + stage.addEventListener(Event.DEACTIVATE,this.onFocusLost); + stage.addEventListener(Event.ACTIVATE,this.onFocus); + this.createFocusScreen(); + } + addEventListener(Event.ENTER_FRAME,this.onEnterFrame); + } + + protected function createSoundTray() : void + { + this._soundTray.visible = false; + this._soundTray.scaleX = 2; + this._soundTray.scaleY = 2; + var _loc1_:Bitmap = new Bitmap(new BitmapData(80,30,true,2130706432)); + this._soundTray.x = FlxG.width / 2 * FlxCamera.defaultZoom - _loc1_.width / 2 * this._soundTray.scaleX; + this._soundTray.addChild(_loc1_); + var _loc2_:TextField = new TextField(); + _loc2_.width = _loc1_.width; + _loc2_.height = _loc1_.height; + _loc2_.multiline = true; + _loc2_.wordWrap = true; + _loc2_.selectable = false; + _loc2_.embedFonts = true; + _loc2_.antiAliasType = AntiAliasType.NORMAL; + _loc2_.gridFitType = GridFitType.PIXEL; + _loc2_.defaultTextFormat = new TextFormat("system",8,16777215,null,null,null,null,null,"center"); + this._soundTray.addChild(_loc2_); + _loc2_.text = "VOLUME"; + _loc2_.y = 16; + var _loc3_:uint = 10; + var _loc4_:uint = 14; + this._soundTrayBars = new Array(); + var _loc5_:uint = 0; + while(_loc5_ < 10) + { + _loc1_ = new Bitmap(new BitmapData(4,++_loc5_,false,16777215)); + _loc1_.x = _loc3_; + _loc1_.y = _loc4_; + this._soundTrayBars.push(this._soundTray.addChild(_loc1_)); + _loc3_ += 6; + _loc4_--; + } + this._soundTray.y = -this._soundTray.height; + this._soundTray.visible = false; + addChild(this._soundTray); + var _loc6_:FlxSave = new FlxSave(); + if(_loc6_.bind("flixel") && _loc6_.data.sound != null) + { + if(_loc6_.data.sound.volume != null) + { + FlxG.volume = _loc6_.data.sound.volume; + } + if(_loc6_.data.sound.mute != null) + { + FlxG.mute = _loc6_.data.sound.mute; + } + _loc6_.destroy(); + } + } + + protected function createFocusScreen() : void + { + var _loc1_:Graphics = this._focus.graphics; + var _loc2_:uint = FlxG.width * FlxCamera.defaultZoom; + var _loc3_:uint = FlxG.height * FlxCamera.defaultZoom; + _loc1_.moveTo(0,0); + _loc1_.beginFill(0,0.5); + _loc1_.lineTo(_loc2_,0); + _loc1_.lineTo(_loc2_,_loc3_); + _loc1_.lineTo(0,_loc3_); + _loc1_.lineTo(0,0); + _loc1_.endFill(); + var _loc4_:uint = _loc2_ / 2; + var _loc5_:uint = _loc3_ / 2; + var _loc6_:uint = FlxU.min(_loc4_,_loc5_) / 3; + _loc1_.moveTo(_loc4_ - _loc6_,_loc5_ - _loc6_); + _loc1_.beginFill(16777215,0.65); + _loc1_.lineTo(_loc4_ + _loc6_,_loc5_); + _loc1_.lineTo(_loc4_ - _loc6_,_loc5_ + _loc6_); + _loc1_.lineTo(_loc4_ - _loc6_,_loc5_ - _loc6_); + _loc1_.endFill(); + var _loc7_:Bitmap = new this.ImgLogo(); + _loc7_.scaleX = int(_loc6_ / 10); + if(_loc7_.scaleX < 1) + { + _loc7_.scaleX = 1; + } + _loc7_.scaleY = _loc7_.scaleX; + _loc7_.x -= _loc7_.scaleX; + _loc7_.alpha = 0.35; + this._focus.addChild(_loc7_); + addChild(this._focus); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxGame_ImgLogo.as b/research/inner_decompiled/scripts/org/flixel/FlxGame_ImgLogo.as new file mode 100644 index 0000000..30b6c4e --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxGame_ImgLogo.as @@ -0,0 +1,15 @@ +package org.flixel +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/166_org.flixel.FlxGame_ImgLogo.png")] + public class FlxGame_ImgLogo extends BitmapAsset + { + + public function FlxGame_ImgLogo() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxGame_SndBeep.as b/research/inner_decompiled/scripts/org/flixel/FlxGame_SndBeep.as new file mode 100644 index 0000000..3629777 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxGame_SndBeep.as @@ -0,0 +1,15 @@ +package org.flixel +{ + import mx.core.SoundAsset; + + [Embed(source="/_assets/1_org.flixel.FlxGame_SndBeep_org.flixel.FlxGame_SndBeep.mp3")] + public class FlxGame_SndBeep extends SoundAsset + { + + public function FlxGame_SndBeep() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxGame_junk.as b/research/inner_decompiled/scripts/org/flixel/FlxGame_junk.as new file mode 100644 index 0000000..0d27f00 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxGame_junk.as @@ -0,0 +1,24 @@ +package org.flixel +{ + import mx.core.FontAsset; + + [Embed(source="/_assets/280_org.flixel.FlxGame_junk_system.ttf", + fontName="system", + fontFamily="Nokia Cellphone FC", + mimeType="application/x-font", + fontWeight="normal", + fontStyle="normal", + unicodeRange="U+0020-007E,U+00A0-00A1,U+00A3-00A7,U+00BA-00BA,U+00BF-00CF,U+00D1-00D6,U+00D8-00DD,U+00DF-00EF,U+00F1-00F6,U+00F8-00FD,U+00FF-00FF,U+011E-011F,U+0161-0161,U+0178-0178,U+02C6-02C6,U+2019-2019,U+20AC-20AC", + advancedAntiAliasing="true", + embedAsCFF="false" + )] + public class FlxGame_junk extends FontAsset + { + + public function FlxGame_junk() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxGroup.as b/research/inner_decompiled/scripts/org/flixel/FlxGroup.as new file mode 100644 index 0000000..ffb6e29 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxGroup.as @@ -0,0 +1,434 @@ +package org.flixel +{ + public class FlxGroup extends FlxBasic + { + + public static const ASCENDING:int = -1; + + public static const DESCENDING:int = 1; + + public var members:Array; + + public var length:Number; + + protected var _maxSize:uint; + + protected var _marker:uint; + + protected var _sortIndex:String; + + protected var _sortOrder:int; + + public function FlxGroup(param1:uint = 0) + { + super(); + this.members = new Array(); + this.length = 0; + this._maxSize = param1; + this._marker = 0; + this._sortIndex = null; + } + + override public function destroy() : void + { + var _loc1_:FlxBasic = null; + var _loc2_:uint = 0; + if(this.members != null) + { + _loc2_ = 0; + while(_loc2_ < this.length) + { + _loc1_ = this.members[_loc2_++] as FlxBasic; + if(_loc1_ != null) + { + _loc1_.destroy(); + } + } + this.members.length = 0; + this.members = null; + } + this._sortIndex = null; + } + + override public function preUpdate() : void + { + } + + override public function update() : void + { + var _loc1_:FlxBasic = null; + var _loc2_:uint = 0; + while(_loc2_ < this.length) + { + _loc1_ = this.members[_loc2_++] as FlxBasic; + if(_loc1_ != null && _loc1_.exists && _loc1_.active) + { + _loc1_.preUpdate(); + _loc1_.update(); + _loc1_.postUpdate(); + } + } + } + + override public function draw() : void + { + var _loc1_:FlxBasic = null; + var _loc2_:uint = 0; + while(_loc2_ < this.length) + { + _loc1_ = this.members[_loc2_++] as FlxBasic; + if(_loc1_ != null && _loc1_.exists && _loc1_.visible) + { + _loc1_.draw(); + } + } + } + + public function get maxSize() : uint + { + return this._maxSize; + } + + public function set maxSize(param1:uint) : void + { + var _loc2_:FlxBasic = null; + this._maxSize = param1; + if(this._marker >= this._maxSize) + { + this._marker = 0; + } + if(this._maxSize == 0 || this.members == null || this._maxSize >= this.members.length) + { + return; + } + var _loc3_:uint = this._maxSize; + var _loc4_:uint = this.members.length; + while(_loc3_ < _loc4_) + { + _loc2_ = this.members[_loc3_++] as FlxBasic; + if(_loc2_ != null) + { + _loc2_.destroy(); + } + } + this.length = this.members.length = this._maxSize; + } + + public function add(param1:FlxBasic) : FlxBasic + { + if(this.members.indexOf(param1) >= 0) + { + return param1; + } + var _loc2_:uint = 0; + var _loc3_:uint = this.members.length; + while(_loc2_ < _loc3_) + { + if(this.members[_loc2_] == null) + { + this.members[_loc2_] = param1; + if(_loc2_ >= this.length) + { + this.length = _loc2_ + 1; + } + return param1; + } + _loc2_++; + } + if(this._maxSize > 0) + { + if(this.members.length >= this._maxSize) + { + return param1; + } + if(this.members.length * 2 <= this._maxSize) + { + this.members.length *= 2; + } + else + { + this.members.length = this._maxSize; + } + } + else + { + this.members.length *= 2; + } + this.members[_loc2_] = param1; + this.length = _loc2_ + 1; + return param1; + } + + public function recycle(param1:Class = null) : FlxBasic + { + var _loc2_:FlxBasic = null; + if(this._maxSize > 0) + { + if(this.length < this._maxSize) + { + if(param1 == null) + { + return null; + } + return this.add(new param1() as FlxBasic); + } + _loc2_ = this.members[this._marker++]; + if(this._marker >= this._maxSize) + { + this._marker = 0; + } + return _loc2_; + } + _loc2_ = this.getFirstAvailable(param1); + if(_loc2_ != null) + { + return _loc2_; + } + if(param1 == null) + { + return null; + } + return this.add(new param1() as FlxBasic); + } + + public function remove(param1:FlxBasic, param2:Boolean = false) : FlxBasic + { + var _loc3_:int = this.members.indexOf(param1); + if(_loc3_ < 0 || _loc3_ >= this.members.length) + { + return null; + } + if(param2) + { + this.members.splice(_loc3_,1); + --this.length; + } + else + { + this.members[_loc3_] = null; + } + return param1; + } + + public function replace(param1:FlxBasic, param2:FlxBasic) : FlxBasic + { + var _loc3_:int = this.members.indexOf(param1); + if(_loc3_ < 0 || _loc3_ >= this.members.length) + { + return null; + } + this.members[_loc3_] = param2; + return param2; + } + + public function sort(param1:String = "y", param2:int = -1) : void + { + this._sortIndex = param1; + this._sortOrder = param2; + this.members.sort(this.sortHandler); + } + + public function setAll(param1:String, param2:Object, param3:Boolean = true) : void + { + var _loc4_:FlxBasic = null; + var _loc5_:uint = 0; + while(_loc5_ < this.length) + { + _loc4_ = this.members[_loc5_++] as FlxBasic; + if(_loc4_ != null) + { + if(param3 && _loc4_ is FlxGroup) + { + (_loc4_ as FlxGroup).setAll(param1,param2,param3); + } + else + { + _loc4_[param1] = param2; + } + } + } + } + + public function callAll(param1:String, param2:Boolean = true) : void + { + var _loc3_:FlxBasic = null; + var _loc4_:uint = 0; + while(_loc4_ < this.length) + { + _loc3_ = this.members[_loc4_++] as FlxBasic; + if(_loc3_ != null) + { + if(param2 && _loc3_ is FlxGroup) + { + (_loc3_ as FlxGroup).callAll(param1,param2); + } + else + { + _loc3_[param1](); + } + } + } + } + + public function getFirstAvailable(param1:Class = null) : FlxBasic + { + var _loc2_:FlxBasic = null; + var _loc3_:uint = 0; + while(_loc3_ < this.length) + { + _loc2_ = this.members[_loc3_++] as FlxBasic; + if(_loc2_ != null && !_loc2_.exists && (param1 == null || _loc2_ is param1)) + { + return _loc2_; + } + } + return null; + } + + public function getFirstNull() : int + { + var _loc1_:FlxBasic = null; + var _loc2_:uint = 0; + var _loc3_:uint = this.members.length; + while(_loc2_ < _loc3_) + { + if(this.members[_loc2_] == null) + { + return _loc2_; + } + _loc2_++; + } + return -1; + } + + public function getFirstExtant() : FlxBasic + { + var _loc1_:FlxBasic = null; + var _loc2_:uint = 0; + while(_loc2_ < this.length) + { + _loc1_ = this.members[_loc2_++] as FlxBasic; + if(_loc1_ != null && _loc1_.exists) + { + return _loc1_; + } + } + return null; + } + + public function getFirstAlive() : FlxBasic + { + var _loc1_:FlxBasic = null; + var _loc2_:uint = 0; + while(_loc2_ < this.length) + { + _loc1_ = this.members[_loc2_++] as FlxBasic; + if(_loc1_ != null && _loc1_.exists && _loc1_.alive) + { + return _loc1_; + } + } + return null; + } + + public function getFirstDead() : FlxBasic + { + var _loc1_:FlxBasic = null; + var _loc2_:uint = 0; + while(_loc2_ < this.length) + { + _loc1_ = this.members[_loc2_++] as FlxBasic; + if(_loc1_ != null && !_loc1_.alive) + { + return _loc1_; + } + } + return null; + } + + public function countLiving() : int + { + var _loc2_:FlxBasic = null; + var _loc1_:int = -1; + var _loc3_:uint = 0; + while(_loc3_ < this.length) + { + _loc2_ = this.members[_loc3_++] as FlxBasic; + if(_loc2_ != null) + { + if(_loc1_ < 0) + { + _loc1_ = 0; + } + if(_loc2_.exists && _loc2_.alive) + { + _loc1_++; + } + } + } + return _loc1_; + } + + public function countDead() : int + { + var _loc2_:FlxBasic = null; + var _loc1_:int = -1; + var _loc3_:uint = 0; + while(_loc3_ < this.length) + { + _loc2_ = this.members[_loc3_++] as FlxBasic; + if(_loc2_ != null) + { + if(_loc1_ < 0) + { + _loc1_ = 0; + } + if(!_loc2_.alive) + { + _loc1_++; + } + } + } + return _loc1_; + } + + public function getRandom() : FlxBasic + { + return FlxG.getRandom(this.members) as FlxBasic; + } + + public function clear() : void + { + this.length = this.members.length = 0; + } + + override public function kill() : void + { + var _loc1_:FlxBasic = null; + var _loc2_:uint = 0; + while(_loc2_ < this.length) + { + _loc1_ = this.members[_loc2_++] as FlxBasic; + if(_loc1_ != null && _loc1_.exists) + { + _loc1_.kill(); + } + } + super.kill(); + } + + protected function sortHandler(param1:FlxBasic, param2:FlxBasic) : int + { + if(param1[this._sortIndex] < param2[this._sortIndex]) + { + return this._sortOrder; + } + if(param1[this._sortIndex] > param2[this._sortIndex]) + { + return -this._sortOrder; + } + return 0; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxObject.as b/research/inner_decompiled/scripts/org/flixel/FlxObject.as new file mode 100644 index 0000000..5607190 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxObject.as @@ -0,0 +1,883 @@ +package org.flixel +{ + import flash.display.Graphics; + + public class FlxObject extends FlxBasic + { + + public static const LEFT:uint = 1; + + public static const RIGHT:uint = 16; + + public static const UP:uint = 256; + + public static const DOWN:uint = 4096; + + public static const NONE:uint = 0; + + public static const CEILING:uint = UP; + + public static const FLOOR:uint = DOWN; + + public static const WALL:uint = LEFT | RIGHT; + + public static const ANY:uint = LEFT | RIGHT | UP | DOWN; + + public static const OVERLAP_BIAS:Number = 4; + + public static const PATH_FORWARD:uint = 0; + + public static const PATH_BACKWARD:uint = 1; + + public static const PATH_LOOP_FORWARD:uint = 16; + + public static const PATH_LOOP_BACKWARD:uint = 256; + + public static const PATH_YOYO:uint = 4096; + + public static const PATH_HORIZONTAL_ONLY:uint = 65536; + + public static const PATH_VERTICAL_ONLY:uint = 1048576; + + protected static const _pZero:FlxPoint = new FlxPoint(); + + public var x:Number; + + public var y:Number; + + public var width:Number; + + public var height:Number; + + public var immovable:Boolean; + + public var velocity:FlxPoint; + + public var mass:Number; + + public var elasticity:Number; + + public var acceleration:FlxPoint; + + public var drag:FlxPoint; + + public var maxVelocity:FlxPoint; + + public var angle:Number; + + public var angularVelocity:Number; + + public var angularAcceleration:Number; + + public var angularDrag:Number; + + public var maxAngular:Number; + + public var scrollFactor:FlxPoint; + + protected var _flicker:Boolean; + + protected var _flickerTimer:Number; + + public var health:Number; + + protected var _point:FlxPoint; + + protected var _rect:FlxRect; + + public var moves:Boolean; + + public var touching:uint; + + public var wasTouching:uint; + + public var allowCollisions:uint; + + public var last:FlxPoint; + + public var path:FlxPath; + + public var pathSpeed:Number; + + public var pathAngle:Number; + + protected var _pathNodeIndex:int; + + protected var _pathMode:uint; + + protected var _pathInc:int; + + protected var _pathRotate:Boolean; + + public function FlxObject(param1:Number = 0, param2:Number = 0, param3:Number = 0, param4:Number = 0) + { + super(); + this.x = param1; + this.y = param2; + this.last = new FlxPoint(this.x,this.y); + this.width = param3; + this.height = param4; + this.mass = 1; + this.elasticity = 0; + this.immovable = false; + this.moves = true; + this.touching = NONE; + this.wasTouching = NONE; + this.allowCollisions = ANY; + this.velocity = new FlxPoint(); + this.acceleration = new FlxPoint(); + this.drag = new FlxPoint(); + this.maxVelocity = new FlxPoint(10000,10000); + this.angle = 0; + this.angularVelocity = 0; + this.angularAcceleration = 0; + this.angularDrag = 0; + this.maxAngular = 10000; + this.scrollFactor = new FlxPoint(1,1); + this._flicker = false; + this._flickerTimer = 0; + this._point = new FlxPoint(); + this._rect = new FlxRect(); + this.path = null; + this.pathSpeed = 0; + this.pathAngle = 0; + } + + public static function separate(param1:FlxObject, param2:FlxObject) : Boolean + { + var _loc3_:Boolean = separateX(param1,param2); + var _loc4_:Boolean = separateY(param1,param2); + return _loc3_ || _loc4_; + } + + public static function separateX(param1:FlxObject, param2:FlxObject) : Boolean + { + var _loc8_:Number = NaN; + var _loc9_:Number = NaN; + var _loc10_:FlxRect = null; + var _loc11_:FlxRect = null; + var _loc12_:Number = NaN; + var _loc13_:Number = NaN; + var _loc14_:Number = NaN; + var _loc15_:Number = NaN; + var _loc16_:Number = NaN; + var _loc17_:Number = NaN; + var _loc3_:Boolean = param1.immovable; + var _loc4_:Boolean = param2.immovable; + if(_loc3_ && _loc4_) + { + return false; + } + if(param1 is FlxTilemap) + { + return (param1 as FlxTilemap).overlapsWithCallback(param2,separateX); + } + if(param2 is FlxTilemap) + { + return (param2 as FlxTilemap).overlapsWithCallback(param1,separateX,true); + } + var _loc5_:Number = 0; + var _loc6_:Number = param1.x - param1.last.x; + var _loc7_:Number = param2.x - param2.last.x; + if(_loc6_ != _loc7_) + { + _loc8_ = _loc6_ > 0 ? _loc6_ : -_loc6_; + _loc9_ = _loc7_ > 0 ? _loc7_ : -_loc7_; + _loc10_ = new FlxRect(param1.x - (_loc6_ > 0 ? _loc6_ : 0),param1.last.y,param1.width + (_loc6_ > 0 ? _loc6_ : -_loc6_),param1.height); + _loc11_ = new FlxRect(param2.x - (_loc7_ > 0 ? _loc7_ : 0),param2.last.y,param2.width + (_loc7_ > 0 ? _loc7_ : -_loc7_),param2.height); + if(_loc10_.x + _loc10_.width > _loc11_.x && _loc10_.x < _loc11_.x + _loc11_.width && _loc10_.y + _loc10_.height > _loc11_.y && _loc10_.y < _loc11_.y + _loc11_.height) + { + _loc12_ = _loc8_ + _loc9_ + OVERLAP_BIAS; + if(_loc6_ > _loc7_) + { + _loc5_ = param1.x + param1.width - param2.x; + if(_loc5_ > _loc12_ || !(param1.allowCollisions & RIGHT) || !(param2.allowCollisions & LEFT)) + { + _loc5_ = 0; + } + else + { + param1.touching |= RIGHT; + param2.touching |= LEFT; + } + } + else if(_loc6_ < _loc7_) + { + _loc5_ = param1.x - param2.width - param2.x; + if(-_loc5_ > _loc12_ || !(param1.allowCollisions & LEFT) || !(param2.allowCollisions & RIGHT)) + { + _loc5_ = 0; + } + else + { + param1.touching |= LEFT; + param2.touching |= RIGHT; + } + } + } + } + if(_loc5_ != 0) + { + _loc13_ = param1.velocity.x; + _loc14_ = param2.velocity.x; + if(!_loc3_ && !_loc4_) + { + _loc5_ *= 0.5; + param1.x -= _loc5_; + param2.x += _loc5_; + _loc15_ = Math.sqrt(_loc14_ * _loc14_ * param2.mass / param1.mass) * (_loc14_ > 0 ? 1 : -1); + _loc16_ = Math.sqrt(_loc13_ * _loc13_ * param1.mass / param2.mass) * (_loc13_ > 0 ? 1 : -1); + _loc17_ = (_loc15_ + _loc16_) * 0.5; + _loc15_ -= _loc17_; + _loc16_ -= _loc17_; + param1.velocity.x = _loc17_ + _loc15_ * param1.elasticity; + param2.velocity.x = _loc17_ + _loc16_ * param2.elasticity; + } + else if(!_loc3_) + { + param1.x -= _loc5_; + param1.velocity.x = _loc14_ - _loc13_ * param1.elasticity; + } + else if(!_loc4_) + { + param2.x += _loc5_; + param2.velocity.x = _loc13_ - _loc14_ * param2.elasticity; + } + return true; + } + return false; + } + + public static function separateY(param1:FlxObject, param2:FlxObject) : Boolean + { + var _loc8_:Number = NaN; + var _loc9_:Number = NaN; + var _loc10_:FlxRect = null; + var _loc11_:FlxRect = null; + var _loc12_:Number = NaN; + var _loc13_:Number = NaN; + var _loc14_:Number = NaN; + var _loc15_:Number = NaN; + var _loc16_:Number = NaN; + var _loc17_:Number = NaN; + var _loc3_:Boolean = param1.immovable; + var _loc4_:Boolean = param2.immovable; + if(_loc3_ && _loc4_) + { + return false; + } + if(param1 is FlxTilemap) + { + return (param1 as FlxTilemap).overlapsWithCallback(param2,separateY); + } + if(param2 is FlxTilemap) + { + return (param2 as FlxTilemap).overlapsWithCallback(param1,separateY,true); + } + var _loc5_:Number = 0; + var _loc6_:Number = param1.y - param1.last.y; + var _loc7_:Number = param2.y - param2.last.y; + if(_loc6_ != _loc7_) + { + _loc8_ = _loc6_ > 0 ? _loc6_ : -_loc6_; + _loc9_ = _loc7_ > 0 ? _loc7_ : -_loc7_; + _loc10_ = new FlxRect(param1.x,param1.y - (_loc6_ > 0 ? _loc6_ : 0),param1.width,param1.height + _loc8_); + _loc11_ = new FlxRect(param2.x,param2.y - (_loc7_ > 0 ? _loc7_ : 0),param2.width,param2.height + _loc9_); + if(_loc10_.x + _loc10_.width > _loc11_.x && _loc10_.x < _loc11_.x + _loc11_.width && _loc10_.y + _loc10_.height > _loc11_.y && _loc10_.y < _loc11_.y + _loc11_.height) + { + _loc12_ = _loc8_ + _loc9_ + OVERLAP_BIAS; + if(_loc6_ > _loc7_) + { + _loc5_ = param1.y + param1.height - param2.y; + if(_loc5_ > _loc12_ || !(param1.allowCollisions & DOWN) || !(param2.allowCollisions & UP)) + { + _loc5_ = 0; + } + else + { + param1.touching |= DOWN; + param2.touching |= UP; + } + } + else if(_loc6_ < _loc7_) + { + _loc5_ = param1.y - param2.height - param2.y; + if(-_loc5_ > _loc12_ || !(param1.allowCollisions & UP) || !(param2.allowCollisions & DOWN)) + { + _loc5_ = 0; + } + else + { + param1.touching |= UP; + param2.touching |= DOWN; + } + } + } + } + if(_loc5_ != 0) + { + _loc13_ = param1.velocity.y; + _loc14_ = param2.velocity.y; + if(!_loc3_ && !_loc4_) + { + _loc5_ *= 0.5; + param1.y -= _loc5_; + param2.y += _loc5_; + _loc15_ = Math.sqrt(_loc14_ * _loc14_ * param2.mass / param1.mass) * (_loc14_ > 0 ? 1 : -1); + _loc16_ = Math.sqrt(_loc13_ * _loc13_ * param1.mass / param2.mass) * (_loc13_ > 0 ? 1 : -1); + _loc17_ = (_loc15_ + _loc16_) * 0.5; + _loc15_ -= _loc17_; + _loc16_ -= _loc17_; + param1.velocity.y = _loc17_ + _loc15_ * param1.elasticity; + param2.velocity.y = _loc17_ + _loc16_ * param2.elasticity; + } + else if(!_loc3_) + { + param1.y -= _loc5_; + param1.velocity.y = _loc14_ - _loc13_ * param1.elasticity; + if(param2.active && param2.moves && _loc6_ > _loc7_) + { + param1.x += param2.x - param2.last.x; + } + } + else if(!_loc4_) + { + param2.y += _loc5_; + param2.velocity.y = _loc13_ - _loc14_ * param2.elasticity; + if(param1.active && param1.moves && _loc6_ < _loc7_) + { + param2.x += param1.x - param1.last.x; + } + } + return true; + } + return false; + } + + override public function destroy() : void + { + this.velocity = null; + this.acceleration = null; + this.drag = null; + this.maxVelocity = null; + this.scrollFactor = null; + this._point = null; + this._rect = null; + this.last = null; + cameras = null; + if(this.path != null) + { + this.path.destroy(); + } + this.path = null; + } + + override public function preUpdate() : void + { + ++_ACTIVECOUNT; + if(this._flickerTimer != 0) + { + if(this._flickerTimer > 0) + { + this._flickerTimer -= FlxG.elapsed; + if(this._flickerTimer <= 0) + { + this._flickerTimer = 0; + this._flicker = false; + } + } + } + this.last.x = this.x; + this.last.y = this.y; + if(this.path != null && this.pathSpeed != 0 && this.path.nodes[this._pathNodeIndex] != null) + { + this.updatePathMotion(); + } + } + + override public function postUpdate() : void + { + if(this.moves) + { + this.updateMotion(); + } + this.wasTouching = this.touching; + this.touching = NONE; + } + + protected function updateMotion() : void + { + var _loc1_:Number = NaN; + var _loc2_:Number = NaN; + _loc2_ = (FlxU.computeVelocity(this.angularVelocity,this.angularAcceleration,this.angularDrag,this.maxAngular) - this.angularVelocity) / 2; + this.angularVelocity += _loc2_; + this.angle += this.angularVelocity * FlxG.elapsed; + this.angularVelocity += _loc2_; + _loc2_ = (FlxU.computeVelocity(this.velocity.x,this.acceleration.x,this.drag.x,this.maxVelocity.x) - this.velocity.x) / 2; + this.velocity.x += _loc2_; + _loc1_ = this.velocity.x * FlxG.elapsed; + this.velocity.x += _loc2_; + this.x += _loc1_; + _loc2_ = (FlxU.computeVelocity(this.velocity.y,this.acceleration.y,this.drag.y,this.maxVelocity.y) - this.velocity.y) / 2; + this.velocity.y += _loc2_; + _loc1_ = this.velocity.y * FlxG.elapsed; + this.velocity.y += _loc2_; + this.y += _loc1_; + } + + override public function draw() : void + { + var _loc1_:FlxCamera = null; + if(cameras == null) + { + cameras = FlxG.cameras; + } + var _loc2_:uint = 0; + var _loc3_:uint = cameras.length; + while(_loc2_ < _loc3_) + { + _loc1_ = cameras[_loc2_++]; + if(this.onScreen(_loc1_)) + { + ++_VISIBLECOUNT; + if(FlxG.visualDebug && !ignoreDrawDebug) + { + this.drawDebug(_loc1_); + } + } + } + } + + override public function drawDebug(param1:FlxCamera = null) : void + { + var _loc7_:uint = 0; + if(param1 == null) + { + param1 = FlxG.camera; + } + var _loc2_:Number = this.x - int(param1.scroll.x * this.scrollFactor.x); + var _loc3_:Number = this.y - int(param1.scroll.y * this.scrollFactor.y); + _loc2_ = int(_loc2_ + (_loc2_ > 0 ? 1e-7 : -1e-7)); + _loc3_ = int(_loc3_ + (_loc3_ > 0 ? 1e-7 : -1e-7)); + var _loc4_:int = this.width != int(this.width) ? int(this.width) : int(this.width - 1); + var _loc5_:int = this.height != int(this.height) ? int(this.height) : int(this.height - 1); + var _loc6_:Graphics = FlxG.flashGfx; + _loc6_.clear(); + _loc6_.moveTo(_loc2_,_loc3_); + if(this.allowCollisions) + { + if(this.allowCollisions != ANY) + { + _loc7_ = FlxG.PINK; + } + if(this.immovable) + { + _loc7_ = FlxG.GREEN; + } + else + { + _loc7_ = FlxG.RED; + } + } + else + { + _loc7_ = FlxG.BLUE; + } + _loc6_.lineStyle(1,_loc7_,0.5); + _loc6_.lineTo(_loc2_ + _loc4_,_loc3_); + _loc6_.lineTo(_loc2_ + _loc4_,_loc3_ + _loc5_); + _loc6_.lineTo(_loc2_,_loc3_ + _loc5_); + _loc6_.lineTo(_loc2_,_loc3_); + param1.buffer.draw(FlxG.flashGfxSprite); + } + + public function followPath(param1:FlxPath, param2:Number = 100, param3:uint = 0, param4:Boolean = false) : void + { + if(param1.nodes.length <= 0) + { + FlxG.log("WARNING: Paths need at least one node in them to be followed."); + return; + } + this.path = param1; + this.pathSpeed = FlxU.abs(param2); + this._pathMode = param3; + this._pathRotate = param4; + if(this._pathMode == PATH_BACKWARD || this._pathMode == PATH_LOOP_BACKWARD) + { + this._pathNodeIndex = this.path.nodes.length - 1; + this._pathInc = -1; + } + else + { + this._pathNodeIndex = 0; + this._pathInc = 1; + } + } + + public function stopFollowingPath(param1:Boolean = false) : void + { + this.pathSpeed = 0; + if(param1 && this.path != null) + { + this.path.destroy(); + this.path = null; + } + } + + protected function advancePath(param1:Boolean = true) : FlxPoint + { + var _loc2_:FlxPoint = null; + if(param1) + { + _loc2_ = this.path.nodes[this._pathNodeIndex]; + if(_loc2_ != null) + { + if((this._pathMode & PATH_VERTICAL_ONLY) == 0) + { + this.x = _loc2_.x - this.width * 0.5; + } + if((this._pathMode & PATH_HORIZONTAL_ONLY) == 0) + { + this.y = _loc2_.y - this.height * 0.5; + } + } + } + this._pathNodeIndex += this._pathInc; + if((this._pathMode & PATH_BACKWARD) > 0) + { + if(this._pathNodeIndex < 0) + { + this._pathNodeIndex = 0; + this.pathSpeed = 0; + } + } + else if((this._pathMode & PATH_LOOP_FORWARD) > 0) + { + if(this._pathNodeIndex >= this.path.nodes.length) + { + this._pathNodeIndex = 0; + } + } + else if((this._pathMode & PATH_LOOP_BACKWARD) > 0) + { + if(this._pathNodeIndex < 0) + { + this._pathNodeIndex = this.path.nodes.length - 1; + if(this._pathNodeIndex < 0) + { + this._pathNodeIndex = 0; + } + } + } + else if((this._pathMode & PATH_YOYO) > 0) + { + if(this._pathInc > 0) + { + if(this._pathNodeIndex >= this.path.nodes.length) + { + this._pathNodeIndex = this.path.nodes.length - 2; + if(this._pathNodeIndex < 0) + { + this._pathNodeIndex = 0; + } + this._pathInc = -this._pathInc; + } + } + else if(this._pathNodeIndex < 0) + { + this._pathNodeIndex = 1; + if(this._pathNodeIndex >= this.path.nodes.length) + { + this._pathNodeIndex = this.path.nodes.length - 1; + } + if(this._pathNodeIndex < 0) + { + this._pathNodeIndex = 0; + } + this._pathInc = -this._pathInc; + } + } + else if(this._pathNodeIndex >= this.path.nodes.length) + { + this._pathNodeIndex = this.path.nodes.length - 1; + this.pathSpeed = 0; + } + return this.path.nodes[this._pathNodeIndex]; + } + + protected function updatePathMotion() : void + { + this._point.x = this.x + this.width * 0.5; + this._point.y = this.y + this.height * 0.5; + var _loc1_:FlxPoint = this.path.nodes[this._pathNodeIndex]; + var _loc2_:Number = _loc1_.x - this._point.x; + var _loc3_:Number = _loc1_.y - this._point.y; + var _loc4_:Boolean = (this._pathMode & PATH_HORIZONTAL_ONLY) > 0; + var _loc5_:Boolean = (this._pathMode & PATH_VERTICAL_ONLY) > 0; + if(_loc4_) + { + if((_loc2_ > 0 ? _loc2_ : -_loc2_) < this.pathSpeed * FlxG.elapsed) + { + _loc1_ = this.advancePath(); + } + } + else if(_loc5_) + { + if((_loc3_ > 0 ? _loc3_ : -_loc3_) < this.pathSpeed * FlxG.elapsed) + { + _loc1_ = this.advancePath(); + } + } + else if(Math.sqrt(_loc2_ * _loc2_ + _loc3_ * _loc3_) < this.pathSpeed * FlxG.elapsed) + { + _loc1_ = this.advancePath(); + } + if(this.pathSpeed != 0) + { + this._point.x = this.x + this.width * 0.5; + this._point.y = this.y + this.height * 0.5; + if(_loc4_ || this._point.y == _loc1_.y) + { + this.velocity.x = this._point.x < _loc1_.x ? this.pathSpeed : -this.pathSpeed; + if(this.velocity.x < 0) + { + this.pathAngle = -90; + } + else + { + this.pathAngle = 90; + } + if(!_loc4_) + { + this.velocity.y = 0; + } + } + else if(_loc5_ || this._point.x == _loc1_.x) + { + this.velocity.y = this._point.y < _loc1_.y ? this.pathSpeed : -this.pathSpeed; + if(this.velocity.y < 0) + { + this.pathAngle = 0; + } + else + { + this.pathAngle = 180; + } + if(!_loc5_) + { + this.velocity.x = 0; + } + } + else + { + this.pathAngle = FlxU.getAngle(this._point,_loc1_); + FlxU.rotatePoint(0,this.pathSpeed,0,0,this.pathAngle,this.velocity); + if(this._pathRotate) + { + this.angularVelocity = 0; + this.angularAcceleration = 0; + this.angle = this.pathAngle; + } + } + } + } + + public function overlaps(param1:FlxBasic, param2:Boolean = false, param3:FlxCamera = null) : Boolean + { + var _loc6_:Boolean = false; + var _loc7_:uint = 0; + var _loc8_:Array = null; + if(param1 is FlxGroup) + { + _loc6_ = false; + _loc7_ = 0; + _loc8_ = (param1 as FlxGroup).members; + while(_loc7_ < length) + { + if(this.overlaps(_loc8_[_loc7_++],param2,param3)) + { + _loc6_ = true; + } + } + return _loc6_; + } + if(param1 is FlxTilemap) + { + return (param1 as FlxTilemap).overlaps(this,param2,param3); + } + var _loc4_:FlxObject = param1 as FlxObject; + if(!param2) + { + return _loc4_.x + _loc4_.width > this.x && _loc4_.x < this.x + this.width && _loc4_.y + _loc4_.height > this.y && _loc4_.y < this.y + this.height; + } + if(param3 == null) + { + param3 = FlxG.camera; + } + var _loc5_:FlxPoint = _loc4_.getScreenXY(null,param3); + this.getScreenXY(this._point,param3); + return _loc5_.x + _loc4_.width > this._point.x && _loc5_.x < this._point.x + this.width && _loc5_.y + _loc4_.height > this._point.y && _loc5_.y < this._point.y + this.height; + } + + public function overlapsAt(param1:Number, param2:Number, param3:FlxBasic, param4:Boolean = false, param5:FlxCamera = null) : Boolean + { + var _loc8_:Boolean = false; + var _loc9_:FlxBasic = null; + var _loc10_:uint = 0; + var _loc11_:Array = null; + var _loc12_:FlxTilemap = null; + if(param3 is FlxGroup) + { + _loc8_ = false; + _loc10_ = 0; + _loc11_ = (param3 as FlxGroup).members; + while(_loc10_ < length) + { + if(this.overlapsAt(param1,param2,_loc11_[_loc10_++],param4,param5)) + { + _loc8_ = true; + } + } + return _loc8_; + } + if(param3 is FlxTilemap) + { + _loc12_ = param3 as FlxTilemap; + return _loc12_.overlapsAt(_loc12_.x - (param1 - this.x),_loc12_.y - (param2 - this.y),this,param4,param5); + } + var _loc6_:FlxObject = param3 as FlxObject; + if(!param4) + { + return _loc6_.x + _loc6_.width > param1 && _loc6_.x < param1 + this.width && _loc6_.y + _loc6_.height > param2 && _loc6_.y < param2 + this.height; + } + if(param5 == null) + { + param5 = FlxG.camera; + } + var _loc7_:FlxPoint = _loc6_.getScreenXY(null,param5); + this._point.x = param1 - int(param5.scroll.x * this.scrollFactor.x); + this._point.y = param2 - int(param5.scroll.y * this.scrollFactor.y); + this._point.x += this._point.x > 0 ? 1e-7 : -1e-7; + this._point.y += this._point.y > 0 ? 1e-7 : -1e-7; + return _loc7_.x + _loc6_.width > this._point.x && _loc7_.x < this._point.x + this.width && _loc7_.y + _loc6_.height > this._point.y && _loc7_.y < this._point.y + this.height; + } + + public function overlapsPoint(param1:FlxPoint, param2:Boolean = false, param3:FlxCamera = null) : Boolean + { + if(!param2) + { + return param1.x > this.x && param1.x < this.x + this.width && param1.y > this.y && param1.y < this.y + this.height; + } + if(param3 == null) + { + param3 = FlxG.camera; + } + var _loc4_:Number = param1.x - param3.scroll.x; + var _loc5_:Number = param1.y - param3.scroll.y; + this.getScreenXY(this._point,param3); + return _loc4_ > this._point.x && _loc4_ < this._point.x + this.width && _loc5_ > this._point.y && _loc5_ < this._point.y + this.height; + } + + public function onScreen(param1:FlxCamera = null) : Boolean + { + if(param1 == null) + { + param1 = FlxG.camera; + } + this.getScreenXY(this._point,param1); + return this._point.x + this.width > 0 && this._point.x < param1.width && this._point.y + this.height > 0 && this._point.y < param1.height; + } + + public function getScreenXY(param1:FlxPoint = null, param2:FlxCamera = null) : FlxPoint + { + if(param1 == null) + { + param1 = new FlxPoint(); + } + if(param2 == null) + { + param2 = FlxG.camera; + } + param1.x = this.x - int(param2.scroll.x * this.scrollFactor.x); + param1.y = this.y - int(param2.scroll.y * this.scrollFactor.y); + param1.x += param1.x > 0 ? 1e-7 : -1e-7; + param1.y += param1.y > 0 ? 1e-7 : -1e-7; + return param1; + } + + public function flicker(param1:Number = 1) : void + { + this._flickerTimer = param1; + if(this._flickerTimer == 0) + { + this._flicker = false; + } + } + + public function get flickering() : Boolean + { + return this._flickerTimer != 0; + } + + public function get solid() : Boolean + { + return (this.allowCollisions & ANY) > NONE; + } + + public function set solid(param1:Boolean) : void + { + if(param1) + { + this.allowCollisions = ANY; + } + else + { + this.allowCollisions = NONE; + } + } + + public function getMidpoint(param1:FlxPoint = null) : FlxPoint + { + if(param1 == null) + { + param1 = new FlxPoint(); + } + param1.x = this.x + this.width * 0.5; + param1.y = this.y + this.height * 0.5; + return param1; + } + + public function reset(param1:Number, param2:Number) : void + { + revive(); + this.touching = NONE; + this.wasTouching = NONE; + this.x = param1; + this.y = param2; + this.last.x = this.x; + this.last.y = this.y; + this.velocity.x = 0; + this.velocity.y = 0; + } + + public function isTouching(param1:uint) : Boolean + { + return (this.touching & param1) > NONE; + } + + public function justTouched(param1:uint) : Boolean + { + return (this.touching & param1) > NONE && (this.wasTouching & param1) <= NONE; + } + + public function hurt(param1:Number) : void + { + this.health -= param1; + if(this.health <= 0) + { + kill(); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxParticle.as b/research/inner_decompiled/scripts/org/flixel/FlxParticle.as new file mode 100644 index 0000000..9fc17a6 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxParticle.as @@ -0,0 +1,68 @@ +package org.flixel +{ + public class FlxParticle extends FlxSprite + { + + public var lifespan:Number; + + public var friction:Number; + + public function FlxParticle() + { + super(); + this.lifespan = 0; + this.friction = 500; + } + + override public function update() : void + { + if(this.lifespan <= 0) + { + return; + } + this.lifespan -= FlxG.elapsed; + if(this.lifespan <= 0) + { + kill(); + } + if(touching) + { + if(angularVelocity != 0) + { + angularVelocity = -angularVelocity; + } + } + if(acceleration.y > 0) + { + if(touching & FLOOR) + { + drag.x = this.friction; + if(!(wasTouching & FLOOR)) + { + if(velocity.y < -elasticity * 10) + { + if(angularVelocity != 0) + { + angularVelocity *= -elasticity; + } + } + else + { + velocity.y = 0; + angularVelocity = 0; + } + } + } + else + { + drag.x = 0; + } + } + } + + public function onEmit() : void + { + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxPath.as b/research/inner_decompiled/scripts/org/flixel/FlxPath.as new file mode 100644 index 0000000..bd3efa9 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxPath.as @@ -0,0 +1,211 @@ +package org.flixel +{ + import flash.display.Graphics; + import org.flixel.plugin.DebugPathDisplay; + + public class FlxPath + { + + public var nodes:Array; + + public var debugColor:uint; + + public var debugScrollFactor:FlxPoint; + + public var ignoreDrawDebug:Boolean; + + protected var _point:FlxPoint; + + public function FlxPath(param1:Array = null) + { + super(); + if(param1 == null) + { + this.nodes = new Array(); + } + else + { + this.nodes = param1; + } + this._point = new FlxPoint(); + this.debugScrollFactor = new FlxPoint(1,1); + this.debugColor = 16777215; + this.ignoreDrawDebug = false; + var _loc2_:DebugPathDisplay = manager; + if(_loc2_ != null) + { + _loc2_.add(this); + } + } + + public static function get manager() : DebugPathDisplay + { + return FlxG.getPlugin(DebugPathDisplay) as DebugPathDisplay; + } + + public function destroy() : void + { + var _loc1_:DebugPathDisplay = manager; + if(_loc1_ != null) + { + _loc1_.remove(this); + } + this.debugScrollFactor = null; + this._point = null; + this.nodes = null; + } + + public function add(param1:Number, param2:Number) : void + { + this.nodes.push(new FlxPoint(param1,param2)); + } + + public function addAt(param1:Number, param2:Number, param3:uint) : void + { + if(param3 > this.nodes.length) + { + param3 = this.nodes.length; + } + this.nodes.splice(param3,0,new FlxPoint(param1,param2)); + } + + public function addPoint(param1:FlxPoint, param2:Boolean = false) : void + { + if(param2) + { + this.nodes.push(param1); + } + else + { + this.nodes.push(new FlxPoint(param1.x,param1.y)); + } + } + + public function addPointAt(param1:FlxPoint, param2:uint, param3:Boolean = false) : void + { + if(param2 > this.nodes.length) + { + param2 = this.nodes.length; + } + if(param3) + { + this.nodes.splice(param2,0,param1); + } + else + { + this.nodes.splice(param2,0,new FlxPoint(param1.x,param1.y)); + } + } + + public function remove(param1:FlxPoint) : FlxPoint + { + var _loc2_:int = this.nodes.indexOf(param1); + if(_loc2_ >= 0) + { + return this.nodes.splice(_loc2_,1)[0]; + } + return null; + } + + public function removeAt(param1:uint) : FlxPoint + { + if(this.nodes.length <= 0) + { + return null; + } + if(param1 >= this.nodes.length) + { + param1 = this.nodes.length - 1; + } + return this.nodes.splice(param1,1)[0]; + } + + public function head() : FlxPoint + { + if(this.nodes.length > 0) + { + return this.nodes[0]; + } + return null; + } + + public function tail() : FlxPoint + { + if(this.nodes.length > 0) + { + return this.nodes[this.nodes.length - 1]; + } + return null; + } + + public function drawDebug(param1:FlxCamera = null) : void + { + var _loc3_:FlxPoint = null; + var _loc4_:FlxPoint = null; + var _loc7_:uint = 0; + var _loc8_:uint = 0; + var _loc9_:Number = NaN; + if(this.nodes.length <= 0) + { + return; + } + if(param1 == null) + { + param1 = FlxG.camera; + } + var _loc2_:Graphics = FlxG.flashGfx; + _loc2_.clear(); + var _loc5_:uint = 0; + var _loc6_:uint = this.nodes.length; + while(_loc5_ < _loc6_) + { + _loc3_ = this.nodes[_loc5_] as FlxPoint; + this._point.x = _loc3_.x - int(param1.scroll.x * this.debugScrollFactor.x); + this._point.y = _loc3_.y - int(param1.scroll.y * this.debugScrollFactor.y); + this._point.x = int(this._point.x + (this._point.x > 0 ? 1e-7 : -1e-7)); + this._point.y = int(this._point.y + (this._point.y > 0 ? 1e-7 : -1e-7)); + _loc7_ = 2; + if(_loc5_ == 0 || _loc5_ == _loc6_ - 1) + { + _loc7_ *= 2; + } + _loc8_ = this.debugColor; + if(_loc6_ > 1) + { + if(_loc5_ == 0) + { + _loc8_ = FlxG.GREEN; + } + else if(_loc5_ == _loc6_ - 1) + { + _loc8_ = FlxG.RED; + } + } + _loc2_.beginFill(_loc8_,0.5); + _loc2_.lineStyle(); + _loc2_.drawRect(this._point.x - _loc7_ * 0.5,this._point.y - _loc7_ * 0.5,_loc7_,_loc7_); + _loc2_.endFill(); + _loc9_ = 0.3; + if(_loc5_ < _loc6_ - 1) + { + _loc4_ = this.nodes[_loc5_ + 1]; + } + else + { + _loc4_ = this.nodes[0]; + _loc9_ = 0.15; + } + _loc2_.moveTo(this._point.x,this._point.y); + _loc2_.lineStyle(1,this.debugColor,_loc9_); + this._point.x = _loc4_.x - int(param1.scroll.x * this.debugScrollFactor.x); + this._point.y = _loc4_.y - int(param1.scroll.y * this.debugScrollFactor.y); + this._point.x = int(this._point.x + (this._point.x > 0 ? 1e-7 : -1e-7)); + this._point.y = int(this._point.y + (this._point.y > 0 ? 1e-7 : -1e-7)); + _loc2_.lineTo(this._point.x,this._point.y); + _loc5_++; + } + param1.buffer.draw(FlxG.flashGfxSprite); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxPoint.as b/research/inner_decompiled/scripts/org/flixel/FlxPoint.as new file mode 100644 index 0000000..cac7844 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxPoint.as @@ -0,0 +1,55 @@ +package org.flixel +{ + import flash.geom.Point; + + public class FlxPoint + { + + public var x:Number; + + public var y:Number; + + public function FlxPoint(param1:Number = 0, param2:Number = 0) + { + super(); + this.x = param1; + this.y = param2; + } + + public function make(param1:Number = 0, param2:Number = 0) : FlxPoint + { + this.x = param1; + this.y = param2; + return this; + } + + public function copyFrom(param1:FlxPoint) : FlxPoint + { + this.x = param1.x; + this.y = param1.y; + return this; + } + + public function copyTo(param1:FlxPoint) : FlxPoint + { + param1.x = this.x; + param1.y = this.y; + return param1; + } + + public function copyFromFlash(param1:Point) : FlxPoint + { + this.x = param1.x; + this.y = param1.y; + return this; + } + + public function copyToFlash(param1:Point) : Point + { + param1.x = this.x; + param1.y = this.y; + return param1; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxRect.as b/research/inner_decompiled/scripts/org/flixel/FlxRect.as new file mode 100644 index 0000000..f5e66a4 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxRect.as @@ -0,0 +1,96 @@ +package org.flixel +{ + import flash.geom.Rectangle; + + public class FlxRect + { + + public var x:Number; + + public var y:Number; + + public var width:Number; + + public var height:Number; + + public function FlxRect(param1:Number = 0, param2:Number = 0, param3:Number = 0, param4:Number = 0) + { + super(); + this.x = param1; + this.y = param2; + this.width = param3; + this.height = param4; + } + + public function get left() : Number + { + return this.x; + } + + public function get right() : Number + { + return this.x + this.width; + } + + public function get top() : Number + { + return this.y; + } + + public function get bottom() : Number + { + return this.y + this.height; + } + + public function make(param1:Number = 0, param2:Number = 0, param3:Number = 0, param4:Number = 0) : FlxRect + { + this.x = param1; + this.y = param2; + this.width = param3; + this.height = param4; + return this; + } + + public function copyFrom(param1:FlxRect) : FlxRect + { + this.x = param1.x; + this.y = param1.y; + this.width = param1.width; + this.height = param1.height; + return this; + } + + public function copyTo(param1:FlxRect) : FlxRect + { + param1.x = this.x; + param1.y = this.y; + param1.width = this.width; + param1.height = this.height; + return param1; + } + + public function copyFromFlash(param1:Rectangle) : FlxRect + { + this.x = param1.x; + this.y = param1.y; + this.width = param1.width; + this.height = param1.height; + return this; + } + + public function copyToFlash(param1:Rectangle) : Rectangle + { + param1.x = this.x; + param1.y = this.y; + param1.width = this.width; + param1.height = this.height; + return param1; + } + + public function overlaps(param1:FlxRect) : Boolean + { + return param1.x + param1.width > this.x && param1.x < this.x + this.width && param1.y + param1.height > this.y && param1.y < this.y + this.height; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxSave.as b/research/inner_decompiled/scripts/org/flixel/FlxSave.as new file mode 100644 index 0000000..8bf1601 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxSave.as @@ -0,0 +1,140 @@ +package org.flixel +{ + import flash.events.NetStatusEvent; + import flash.net.SharedObject; + import flash.net.SharedObjectFlushStatus; + + public class FlxSave + { + + protected static var SUCCESS:uint = 0; + + protected static var PENDING:uint = 1; + + protected static var ERROR:uint = 2; + + public var data:Object; + + public var name:String; + + protected var _sharedObject:SharedObject; + + protected var _onComplete:Function; + + protected var _closeRequested:Boolean; + + public function FlxSave() + { + super(); + this.destroy(); + } + + public function destroy() : void + { + this._sharedObject = null; + this.name = null; + this.data = null; + this._onComplete = null; + this._closeRequested = false; + } + + public function bind(param1:String) : Boolean + { + var Name:String = param1; + this.destroy(); + this.name = Name; + try + { + this._sharedObject = SharedObject.getLocal(this.name); + } + catch(e:Error) + { + FlxG.log("ERROR: There was a problem binding to\nthe shared object data from FlxSave."); + destroy(); + return false; + } + this.data = this._sharedObject.data; + return true; + } + + public function close(param1:uint = 0, param2:Function = null) : Boolean + { + this._closeRequested = true; + return this.flush(param1,param2); + } + + public function flush(param1:uint = 0, param2:Function = null) : Boolean + { + var result:String; + var MinFileSize:uint = param1; + var OnComplete:Function = param2; + if(!this.checkBinding()) + { + return false; + } + this._onComplete = OnComplete; + result = null; + try + { + result = this._sharedObject.flush(MinFileSize); + } + catch(e:Error) + { + return onDone(ERROR); + } + if(result == SharedObjectFlushStatus.PENDING) + { + this._sharedObject.addEventListener(NetStatusEvent.NET_STATUS,this.onFlushStatus); + } + return this.onDone(result == SharedObjectFlushStatus.FLUSHED ? SUCCESS : PENDING); + } + + public function erase() : Boolean + { + if(!this.checkBinding()) + { + return false; + } + this._sharedObject.clear(); + return true; + } + + protected function onFlushStatus(param1:NetStatusEvent) : void + { + this._sharedObject.removeEventListener(NetStatusEvent.NET_STATUS,this.onFlushStatus); + this.onDone(param1.info.code == "SharedObject.Flush.Success" ? SUCCESS : ERROR); + } + + protected function onDone(param1:uint) : Boolean + { + switch(param1) + { + case PENDING: + FlxG.log("FLIXEL: FlxSave is requesting extra storage space."); + break; + case ERROR: + FlxG.log("ERROR: There was a problem flushing\nthe shared object data from FlxSave."); + } + if(this._onComplete != null) + { + this._onComplete(param1 == SUCCESS); + } + if(this._closeRequested) + { + this.destroy(); + } + return param1 == SUCCESS; + } + + protected function checkBinding() : Boolean + { + if(this._sharedObject == null) + { + FlxG.log("FLIXEL: You must call FlxSave.bind()\nbefore you can read or write data."); + return false; + } + return true; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxSound.as b/research/inner_decompiled/scripts/org/flixel/FlxSound.as new file mode 100644 index 0000000..e094502 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxSound.as @@ -0,0 +1,395 @@ +package org.flixel +{ + import flash.events.Event; + import flash.media.Sound; + import flash.media.SoundChannel; + import flash.media.SoundTransform; + import flash.net.URLRequest; + + public class FlxSound extends FlxBasic + { + + public var x:Number; + + public var y:Number; + + public var survive:Boolean; + + public var name:String; + + public var artist:String; + + public var amplitude:Number; + + public var amplitudeLeft:Number; + + public var amplitudeRight:Number; + + protected var _sound:Sound; + + protected var _channel:SoundChannel; + + protected var _transform:SoundTransform; + + protected var _position:Number; + + protected var _volume:Number; + + protected var _volumeAdjust:Number; + + protected var _looped:Boolean; + + protected var _target:FlxObject; + + protected var _radius:Number; + + protected var _pan:Boolean; + + protected var _fadeOutTimer:Number; + + protected var _fadeOutTotal:Number; + + protected var _pauseOnFadeOut:Boolean; + + protected var _fadeInTimer:Number; + + protected var _fadeInTotal:Number; + + public function FlxSound() + { + super(); + this.createSound(); + } + + protected function createSound() : void + { + this.destroy(); + this.x = 0; + this.y = 0; + if(this._transform == null) + { + this._transform = new SoundTransform(); + } + this._transform.pan = 0; + this._sound = null; + this._position = 0; + this._volume = 1; + this._volumeAdjust = 1; + this._looped = false; + this._target = null; + this._radius = 0; + this._pan = false; + this._fadeOutTimer = 0; + this._fadeOutTotal = 0; + this._pauseOnFadeOut = false; + this._fadeInTimer = 0; + this._fadeInTotal = 0; + exists = false; + active = false; + visible = false; + this.name = null; + this.artist = null; + this.amplitude = 0; + this.amplitudeLeft = 0; + this.amplitudeRight = 0; + } + + override public function destroy() : void + { + this.stop(); + this._transform = null; + this._sound = null; + this._target = null; + this.name = null; + this.artist = null; + super.destroy(); + } + + override public function update() : void + { + var _loc3_:Number = NaN; + if(this._position != 0) + { + return; + } + var _loc1_:Number = 1; + var _loc2_:Number = 1; + if(this._target != null) + { + _loc1_ = FlxU.getDistance(new FlxPoint(this._target.x,this._target.y),new FlxPoint(this.x,this.y)) / this._radius; + if(_loc1_ < 0) + { + _loc1_ = 0; + } + if(_loc1_ > 1) + { + _loc1_ = 1; + } + if(this._pan) + { + _loc3_ = (this._target.x - this.x) / this._radius; + if(_loc3_ < -1) + { + _loc3_ = -1; + } + else if(_loc3_ > 1) + { + _loc3_ = 1; + } + this._transform.pan = _loc3_; + } + } + if(this._fadeOutTimer > 0) + { + this._fadeOutTimer -= FlxG.elapsed; + if(this._fadeOutTimer <= 0) + { + if(this._pauseOnFadeOut) + { + this.pause(); + } + else + { + this.stop(); + } + } + _loc2_ = this._fadeOutTimer / this._fadeOutTotal; + if(_loc2_ < 0) + { + _loc2_ = 0; + } + } + else if(this._fadeInTimer > 0) + { + this._fadeInTimer -= FlxG.elapsed; + _loc2_ = this._fadeInTimer / this._fadeInTotal; + if(_loc2_ < 0) + { + _loc2_ = 0; + } + _loc2_ = 1 - _loc2_; + } + this._volumeAdjust = _loc1_ * _loc2_; + this.updateTransform(); + if(this._transform.volume > 0 && this._channel != null) + { + this.amplitudeLeft = this._channel.leftPeak / this._transform.volume; + this.amplitudeRight = this._channel.rightPeak / this._transform.volume; + this.amplitude = (this.amplitudeLeft + this.amplitudeRight) * 0.5; + } + } + + public function loadEmbedded(param1:Class, param2:Boolean = false) : FlxSound + { + this.stop(); + this.createSound(); + this._sound = new param1(); + this._looped = param2; + this.updateTransform(); + exists = true; + return this; + } + + public function loadStream(param1:String, param2:Boolean = false) : FlxSound + { + this.stop(); + this.createSound(); + this._sound = new Sound(); + this._sound.addEventListener(Event.ID3,this.gotID3); + this._sound.load(new URLRequest(param1)); + this._looped = param2; + this.updateTransform(); + exists = true; + return this; + } + + public function proximity(param1:Number, param2:Number, param3:FlxObject, param4:Number, param5:Boolean = true) : FlxSound + { + this.x = param1; + this.y = param2; + this._target = param3; + this._radius = param4; + this._pan = param5; + return this; + } + + public function play(param1:Number = 0) : void + { + if(this._position < 0) + { + return; + } + if(this._looped) + { + if(this._position == 0) + { + if(this._channel == null) + { + this._channel = this._sound.play(param1,9999,this._transform); + } + if(this._channel == null) + { + exists = false; + } + } + else + { + this._channel = this._sound.play(this._position,0,this._transform); + if(this._channel == null) + { + exists = false; + } + else + { + this._channel.addEventListener(Event.SOUND_COMPLETE,this.looped); + } + } + } + else if(this._position == 0) + { + if(this._channel == null) + { + this._channel = this._sound.play(0,0,this._transform); + if(this._channel == null) + { + exists = false; + } + else + { + this._channel.addEventListener(Event.SOUND_COMPLETE,this.stopped); + } + } + } + else + { + this._channel = this._sound.play(this._position,0,this._transform); + if(this._channel == null) + { + exists = false; + } + } + active = this._channel != null; + this._position = 0; + } + + public function pause() : void + { + if(this._channel == null) + { + this._position = -1; + return; + } + this._position = this._channel.position; + this._channel.stop(); + if(this._looped) + { + while(this._position >= this._sound.length) + { + this._position -= this._sound.length; + } + } + this._channel = null; + active = false; + } + + public function stop() : void + { + this._position = 0; + if(this._channel != null) + { + this._channel.stop(); + this.stopped(); + } + } + + public function fadeOut(param1:Number, param2:Boolean = false) : void + { + this._pauseOnFadeOut = param2; + this._fadeInTimer = 0; + this._fadeOutTimer = param1; + this._fadeOutTotal = this._fadeOutTimer; + } + + public function fadeIn(param1:Number) : void + { + this._fadeOutTimer = 0; + this._fadeInTimer = param1; + this._fadeInTotal = this._fadeInTimer; + this.play(); + } + + public function get volume() : Number + { + return this._volume; + } + + public function set volume(param1:Number) : void + { + this._volume = param1; + if(this._volume < 0) + { + this._volume = 0; + } + else if(this._volume > 1) + { + this._volume = 1; + } + this.updateTransform(); + } + + public function getActualVolume() : Number + { + return this._volume * this._volumeAdjust; + } + + internal function updateTransform() : void + { + this._transform.volume = (FlxG.mute ? 0 : 1) * FlxG.volume * this._volume * this._volumeAdjust; + if(this._channel != null) + { + this._channel.soundTransform = this._transform; + } + } + + protected function looped(param1:Event = null) : void + { + if(this._channel == null) + { + return; + } + this._channel.removeEventListener(Event.SOUND_COMPLETE,this.looped); + this._channel = null; + this.play(); + } + + protected function stopped(param1:Event = null) : void + { + if(!this._looped) + { + this._channel.removeEventListener(Event.SOUND_COMPLETE,this.stopped); + } + else + { + this._channel.removeEventListener(Event.SOUND_COMPLETE,this.looped); + } + this._channel = null; + exists = false; + active = false; + } + + protected function gotID3(param1:Event = null) : void + { + FlxG.log("got ID3 info!"); + if(this._sound.id3.songName.length > 0) + { + this.name = this._sound.id3.songName; + } + if(this._sound.id3.artist.length > 0) + { + this.artist = this._sound.id3.artist; + } + this._sound.removeEventListener(Event.ID3,this.gotID3); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxSprite.as b/research/inner_decompiled/scripts/org/flixel/FlxSprite.as new file mode 100644 index 0000000..3dee86f --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxSprite.as @@ -0,0 +1,733 @@ +package org.flixel +{ + import flash.display.BitmapData; + import flash.display.Graphics; + import flash.geom.ColorTransform; + import flash.geom.Matrix; + import flash.geom.Point; + import flash.geom.Rectangle; + import org.flixel.system.FlxAnim; + + public class FlxSprite extends FlxObject + { + + protected var ImgDefault:Class = FlxSprite_ImgDefault; + + public var origin:FlxPoint; + + public var offset:FlxPoint; + + public var scale:FlxPoint; + + public var blend:String; + + public var antialiasing:Boolean; + + public var finished:Boolean; + + public var frameWidth:uint; + + public var frameHeight:uint; + + public var frames:uint; + + public var framePixels:BitmapData; + + public var dirty:Boolean; + + protected var _animations:Array; + + protected var _flipped:uint; + + protected var _curAnim:FlxAnim; + + protected var _curFrame:uint; + + protected var _curIndex:uint; + + protected var _frameTimer:Number; + + protected var _callback:Function; + + protected var _facing:uint; + + protected var _alpha:Number; + + protected var _color:uint; + + protected var _bakedRotation:Number; + + protected var _pixels:BitmapData; + + protected var _flashPoint:Point; + + protected var _flashRect:Rectangle; + + protected var _flashRect2:Rectangle; + + protected var _flashPointZero:Point; + + protected var _colorTransform:ColorTransform; + + protected var _matrix:Matrix; + + public function FlxSprite(param1:Number = 0, param2:Number = 0, param3:Class = null) + { + super(param1,param2); + health = 1; + this._flashPoint = new Point(); + this._flashRect = new Rectangle(); + this._flashRect2 = new Rectangle(); + this._flashPointZero = new Point(); + this.offset = new FlxPoint(); + this.origin = new FlxPoint(); + this.scale = new FlxPoint(1,1); + this._alpha = 1; + this._color = 16777215; + this.blend = null; + this.antialiasing = false; + cameras = null; + this.finished = false; + this._facing = RIGHT; + this._animations = new Array(); + this._flipped = 0; + this._curAnim = null; + this._curFrame = 0; + this._curIndex = 0; + this._frameTimer = 0; + this._matrix = new Matrix(); + this._callback = null; + if(param3 == null) + { + param3 = this.ImgDefault; + } + this.loadGraphic(param3); + } + + override public function destroy() : void + { + var _loc1_:FlxAnim = null; + var _loc2_:uint = 0; + var _loc3_:uint = 0; + if(this._animations != null) + { + _loc2_ = 0; + _loc3_ = this._animations.length; + while(_loc2_ < _loc3_) + { + _loc1_ = this._animations[_loc2_++]; + if(_loc1_ != null) + { + _loc1_.destroy(); + } + } + this._animations = null; + } + this._flashPoint = null; + this._flashRect = null; + this._flashRect2 = null; + this._flashPointZero = null; + this.offset = null; + this.origin = null; + this.scale = null; + this._curAnim = null; + this._matrix = null; + this._callback = null; + this.framePixels = null; + } + + public function loadGraphic(param1:Class, param2:Boolean = false, param3:Boolean = false, param4:uint = 0, param5:uint = 0, param6:Boolean = false) : FlxSprite + { + this._bakedRotation = 0; + this._pixels = FlxG.addBitmap(param1,param3,param6); + if(param3) + { + this._flipped = this._pixels.width >> 1; + } + else + { + this._flipped = 0; + } + if(param4 == 0) + { + if(param2) + { + param4 = uint(this._pixels.height); + } + else if(this._flipped > 0) + { + param4 = this._pixels.width * 0.5; + } + else + { + param4 = uint(this._pixels.width); + } + } + width = this.frameWidth = param4; + if(param5 == 0) + { + if(param2) + { + param5 = width; + } + else + { + param5 = uint(this._pixels.height); + } + } + height = this.frameHeight = param5; + this.resetHelpers(); + return this; + } + + public function loadRotatedGraphic(param1:Class, param2:uint = 16, param3:int = -1, param4:Boolean = false, param5:Boolean = false) : FlxSprite + { + var _loc12_:BitmapData = null; + var _loc13_:uint = 0; + var _loc14_:uint = 0; + var _loc15_:uint = 0; + var _loc16_:uint = 0; + var _loc17_:uint = 0; + var _loc18_:Number = NaN; + var _loc19_:uint = 0; + var _loc20_:uint = 0; + var _loc21_:uint = 0; + var _loc22_:uint = 0; + var _loc6_:uint = Math.sqrt(param2); + var _loc7_:BitmapData = FlxG.addBitmap(param1); + if(param3 >= 0) + { + _loc12_ = _loc7_; + _loc7_ = new BitmapData(_loc12_.height,_loc12_.height); + _loc13_ = param3 * _loc7_.width; + _loc14_ = 0; + _loc15_ = uint(_loc12_.width); + if(_loc13_ >= _loc15_) + { + _loc14_ = uint(_loc13_ / _loc15_) * _loc7_.height; + _loc13_ %= _loc15_; + } + this._flashRect.x = _loc13_; + this._flashRect.y = _loc14_; + this._flashRect.width = _loc7_.width; + this._flashRect.height = _loc7_.height; + _loc7_.copyPixels(_loc12_,this._flashRect,this._flashPointZero); + } + var _loc8_:uint = uint(_loc7_.width); + if(_loc7_.height > _loc8_) + { + _loc8_ = uint(_loc7_.height); + } + if(param5) + { + _loc8_ *= 1.5; + } + var _loc9_:uint = FlxU.ceil(param2 / _loc6_); + width = _loc8_ * _loc9_; + height = _loc8_ * _loc6_; + var _loc10_:String = String(param1) + ":" + param3 + ":" + width + "x" + height; + var _loc11_:Boolean = FlxG.checkBitmapCache(_loc10_); + this._pixels = FlxG.createBitmap(width,height,0,true,_loc10_); + width = this.frameWidth = this._pixels.width; + height = this.frameHeight = this._pixels.height; + this._bakedRotation = 360 / param2; + if(!_loc11_) + { + _loc16_ = 0; + _loc18_ = 0; + _loc19_ = _loc7_.width * 0.5; + _loc20_ = _loc7_.height * 0.5; + _loc21_ = _loc8_ * 0.5; + _loc22_ = _loc8_ * 0.5; + while(_loc16_ < _loc6_) + { + _loc17_ = 0; + while(_loc17_ < _loc9_) + { + this._matrix.identity(); + this._matrix.translate(-_loc19_,-_loc20_); + this._matrix.rotate(_loc18_ * 0.017453293); + this._matrix.translate(_loc8_ * _loc17_ + _loc21_,_loc22_); + _loc18_ += this._bakedRotation; + this._pixels.draw(_loc7_,this._matrix,null,null,null,param4); + _loc17_++; + } + _loc22_ += _loc8_; + _loc16_++; + } + } + this.frameWidth = this.frameHeight = width = height = _loc8_; + this.resetHelpers(); + if(param5) + { + width = _loc7_.width; + height = _loc7_.height; + this.centerOffsets(); + } + return this; + } + + public function makeGraphic(param1:uint, param2:uint, param3:uint = 4294967295, param4:Boolean = false, param5:String = null) : FlxSprite + { + this._bakedRotation = 0; + this._pixels = FlxG.createBitmap(param1,param2,param3,param4,param5); + width = this.frameWidth = this._pixels.width; + height = this.frameHeight = this._pixels.height; + this.resetHelpers(); + return this; + } + + protected function resetHelpers() : void + { + this._flashRect.x = 0; + this._flashRect.y = 0; + this._flashRect.width = this.frameWidth; + this._flashRect.height = this.frameHeight; + this._flashRect2.x = 0; + this._flashRect2.y = 0; + this._flashRect2.width = this._pixels.width; + this._flashRect2.height = this._pixels.height; + if(this.framePixels == null || this.framePixels.width != width || this.framePixels.height != height) + { + this.framePixels = new BitmapData(width,height); + } + this.origin.make(this.frameWidth * 0.5,this.frameHeight * 0.5); + this.framePixels.copyPixels(this._pixels,this._flashRect,this._flashPointZero); + this.frames = this._flashRect2.width / this._flashRect.width * (this._flashRect2.height / this._flashRect.height); + if(this._colorTransform != null) + { + this.framePixels.colorTransform(this._flashRect,this._colorTransform); + } + this._curIndex = 0; + } + + override public function postUpdate() : void + { + super.postUpdate(); + this.updateAnimation(); + } + + override public function draw() : void + { + var _loc1_:FlxCamera = null; + if(_flickerTimer != 0) + { + _flicker = !_flicker; + if(_flicker) + { + return; + } + } + if(this.dirty) + { + this.calcFrame(); + } + if(cameras == null) + { + cameras = FlxG.cameras; + } + var _loc2_:uint = 0; + var _loc3_:uint = cameras.length; + while(_loc2_ < _loc3_) + { + _loc1_ = cameras[_loc2_++]; + if(this.onScreen(_loc1_)) + { + _point.x = x - int(_loc1_.scroll.x * scrollFactor.x) - this.offset.x; + _point.y = y - int(_loc1_.scroll.y * scrollFactor.y) - this.offset.y; + _point.x += _point.x > 0 ? 1e-7 : -1e-7; + _point.y += _point.y > 0 ? 1e-7 : -1e-7; + if((angle == 0 || this._bakedRotation > 0) && this.scale.x == 1 && this.scale.y == 1 && this.blend == null) + { + this._flashPoint.x = _point.x; + this._flashPoint.y = _point.y; + _loc1_.buffer.copyPixels(this.framePixels,this._flashRect,this._flashPoint,null,null,true); + } + else + { + this._matrix.identity(); + this._matrix.translate(-this.origin.x,-this.origin.y); + this._matrix.scale(this.scale.x,this.scale.y); + if(angle != 0 && this._bakedRotation <= 0) + { + this._matrix.rotate(angle * 0.017453293); + } + this._matrix.translate(_point.x + this.origin.x,_point.y + this.origin.y); + _loc1_.buffer.draw(this.framePixels,this._matrix,null,this.blend,null,this.antialiasing); + } + ++_VISIBLECOUNT; + if(FlxG.visualDebug && !ignoreDrawDebug) + { + drawDebug(_loc1_); + } + } + } + } + + public function stamp(param1:FlxSprite, param2:int = 0, param3:int = 0) : void + { + param1.drawFrame(); + var _loc4_:BitmapData = param1.framePixels; + if((param1.angle == 0 || param1._bakedRotation > 0) && param1.scale.x == 1 && param1.scale.y == 1 && param1.blend == null) + { + this._flashPoint.x = param2; + this._flashPoint.y = param3; + this._flashRect2.width = _loc4_.width; + this._flashRect2.height = _loc4_.height; + this._pixels.copyPixels(_loc4_,this._flashRect2,this._flashPoint,null,null,true); + this._flashRect2.width = this._pixels.width; + this._flashRect2.height = this._pixels.height; + this.calcFrame(); + return; + } + this._matrix.identity(); + this._matrix.translate(-param1.origin.x,-param1.origin.y); + this._matrix.scale(param1.scale.x,param1.scale.y); + if(param1.angle != 0) + { + this._matrix.rotate(param1.angle * 0.017453293); + } + this._matrix.translate(param2 + param1.origin.x,param3 + param1.origin.y); + this._pixels.draw(_loc4_,this._matrix,null,param1.blend,null,param1.antialiasing); + this.calcFrame(); + } + + public function drawLine(param1:Number, param2:Number, param3:Number, param4:Number, param5:uint, param6:uint = 1) : void + { + var _loc7_:Graphics = FlxG.flashGfx; + _loc7_.clear(); + _loc7_.moveTo(param1,param2); + var _loc8_:Number = Number(param5 >> 24 & 0xFF) / 255; + if(_loc8_ <= 0) + { + _loc8_ = 1; + } + _loc7_.lineStyle(param6,param5,_loc8_); + _loc7_.lineTo(param3,param4); + this._pixels.draw(FlxG.flashGfxSprite); + this.dirty = true; + } + + public function fill(param1:uint) : void + { + this._pixels.fillRect(this._flashRect2,param1); + if(this._pixels != this.framePixels) + { + this.dirty = true; + } + } + + protected function updateAnimation() : void + { + var _loc1_:uint = 0; + var _loc2_:int = 0; + if(this._bakedRotation > 0) + { + _loc1_ = this._curIndex; + _loc2_ = angle % 360; + if(_loc2_ < 0) + { + _loc2_ += 360; + } + this._curIndex = _loc2_ / this._bakedRotation + 0.5; + if(_loc1_ != this._curIndex) + { + this.dirty = true; + } + } + else if(this._curAnim != null && this._curAnim.delay > 0 && (this._curAnim.looped || !this.finished)) + { + this._frameTimer += FlxG.elapsed; + while(this._frameTimer > this._curAnim.delay) + { + this._frameTimer -= this._curAnim.delay; + if(this._curFrame == this._curAnim.frames.length - 1) + { + if(this._curAnim.looped) + { + this._curFrame = 0; + } + this.finished = true; + } + else + { + ++this._curFrame; + } + this._curIndex = this._curAnim.frames[this._curFrame]; + this.dirty = true; + } + } + if(this.dirty) + { + this.calcFrame(); + } + } + + public function drawFrame(param1:Boolean = false) : void + { + if(param1 || this.dirty) + { + this.calcFrame(); + } + } + + public function addAnimation(param1:String, param2:Array, param3:Number = 0, param4:Boolean = true) : void + { + this._animations.push(new FlxAnim(param1,param2,param3,param4)); + } + + public function addAnimationCallback(param1:Function) : void + { + this._callback = param1; + } + + public function play(param1:String, param2:Boolean = false) : void + { + if(!param2 && this._curAnim != null && param1 == this._curAnim.name && (this._curAnim.looped || !this.finished)) + { + return; + } + this._curFrame = 0; + this._curIndex = 0; + this._frameTimer = 0; + var _loc3_:uint = 0; + var _loc4_:uint = this._animations.length; + while(_loc3_ < _loc4_) + { + if(this._animations[_loc3_].name == param1) + { + this._curAnim = this._animations[_loc3_]; + if(this._curAnim.delay <= 0) + { + this.finished = true; + } + else + { + this.finished = false; + } + this._curIndex = this._curAnim.frames[this._curFrame]; + this.dirty = true; + return; + } + _loc3_++; + } + FlxG.log("WARNING: No animation called \"" + param1 + "\""); + } + + public function randomFrame() : void + { + this._curAnim = null; + this._curIndex = int(FlxG.random() * (this._pixels.width / this.frameWidth)); + this.dirty = true; + } + + public function setOriginToCorner() : void + { + this.origin.x = this.origin.y = 0; + } + + public function centerOffsets(param1:Boolean = false) : void + { + this.offset.x = (this.frameWidth - width) * 0.5; + this.offset.y = (this.frameHeight - height) * 0.5; + if(param1) + { + x += this.offset.x; + y += this.offset.y; + } + } + + public function replaceColor(param1:uint, param2:uint, param3:Boolean = false) : Array + { + var _loc6_:uint = 0; + var _loc4_:Array = null; + if(param3) + { + _loc4_ = new Array(); + } + var _loc5_:uint = 0; + var _loc7_:uint = uint(this._pixels.height); + var _loc8_:uint = uint(this._pixels.width); + while(_loc5_ < _loc7_) + { + _loc6_ = 0; + while(_loc6_ < _loc8_) + { + if(this._pixels.getPixel32(_loc6_,_loc5_) == param1) + { + this._pixels.setPixel32(_loc6_,_loc5_,param2); + if(param3) + { + _loc4_.push(new FlxPoint(_loc6_,_loc5_)); + } + this.dirty = true; + } + _loc6_++; + } + _loc5_++; + } + return _loc4_; + } + + public function get pixels() : BitmapData + { + return this._pixels; + } + + public function set pixels(param1:BitmapData) : void + { + this._pixels = param1; + width = this.frameWidth = this._pixels.width; + height = this.frameHeight = this._pixels.height; + this.resetHelpers(); + } + + public function get facing() : uint + { + return this._facing; + } + + public function set facing(param1:uint) : void + { + if(this._facing != param1) + { + this.dirty = true; + } + this._facing = param1; + } + + public function get alpha() : Number + { + return this._alpha; + } + + public function set alpha(param1:Number) : void + { + if(param1 > 1) + { + param1 = 1; + } + if(param1 < 0) + { + param1 = 0; + } + if(param1 == this._alpha) + { + return; + } + this._alpha = param1; + if(this._alpha != 1 || this._color != 16777215) + { + this._colorTransform = new ColorTransform((this._color >> 16) * 0.00392,(this._color >> 8 & 0xFF) * 0.00392,(this._color & 0xFF) * 0.00392,this._alpha); + } + else + { + this._colorTransform = null; + } + this.dirty = true; + } + + public function get color() : uint + { + return this._color; + } + + public function set color(param1:uint) : void + { + param1 &= 16777215; + if(this._color == param1) + { + return; + } + this._color = param1; + if(this._alpha != 1 || this._color != 16777215) + { + this._colorTransform = new ColorTransform((this._color >> 16) * 0.00392,(this._color >> 8 & 0xFF) * 0.00392,(this._color & 0xFF) * 0.00392,this._alpha); + } + else + { + this._colorTransform = null; + } + this.dirty = true; + } + + public function get frame() : uint + { + return this._curIndex; + } + + public function set frame(param1:uint) : void + { + this._curAnim = null; + this._curIndex = param1; + this.dirty = true; + } + + override public function onScreen(param1:FlxCamera = null) : Boolean + { + if(param1 == null) + { + param1 = FlxG.camera; + } + getScreenXY(_point,param1); + _point.x -= this.offset.x; + _point.y -= this.offset.y; + if((angle == 0 || this._bakedRotation > 0) && this.scale.x == 1 && this.scale.y == 1) + { + return _point.x + this.frameWidth > 0 && _point.x < param1.width && _point.y + this.frameHeight > 0 && _point.y < param1.height; + } + var _loc2_:Number = this.frameWidth / 2; + var _loc3_:Number = this.frameHeight / 2; + var _loc4_:Number = this.scale.x > 0 ? this.scale.x : -this.scale.x; + var _loc5_:Number = this.scale.y > 0 ? this.scale.y : -this.scale.y; + var _loc6_:Number = Math.sqrt(_loc2_ * _loc2_ + _loc3_ * _loc3_) * (_loc4_ >= _loc5_ ? _loc4_ : _loc5_); + _point.x += _loc2_; + _point.y += _loc3_; + return _point.x + _loc6_ > 0 && _point.x - _loc6_ < param1.width && _point.y + _loc6_ > 0 && _point.y - _loc6_ < param1.height; + } + + public function pixelsOverlapPoint(param1:FlxPoint, param2:uint = 255, param3:FlxCamera = null) : Boolean + { + if(param3 == null) + { + param3 = FlxG.camera; + } + getScreenXY(_point,param3); + _point.x -= this.offset.x; + _point.y -= this.offset.y; + this._flashPoint.x = param1.x - param3.scroll.x - _point.x; + this._flashPoint.y = param1.y - param3.scroll.y - _point.y; + return this.framePixels.hitTest(this._flashPointZero,param2,this._flashPoint); + } + + protected function calcFrame() : void + { + var _loc1_:uint = this._curIndex * this.frameWidth; + var _loc2_:uint = 0; + var _loc3_:uint = this._flipped ? this._flipped : uint(this._pixels.width); + if(_loc1_ >= _loc3_) + { + _loc2_ = uint(_loc1_ / _loc3_) * this.frameHeight; + _loc1_ %= _loc3_; + } + if(Boolean(this._flipped) && this._facing == LEFT) + { + _loc1_ = (this._flipped << 1) - _loc1_ - this.frameWidth; + } + this._flashRect.x = _loc1_; + this._flashRect.y = _loc2_; + this.framePixels.copyPixels(this._pixels,this._flashRect,this._flashPointZero); + this._flashRect.x = this._flashRect.y = 0; + if(this._colorTransform != null) + { + this.framePixels.colorTransform(this._flashRect,this._colorTransform); + } + if(this._callback != null) + { + this._callback(this._curAnim != null ? this._curAnim.name : null,this._curFrame,this._curIndex); + } + this.dirty = false; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxSprite_ImgDefault.as b/research/inner_decompiled/scripts/org/flixel/FlxSprite_ImgDefault.as new file mode 100644 index 0000000..f0ffe45 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxSprite_ImgDefault.as @@ -0,0 +1,15 @@ +package org.flixel +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/70_org.flixel.FlxSprite_ImgDefault.png")] + public class FlxSprite_ImgDefault extends BitmapAsset + { + + public function FlxSprite_ImgDefault() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxState.as b/research/inner_decompiled/scripts/org/flixel/FlxState.as new file mode 100644 index 0000000..15eab42 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxState.as @@ -0,0 +1,21 @@ +package org.flixel +{ + public class FlxState extends FlxGroup + { + + public function FlxState() + { + super(); + } + + public function create() : void + { + } + + override public function update() : void + { + super.update(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxTilemap.as b/research/inner_decompiled/scripts/org/flixel/FlxTilemap.as new file mode 100644 index 0000000..1e79fe3 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxTilemap.as @@ -0,0 +1,1252 @@ +package org.flixel +{ + import flash.display.BitmapData; + import flash.display.Graphics; + import flash.geom.Matrix; + import flash.geom.Point; + import flash.geom.Rectangle; + import org.flixel.system.FlxTile; + import org.flixel.system.FlxTilemapBuffer; + + public class FlxTilemap extends FlxObject + { + + public static var ImgAuto:Class = FlxTilemap_ImgAuto; + + public static var ImgAutoAlt:Class = FlxTilemap_ImgAutoAlt; + + public static const OFF:uint = 0; + + public static const AUTO:uint = 1; + + public static const ALT:uint = 2; + + public var auto:uint; + + public var widthInTiles:uint; + + public var heightInTiles:uint; + + public var totalTiles:uint; + + protected var _flashPoint:Point; + + protected var _flashRect:Rectangle; + + protected var _tiles:BitmapData; + + protected var _buffers:Array; + + protected var _data:Array; + + protected var _rects:Array; + + protected var _tileWidth:uint; + + protected var _tileHeight:uint; + + protected var _tileObjects:Array; + + protected var _debugTileNotSolid:BitmapData; + + protected var _debugTilePartial:BitmapData; + + protected var _debugTileSolid:BitmapData; + + protected var _debugRect:Rectangle; + + protected var _lastVisualDebug:Boolean; + + protected var _startingIndex:uint; + + public function FlxTilemap() + { + super(); + this.auto = OFF; + this.widthInTiles = 0; + this.heightInTiles = 0; + this.totalTiles = 0; + this._buffers = new Array(); + this._flashPoint = new Point(); + this._flashRect = null; + this._data = null; + this._tileWidth = 0; + this._tileHeight = 0; + this._rects = null; + this._tiles = null; + this._tileObjects = null; + immovable = true; + cameras = null; + this._debugTileNotSolid = null; + this._debugTilePartial = null; + this._debugTileSolid = null; + this._debugRect = null; + this._lastVisualDebug = FlxG.visualDebug; + this._startingIndex = 0; + } + + public static function arrayToCSV(param1:Array, param2:int, param3:Boolean = false) : String + { + var _loc5_:uint = 0; + var _loc6_:String = null; + var _loc8_:int = 0; + var _loc4_:uint = 0; + var _loc7_:int = param1.length / param2; + while(_loc4_ < _loc7_) + { + _loc5_ = 0; + while(_loc5_ < param2) + { + _loc8_ = int(param1[_loc4_ * param2 + _loc5_]); + if(param3) + { + if(_loc8_ == 0) + { + _loc8_ = 1; + } + else if(_loc8_ == 1) + { + _loc8_ = 0; + } + } + if(_loc5_ == 0) + { + if(_loc4_ == 0) + { + _loc6_ += _loc8_; + } + else + { + _loc6_ += "\n" + _loc8_; + } + } + else + { + _loc6_ += ", " + _loc8_; + } + _loc5_++; + } + _loc4_++; + } + return _loc6_; + } + + public static function bitmapToCSV(param1:BitmapData, param2:Boolean = false, param3:uint = 1) : String + { + var _loc5_:uint = 0; + var _loc6_:uint = 0; + var _loc10_:BitmapData = null; + var _loc11_:Matrix = null; + if(param3 > 1) + { + _loc10_ = param1; + param1 = new BitmapData(param1.width * param3,param1.height * param3); + _loc11_ = new Matrix(); + _loc11_.scale(param3,param3); + param1.draw(_loc10_,_loc11_); + } + var _loc4_:uint = 0; + var _loc7_:String = ""; + var _loc8_:uint = uint(param1.width); + var _loc9_:uint = uint(param1.height); + while(_loc4_ < _loc9_) + { + _loc5_ = 0; + while(_loc5_ < _loc8_) + { + _loc6_ = param1.getPixel(_loc5_,_loc4_); + if(param2 && _loc6_ > 0 || !param2 && _loc6_ == 0) + { + _loc6_ = 1; + } + else + { + _loc6_ = 0; + } + if(_loc5_ == 0) + { + if(_loc4_ == 0) + { + _loc7_ += _loc6_; + } + else + { + _loc7_ += "\n" + _loc6_; + } + } + else + { + _loc7_ += ", " + _loc6_; + } + _loc5_++; + } + _loc4_++; + } + return _loc7_; + } + + public static function imageToCSV(param1:Class, param2:Boolean = false, param3:uint = 1) : String + { + return bitmapToCSV(new param1().bitmapData,param2,param3); + } + + override public function destroy() : void + { + this._flashPoint = null; + this._flashRect = null; + this._tiles = null; + var _loc1_:uint = 0; + var _loc2_:uint = this._tileObjects.length; + while(_loc1_ < _loc2_) + { + (this._tileObjects[_loc1_++] as FlxTile).destroy(); + } + this._tileObjects = null; + _loc1_ = 0; + _loc2_ = this._buffers.length; + while(_loc1_ < _loc2_) + { + (this._buffers[_loc1_++] as FlxTilemapBuffer).destroy(); + } + this._buffers = null; + this._data = null; + this._rects = null; + this._debugTileNotSolid = null; + this._debugTilePartial = null; + this._debugTileSolid = null; + this._debugRect = null; + super.destroy(); + } + + public function loadMap(param1:String, param2:Class, param3:uint = 0, param4:uint = 0, param5:uint = 0, param6:uint = 0, param7:uint = 1, param8:uint = 1) : FlxTilemap + { + var _loc9_:Array = null; + var _loc12_:uint = 0; + var _loc13_:uint = 0; + var _loc15_:uint = 0; + this.auto = param5; + this._startingIndex = param6; + var _loc10_:Array = param1.split("\n"); + this.heightInTiles = _loc10_.length; + this._data = new Array(); + var _loc11_:uint = 0; + while(_loc11_ < this.heightInTiles) + { + _loc9_ = _loc10_[_loc11_++].split(","); + if(_loc9_.length <= 1) + { + --this.heightInTiles; + } + else + { + if(this.widthInTiles == 0) + { + this.widthInTiles = _loc9_.length; + } + _loc12_ = 0; + while(_loc12_ < this.widthInTiles) + { + this._data.push(uint(_loc9_[_loc12_++])); + } + } + } + this.totalTiles = this.widthInTiles * this.heightInTiles; + if(this.auto > OFF) + { + this._startingIndex = 1; + param7 = 1; + param8 = 1; + _loc13_ = 0; + while(_loc13_ < this.totalTiles) + { + this.autoTile(_loc13_++); + } + } + this._tiles = FlxG.addBitmap(param2); + this._tileWidth = param3; + if(this._tileWidth == 0) + { + this._tileWidth = this._tiles.height; + } + this._tileHeight = param4; + if(this._tileHeight == 0) + { + this._tileHeight = this._tileWidth; + } + _loc13_ = 0; + var _loc14_:uint = this._tiles.width / this._tileWidth * (this._tiles.height / this._tileHeight); + if(this.auto > OFF) + { + _loc14_++; + } + this._tileObjects = new Array(_loc14_); + while(_loc13_ < _loc14_) + { + this._tileObjects[_loc13_] = new FlxTile(this,_loc13_,this._tileWidth,this._tileHeight,_loc13_ >= param7,_loc13_ >= param8 ? allowCollisions : NONE); + _loc13_++; + } + this._debugTileNotSolid = this.makeDebugTile(FlxG.BLUE); + this._debugTilePartial = this.makeDebugTile(FlxG.PINK); + this._debugTileSolid = this.makeDebugTile(FlxG.GREEN); + this._debugRect = new Rectangle(0,0,this._tileWidth,this._tileHeight); + width = this.widthInTiles * this._tileWidth; + height = this.heightInTiles * this._tileHeight; + this._rects = new Array(this.totalTiles); + _loc13_ = 0; + while(_loc13_ < this.totalTiles) + { + this.updateTile(_loc13_++); + } + return this; + } + + protected function makeDebugTile(param1:uint) : BitmapData + { + var _loc2_:BitmapData = null; + _loc2_ = new BitmapData(this._tileWidth,this._tileHeight,true,0); + var _loc3_:Graphics = FlxG.flashGfx; + _loc3_.clear(); + _loc3_.moveTo(0,0); + _loc3_.lineStyle(1,param1,0.5); + _loc3_.lineTo(this._tileWidth - 1,0); + _loc3_.lineTo(this._tileWidth - 1,this._tileHeight - 1); + _loc3_.lineTo(0,this._tileHeight - 1); + _loc3_.lineTo(0,0); + _loc2_.draw(FlxG.flashGfxSprite); + return _loc2_; + } + + override public function update() : void + { + if(this._lastVisualDebug != FlxG.visualDebug) + { + this._lastVisualDebug = FlxG.visualDebug; + this.setDirty(); + } + } + + protected function drawTilemap(param1:FlxTilemapBuffer, param2:FlxCamera) : void + { + var _loc9_:uint = 0; + var _loc10_:uint = 0; + var _loc11_:FlxTile = null; + var _loc12_:BitmapData = null; + param1.fill(); + _point.x = int(param2.scroll.x * scrollFactor.x) - x; + _point.y = int(param2.scroll.y * scrollFactor.y) - y; + var _loc3_:int = (_point.x + (_point.x > 0 ? 1e-7 : -1e-7)) / this._tileWidth; + var _loc4_:int = (_point.y + (_point.y > 0 ? 1e-7 : -1e-7)) / this._tileHeight; + var _loc5_:uint = param1.rows; + var _loc6_:uint = param1.columns; + if(_loc3_ < 0) + { + _loc3_ = 0; + } + if(_loc3_ > this.widthInTiles - _loc6_) + { + _loc3_ = this.widthInTiles - _loc6_; + } + if(_loc4_ < 0) + { + _loc4_ = 0; + } + if(_loc4_ > this.heightInTiles - _loc5_) + { + _loc4_ = this.heightInTiles - _loc5_; + } + var _loc7_:int = _loc4_ * this.widthInTiles + _loc3_; + this._flashPoint.y = 0; + var _loc8_:uint = 0; + while(_loc8_ < _loc5_) + { + _loc10_ = uint(_loc7_); + _loc9_ = 0; + this._flashPoint.x = 0; + while(_loc9_ < _loc6_) + { + this._flashRect = this._rects[_loc10_] as Rectangle; + if(this._flashRect != null) + { + param1.pixels.copyPixels(this._tiles,this._flashRect,this._flashPoint,null,null,true); + if(FlxG.visualDebug && !ignoreDrawDebug) + { + _loc11_ = this._tileObjects[this._data[_loc10_]]; + if(_loc11_ != null) + { + if(_loc11_.allowCollisions <= NONE) + { + _loc12_ = this._debugTileNotSolid; + } + else if(_loc11_.allowCollisions != ANY) + { + _loc12_ = this._debugTilePartial; + } + else + { + _loc12_ = this._debugTileSolid; + } + param1.pixels.copyPixels(_loc12_,this._debugRect,this._flashPoint,null,null,true); + } + } + } + this._flashPoint.x += this._tileWidth; + _loc9_++; + _loc10_++; + } + _loc7_ += this.widthInTiles; + this._flashPoint.y += this._tileHeight; + _loc8_++; + } + param1.x = _loc3_ * this._tileWidth; + param1.y = _loc4_ * this._tileHeight; + } + + override public function draw() : void + { + var _loc1_:FlxCamera = null; + var _loc2_:FlxTilemapBuffer = null; + if(_flickerTimer != 0) + { + _flicker = !_flicker; + if(_flicker) + { + return; + } + } + if(cameras == null) + { + cameras = FlxG.cameras; + } + var _loc3_:uint = 0; + var _loc4_:uint = cameras.length; + while(_loc3_ < _loc4_) + { + _loc1_ = cameras[_loc3_]; + if(this._buffers[_loc3_] == null) + { + this._buffers[_loc3_] = new FlxTilemapBuffer(this._tileWidth,this._tileHeight,this.widthInTiles,this.heightInTiles,_loc1_); + } + _loc2_ = this._buffers[_loc3_++] as FlxTilemapBuffer; + if(!_loc2_.dirty) + { + _point.x = x - int(_loc1_.scroll.x * scrollFactor.x) + _loc2_.x; + _point.y = y - int(_loc1_.scroll.y * scrollFactor.y) + _loc2_.y; + _loc2_.dirty = _point.x > 0 || _point.y > 0 || _point.x + _loc2_.width < _loc1_.width || _point.y + _loc2_.height < _loc1_.height; + } + if(_loc2_.dirty) + { + this.drawTilemap(_loc2_,_loc1_); + _loc2_.dirty = false; + } + this._flashPoint.x = x - int(_loc1_.scroll.x * scrollFactor.x) + _loc2_.x; + this._flashPoint.y = y - int(_loc1_.scroll.y * scrollFactor.y) + _loc2_.y; + this._flashPoint.x += this._flashPoint.x > 0 ? 1e-7 : -1e-7; + this._flashPoint.y += this._flashPoint.y > 0 ? 1e-7 : -1e-7; + _loc2_.draw(_loc1_,this._flashPoint); + ++_VISIBLECOUNT; + } + } + + public function getData(param1:Boolean = false) : Array + { + if(!param1) + { + return this._data; + } + var _loc2_:uint = 0; + var _loc3_:uint = this._data.length; + var _loc4_:Array = new Array(_loc3_); + while(_loc2_ < _loc3_) + { + _loc4_[_loc2_] = (this._tileObjects[this._data[_loc2_]] as FlxTile).allowCollisions > 0 ? 1 : 0; + _loc2_++; + } + return _loc4_; + } + + public function setDirty(param1:Boolean = true) : void + { + var _loc2_:uint = 0; + var _loc3_:uint = this._buffers.length; + while(_loc2_ < _loc3_) + { + (this._buffers[_loc2_++] as FlxTilemapBuffer).dirty = param1; + } + } + + public function findPath(param1:FlxPoint, param2:FlxPoint, param3:Boolean = true, param4:Boolean = false) : FlxPath + { + var _loc9_:FlxPoint = null; + var _loc5_:uint = uint((param1.y - y) / this._tileHeight) * this.widthInTiles + uint((param1.x - x) / this._tileWidth); + var _loc6_:uint = uint((param2.y - y) / this._tileHeight) * this.widthInTiles + uint((param2.x - x) / this._tileWidth); + if((this._tileObjects[this._data[_loc5_]] as FlxTile).allowCollisions > 0 || (this._tileObjects[this._data[_loc6_]] as FlxTile).allowCollisions > 0) + { + return null; + } + var _loc7_:Array = this.computePathDistance(_loc5_,_loc6_); + if(_loc7_ == null) + { + return null; + } + var _loc8_:Array = new Array(); + this.walkPath(_loc7_,_loc6_,_loc8_); + _loc9_ = _loc8_[_loc8_.length - 1] as FlxPoint; + _loc9_.x = param1.x; + _loc9_.y = param1.y; + _loc9_ = _loc8_[0] as FlxPoint; + _loc9_.x = param2.x; + _loc9_.y = param2.y; + if(param3) + { + this.simplifyPath(_loc8_); + } + if(param4) + { + this.raySimplifyPath(_loc8_); + } + var _loc10_:FlxPath = new FlxPath(); + var _loc11_:* = int(_loc8_.length - 1); + while(_loc11_ >= 0) + { + _loc9_ = _loc8_[_loc11_--] as FlxPoint; + if(_loc9_ != null) + { + _loc10_.addPoint(_loc9_,true); + } + } + return _loc10_; + } + + protected function simplifyPath(param1:Array) : void + { + var _loc2_:Number = NaN; + var _loc3_:Number = NaN; + var _loc5_:FlxPoint = null; + var _loc4_:FlxPoint = param1[0]; + var _loc6_:uint = 1; + var _loc7_:uint = param1.length - 1; + while(_loc6_ < _loc7_) + { + _loc5_ = param1[_loc6_]; + _loc2_ = (_loc5_.x - _loc4_.x) / (_loc5_.y - _loc4_.y); + _loc3_ = (_loc5_.x - param1[_loc6_ + 1].x) / (_loc5_.y - param1[_loc6_ + 1].y); + if(_loc4_.x == param1[_loc6_ + 1].x || _loc4_.y == param1[_loc6_ + 1].y || _loc2_ == _loc3_) + { + param1[_loc6_] = null; + } + else + { + _loc4_ = _loc5_; + } + _loc6_++; + } + } + + protected function raySimplifyPath(param1:Array) : void + { + var _loc4_:FlxPoint = null; + var _loc2_:FlxPoint = param1[0]; + var _loc3_:int = -1; + var _loc5_:uint = 1; + var _loc6_:uint = param1.length; + while(_loc5_ < _loc6_) + { + _loc4_ = param1[_loc5_++]; + if(_loc4_ != null) + { + if(this.ray(_loc2_,_loc4_,_point)) + { + if(_loc3_ >= 0) + { + param1[_loc3_] = null; + } + } + else + { + _loc2_ = param1[_loc3_]; + } + _loc3_ = _loc5_ - 1; + } + } + } + + protected function computePathDistance(param1:uint, param2:uint) : Array + { + var _loc8_:Array = null; + var _loc9_:uint = 0; + var _loc10_:Boolean = false; + var _loc11_:Boolean = false; + var _loc12_:Boolean = false; + var _loc13_:Boolean = false; + var _loc14_:uint = 0; + var _loc16_:uint = 0; + var _loc3_:uint = this.widthInTiles * this.heightInTiles; + var _loc4_:Array = new Array(_loc3_); + var _loc5_:* = 0; + while(_loc5_ < _loc3_) + { + if((this._tileObjects[this._data[_loc5_]] as FlxTile).allowCollisions) + { + _loc4_[_loc5_] = -2; + } + else + { + _loc4_[_loc5_] = -1; + } + _loc5_++; + } + var _loc6_:uint = 0; + var _loc7_:Array = [param1]; + var _loc15_:Boolean = false; + while(_loc7_.length > 0) + { + _loc8_ = _loc7_; + _loc7_ = new Array(); + _loc5_ = 0; + _loc14_ = _loc8_.length; + while(_loc5_ < _loc14_) + { + _loc9_ = uint(_loc8_[_loc5_++]); + if(_loc9_ == param2) + { + _loc15_ = true; + _loc7_.length = 0; + break; + } + _loc10_ = _loc9_ % this.widthInTiles > 0; + _loc11_ = _loc9_ % this.widthInTiles < this.widthInTiles - 1; + _loc12_ = _loc9_ / this.widthInTiles > 0; + _loc13_ = _loc9_ / this.widthInTiles < this.heightInTiles - 1; + if(_loc12_) + { + _loc16_ = _loc9_ - this.widthInTiles; + if(_loc4_[_loc16_] == -1) + { + _loc4_[_loc16_] = _loc6_; + _loc7_.push(_loc16_); + } + } + if(_loc11_) + { + _loc16_ = _loc9_ + 1; + if(_loc4_[_loc16_] == -1) + { + _loc4_[_loc16_] = _loc6_; + _loc7_.push(_loc16_); + } + } + if(_loc13_) + { + _loc16_ = _loc9_ + this.widthInTiles; + if(_loc4_[_loc16_] == -1) + { + _loc4_[_loc16_] = _loc6_; + _loc7_.push(_loc16_); + } + } + if(_loc10_) + { + _loc16_ = _loc9_ - 1; + if(_loc4_[_loc16_] == -1) + { + _loc4_[_loc16_] = _loc6_; + _loc7_.push(_loc16_); + } + } + if(_loc12_ && _loc11_) + { + _loc16_ = _loc9_ - this.widthInTiles + 1; + if(_loc4_[_loc16_] == -1 && _loc4_[_loc9_ - this.widthInTiles] >= -1 && _loc4_[_loc9_ + 1] >= -1) + { + _loc4_[_loc16_] = _loc6_; + _loc7_.push(_loc16_); + } + } + if(_loc11_ && _loc13_) + { + _loc16_ = _loc9_ + this.widthInTiles + 1; + if(_loc4_[_loc16_] == -1 && _loc4_[_loc9_ + this.widthInTiles] >= -1 && _loc4_[_loc9_ + 1] >= -1) + { + _loc4_[_loc16_] = _loc6_; + _loc7_.push(_loc16_); + } + } + if(_loc10_ && _loc13_) + { + _loc16_ = _loc9_ + this.widthInTiles - 1; + if(_loc4_[_loc16_] == -1 && _loc4_[_loc9_ + this.widthInTiles] >= -1 && _loc4_[_loc9_ - 1] >= -1) + { + _loc4_[_loc16_] = _loc6_; + _loc7_.push(_loc16_); + } + } + if(_loc12_ && _loc10_) + { + _loc16_ = _loc9_ - this.widthInTiles - 1; + if(_loc4_[_loc16_] == -1 && _loc4_[_loc9_ - this.widthInTiles] >= -1 && _loc4_[_loc9_ - 1] >= -1) + { + _loc4_[_loc16_] = _loc6_; + _loc7_.push(_loc16_); + } + } + } + _loc6_++; + } + if(!_loc15_) + { + _loc4_ = null; + } + return _loc4_; + } + + protected function walkPath(param1:Array, param2:uint, param3:Array) : void + { + var _loc9_:uint = 0; + param3.push(new FlxPoint(x + uint(param2 % this.widthInTiles) * this._tileWidth + this._tileWidth * 0.5,y + uint(param2 / this.widthInTiles) * this._tileHeight + this._tileHeight * 0.5)); + if(param1[param2] == 0) + { + return; + } + var _loc4_:Boolean = param2 % this.widthInTiles > 0; + var _loc5_:Boolean = param2 % this.widthInTiles < this.widthInTiles - 1; + var _loc6_:Boolean = param2 / this.widthInTiles > 0; + var _loc7_:Boolean = param2 / this.widthInTiles < this.heightInTiles - 1; + var _loc8_:uint = uint(param1[param2]); + if(_loc6_) + { + _loc9_ = param2 - this.widthInTiles; + if(param1[_loc9_] >= 0 && param1[_loc9_] < _loc8_) + { + return this.walkPath(param1,_loc9_,param3); + } + } + if(_loc5_) + { + _loc9_ = param2 + 1; + if(param1[_loc9_] >= 0 && param1[_loc9_] < _loc8_) + { + return this.walkPath(param1,_loc9_,param3); + } + } + if(_loc7_) + { + _loc9_ = param2 + this.widthInTiles; + if(param1[_loc9_] >= 0 && param1[_loc9_] < _loc8_) + { + return this.walkPath(param1,_loc9_,param3); + } + } + if(_loc4_) + { + _loc9_ = param2 - 1; + if(param1[_loc9_] >= 0 && param1[_loc9_] < _loc8_) + { + return this.walkPath(param1,_loc9_,param3); + } + } + if(_loc6_ && _loc5_) + { + _loc9_ = param2 - this.widthInTiles + 1; + if(param1[_loc9_] >= 0 && param1[_loc9_] < _loc8_) + { + return this.walkPath(param1,_loc9_,param3); + } + } + if(_loc5_ && _loc7_) + { + _loc9_ = param2 + this.widthInTiles + 1; + if(param1[_loc9_] >= 0 && param1[_loc9_] < _loc8_) + { + return this.walkPath(param1,_loc9_,param3); + } + } + if(_loc4_ && _loc7_) + { + _loc9_ = param2 + this.widthInTiles - 1; + if(param1[_loc9_] >= 0 && param1[_loc9_] < _loc8_) + { + return this.walkPath(param1,_loc9_,param3); + } + } + if(_loc6_ && _loc4_) + { + _loc9_ = param2 - this.widthInTiles - 1; + if(param1[_loc9_] >= 0 && param1[_loc9_] < _loc8_) + { + return this.walkPath(param1,_loc9_,param3); + } + } + } + + override public function overlaps(param1:FlxBasic, param2:Boolean = false, param3:FlxCamera = null) : Boolean + { + var _loc4_:Boolean = false; + var _loc5_:FlxBasic = null; + var _loc6_:uint = 0; + var _loc7_:Array = null; + if(param1 is FlxGroup) + { + _loc4_ = false; + _loc6_ = 0; + _loc7_ = (param1 as FlxGroup).members; + while(_loc6_ < length) + { + _loc5_ = _loc7_[_loc6_++] as FlxBasic; + if(_loc5_ is FlxObject) + { + if(this.overlapsWithCallback(_loc5_ as FlxObject)) + { + _loc4_ = true; + } + } + else if(this.overlaps(_loc5_,param2,param3)) + { + _loc4_ = true; + } + } + return _loc4_; + } + if(param1 is FlxObject) + { + return this.overlapsWithCallback(param1 as FlxObject); + } + return false; + } + + override public function overlapsAt(param1:Number, param2:Number, param3:FlxBasic, param4:Boolean = false, param5:FlxCamera = null) : Boolean + { + var _loc6_:Boolean = false; + var _loc7_:FlxBasic = null; + var _loc8_:uint = 0; + var _loc9_:Array = null; + if(param3 is FlxGroup) + { + _loc6_ = false; + _loc8_ = 0; + _loc9_ = (param3 as FlxGroup).members; + while(_loc8_ < length) + { + _loc7_ = _loc9_[_loc8_++] as FlxBasic; + if(_loc7_ is FlxObject) + { + _point.x = param1; + _point.y = param2; + if(this.overlapsWithCallback(_loc7_ as FlxObject,null,false,_point)) + { + _loc6_ = true; + } + } + else if(this.overlapsAt(param1,param2,_loc7_,param4,param5)) + { + _loc6_ = true; + } + } + return _loc6_; + } + if(param3 is FlxObject) + { + _point.x = param1; + _point.y = param2; + return this.overlapsWithCallback(param3 as FlxObject,null,false,_point); + } + return false; + } + + public function overlapsWithCallback(param1:FlxObject, param2:Function = null, param3:Boolean = false, param4:FlxPoint = null) : Boolean + { + var _loc14_:uint = 0; + var _loc15_:FlxTile = null; + var _loc16_:Boolean = false; + var _loc5_:Boolean = false; + var _loc6_:Number = x; + var _loc7_:Number = y; + if(param4 != null) + { + _loc6_ = param4.x; + _loc7_ = param4.y; + } + var _loc8_:int = FlxU.floor((param1.x - _loc6_) / this._tileWidth); + var _loc9_:int = FlxU.floor((param1.y - _loc7_) / this._tileHeight); + var _loc10_:uint = _loc8_ + FlxU.ceil(param1.width / this._tileWidth) + 1; + var _loc11_:uint = _loc9_ + FlxU.ceil(param1.height / this._tileHeight) + 1; + if(_loc8_ < 0) + { + _loc8_ = 0; + } + if(_loc9_ < 0) + { + _loc9_ = 0; + } + if(_loc10_ > this.widthInTiles) + { + _loc10_ = this.widthInTiles; + } + if(_loc11_ > this.heightInTiles) + { + _loc11_ = this.heightInTiles; + } + var _loc12_:uint = _loc9_ * this.widthInTiles; + var _loc13_:uint = uint(_loc9_); + var _loc17_:Number = _loc6_ - last.x; + var _loc18_:Number = _loc7_ - last.y; + while(_loc13_ < _loc11_) + { + _loc14_ = uint(_loc8_); + while(_loc14_ < _loc10_) + { + _loc16_ = false; + _loc15_ = this._tileObjects[this._data[_loc12_ + _loc14_]] as FlxTile; + if(_loc15_.allowCollisions) + { + _loc15_.x = _loc6_ + _loc14_ * this._tileWidth; + _loc15_.y = _loc7_ + _loc13_ * this._tileHeight; + _loc15_.last.x = _loc15_.x - _loc17_; + _loc15_.last.y = _loc15_.y - _loc18_; + if(param2 != null) + { + if(param3) + { + _loc16_ = param2(param1,_loc15_); + } + else + { + _loc16_ = param2(_loc15_,param1); + } + } + else + { + _loc16_ = param1.x + param1.width > _loc15_.x && param1.x < _loc15_.x + _loc15_.width && param1.y + param1.height > _loc15_.y && param1.y < _loc15_.y + _loc15_.height; + } + if(_loc16_) + { + if(_loc15_.callback != null && (_loc15_.filter == null || param1 is _loc15_.filter)) + { + _loc15_.mapIndex = _loc12_ + _loc14_; + _loc15_.callback(_loc15_,param1); + } + _loc5_ = true; + } + } + else if(_loc15_.callback != null && (_loc15_.filter == null || param1 is _loc15_.filter)) + { + _loc15_.mapIndex = _loc12_ + _loc14_; + _loc15_.callback(_loc15_,param1); + } + _loc14_++; + } + _loc12_ += this.widthInTiles; + _loc13_++; + } + return _loc5_; + } + + override public function overlapsPoint(param1:FlxPoint, param2:Boolean = false, param3:FlxCamera = null) : Boolean + { + if(!param2) + { + return (this._tileObjects[this._data[uint(uint((param1.y - y) / this._tileHeight) * this.widthInTiles + (param1.x - x) / this._tileWidth)]] as FlxTile).allowCollisions > 0; + } + if(param3 == null) + { + param3 = FlxG.camera; + } + param1.x -= param3.scroll.x; + param1.y -= param3.scroll.y; + getScreenXY(_point,param3); + return (this._tileObjects[this._data[uint(uint((param1.y - _point.y) / this._tileHeight) * this.widthInTiles + (param1.x - _point.x) / this._tileWidth)]] as FlxTile).allowCollisions > 0; + } + + public function getTile(param1:uint, param2:uint) : uint + { + return this._data[param2 * this.widthInTiles + param1] as uint; + } + + public function getTileByIndex(param1:uint) : uint + { + return this._data[param1] as uint; + } + + public function getTileInstances(param1:uint) : Array + { + var _loc2_:Array = null; + var _loc3_:uint = 0; + var _loc4_:uint = this.widthInTiles * this.heightInTiles; + while(_loc3_ < _loc4_) + { + if(this._data[_loc3_] == param1) + { + if(_loc2_ == null) + { + _loc2_ = new Array(); + } + _loc2_.push(_loc3_); + } + _loc3_++; + } + return _loc2_; + } + + public function getTileCoords(param1:uint, param2:Boolean = true) : Array + { + var _loc4_:FlxPoint = null; + var _loc3_:Array = null; + var _loc5_:uint = 0; + var _loc6_:uint = this.widthInTiles * this.heightInTiles; + while(_loc5_ < _loc6_) + { + if(this._data[_loc5_] == param1) + { + _loc4_ = new FlxPoint(x + uint(_loc5_ % this.widthInTiles) * this._tileWidth,y + uint(_loc5_ / this.widthInTiles) * this._tileHeight); + if(param2) + { + _loc4_.x += this._tileWidth * 0.5; + _loc4_.y += this._tileHeight * 0.5; + } + if(_loc3_ == null) + { + _loc3_ = new Array(); + } + _loc3_.push(_loc4_); + } + _loc5_++; + } + return _loc3_; + } + + public function setTile(param1:uint, param2:uint, param3:uint, param4:Boolean = true) : Boolean + { + if(param1 >= this.widthInTiles || param2 >= this.heightInTiles) + { + return false; + } + return this.setTileByIndex(param2 * this.widthInTiles + param1,param3,param4); + } + + public function setTileByIndex(param1:uint, param2:uint, param3:Boolean = true) : Boolean + { + var _loc5_:uint = 0; + if(param1 >= this._data.length) + { + return false; + } + var _loc4_:Boolean = true; + this._data[param1] = param2; + if(!param3) + { + return _loc4_; + } + this.setDirty(); + if(this.auto == OFF) + { + this.updateTile(param1); + return _loc4_; + } + var _loc6_:int = int(param1 / this.widthInTiles) - 1; + var _loc7_:int = _loc6_ + 3; + var _loc8_:int = param1 % this.widthInTiles - 1; + var _loc9_:int = _loc8_ + 3; + while(_loc6_ < _loc7_) + { + _loc8_ = _loc9_ - 3; + while(_loc8_ < _loc9_) + { + if(_loc6_ >= 0 && _loc6_ < this.heightInTiles && _loc8_ >= 0 && _loc8_ < this.widthInTiles) + { + _loc5_ = _loc6_ * this.widthInTiles + _loc8_; + this.autoTile(_loc5_); + this.updateTile(_loc5_); + } + _loc8_++; + } + _loc6_++; + } + return _loc4_; + } + + public function setTileProperties(param1:uint, param2:uint = 4369, param3:Function = null, param4:Class = null, param5:uint = 1) : void + { + var _loc6_:FlxTile = null; + if(param5 <= 0) + { + param5 = 1; + } + var _loc7_:uint = param1; + var _loc8_:uint = param1 + param5; + while(_loc7_ < _loc8_) + { + _loc6_ = this._tileObjects[_loc7_++] as FlxTile; + _loc6_.allowCollisions = param2; + _loc6_.callback = param3; + _loc6_.filter = param4; + } + } + + public function follow(param1:FlxCamera = null, param2:int = 0, param3:Boolean = true) : void + { + if(param1 == null) + { + param1 = FlxG.camera; + } + param1.setBounds(x + param2 * this._tileWidth,y + param2 * this._tileHeight,width - param2 * this._tileWidth * 2,height - param2 * this._tileHeight * 2,param3); + } + + public function getBounds(param1:FlxRect = null) : FlxRect + { + if(param1 == null) + { + param1 = new FlxRect(); + } + return param1.make(x,y,width,height); + } + + public function ray(param1:FlxPoint, param2:FlxPoint, param3:FlxPoint = null, param4:Number = 1) : Boolean + { + var _loc14_:uint = 0; + var _loc15_:uint = 0; + var _loc17_:Number = NaN; + var _loc18_:Number = NaN; + var _loc19_:Number = NaN; + var _loc20_:Number = NaN; + var _loc21_:Number = NaN; + var _loc5_:Number = this._tileWidth; + if(this._tileHeight < this._tileWidth) + { + _loc5_ = this._tileHeight; + } + _loc5_ /= param4; + var _loc6_:Number = param2.x - param1.x; + var _loc7_:Number = param2.y - param1.y; + var _loc8_:Number = Math.sqrt(_loc6_ * _loc6_ + _loc7_ * _loc7_); + var _loc9_:uint = Math.ceil(_loc8_ / _loc5_); + var _loc10_:Number = _loc6_ / _loc9_; + var _loc11_:Number = _loc7_ / _loc9_; + var _loc12_:Number = param1.x - _loc10_ - x; + var _loc13_:Number = param1.y - _loc11_ - y; + var _loc16_:uint = 0; + while(_loc16_ < _loc9_) + { + _loc12_ += _loc10_; + _loc13_ += _loc11_; + if(_loc12_ < 0 || _loc12_ > width || _loc13_ < 0 || _loc13_ > height) + { + _loc16_++; + } + else + { + _loc14_ = _loc12_ / this._tileWidth; + _loc15_ = _loc13_ / this._tileHeight; + if((this._tileObjects[this._data[_loc15_ * this.widthInTiles + _loc14_]] as FlxTile).allowCollisions) + { + _loc14_ *= this._tileWidth; + _loc15_ *= this._tileHeight; + _loc17_ = 0; + _loc18_ = 0; + _loc20_ = _loc12_ - _loc10_; + _loc21_ = _loc13_ - _loc11_; + _loc19_ = _loc14_; + if(_loc6_ < 0) + { + _loc19_ += this._tileWidth; + } + _loc17_ = _loc19_; + _loc18_ = _loc21_ + _loc11_ * ((_loc19_ - _loc20_) / _loc10_); + if(_loc18_ > _loc15_ && _loc18_ < _loc15_ + this._tileHeight) + { + if(param3 == null) + { + param3 = new FlxPoint(); + } + param3.x = _loc17_; + param3.y = _loc18_; + return false; + } + _loc19_ = _loc15_; + if(_loc7_ < 0) + { + _loc19_ += this._tileHeight; + } + _loc17_ = _loc20_ + _loc10_ * ((_loc19_ - _loc21_) / _loc11_); + _loc18_ = _loc19_; + if(_loc17_ > _loc14_ && _loc17_ < _loc14_ + this._tileWidth) + { + if(param3 == null) + { + param3 = new FlxPoint(); + } + param3.x = _loc17_; + param3.y = _loc18_; + return false; + } + return true; + } + _loc16_++; + } + } + return true; + } + + protected function autoTile(param1:uint) : void + { + if(this._data[param1] == 0) + { + return; + } + this._data[param1] = 0; + if(param1 - this.widthInTiles < 0 || this._data[param1 - this.widthInTiles] > 0) + { + this._data[param1] += 1; + } + if(param1 % this.widthInTiles >= this.widthInTiles - 1 || this._data[param1 + 1] > 0) + { + this._data[param1] += 2; + } + if(param1 + this.widthInTiles >= this.totalTiles || this._data[param1 + this.widthInTiles] > 0) + { + this._data[param1] += 4; + } + if(param1 % this.widthInTiles <= 0 || this._data[param1 - 1] > 0) + { + this._data[param1] += 8; + } + if(this.auto == ALT && this._data[param1] == 15) + { + if(param1 % this.widthInTiles > 0 && param1 + this.widthInTiles < this.totalTiles && this._data[param1 + this.widthInTiles - 1] <= 0) + { + this._data[param1] = 1; + } + if(param1 % this.widthInTiles > 0 && param1 - this.widthInTiles >= 0 && this._data[param1 - this.widthInTiles - 1] <= 0) + { + this._data[param1] = 2; + } + if(param1 % this.widthInTiles < this.widthInTiles - 1 && param1 - this.widthInTiles >= 0 && this._data[param1 - this.widthInTiles + 1] <= 0) + { + this._data[param1] = 4; + } + if(param1 % this.widthInTiles < this.widthInTiles - 1 && param1 + this.widthInTiles < this.totalTiles && this._data[param1 + this.widthInTiles + 1] <= 0) + { + this._data[param1] = 8; + } + } + this._data[param1] += 1; + } + + protected function updateTile(param1:uint) : void + { + var _loc2_:FlxTile = this._tileObjects[this._data[param1]] as FlxTile; + if(_loc2_ == null || !_loc2_.visible) + { + this._rects[param1] = null; + return; + } + var _loc3_:uint = (this._data[param1] - this._startingIndex) * this._tileWidth; + var _loc4_:uint = 0; + if(_loc3_ >= this._tiles.width) + { + _loc4_ = uint(_loc3_ / this._tiles.width) * this._tileHeight; + _loc3_ %= this._tiles.width; + } + this._rects[param1] = new Rectangle(_loc3_,_loc4_,this._tileWidth,this._tileHeight); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxTilemap_ImgAuto.as b/research/inner_decompiled/scripts/org/flixel/FlxTilemap_ImgAuto.as new file mode 100644 index 0000000..1e86715 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxTilemap_ImgAuto.as @@ -0,0 +1,15 @@ +package org.flixel +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/245_org.flixel.FlxTilemap_ImgAuto.png")] + public class FlxTilemap_ImgAuto extends BitmapAsset + { + + public function FlxTilemap_ImgAuto() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxTilemap_ImgAutoAlt.as b/research/inner_decompiled/scripts/org/flixel/FlxTilemap_ImgAutoAlt.as new file mode 100644 index 0000000..640a492 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxTilemap_ImgAutoAlt.as @@ -0,0 +1,15 @@ +package org.flixel +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/153_org.flixel.FlxTilemap_ImgAutoAlt.png")] + public class FlxTilemap_ImgAutoAlt extends BitmapAsset + { + + public function FlxTilemap_ImgAutoAlt() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxTimer.as b/research/inner_decompiled/scripts/org/flixel/FlxTimer.as new file mode 100644 index 0000000..b47b10e --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxTimer.as @@ -0,0 +1,106 @@ +package org.flixel +{ + import org.flixel.plugin.TimerManager; + + public class FlxTimer + { + + public var time:Number; + + public var loops:uint; + + public var paused:Boolean; + + public var finished:Boolean; + + protected var _callback:Function; + + protected var _timeCounter:Number; + + protected var _loopsCounter:uint; + + public function FlxTimer() + { + super(); + this.time = 0; + this.loops = 0; + this._callback = null; + this._timeCounter = 0; + this._loopsCounter = 0; + this.paused = false; + this.finished = false; + } + + public static function get manager() : TimerManager + { + return FlxG.getPlugin(TimerManager) as TimerManager; + } + + public function destroy() : void + { + this.stop(); + this._callback = null; + } + + public function update() : void + { + this._timeCounter += FlxG.elapsed; + while(this._timeCounter >= this.time && !this.paused && !this.finished) + { + this._timeCounter -= this.time; + ++this._loopsCounter; + if(this.loops > 0 && this._loopsCounter >= this.loops) + { + this.stop(); + } + if(this._callback != null) + { + this._callback(this); + } + } + } + + public function start(param1:Number = 1, param2:uint = 1, param3:Function = null) : FlxTimer + { + var _loc4_:TimerManager = manager; + if(_loc4_ != null) + { + _loc4_.add(this); + } + if(this.paused) + { + this.paused = false; + return this; + } + this.paused = false; + this.finished = false; + this.time = param1; + this.loops = param2; + this._callback = param3; + this._timeCounter = 0; + this._loopsCounter = 0; + return this; + } + + public function stop() : void + { + this.finished = true; + var _loc1_:TimerManager = manager; + if(_loc1_ != null) + { + _loc1_.remove(this); + } + } + + public function get timeLeft() : Number + { + return this.time - this._timeCounter; + } + + public function get loopsLeft() : int + { + return this.loops - this._loopsCounter; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/FlxU.as b/research/inner_decompiled/scripts/org/flixel/FlxU.as new file mode 100644 index 0000000..9cfb0de --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/FlxU.as @@ -0,0 +1,500 @@ +package org.flixel +{ + import flash.net.URLRequest; + import flash.net.navigateToURL; + import flash.utils.getDefinitionByName; + import flash.utils.getQualifiedClassName; + import flash.utils.getTimer; + + public class FlxU + { + + public function FlxU() + { + super(); + } + + public static function openURL(param1:String) : void + { + navigateToURL(new URLRequest(param1),"_blank"); + } + + public static function abs(param1:Number) : Number + { + return param1 > 0 ? param1 : -param1; + } + + public static function floor(param1:Number) : Number + { + var _loc2_:Number = int(param1); + return param1 > 0 ? _loc2_ : (_loc2_ != param1 ? _loc2_ - 1 : _loc2_); + } + + public static function ceil(param1:Number) : Number + { + var _loc2_:Number = int(param1); + return param1 > 0 ? (_loc2_ != param1 ? _loc2_ + 1 : _loc2_) : _loc2_; + } + + public static function round(param1:Number) : Number + { + var _loc2_:Number = int(param1 + (param1 > 0 ? 0.5 : -0.5)); + return param1 > 0 ? _loc2_ : (_loc2_ != param1 ? _loc2_ - 1 : _loc2_); + } + + public static function min(param1:Number, param2:Number) : Number + { + return param1 <= param2 ? param1 : param2; + } + + public static function max(param1:Number, param2:Number) : Number + { + return param1 >= param2 ? param1 : param2; + } + + public static function bound(param1:Number, param2:Number, param3:Number) : Number + { + var _loc4_:Number = param1 < param2 ? param2 : param1; + return _loc4_ > param3 ? param3 : _loc4_; + } + + public static function srand(param1:Number) : Number + { + return 69621 * int(param1 * 2147483647) % 2147483647 / 2147483647; + } + + public static function shuffle(param1:Array, param2:uint) : Array + { + var _loc4_:uint = 0; + var _loc5_:uint = 0; + var _loc6_:Object = null; + var _loc3_:uint = 0; + while(_loc3_ < param2) + { + _loc4_ = Math.random() * param1.length; + _loc5_ = Math.random() * param1.length; + _loc6_ = param1[_loc5_]; + param1[_loc5_] = param1[_loc4_]; + param1[_loc4_] = _loc6_; + _loc3_++; + } + return param1; + } + + public static function getRandom(param1:Array) : Object + { + var _loc2_:uint = 0; + if(param1 != null) + { + _loc2_ = param1.length; + if(_loc2_ > 0) + { + return param1[uint(Math.random() * _loc2_)]; + } + } + return null; + } + + public static function getTicks() : uint + { + return getTimer(); + } + + public static function formatTicks(param1:uint, param2:uint) : String + { + return (param2 - param1) / 1000 + "s"; + } + + public static function makeColor(param1:uint, param2:uint, param3:uint, param4:Number = 1) : uint + { + return ((param4 > 1 ? param4 : param4 * 255) & 0xFF) << 24 | (param1 & 0xFF) << 16 | (param2 & 0xFF) << 8 | param3 & 0xFF; + } + + public static function makeColorFromHSB(param1:Number, param2:Number, param3:Number, param4:Number = 1) : uint + { + var _loc5_:Number = NaN; + var _loc6_:Number = NaN; + var _loc7_:Number = NaN; + var _loc8_:int = 0; + var _loc9_:Number = NaN; + var _loc10_:Number = NaN; + var _loc11_:Number = NaN; + var _loc12_:Number = NaN; + if(param2 == 0) + { + _loc5_ = param3; + _loc6_ = param3; + _loc7_ = param3; + } + else + { + if(param1 == 360) + { + param1 = 0; + } + _loc8_ = param1 / 60; + _loc9_ = param1 / 60 - _loc8_; + _loc10_ = param3 * (1 - param2); + _loc11_ = param3 * (1 - param2 * _loc9_); + _loc12_ = param3 * (1 - param2 * (1 - _loc9_)); + switch(_loc8_) + { + case 0: + _loc5_ = param3; + _loc6_ = _loc12_; + _loc7_ = _loc10_; + break; + case 1: + _loc5_ = _loc11_; + _loc6_ = param3; + _loc7_ = _loc10_; + break; + case 2: + _loc5_ = _loc10_; + _loc6_ = param3; + _loc7_ = _loc12_; + break; + case 3: + _loc5_ = _loc10_; + _loc6_ = _loc11_; + _loc7_ = param3; + break; + case 4: + _loc5_ = _loc12_; + _loc6_ = _loc10_; + _loc7_ = param3; + break; + case 5: + _loc5_ = param3; + _loc6_ = _loc10_; + _loc7_ = _loc11_; + break; + default: + _loc5_ = 0; + _loc6_ = 0; + _loc7_ = 0; + } + } + return ((param4 > 1 ? param4 : param4 * 255) & 0xFF) << 24 | uint(_loc5_ * 255) << 16 | uint(_loc6_ * 255) << 8 | uint(_loc7_ * 255); + } + + public static function getRGBA(param1:uint, param2:Array = null) : Array + { + if(param2 == null) + { + param2 = new Array(); + } + param2[0] = param1 >> 16 & 0xFF; + param2[1] = param1 >> 8 & 0xFF; + param2[2] = param1 & 0xFF; + param2[3] = Number(param1 >> 24 & 0xFF) / 255; + return param2; + } + + public static function getHSB(param1:uint, param2:Array = null) : Array + { + if(param2 == null) + { + param2 = new Array(); + } + var _loc3_:Number = Number(param1 >> 16 & 0xFF) / 255; + var _loc4_:Number = Number(param1 >> 8 & 0xFF) / 255; + var _loc5_:Number = Number(param1 & 0xFF) / 255; + var _loc6_:Number = _loc3_ > _loc4_ ? _loc3_ : _loc4_; + var _loc7_:Number = _loc6_ > _loc5_ ? _loc6_ : _loc5_; + _loc6_ = _loc3_ > _loc4_ ? _loc4_ : _loc3_; + var _loc8_:Number = _loc6_ > _loc5_ ? _loc5_ : _loc6_; + var _loc9_:Number = _loc7_ - _loc8_; + param2[2] = _loc7_; + param2[1] = 0; + param2[0] = 0; + if(_loc7_ != 0) + { + param2[1] = _loc9_ / _loc7_; + } + if(param2[1] != 0) + { + if(_loc3_ == _loc7_) + { + param2[0] = (_loc4_ - _loc5_) / _loc9_; + } + else if(_loc4_ == _loc7_) + { + param2[0] = 2 + (_loc5_ - _loc3_) / _loc9_; + } + else if(_loc5_ == _loc7_) + { + param2[0] = 4 + (_loc3_ - _loc4_) / _loc9_; + } + param2[0] *= 60; + if(param2[0] < 0) + { + param2[0] += 360; + } + } + param2[3] = Number(param1 >> 24 & 0xFF) / 255; + return param2; + } + + public static function formatTime(param1:Number, param2:Boolean = false) : String + { + var _loc3_:String = int(param1 / 60) + ":"; + var _loc4_:int = int(param1) % 60; + if(_loc4_ < 10) + { + _loc3_ += "0"; + } + _loc3_ += _loc4_; + if(param2) + { + _loc3_ += "."; + _loc4_ = (param1 - int(param1)) * 100; + if(_loc4_ < 10) + { + _loc3_ += "0"; + } + _loc3_ += _loc4_; + } + return _loc3_; + } + + public static function formatArray(param1:Array) : String + { + if(param1 == null || param1.length <= 0) + { + return ""; + } + var _loc2_:String = param1[0].toString(); + var _loc3_:uint = 0; + var _loc4_:uint = param1.length; + while(_loc3_ < _loc4_) + { + _loc2_ += ", " + param1[_loc3_++].toString(); + } + return _loc2_; + } + + public static function formatMoney(param1:Number, param2:Boolean = true, param3:Boolean = true) : String + { + var _loc4_:int = 0; + var _loc5_:int = param1; + var _loc6_:String = ""; + var _loc7_:String = ""; + var _loc8_:String = ""; + while(_loc5_ > 0) + { + if(_loc6_.length > 0 && _loc7_.length <= 0) + { + if(param3) + { + _loc7_ = ","; + } + else + { + _loc7_ = "."; + } + } + _loc8_ = ""; + _loc4_ = _loc5_ - int(_loc5_ / 1000) * 1000; + _loc5_ /= 1000; + if(_loc5_ > 0) + { + if(_loc4_ < 100) + { + _loc8_ += "0"; + } + if(_loc4_ < 10) + { + _loc8_ += "0"; + } + } + _loc6_ = _loc8_ + _loc4_ + _loc7_ + _loc6_; + } + if(param2) + { + _loc5_ = int(param1 * 100) - int(param1) * 100; + _loc6_ += (param3 ? "." : ",") + _loc5_; + if(_loc5_ < 10) + { + _loc6_ += "0"; + } + } + return _loc6_; + } + + public static function getClassName(param1:Object, param2:Boolean = false) : String + { + var _loc3_:String = getQualifiedClassName(param1); + _loc3_ = _loc3_.replace("::","."); + if(param2) + { + _loc3_ = _loc3_.substr(_loc3_.lastIndexOf(".") + 1); + } + return _loc3_; + } + + public static function compareClassNames(param1:Object, param2:Object) : Boolean + { + return getQualifiedClassName(param1) == getQualifiedClassName(param2); + } + + public static function getClass(param1:String) : Class + { + return getDefinitionByName(param1) as Class; + } + + public static function computeVelocity(param1:Number, param2:Number = 0, param3:Number = 0, param4:Number = 10000) : Number + { + var _loc5_:Number = NaN; + if(param2 != 0) + { + param1 += param2 * FlxG.elapsed; + } + else if(param3 != 0) + { + _loc5_ = param3 * FlxG.elapsed; + if(param1 - _loc5_ > 0) + { + param1 -= _loc5_; + } + else if(param1 + _loc5_ < 0) + { + param1 += _loc5_; + } + else + { + param1 = 0; + } + } + if(param1 != 0 && param4 != 10000) + { + if(param1 > param4) + { + param1 = param4; + } + else if(param1 < -param4) + { + param1 = -param4; + } + } + return param1; + } + + public static function rotatePoint(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number, param6:FlxPoint = null) : FlxPoint + { + var _loc7_:Number = 0; + var _loc8_:Number = 0; + var _loc9_:Number = param5 * -0.017453293; + while(_loc9_ < -3.14159265) + { + _loc9_ += 6.28318531; + } + while(_loc9_ > 3.14159265) + { + _loc9_ -= 6.28318531; + } + if(_loc9_ < 0) + { + _loc7_ = 1.27323954 * _loc9_ + 0.405284735 * _loc9_ * _loc9_; + if(_loc7_ < 0) + { + _loc7_ = 0.225 * (_loc7_ * -_loc7_ - _loc7_) + _loc7_; + } + else + { + _loc7_ = 0.225 * (_loc7_ * _loc7_ - _loc7_) + _loc7_; + } + } + else + { + _loc7_ = 1.27323954 * _loc9_ - 0.405284735 * _loc9_ * _loc9_; + if(_loc7_ < 0) + { + _loc7_ = 0.225 * (_loc7_ * -_loc7_ - _loc7_) + _loc7_; + } + else + { + _loc7_ = 0.225 * (_loc7_ * _loc7_ - _loc7_) + _loc7_; + } + } + _loc9_ += 1.57079632; + if(_loc9_ > 3.14159265) + { + _loc9_ -= 6.28318531; + } + if(_loc9_ < 0) + { + _loc8_ = 1.27323954 * _loc9_ + 0.405284735 * _loc9_ * _loc9_; + if(_loc8_ < 0) + { + _loc8_ = 0.225 * (_loc8_ * -_loc8_ - _loc8_) + _loc8_; + } + else + { + _loc8_ = 0.225 * (_loc8_ * _loc8_ - _loc8_) + _loc8_; + } + } + else + { + _loc8_ = 1.27323954 * _loc9_ - 0.405284735 * _loc9_ * _loc9_; + if(_loc8_ < 0) + { + _loc8_ = 0.225 * (_loc8_ * -_loc8_ - _loc8_) + _loc8_; + } + else + { + _loc8_ = 0.225 * (_loc8_ * _loc8_ - _loc8_) + _loc8_; + } + } + var _loc10_:Number = param1 - param3; + var _loc11_:Number = param4 + param2; + if(param6 == null) + { + param6 = new FlxPoint(); + } + param6.x = param3 + _loc8_ * _loc10_ - _loc7_ * _loc11_; + param6.y = param4 - _loc7_ * _loc10_ - _loc8_ * _loc11_; + return param6; + } + + public static function getAngle(param1:FlxPoint, param2:FlxPoint) : Number + { + var _loc3_:Number = param2.x - param1.x; + var _loc4_:Number = param2.y - param1.y; + if(_loc3_ == 0 && _loc4_ == 0) + { + return 0; + } + var _loc5_:Number = 3.14159265358979 * 0.25; + var _loc6_:Number = 3 * _loc5_; + var _loc7_:Number = _loc4_ < 0 ? -_loc4_ : _loc4_; + var _loc8_:Number = 0; + if(_loc3_ >= 0) + { + _loc8_ = _loc5_ - _loc5_ * ((_loc3_ - _loc7_) / (_loc3_ + _loc7_)); + } + else + { + _loc8_ = _loc6_ - _loc5_ * ((_loc3_ + _loc7_) / (_loc7_ - _loc3_)); + } + _loc8_ = (_loc4_ < 0 ? -_loc8_ : _loc8_) * 57.2957795130823; + if(_loc8_ > 90) + { + _loc8_ -= 270; + } + else + { + _loc8_ += 90; + } + return _loc8_; + } + + public static function getDistance(param1:FlxPoint, param2:FlxPoint) : Number + { + var _loc3_:Number = param1.x - param2.x; + var _loc4_:Number = param1.y - param2.y; + return Math.sqrt(_loc3_ * _loc3_ + _loc4_ * _loc4_); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/plugin/DebugPathDisplay.as b/research/inner_decompiled/scripts/org/flixel/plugin/DebugPathDisplay.as new file mode 100644 index 0000000..434627a --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/plugin/DebugPathDisplay.as @@ -0,0 +1,90 @@ +package org.flixel.plugin +{ + import org.flixel.*; + + public class DebugPathDisplay extends FlxBasic + { + + protected var _paths:Array; + + public function DebugPathDisplay() + { + super(); + this._paths = new Array(); + active = false; + } + + override public function destroy() : void + { + super.destroy(); + this.clear(); + this._paths = null; + } + + override public function draw() : void + { + if(!FlxG.visualDebug || ignoreDrawDebug) + { + return; + } + if(cameras == null) + { + cameras = FlxG.cameras; + } + var _loc1_:uint = 0; + var _loc2_:uint = cameras.length; + while(_loc1_ < _loc2_) + { + this.drawDebug(cameras[_loc1_++]); + } + } + + override public function drawDebug(param1:FlxCamera = null) : void + { + var _loc3_:FlxPath = null; + if(param1 == null) + { + param1 = FlxG.camera; + } + var _loc2_:* = int(this._paths.length - 1); + while(_loc2_ >= 0) + { + _loc3_ = this._paths[_loc2_--] as FlxPath; + if(_loc3_ != null && !_loc3_.ignoreDrawDebug) + { + _loc3_.drawDebug(param1); + } + } + } + + public function add(param1:FlxPath) : void + { + this._paths.push(param1); + } + + public function remove(param1:FlxPath) : void + { + var _loc2_:int = this._paths.indexOf(param1); + if(_loc2_ >= 0) + { + this._paths.splice(_loc2_,1); + } + } + + public function clear() : void + { + var _loc2_:FlxPath = null; + var _loc1_:* = int(this._paths.length - 1); + while(_loc1_ >= 0) + { + _loc2_ = this._paths[_loc1_--] as FlxPath; + if(_loc2_ != null) + { + _loc2_.destroy(); + } + } + this._paths.length = 0; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/plugin/TimerManager.as b/research/inner_decompiled/scripts/org/flixel/plugin/TimerManager.as new file mode 100644 index 0000000..bead95d --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/plugin/TimerManager.as @@ -0,0 +1,67 @@ +package org.flixel.plugin +{ + import org.flixel.*; + + public class TimerManager extends FlxBasic + { + + protected var _timers:Array; + + public function TimerManager() + { + super(); + this._timers = new Array(); + visible = false; + } + + override public function destroy() : void + { + this.clear(); + this._timers = null; + } + + override public function update() : void + { + var _loc2_:FlxTimer = null; + var _loc1_:* = int(this._timers.length - 1); + while(_loc1_ >= 0) + { + _loc2_ = this._timers[_loc1_--] as FlxTimer; + if(_loc2_ != null && !_loc2_.paused && !_loc2_.finished && _loc2_.time > 0) + { + _loc2_.update(); + } + } + } + + public function add(param1:FlxTimer) : void + { + this._timers.push(param1); + } + + public function remove(param1:FlxTimer) : void + { + var _loc2_:int = this._timers.indexOf(param1); + if(_loc2_ >= 0) + { + this._timers.splice(_loc2_,1); + } + } + + public function clear() : void + { + var _loc2_:FlxTimer = null; + var _loc1_:* = int(this._timers.length - 1); + while(_loc1_ >= 0) + { + _loc2_ = this._timers[_loc1_--] as FlxTimer; + if(_loc2_ != null) + { + _loc2_.destroy(); + } + } + this._timers.length = 0; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/FlxAnim.as b/research/inner_decompiled/scripts/org/flixel/system/FlxAnim.as new file mode 100644 index 0000000..b19d7c0 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/FlxAnim.as @@ -0,0 +1,33 @@ +package org.flixel.system +{ + public class FlxAnim + { + + public var name:String; + + public var delay:Number; + + public var frames:Array; + + public var looped:Boolean; + + public function FlxAnim(param1:String, param2:Array, param3:Number = 0, param4:Boolean = true) + { + super(); + this.name = param1; + this.delay = 0; + if(param3 > 0) + { + this.delay = 1 / param3; + } + this.frames = param2; + this.looped = param4; + } + + public function destroy() : void + { + this.frames = null; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/FlxDebugger.as b/research/inner_decompiled/scripts/org/flixel/system/FlxDebugger.as new file mode 100644 index 0000000..00178ea --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/FlxDebugger.as @@ -0,0 +1,173 @@ +package org.flixel.system +{ + import flash.display.Bitmap; + import flash.display.BitmapData; + import flash.display.Sprite; + import flash.events.MouseEvent; + import flash.geom.Point; + import flash.geom.Rectangle; + import flash.text.TextField; + import flash.text.TextFormat; + import org.flixel.FlxG; + import org.flixel.system.debug.Log; + import org.flixel.system.debug.Perf; + import org.flixel.system.debug.VCR; + import org.flixel.system.debug.Vis; + import org.flixel.system.debug.Watch; + + public class FlxDebugger extends Sprite + { + + public var perf:Perf; + + public var log:Log; + + public var watch:Watch; + + public var vcr:VCR; + + public var vis:Vis; + + public var hasMouse:Boolean; + + protected var _layout:uint; + + protected var _screen:Point; + + protected var _gutter:uint; + + public function FlxDebugger(param1:Number, param2:Number) + { + super(); + visible = false; + this.hasMouse = false; + this._screen = new Point(param1,param2); + addChild(new Bitmap(new BitmapData(param1,15,true,2130706432))); + var _loc3_:TextField = new TextField(); + _loc3_.x = 2; + _loc3_.width = 160; + _loc3_.height = 16; + _loc3_.selectable = false; + _loc3_.multiline = false; + _loc3_.defaultTextFormat = new TextFormat("Courier",12,16777215); + var _loc4_:String = FlxG.getLibraryName(); + if(FlxG.debug) + { + _loc4_ += " [debug]"; + } + else + { + _loc4_ += " [release]"; + } + _loc3_.text = _loc4_; + addChild(_loc3_); + this._gutter = 8; + var _loc5_:Rectangle = new Rectangle(this._gutter,15 + this._gutter / 2,this._screen.x - this._gutter * 2,this._screen.y - this._gutter * 1.5 - 15); + this.log = new Log("log",0,0,true,_loc5_); + addChild(this.log); + this.watch = new Watch("watch",0,0,true,_loc5_); + addChild(this.watch); + this.perf = new Perf("stats",0,0,false,_loc5_); + addChild(this.perf); + this.vcr = new VCR(); + this.vcr.x = (param1 - this.vcr.width / 2) / 2; + this.vcr.y = 2; + addChild(this.vcr); + this.vis = new Vis(); + this.vis.x = param1 - this.vis.width - 4; + this.vis.y = 2; + addChild(this.vis); + this.setLayout(FlxG.DEBUGGER_STANDARD); + addEventListener(MouseEvent.MOUSE_OVER,this.onMouseOver); + addEventListener(MouseEvent.MOUSE_OUT,this.onMouseOut); + } + + public function destroy() : void + { + this._screen = null; + removeChild(this.log); + this.log.destroy(); + this.log = null; + removeChild(this.watch); + this.watch.destroy(); + this.watch = null; + removeChild(this.perf); + this.perf.destroy(); + this.perf = null; + removeChild(this.vcr); + this.vcr.destroy(); + this.vcr = null; + removeChild(this.vis); + this.vis.destroy(); + this.vis = null; + removeEventListener(MouseEvent.MOUSE_OVER,this.onMouseOver); + removeEventListener(MouseEvent.MOUSE_OUT,this.onMouseOut); + } + + protected function onMouseOver(param1:MouseEvent = null) : void + { + this.hasMouse = true; + } + + protected function onMouseOut(param1:MouseEvent = null) : void + { + this.hasMouse = false; + } + + public function setLayout(param1:uint) : void + { + this._layout = param1; + this.resetLayout(); + } + + public function resetLayout() : void + { + switch(this._layout) + { + case FlxG.DEBUGGER_MICRO: + this.log.resize(this._screen.x / 4,68); + this.log.reposition(0,this._screen.y); + this.watch.resize(this._screen.x / 4,68); + this.watch.reposition(this._screen.x,this._screen.y); + this.perf.reposition(this._screen.x,0); + break; + case FlxG.DEBUGGER_BIG: + this.log.resize((this._screen.x - this._gutter * 3) / 2,this._screen.y / 2); + this.log.reposition(0,this._screen.y); + this.watch.resize((this._screen.x - this._gutter * 3) / 2,this._screen.y / 2); + this.watch.reposition(this._screen.x,this._screen.y); + this.perf.reposition(this._screen.x,0); + break; + case FlxG.DEBUGGER_TOP: + this.log.resize((this._screen.x - this._gutter * 3) / 2,this._screen.y / 4); + this.log.reposition(0,0); + this.watch.resize((this._screen.x - this._gutter * 3) / 2,this._screen.y / 4); + this.watch.reposition(this._screen.x,0); + this.perf.reposition(this._screen.x,this._screen.y); + break; + case FlxG.DEBUGGER_LEFT: + this.log.resize(this._screen.x / 3,(this._screen.y - 15 - this._gutter * 2.5) / 2); + this.log.reposition(0,0); + this.watch.resize(this._screen.x / 3,(this._screen.y - 15 - this._gutter * 2.5) / 2); + this.watch.reposition(0,this._screen.y); + this.perf.reposition(this._screen.x,0); + break; + case FlxG.DEBUGGER_RIGHT: + this.log.resize(this._screen.x / 3,(this._screen.y - 15 - this._gutter * 2.5) / 2); + this.log.reposition(this._screen.x,0); + this.watch.resize(this._screen.x / 3,(this._screen.y - 15 - this._gutter * 2.5) / 2); + this.watch.reposition(this._screen.x,this._screen.y); + this.perf.reposition(0,0); + break; + case FlxG.DEBUGGER_STANDARD: + default: + this.log.resize((this._screen.x - this._gutter * 3) / 2,this._screen.y / 4); + this.log.reposition(0,this._screen.y); + this.watch.resize((this._screen.x - this._gutter * 3) / 2,this._screen.y / 4); + this.watch.reposition(this._screen.x,this._screen.y); + this.perf.reposition(this._screen.x,0); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/FlxList.as b/research/inner_decompiled/scripts/org/flixel/system/FlxList.as new file mode 100644 index 0000000..db4ffcc --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/FlxList.as @@ -0,0 +1,30 @@ +package org.flixel.system +{ + import org.flixel.FlxObject; + + public class FlxList + { + + public var object:FlxObject; + + public var next:FlxList; + + public function FlxList() + { + super(); + this.object = null; + this.next = null; + } + + public function destroy() : void + { + this.object = null; + if(this.next != null) + { + this.next.destroy(); + } + this.next = null; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/FlxQuadTree.as b/research/inner_decompiled/scripts/org/flixel/system/FlxQuadTree.as new file mode 100644 index 0000000..109b82d --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/FlxQuadTree.as @@ -0,0 +1,468 @@ +package org.flixel.system +{ + import org.flixel.FlxBasic; + import org.flixel.FlxGroup; + import org.flixel.FlxObject; + import org.flixel.FlxRect; + + public class FlxQuadTree extends FlxRect + { + + public static var divisions:uint; + + protected static var _min:uint; + + protected static var _object:FlxObject; + + protected static var _objectLeftEdge:Number; + + protected static var _objectTopEdge:Number; + + protected static var _objectRightEdge:Number; + + protected static var _objectBottomEdge:Number; + + protected static var _list:uint; + + protected static var _useBothLists:Boolean; + + protected static var _processingCallback:Function; + + protected static var _notifyCallback:Function; + + protected static var _iterator:FlxList; + + protected static var _objectHullX:Number; + + protected static var _objectHullY:Number; + + protected static var _objectHullWidth:Number; + + protected static var _objectHullHeight:Number; + + protected static var _checkObjectHullX:Number; + + protected static var _checkObjectHullY:Number; + + protected static var _checkObjectHullWidth:Number; + + protected static var _checkObjectHullHeight:Number; + + public static const A_LIST:uint = 0; + + public static const B_LIST:uint = 1; + + protected var _canSubdivide:Boolean; + + protected var _headA:FlxList; + + protected var _tailA:FlxList; + + protected var _headB:FlxList; + + protected var _tailB:FlxList; + + protected var _northWestTree:FlxQuadTree; + + protected var _northEastTree:FlxQuadTree; + + protected var _southEastTree:FlxQuadTree; + + protected var _southWestTree:FlxQuadTree; + + protected var _leftEdge:Number; + + protected var _rightEdge:Number; + + protected var _topEdge:Number; + + protected var _bottomEdge:Number; + + protected var _halfWidth:Number; + + protected var _halfHeight:Number; + + protected var _midpointX:Number; + + protected var _midpointY:Number; + + public function FlxQuadTree(param1:Number, param2:Number, param3:Number, param4:Number, param5:FlxQuadTree = null) + { + var _loc6_:FlxList = null; + var _loc7_:FlxList = null; + super(param1,param2,param3,param4); + this._headA = this._tailA = new FlxList(); + this._headB = this._tailB = new FlxList(); + if(param5 != null) + { + if(param5._headA.object != null) + { + _loc6_ = param5._headA; + while(_loc6_ != null) + { + if(this._tailA.object != null) + { + _loc7_ = this._tailA; + this._tailA = new FlxList(); + _loc7_.next = this._tailA; + } + this._tailA.object = _loc6_.object; + _loc6_ = _loc6_.next; + } + } + if(param5._headB.object != null) + { + _loc6_ = param5._headB; + while(_loc6_ != null) + { + if(this._tailB.object != null) + { + _loc7_ = this._tailB; + this._tailB = new FlxList(); + _loc7_.next = this._tailB; + } + this._tailB.object = _loc6_.object; + _loc6_ = _loc6_.next; + } + } + } + else + { + _min = (width + height) / (2 * divisions); + } + this._canSubdivide = width > _min || height > _min; + this._northWestTree = null; + this._northEastTree = null; + this._southEastTree = null; + this._southWestTree = null; + this._leftEdge = x; + this._rightEdge = x + width; + this._halfWidth = width / 2; + this._midpointX = this._leftEdge + this._halfWidth; + this._topEdge = y; + this._bottomEdge = y + height; + this._halfHeight = height / 2; + this._midpointY = this._topEdge + this._halfHeight; + } + + public function destroy() : void + { + this._headA.destroy(); + this._headA = null; + this._tailA.destroy(); + this._tailA = null; + this._headB.destroy(); + this._headB = null; + this._tailB.destroy(); + this._tailB = null; + if(this._northWestTree != null) + { + this._northWestTree.destroy(); + } + this._northWestTree = null; + if(this._northEastTree != null) + { + this._northEastTree.destroy(); + } + this._northEastTree = null; + if(this._southEastTree != null) + { + this._southEastTree.destroy(); + } + this._southEastTree = null; + if(this._southWestTree != null) + { + this._southWestTree.destroy(); + } + this._southWestTree = null; + _object = null; + _processingCallback = null; + _notifyCallback = null; + } + + public function load(param1:FlxBasic, param2:FlxBasic = null, param3:Function = null, param4:Function = null) : void + { + this.add(param1,A_LIST); + if(param2 != null) + { + this.add(param2,B_LIST); + _useBothLists = true; + } + else + { + _useBothLists = false; + } + _notifyCallback = param3; + _processingCallback = param4; + } + + public function add(param1:FlxBasic, param2:uint) : void + { + var _loc3_:uint = 0; + var _loc4_:FlxBasic = null; + var _loc5_:Array = null; + var _loc6_:uint = 0; + _list = param2; + if(param1 is FlxGroup) + { + _loc3_ = 0; + _loc5_ = (param1 as FlxGroup).members; + _loc6_ = _loc5_.length; + while(_loc3_ < _loc6_) + { + _loc4_ = _loc5_[_loc3_++] as FlxBasic; + if(_loc4_ != null && _loc4_.exists) + { + if(_loc4_ is FlxGroup) + { + this.add(_loc4_,param2); + } + else if(_loc4_ is FlxObject) + { + _object = _loc4_ as FlxObject; + if(_object.exists && Boolean(_object.allowCollisions)) + { + _objectLeftEdge = _object.x; + _objectTopEdge = _object.y; + _objectRightEdge = _object.x + _object.width; + _objectBottomEdge = _object.y + _object.height; + this.addObject(); + } + } + } + } + } + else + { + _object = param1 as FlxObject; + if(_object.exists && Boolean(_object.allowCollisions)) + { + _objectLeftEdge = _object.x; + _objectTopEdge = _object.y; + _objectRightEdge = _object.x + _object.width; + _objectBottomEdge = _object.y + _object.height; + this.addObject(); + } + } + } + + protected function addObject() : void + { + if(!this._canSubdivide || this._leftEdge >= _objectLeftEdge && this._rightEdge <= _objectRightEdge && this._topEdge >= _objectTopEdge && this._bottomEdge <= _objectBottomEdge) + { + this.addToList(); + return; + } + if(_objectLeftEdge > this._leftEdge && _objectRightEdge < this._midpointX) + { + if(_objectTopEdge > this._topEdge && _objectBottomEdge < this._midpointY) + { + if(this._northWestTree == null) + { + this._northWestTree = new FlxQuadTree(this._leftEdge,this._topEdge,this._halfWidth,this._halfHeight,this); + } + this._northWestTree.addObject(); + return; + } + if(_objectTopEdge > this._midpointY && _objectBottomEdge < this._bottomEdge) + { + if(this._southWestTree == null) + { + this._southWestTree = new FlxQuadTree(this._leftEdge,this._midpointY,this._halfWidth,this._halfHeight,this); + } + this._southWestTree.addObject(); + return; + } + } + if(_objectLeftEdge > this._midpointX && _objectRightEdge < this._rightEdge) + { + if(_objectTopEdge > this._topEdge && _objectBottomEdge < this._midpointY) + { + if(this._northEastTree == null) + { + this._northEastTree = new FlxQuadTree(this._midpointX,this._topEdge,this._halfWidth,this._halfHeight,this); + } + this._northEastTree.addObject(); + return; + } + if(_objectTopEdge > this._midpointY && _objectBottomEdge < this._bottomEdge) + { + if(this._southEastTree == null) + { + this._southEastTree = new FlxQuadTree(this._midpointX,this._midpointY,this._halfWidth,this._halfHeight,this); + } + this._southEastTree.addObject(); + return; + } + } + if(_objectRightEdge > this._leftEdge && _objectLeftEdge < this._midpointX && _objectBottomEdge > this._topEdge && _objectTopEdge < this._midpointY) + { + if(this._northWestTree == null) + { + this._northWestTree = new FlxQuadTree(this._leftEdge,this._topEdge,this._halfWidth,this._halfHeight,this); + } + this._northWestTree.addObject(); + } + if(_objectRightEdge > this._midpointX && _objectLeftEdge < this._rightEdge && _objectBottomEdge > this._topEdge && _objectTopEdge < this._midpointY) + { + if(this._northEastTree == null) + { + this._northEastTree = new FlxQuadTree(this._midpointX,this._topEdge,this._halfWidth,this._halfHeight,this); + } + this._northEastTree.addObject(); + } + if(_objectRightEdge > this._midpointX && _objectLeftEdge < this._rightEdge && _objectBottomEdge > this._midpointY && _objectTopEdge < this._bottomEdge) + { + if(this._southEastTree == null) + { + this._southEastTree = new FlxQuadTree(this._midpointX,this._midpointY,this._halfWidth,this._halfHeight,this); + } + this._southEastTree.addObject(); + } + if(_objectRightEdge > this._leftEdge && _objectLeftEdge < this._midpointX && _objectBottomEdge > this._midpointY && _objectTopEdge < this._bottomEdge) + { + if(this._southWestTree == null) + { + this._southWestTree = new FlxQuadTree(this._leftEdge,this._midpointY,this._halfWidth,this._halfHeight,this); + } + this._southWestTree.addObject(); + } + } + + protected function addToList() : void + { + var _loc1_:FlxList = null; + if(_list == A_LIST) + { + if(this._tailA.object != null) + { + _loc1_ = this._tailA; + this._tailA = new FlxList(); + _loc1_.next = this._tailA; + } + this._tailA.object = _object; + } + else + { + if(this._tailB.object != null) + { + _loc1_ = this._tailB; + this._tailB = new FlxList(); + _loc1_.next = this._tailB; + } + this._tailB.object = _object; + } + if(!this._canSubdivide) + { + return; + } + if(this._northWestTree != null) + { + this._northWestTree.addToList(); + } + if(this._northEastTree != null) + { + this._northEastTree.addToList(); + } + if(this._southEastTree != null) + { + this._southEastTree.addToList(); + } + if(this._southWestTree != null) + { + this._southWestTree.addToList(); + } + } + + public function execute() : Boolean + { + var _loc2_:FlxList = null; + var _loc1_:Boolean = false; + if(this._headA.object != null) + { + _loc2_ = this._headA; + while(_loc2_ != null) + { + _object = _loc2_.object; + if(_useBothLists) + { + _iterator = this._headB; + } + else + { + _iterator = _loc2_.next; + } + if(_object.exists && _object.allowCollisions > 0 && _iterator != null && _iterator.object != null && _iterator.object.exists && this.overlapNode()) + { + _loc1_ = true; + } + _loc2_ = _loc2_.next; + } + } + if(this._northWestTree != null && this._northWestTree.execute()) + { + _loc1_ = true; + } + if(this._northEastTree != null && this._northEastTree.execute()) + { + _loc1_ = true; + } + if(this._southEastTree != null && this._southEastTree.execute()) + { + _loc1_ = true; + } + if(this._southWestTree != null && this._southWestTree.execute()) + { + _loc1_ = true; + } + return _loc1_; + } + + protected function overlapNode() : Boolean + { + var _loc2_:FlxObject = null; + var _loc1_:Boolean = false; + while(_iterator != null) + { + if(!_object.exists || _object.allowCollisions <= 0) + { + break; + } + _loc2_ = _iterator.object; + if(_object === _loc2_ || !_loc2_.exists || _loc2_.allowCollisions <= 0) + { + _iterator = _iterator.next; + } + else + { + _objectHullX = _object.x < _object.last.x ? _object.x : _object.last.x; + _objectHullY = _object.y < _object.last.y ? _object.y : _object.last.y; + _objectHullWidth = _object.x - _object.last.x; + _objectHullWidth = _object.width + (_objectHullWidth > 0 ? _objectHullWidth : -_objectHullWidth); + _objectHullHeight = _object.y - _object.last.y; + _objectHullHeight = _object.height + (_objectHullHeight > 0 ? _objectHullHeight : -_objectHullHeight); + _checkObjectHullX = _loc2_.x < _loc2_.last.x ? _loc2_.x : _loc2_.last.x; + _checkObjectHullY = _loc2_.y < _loc2_.last.y ? _loc2_.y : _loc2_.last.y; + _checkObjectHullWidth = _loc2_.x - _loc2_.last.x; + _checkObjectHullWidth = _loc2_.width + (_checkObjectHullWidth > 0 ? _checkObjectHullWidth : -_checkObjectHullWidth); + _checkObjectHullHeight = _loc2_.y - _loc2_.last.y; + _checkObjectHullHeight = _loc2_.height + (_checkObjectHullHeight > 0 ? _checkObjectHullHeight : -_checkObjectHullHeight); + if(_objectHullX + _objectHullWidth > _checkObjectHullX && _objectHullX < _checkObjectHullX + _checkObjectHullWidth && _objectHullY + _objectHullHeight > _checkObjectHullY && _objectHullY < _checkObjectHullY + _checkObjectHullHeight) + { + if(_processingCallback == null || Boolean(_processingCallback(_object,_loc2_))) + { + _loc1_ = true; + } + if(_loc1_ && _notifyCallback != null) + { + _notifyCallback(_object,_loc2_); + } + } + _iterator = _iterator.next; + } + } + return _loc1_; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/FlxReplay.as b/research/inner_decompiled/scripts/org/flixel/system/FlxReplay.as new file mode 100644 index 0000000..a6ee8e6 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/FlxReplay.as @@ -0,0 +1,153 @@ +package org.flixel.system +{ + import org.flixel.FlxG; + import org.flixel.system.replay.FrameRecord; + import org.flixel.system.replay.MouseRecord; + + public class FlxReplay + { + + public var seed:Number; + + public var frame:int; + + public var frameCount:int; + + public var finished:Boolean; + + protected var _frames:Array; + + protected var _capacity:int; + + protected var _marker:int; + + public function FlxReplay() + { + super(); + this.seed = 0; + this.frame = 0; + this.frameCount = 0; + this.finished = false; + this._frames = null; + this._capacity = 0; + this._marker = 0; + } + + public function destroy() : void + { + if(this._frames == null) + { + return; + } + var _loc1_:* = int(this.frameCount - 1); + while(_loc1_ >= 0) + { + (this._frames[_loc1_--] as FrameRecord).destroy(); + } + this._frames = null; + } + + public function create(param1:Number) : void + { + this.destroy(); + this.init(); + this.seed = param1; + this.rewind(); + } + + public function load(param1:String) : void + { + var _loc3_:String = null; + this.init(); + var _loc2_:Array = param1.split("\n"); + this.seed = Number(_loc2_[0]); + var _loc4_:uint = 1; + var _loc5_:uint = _loc2_.length; + while(_loc4_ < _loc5_) + { + _loc3_ = _loc2_[_loc4_++] as String; + if(_loc3_.length > 3) + { + var _loc6_:Number; + this._frames[_loc6_ = this.frameCount++] = new FrameRecord().load(_loc3_); + if(this.frameCount >= this._capacity) + { + this._capacity *= 2; + this._frames.length = this._capacity; + } + } + } + this.rewind(); + } + + protected function init() : void + { + this._capacity = 100; + this._frames = new Array(this._capacity); + this.frameCount = 0; + } + + public function save() : String + { + if(this.frameCount <= 0) + { + return null; + } + var _loc1_:String = this.seed + "\n"; + var _loc2_:uint = 0; + while(_loc2_ < this.frameCount) + { + _loc1_ += this._frames[_loc2_++].save() + "\n"; + } + return _loc1_; + } + + public function recordFrame() : void + { + var _loc1_:Array = FlxG.keys.record(); + var _loc2_:MouseRecord = FlxG.mouse.record(); + if(_loc1_ == null && _loc2_ == null) + { + ++this.frame; + return; + } + this._frames[this.frameCount++] = new FrameRecord().create(this.frame++,_loc1_,_loc2_); + if(this.frameCount >= this._capacity) + { + this._capacity *= 2; + this._frames.length = this._capacity; + } + } + + public function playNextFrame() : void + { + FlxG.resetInput(); + if(this._marker >= this.frameCount) + { + this.finished = true; + return; + } + if((this._frames[this._marker] as FrameRecord).frame != this.frame++) + { + return; + } + var _loc1_:FrameRecord = this._frames[this._marker++]; + if(_loc1_.keys != null) + { + FlxG.keys.playback(_loc1_.keys); + } + if(_loc1_.mouse != null) + { + FlxG.mouse.playback(_loc1_.mouse); + } + } + + public function rewind() : void + { + this._marker = 0; + this.frame = 0; + this.finished = false; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/FlxTile.as b/research/inner_decompiled/scripts/org/flixel/system/FlxTile.as new file mode 100644 index 0000000..36079e2 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/FlxTile.as @@ -0,0 +1,41 @@ +package org.flixel.system +{ + import org.flixel.FlxObject; + import org.flixel.FlxTilemap; + + public class FlxTile extends FlxObject + { + + public var callback:Function; + + public var filter:Class; + + public var tilemap:FlxTilemap; + + public var index:uint; + + public var mapIndex:uint; + + public function FlxTile(param1:FlxTilemap, param2:uint, param3:Number, param4:Number, param5:Boolean, param6:uint) + { + super(0,0,param3,param4); + immovable = true; + moves = false; + this.callback = null; + this.filter = null; + this.tilemap = param1; + this.index = param2; + visible = param5; + allowCollisions = param6; + this.mapIndex = 0; + } + + override public function destroy() : void + { + super.destroy(); + this.callback = null; + this.tilemap = null; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/FlxTilemapBuffer.as b/research/inner_decompiled/scripts/org/flixel/system/FlxTilemapBuffer.as new file mode 100644 index 0000000..776d852 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/FlxTilemapBuffer.as @@ -0,0 +1,76 @@ +package org.flixel.system +{ + import flash.display.BitmapData; + import flash.geom.Point; + import flash.geom.Rectangle; + import org.flixel.FlxCamera; + import org.flixel.FlxG; + import org.flixel.FlxU; + + public class FlxTilemapBuffer + { + + public var x:Number; + + public var y:Number; + + public var width:Number; + + public var height:Number; + + public var dirty:Boolean; + + public var rows:uint; + + public var columns:uint; + + protected var _pixels:BitmapData; + + protected var _flashRect:Rectangle; + + public function FlxTilemapBuffer(param1:Number, param2:Number, param3:uint, param4:uint, param5:FlxCamera = null) + { + super(); + if(param5 == null) + { + param5 = FlxG.camera; + } + this.columns = FlxU.ceil(param5.width / param1) + 1; + if(this.columns > param3) + { + this.columns = param3; + } + this.rows = FlxU.ceil(param5.height / param2) + 1; + if(this.rows > param4) + { + this.rows = param4; + } + this._pixels = new BitmapData(this.columns * param1,this.rows * param2,true,0); + this.width = this._pixels.width; + this.height = this._pixels.height; + this._flashRect = new Rectangle(0,0,this.width,this.height); + this.dirty = true; + } + + public function destroy() : void + { + this._pixels = null; + } + + public function fill(param1:uint = 0) : void + { + this._pixels.fillRect(this._flashRect,param1); + } + + public function get pixels() : BitmapData + { + return this._pixels; + } + + public function draw(param1:FlxCamera, param2:Point) : void + { + param1.buffer.copyPixels(this._pixels,this._flashRect,param2,null,null,true); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/FlxWindow.as b/research/inner_decompiled/scripts/org/flixel/system/FlxWindow.as new file mode 100644 index 0000000..823c826 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/FlxWindow.as @@ -0,0 +1,234 @@ +package org.flixel.system +{ + import flash.display.Bitmap; + import flash.display.BitmapData; + import flash.display.Sprite; + import flash.events.Event; + import flash.events.MouseEvent; + import flash.geom.Point; + import flash.geom.Rectangle; + import flash.text.TextField; + import flash.text.TextFormat; + import org.flixel.FlxU; + + public class FlxWindow extends Sprite + { + + protected var ImgHandle:Class = FlxWindow_ImgHandle; + + public var minSize:Point; + + public var maxSize:Point; + + protected var _width:uint; + + protected var _height:uint; + + protected var _bounds:Rectangle; + + protected var _background:Bitmap; + + protected var _header:Bitmap; + + protected var _shadow:Bitmap; + + protected var _title:TextField; + + protected var _handle:Bitmap; + + protected var _overHeader:Boolean; + + protected var _overHandle:Boolean; + + protected var _drag:Point; + + protected var _dragging:Boolean; + + protected var _resizing:Boolean; + + protected var _resizable:Boolean; + + public function FlxWindow(param1:String, param2:Number, param3:Number, param4:Boolean = true, param5:Rectangle = null, param6:uint = 2139062143, param7:uint = 2130706432) + { + super(); + this._width = param2; + this._height = param3; + this._bounds = param5; + this.minSize = new Point(50,30); + if(this._bounds != null) + { + this.maxSize = new Point(this._bounds.width,this._bounds.height); + } + else + { + this.maxSize = new Point(Number.MAX_VALUE,Number.MAX_VALUE); + } + this._drag = new Point(); + this._resizable = param4; + this._shadow = new Bitmap(new BitmapData(1,2,true,4278190080)); + addChild(this._shadow); + this._background = new Bitmap(new BitmapData(1,1,true,param6)); + this._background.y = 15; + addChild(this._background); + this._header = new Bitmap(new BitmapData(1,15,true,param7)); + addChild(this._header); + this._title = new TextField(); + this._title.x = 2; + this._title.height = 16; + this._title.selectable = false; + this._title.multiline = false; + this._title.defaultTextFormat = new TextFormat("Courier",12,16777215); + this._title.text = param1; + addChild(this._title); + if(this._resizable) + { + this._handle = new this.ImgHandle(); + addChild(this._handle); + } + if(this._width != 0 || this._height != 0) + { + this.updateSize(); + } + this.bound(); + addEventListener(Event.ENTER_FRAME,this.init); + } + + public function destroy() : void + { + this.minSize = null; + this.maxSize = null; + this._bounds = null; + removeChild(this._shadow); + this._shadow = null; + removeChild(this._background); + this._background = null; + removeChild(this._header); + this._header = null; + removeChild(this._title); + this._title = null; + if(this._handle != null) + { + removeChild(this._handle); + } + this._handle = null; + this._drag = null; + } + + public function resize(param1:Number, param2:Number) : void + { + this._width = param1; + this._height = param2; + this.updateSize(); + } + + public function reposition(param1:Number, param2:Number) : void + { + x = param1; + y = param2; + this.bound(); + } + + protected function init(param1:Event = null) : void + { + if(root == null) + { + return; + } + removeEventListener(Event.ENTER_FRAME,this.init); + stage.addEventListener(MouseEvent.MOUSE_MOVE,this.onMouseMove); + stage.addEventListener(MouseEvent.MOUSE_DOWN,this.onMouseDown); + stage.addEventListener(MouseEvent.MOUSE_UP,this.onMouseUp); + } + + protected function onMouseMove(param1:MouseEvent = null) : void + { + if(this._dragging) + { + this._overHeader = true; + this.reposition(parent.mouseX - this._drag.x,parent.mouseY - this._drag.y); + } + else if(this._resizing) + { + this._overHandle = true; + this.resize(mouseX - this._drag.x,mouseY - this._drag.y); + } + else if(mouseX >= 0 && mouseX <= this._width && mouseY >= 0 && mouseY <= this._height) + { + this._overHeader = mouseX <= this._header.width && mouseY <= this._header.height; + if(this._resizable) + { + this._overHandle = mouseX >= this._width - this._handle.width && mouseY >= this._height - this._handle.height; + } + } + else + { + this._overHandle = this._overHeader = false; + } + this.updateGUI(); + } + + protected function onMouseDown(param1:MouseEvent = null) : void + { + if(this._overHeader) + { + this._dragging = true; + this._drag.x = mouseX; + this._drag.y = mouseY; + } + else if(this._overHandle) + { + this._resizing = true; + this._drag.x = this._width - mouseX; + this._drag.y = this._height - mouseY; + } + } + + protected function onMouseUp(param1:MouseEvent = null) : void + { + this._dragging = false; + this._resizing = false; + } + + protected function bound() : void + { + if(this._bounds != null) + { + x = FlxU.bound(x,this._bounds.left,this._bounds.right - this._width); + y = FlxU.bound(y,this._bounds.top,this._bounds.bottom - this._height); + } + } + + protected function updateSize() : void + { + this._width = FlxU.bound(this._width,this.minSize.x,this.maxSize.x); + this._height = FlxU.bound(this._height,this.minSize.y,this.maxSize.y); + this._header.scaleX = this._width; + this._background.scaleX = this._width; + this._background.scaleY = this._height - 15; + this._shadow.scaleX = this._width; + this._shadow.y = this._height; + this._title.width = this._width - 4; + if(this._resizable) + { + this._handle.x = this._width - this._handle.width; + this._handle.y = this._height - this._handle.height; + } + } + + protected function updateGUI() : void + { + if(this._overHeader || this._overHandle) + { + if(this._title.alpha != 1) + { + this._title.alpha = 1; + } + } + else if(this._title.alpha != 0.65) + { + this._title.alpha = 0.65; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/FlxWindow_ImgHandle.as b/research/inner_decompiled/scripts/org/flixel/system/FlxWindow_ImgHandle.as new file mode 100644 index 0000000..9fed196 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/FlxWindow_ImgHandle.as @@ -0,0 +1,15 @@ +package org.flixel.system +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/110_org.flixel.system.FlxWindow_ImgHandle.png")] + public class FlxWindow_ImgHandle extends BitmapAsset + { + + public function FlxWindow_ImgHandle() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/Log.as b/research/inner_decompiled/scripts/org/flixel/system/debug/Log.as new file mode 100644 index 0000000..459c298 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/Log.as @@ -0,0 +1,75 @@ +package org.flixel.system.debug +{ + import flash.geom.Rectangle; + import flash.text.TextField; + import flash.text.TextFormat; + import org.flixel.system.FlxWindow; + + public class Log extends FlxWindow + { + + protected static const MAX_LOG_LINES:uint = 200; + + protected var _text:TextField; + + protected var _lines:Array; + + public function Log(param1:String, param2:Number, param3:Number, param4:Boolean = true, param5:Rectangle = null, param6:uint = 2139062143, param7:uint = 2130706432) + { + super(param1,param2,param3,param4,param5,param6,param7); + this._text = new TextField(); + this._text.x = 2; + this._text.y = 15; + this._text.multiline = true; + this._text.wordWrap = true; + this._text.selectable = true; + this._text.defaultTextFormat = new TextFormat("Courier",12,16777215); + addChild(this._text); + this._lines = new Array(); + } + + override public function destroy() : void + { + removeChild(this._text); + this._text = null; + this._lines = null; + super.destroy(); + } + + public function add(param1:String) : void + { + var _loc2_:String = null; + var _loc3_:uint = 0; + if(this._lines.length <= 0) + { + this._text.text = ""; + } + this._lines.push(param1); + if(this._lines.length > MAX_LOG_LINES) + { + this._lines.shift(); + _loc2_ = ""; + _loc3_ = 0; + while(_loc3_ < this._lines.length) + { + _loc2_ += this._lines[_loc3_] + "\n"; + _loc3_++; + } + this._text.text = _loc2_; + } + else + { + this._text.appendText(param1 + "\n"); + } + this._text.scrollV = this._text.height; + } + + override protected function updateSize() : void + { + super.updateSize(); + this._text.width = _width - 10; + this._text.height = _height - 15; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/Perf.as b/research/inner_decompiled/scripts/org/flixel/system/debug/Perf.as new file mode 100644 index 0000000..3e65316 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/Perf.as @@ -0,0 +1,176 @@ +package org.flixel.system.debug +{ + import flash.geom.Rectangle; + import flash.system.System; + import flash.text.TextField; + import flash.text.TextFormat; + import flash.utils.getTimer; + import org.flixel.FlxG; + import org.flixel.system.FlxWindow; + + public class Perf extends FlxWindow + { + + protected var _text:TextField; + + protected var _lastTime:int; + + protected var _updateTimer:int; + + protected var _flixelUpdate:Array; + + protected var _flixelUpdateMarker:uint; + + protected var _flixelDraw:Array; + + protected var _flixelDrawMarker:uint; + + protected var _flash:Array; + + protected var _flashMarker:uint; + + protected var _activeObject:Array; + + protected var _objectMarker:uint; + + protected var _visibleObject:Array; + + protected var _visibleObjectMarker:uint; + + public function Perf(param1:String, param2:Number, param3:Number, param4:Boolean = true, param5:Rectangle = null, param6:uint = 2139062143, param7:uint = 2130706432) + { + super(param1,param2,param3,param4,param5,param6,param7); + resize(90,66); + this._lastTime = 0; + this._updateTimer = 0; + this._text = new TextField(); + this._text.width = _width; + this._text.x = 2; + this._text.y = 15; + this._text.multiline = true; + this._text.wordWrap = true; + this._text.selectable = true; + this._text.defaultTextFormat = new TextFormat("Courier",12,16777215); + addChild(this._text); + this._flixelUpdate = new Array(32); + this._flixelUpdateMarker = 0; + this._flixelDraw = new Array(32); + this._flixelDrawMarker = 0; + this._flash = new Array(32); + this._flashMarker = 0; + this._activeObject = new Array(32); + this._objectMarker = 0; + this._visibleObject = new Array(32); + this._visibleObjectMarker = 0; + } + + override public function destroy() : void + { + removeChild(this._text); + this._text = null; + this._flixelUpdate = null; + this._flixelDraw = null; + this._flash = null; + this._activeObject = null; + this._visibleObject = null; + super.destroy(); + } + + public function update() : void + { + var _loc4_:uint = 0; + var _loc5_:String = null; + var _loc6_:Number = NaN; + var _loc7_:uint = 0; + var _loc8_:uint = 0; + var _loc9_:uint = 0; + var _loc10_:uint = 0; + var _loc11_:uint = 0; + var _loc1_:int = getTimer(); + var _loc2_:int = _loc1_ - this._lastTime; + var _loc3_:uint = 500; + if(_loc2_ > _loc3_) + { + _loc2_ = int(_loc3_); + } + this._lastTime = _loc1_; + this._updateTimer += _loc2_; + if(this._updateTimer > _loc3_) + { + _loc5_ = ""; + _loc6_ = 0; + _loc4_ = 0; + while(_loc4_ < this._flashMarker) + { + _loc6_ += this._flash[_loc4_++]; + } + _loc6_ /= this._flashMarker; + _loc5_ += uint(1 / (_loc6_ / 1000)) + "/" + FlxG.flashFramerate + "fps\n"; + _loc5_ = _loc5_ + (Number((System.totalMemory * 9.54e-7).toFixed(2)) + "MB\n"); + _loc7_ = 0; + _loc4_ = 0; + while(_loc4_ < this._flixelUpdateMarker) + { + _loc7_ += this._flixelUpdate[_loc4_++]; + } + _loc8_ = 0; + _loc9_ = 0; + _loc4_ = 0; + while(_loc4_ < this._objectMarker) + { + _loc8_ += this._activeObject[_loc4_]; + _loc11_ += this._visibleObject[_loc4_++]; + } + _loc8_ /= this._objectMarker; + _loc5_ += "U:" + _loc8_ + " " + uint(_loc7_ / this._flixelDrawMarker) + "ms\n"; + _loc10_ = 0; + _loc4_ = 0; + while(_loc4_ < this._flixelDrawMarker) + { + _loc10_ += this._flixelDraw[_loc4_++]; + } + _loc11_ = 0; + _loc4_ = 0; + while(_loc4_ < this._visibleObjectMarker) + { + _loc11_ += this._visibleObject[_loc4_++]; + } + _loc11_ /= this._visibleObjectMarker; + _loc5_ += "D:" + _loc11_ + " " + uint(_loc10_ / this._flixelDrawMarker) + "ms"; + this._text.text = _loc5_; + this._flixelUpdateMarker = 0; + this._flixelDrawMarker = 0; + this._flashMarker = 0; + this._objectMarker = 0; + this._visibleObjectMarker = 0; + this._updateTimer -= _loc3_; + } + } + + public function flixelUpdate(param1:int) : void + { + this._flixelUpdate[this._flixelUpdateMarker++] = param1; + } + + public function flixelDraw(param1:int) : void + { + this._flixelDraw[this._flixelDrawMarker++] = param1; + } + + public function flash(param1:int) : void + { + this._flash[this._flashMarker++] = param1; + } + + public function activeObjects(param1:int) : void + { + this._activeObject[this._objectMarker++] = param1; + } + + public function visibleObjects(param1:int) : void + { + this._visibleObject[this._visibleObjectMarker++] = param1; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/VCR.as b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR.as new file mode 100644 index 0000000..42e8ad8 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR.as @@ -0,0 +1,490 @@ +package org.flixel.system.debug +{ + import flash.display.Bitmap; + import flash.display.Sprite; + import flash.events.Event; + import flash.events.IOErrorEvent; + import flash.events.MouseEvent; + import flash.net.FileFilter; + import flash.net.FileReference; + import flash.text.TextField; + import flash.text.TextFormat; + import flash.utils.ByteArray; + import org.flixel.FlxG; + import org.flixel.FlxU; + + public class VCR extends Sprite + { + + protected static const FILE_TYPES:Array = [new FileFilter("Flixel Game Recording","*.fgr")]; + + protected static const DEFAULT_FILE_NAME:String = "replay.fgr"; + + protected var ImgOpen:Class = VCR_ImgOpen; + + protected var ImgRecordOff:Class = VCR_ImgRecordOff; + + protected var ImgRecordOn:Class = VCR_ImgRecordOn; + + protected var ImgStop:Class = VCR_ImgStop; + + protected var ImgFlixel:Class = VCR_ImgFlixel; + + protected var ImgRestart:Class = VCR_ImgRestart; + + protected var ImgPause:Class = VCR_ImgPause; + + protected var ImgPlay:Class = VCR_ImgPlay; + + protected var ImgStep:Class = VCR_ImgStep; + + public var paused:Boolean; + + public var stepRequested:Boolean; + + protected var _open:Bitmap; + + protected var _recordOff:Bitmap; + + protected var _recordOn:Bitmap; + + protected var _stop:Bitmap; + + protected var _flixel:Bitmap; + + protected var _restart:Bitmap; + + protected var _pause:Bitmap; + + protected var _play:Bitmap; + + protected var _step:Bitmap; + + protected var _overOpen:Boolean; + + protected var _overRecord:Boolean; + + protected var _overRestart:Boolean; + + protected var _overPause:Boolean; + + protected var _overStep:Boolean; + + protected var _pressingOpen:Boolean; + + protected var _pressingRecord:Boolean; + + protected var _pressingRestart:Boolean; + + protected var _pressingPause:Boolean; + + protected var _pressingStep:Boolean; + + protected var _file:FileReference; + + protected var _runtimeDisplay:TextField; + + protected var _runtime:uint; + + public function VCR() + { + super(); + var _loc1_:uint = 7; + this._open = new this.ImgOpen(); + addChild(this._open); + this._recordOff = new this.ImgRecordOff(); + this._recordOff.x = this._open.x + this._open.width + _loc1_; + addChild(this._recordOff); + this._recordOn = new this.ImgRecordOn(); + this._recordOn.x = this._recordOff.x; + this._recordOn.visible = false; + addChild(this._recordOn); + this._stop = new this.ImgStop(); + this._stop.x = this._recordOff.x; + this._stop.visible = false; + addChild(this._stop); + this._flixel = new this.ImgFlixel(); + this._flixel.x = this._recordOff.x + this._recordOff.width + _loc1_; + addChild(this._flixel); + this._restart = new this.ImgRestart(); + this._restart.x = this._flixel.x + this._flixel.width + _loc1_; + addChild(this._restart); + this._pause = new this.ImgPause(); + this._pause.x = this._restart.x + this._restart.width + _loc1_; + addChild(this._pause); + this._play = new this.ImgPlay(); + this._play.x = this._pause.x; + this._play.visible = false; + addChild(this._play); + this._step = new this.ImgStep(); + this._step.x = this._pause.x + this._pause.width + _loc1_; + addChild(this._step); + this._runtimeDisplay = new TextField(); + this._runtimeDisplay.width = width; + this._runtimeDisplay.x = width; + this._runtimeDisplay.y = -2; + this._runtimeDisplay.multiline = false; + this._runtimeDisplay.wordWrap = false; + this._runtimeDisplay.selectable = false; + this._runtimeDisplay.defaultTextFormat = new TextFormat("Courier",12,16777215,null,null,null,null,null,"center"); + this._runtimeDisplay.visible = false; + addChild(this._runtimeDisplay); + this._runtime = 0; + this.stepRequested = false; + this._file = null; + this.unpress(); + this.checkOver(); + this.updateGUI(); + addEventListener(Event.ENTER_FRAME,this.init); + } + + public function destroy() : void + { + this._file = null; + removeChild(this._open); + this._open = null; + removeChild(this._recordOff); + this._recordOff = null; + removeChild(this._recordOn); + this._recordOn = null; + removeChild(this._stop); + this._stop = null; + removeChild(this._flixel); + this._flixel = null; + removeChild(this._restart); + this._restart = null; + removeChild(this._pause); + this._pause = null; + removeChild(this._play); + this._play = null; + removeChild(this._step); + this._step = null; + stage.removeEventListener(MouseEvent.MOUSE_MOVE,this.onMouseMove); + stage.removeEventListener(MouseEvent.MOUSE_DOWN,this.onMouseDown); + stage.removeEventListener(MouseEvent.MOUSE_UP,this.onMouseUp); + } + + public function recording() : void + { + this._stop.visible = false; + this._recordOff.visible = false; + this._recordOn.visible = true; + } + + public function stopped() : void + { + this._stop.visible = false; + this._recordOn.visible = false; + this._recordOff.visible = true; + } + + public function playing() : void + { + this._recordOff.visible = false; + this._recordOn.visible = false; + this._stop.visible = true; + } + + public function updateRuntime(param1:uint) : void + { + this._runtime += param1; + this._runtimeDisplay.text = FlxU.formatTime(this._runtime / 1000,true); + if(!this._runtimeDisplay.visible) + { + this._runtimeDisplay.visible = true; + } + } + + public function onOpen() : void + { + this._file = new FileReference(); + this._file.addEventListener(Event.SELECT,this.onOpenSelect); + this._file.addEventListener(Event.CANCEL,this.onOpenCancel); + this._file.browse(FILE_TYPES); + } + + protected function onOpenSelect(param1:Event = null) : void + { + this._file.removeEventListener(Event.SELECT,this.onOpenSelect); + this._file.removeEventListener(Event.CANCEL,this.onOpenCancel); + this._file.addEventListener(Event.COMPLETE,this.onOpenComplete); + this._file.addEventListener(IOErrorEvent.IO_ERROR,this.onOpenError); + this._file.load(); + } + + protected function onOpenComplete(param1:Event = null) : void + { + this._file.removeEventListener(Event.COMPLETE,this.onOpenComplete); + this._file.removeEventListener(IOErrorEvent.IO_ERROR,this.onOpenError); + var _loc2_:String = null; + var _loc3_:ByteArray = this._file.data; + if(_loc3_ != null) + { + _loc2_ = _loc3_.readUTFBytes(_loc3_.bytesAvailable); + } + this._file = null; + if(_loc2_ == null || _loc2_.length <= 0) + { + return FlxG.log("ERROR: Empty flixel gameplay record."); + } + FlxG.loadReplay(_loc2_); + } + + protected function onOpenCancel(param1:Event = null) : void + { + this._file.removeEventListener(Event.SELECT,this.onOpenSelect); + this._file.removeEventListener(Event.CANCEL,this.onOpenCancel); + this._file = null; + } + + protected function onOpenError(param1:Event = null) : void + { + this._file.removeEventListener(Event.COMPLETE,this.onOpenComplete); + this._file.removeEventListener(IOErrorEvent.IO_ERROR,this.onOpenError); + this._file = null; + FlxG.log("ERROR: Unable to open flixel gameplay record."); + } + + public function onRecord(param1:Boolean = false) : void + { + if(this._play.visible) + { + this.onPlay(); + } + FlxG.recordReplay(param1); + } + + public function stopRecording() : void + { + var _loc1_:String = FlxG.stopRecording(); + if(_loc1_ != null && _loc1_.length > 0) + { + this._file = new FileReference(); + this._file.addEventListener(Event.COMPLETE,this.onSaveComplete); + this._file.addEventListener(Event.CANCEL,this.onSaveCancel); + this._file.addEventListener(IOErrorEvent.IO_ERROR,this.onSaveError); + this._file.save(_loc1_,DEFAULT_FILE_NAME); + } + } + + protected function onSaveComplete(param1:Event = null) : void + { + this._file.removeEventListener(Event.COMPLETE,this.onSaveComplete); + this._file.removeEventListener(Event.CANCEL,this.onSaveCancel); + this._file.removeEventListener(IOErrorEvent.IO_ERROR,this.onSaveError); + this._file = null; + FlxG.log("FLIXEL: successfully saved flixel gameplay record."); + } + + protected function onSaveCancel(param1:Event = null) : void + { + this._file.removeEventListener(Event.COMPLETE,this.onSaveComplete); + this._file.removeEventListener(Event.CANCEL,this.onSaveCancel); + this._file.removeEventListener(IOErrorEvent.IO_ERROR,this.onSaveError); + this._file = null; + } + + protected function onSaveError(param1:Event = null) : void + { + this._file.removeEventListener(Event.COMPLETE,this.onSaveComplete); + this._file.removeEventListener(Event.CANCEL,this.onSaveCancel); + this._file.removeEventListener(IOErrorEvent.IO_ERROR,this.onSaveError); + this._file = null; + FlxG.log("ERROR: problem saving flixel gameplay record."); + } + + public function onStop() : void + { + FlxG.stopReplay(); + } + + public function onRestart(param1:Boolean = false) : void + { + if(FlxG.reloadReplay(param1)) + { + this._recordOff.visible = false; + this._recordOn.visible = false; + this._stop.visible = true; + } + } + + public function onPause() : void + { + this.paused = true; + this._pause.visible = false; + this._play.visible = true; + } + + public function onPlay() : void + { + this.paused = false; + this._play.visible = false; + this._pause.visible = true; + } + + public function onStep() : void + { + if(!this.paused) + { + this.onPause(); + } + this.stepRequested = true; + } + + protected function init(param1:Event = null) : void + { + if(root == null) + { + return; + } + removeEventListener(Event.ENTER_FRAME,this.init); + stage.addEventListener(MouseEvent.MOUSE_MOVE,this.onMouseMove); + stage.addEventListener(MouseEvent.MOUSE_DOWN,this.onMouseDown); + stage.addEventListener(MouseEvent.MOUSE_UP,this.onMouseUp); + } + + protected function onMouseMove(param1:MouseEvent = null) : void + { + if(!this.checkOver()) + { + this.unpress(); + } + this.updateGUI(); + } + + protected function onMouseDown(param1:MouseEvent = null) : void + { + this.unpress(); + if(this._overOpen) + { + this._pressingOpen = true; + } + if(this._overRecord) + { + this._pressingRecord = true; + } + if(this._overRestart) + { + this._pressingRestart = true; + } + if(this._overPause) + { + this._pressingPause = true; + } + if(this._overStep) + { + this._pressingStep = true; + } + } + + protected function onMouseUp(param1:MouseEvent = null) : void + { + if(this._overOpen && this._pressingOpen) + { + this.onOpen(); + } + else if(this._overRecord && this._pressingRecord) + { + if(this._stop.visible) + { + this.onStop(); + } + else if(this._recordOn.visible) + { + this.stopRecording(); + } + else + { + this.onRecord(!param1.altKey); + } + } + else if(this._overRestart && this._pressingRestart) + { + this.onRestart(!param1.altKey); + } + else if(this._overPause && this._pressingPause) + { + if(this._play.visible) + { + this.onPlay(); + } + else + { + this.onPause(); + } + } + else if(this._overStep && this._pressingStep) + { + this.onStep(); + } + this.unpress(); + this.checkOver(); + this.updateGUI(); + } + + protected function checkOver() : Boolean + { + return false; + } + + protected function unpress() : void + { + this._pressingOpen = false; + this._pressingRecord = false; + this._pressingRestart = false; + this._pressingPause = false; + this._pressingStep = false; + } + + protected function updateGUI() : void + { + if(this._recordOn.visible) + { + this._open.alpha = this._restart.alpha = this._pause.alpha = this._step.alpha = 0.35; + this._recordOn.alpha = 1; + return; + } + if(this._overOpen && this._open.alpha != 1) + { + this._open.alpha = 1; + } + else if(!this._overOpen && this._open.alpha != 0.8) + { + this._open.alpha = 0.8; + } + if(this._overRecord && this._recordOff.alpha != 1) + { + this._recordOff.alpha = this._recordOn.alpha = this._stop.alpha = 1; + } + else if(!this._overRecord && this._recordOff.alpha != 0.8) + { + this._recordOff.alpha = this._recordOn.alpha = this._stop.alpha = 0.8; + } + if(this._overRestart && this._restart.alpha != 1) + { + this._restart.alpha = 1; + } + else if(!this._overRestart && this._restart.alpha != 0.8) + { + this._restart.alpha = 0.8; + } + if(this._overPause && this._pause.alpha != 1) + { + this._pause.alpha = this._play.alpha = 1; + } + else if(!this._overPause && this._pause.alpha != 0.8) + { + this._pause.alpha = this._play.alpha = 0.8; + } + if(this._overStep && this._step.alpha != 1) + { + this._step.alpha = 1; + } + else if(!this._overStep && this._step.alpha != 0.8) + { + this._step.alpha = 0.8; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgFlixel.as b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgFlixel.as new file mode 100644 index 0000000..3a7fd3b --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgFlixel.as @@ -0,0 +1,15 @@ +package org.flixel.system.debug +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/108_org.flixel.system.debug.VCR_ImgFlixel.png")] + public class VCR_ImgFlixel extends BitmapAsset + { + + public function VCR_ImgFlixel() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgOpen.as b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgOpen.as new file mode 100644 index 0000000..8ce11b8 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgOpen.as @@ -0,0 +1,15 @@ +package org.flixel.system.debug +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/157_org.flixel.system.debug.VCR_ImgOpen.png")] + public class VCR_ImgOpen extends BitmapAsset + { + + public function VCR_ImgOpen() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgPause.as b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgPause.as new file mode 100644 index 0000000..0a5998a --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgPause.as @@ -0,0 +1,15 @@ +package org.flixel.system.debug +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/251_org.flixel.system.debug.VCR_ImgPause.png")] + public class VCR_ImgPause extends BitmapAsset + { + + public function VCR_ImgPause() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgPlay.as b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgPlay.as new file mode 100644 index 0000000..967674d --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgPlay.as @@ -0,0 +1,15 @@ +package org.flixel.system.debug +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/86_org.flixel.system.debug.VCR_ImgPlay.png")] + public class VCR_ImgPlay extends BitmapAsset + { + + public function VCR_ImgPlay() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgRecordOff.as b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgRecordOff.as new file mode 100644 index 0000000..44f6938 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgRecordOff.as @@ -0,0 +1,15 @@ +package org.flixel.system.debug +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/71_org.flixel.system.debug.VCR_ImgRecordOff.png")] + public class VCR_ImgRecordOff extends BitmapAsset + { + + public function VCR_ImgRecordOff() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgRecordOn.as b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgRecordOn.as new file mode 100644 index 0000000..becfd1e --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgRecordOn.as @@ -0,0 +1,15 @@ +package org.flixel.system.debug +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/286_org.flixel.system.debug.VCR_ImgRecordOn.png")] + public class VCR_ImgRecordOn extends BitmapAsset + { + + public function VCR_ImgRecordOn() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgRestart.as b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgRestart.as new file mode 100644 index 0000000..d6f10ea --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgRestart.as @@ -0,0 +1,15 @@ +package org.flixel.system.debug +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/301_org.flixel.system.debug.VCR_ImgRestart.png")] + public class VCR_ImgRestart extends BitmapAsset + { + + public function VCR_ImgRestart() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgStep.as b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgStep.as new file mode 100644 index 0000000..4ee59ce --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgStep.as @@ -0,0 +1,15 @@ +package org.flixel.system.debug +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/113_org.flixel.system.debug.VCR_ImgStep.png")] + public class VCR_ImgStep extends BitmapAsset + { + + public function VCR_ImgStep() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgStop.as b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgStop.as new file mode 100644 index 0000000..48f6f00 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/VCR_ImgStop.as @@ -0,0 +1,15 @@ +package org.flixel.system.debug +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/272_org.flixel.system.debug.VCR_ImgStop.png")] + public class VCR_ImgStop extends BitmapAsset + { + + public function VCR_ImgStop() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/Vis.as b/research/inner_decompiled/scripts/org/flixel/system/debug/Vis.as new file mode 100644 index 0000000..99460c7 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/Vis.as @@ -0,0 +1,129 @@ +package org.flixel.system.debug +{ + import flash.display.Bitmap; + import flash.display.Sprite; + import flash.events.Event; + import flash.events.MouseEvent; + import org.flixel.FlxG; + + public class Vis extends Sprite + { + + protected var ImgBounds:Class = Vis_ImgBounds; + + protected var _bounds:Bitmap; + + protected var _overBounds:Boolean; + + protected var _pressingBounds:Boolean; + + public function Vis() + { + super(); + var _loc1_:uint = 7; + this._bounds = new this.ImgBounds(); + addChild(this._bounds); + this.unpress(); + this.checkOver(); + this.updateGUI(); + addEventListener(Event.ENTER_FRAME,this.init); + } + + public function destroy() : void + { + removeChild(this._bounds); + this._bounds = null; + stage.removeEventListener(MouseEvent.MOUSE_MOVE,this.onMouseMove); + stage.removeEventListener(MouseEvent.MOUSE_DOWN,this.onMouseDown); + stage.removeEventListener(MouseEvent.MOUSE_UP,this.onMouseUp); + } + + public function onBounds() : void + { + } + + protected function init(param1:Event = null) : void + { + if(root == null) + { + return; + } + removeEventListener(Event.ENTER_FRAME,this.init); + stage.addEventListener(MouseEvent.MOUSE_MOVE,this.onMouseMove); + stage.addEventListener(MouseEvent.MOUSE_DOWN,this.onMouseDown); + stage.addEventListener(MouseEvent.MOUSE_UP,this.onMouseUp); + } + + protected function onMouseMove(param1:MouseEvent = null) : void + { + if(!this.checkOver()) + { + this.unpress(); + } + this.updateGUI(); + } + + protected function onMouseDown(param1:MouseEvent = null) : void + { + this.unpress(); + if(this._overBounds) + { + this._pressingBounds = true; + } + } + + protected function onMouseUp(param1:MouseEvent = null) : void + { + if(this._overBounds && this._pressingBounds) + { + this.onBounds(); + } + this.unpress(); + this.checkOver(); + this.updateGUI(); + } + + protected function checkOver() : Boolean + { + this._overBounds = false; + if(mouseX < 0 || mouseX > width || mouseY < 0 || mouseY > height) + { + return false; + } + if(mouseX > this._bounds.x || mouseX < this._bounds.x + this._bounds.width) + { + this._overBounds = true; + } + return true; + } + + protected function unpress() : void + { + this._pressingBounds = false; + } + + protected function updateGUI() : void + { + if(FlxG.visualDebug) + { + if(this._overBounds && this._bounds.alpha != 1) + { + this._bounds.alpha = 1; + } + else if(!this._overBounds && this._bounds.alpha != 0.9) + { + this._bounds.alpha = 0.9; + } + } + else if(this._overBounds && this._bounds.alpha != 0.6) + { + this._bounds.alpha = 0.6; + } + else if(!this._overBounds && this._bounds.alpha != 0.5) + { + this._bounds.alpha = 0.5; + } + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/Vis_ImgBounds.as b/research/inner_decompiled/scripts/org/flixel/system/debug/Vis_ImgBounds.as new file mode 100644 index 0000000..96c5996 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/Vis_ImgBounds.as @@ -0,0 +1,15 @@ +package org.flixel.system.debug +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/222_org.flixel.system.debug.Vis_ImgBounds.png")] + public class Vis_ImgBounds extends BitmapAsset + { + + public function Vis_ImgBounds() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/Watch.as b/research/inner_decompiled/scripts/org/flixel/system/debug/Watch.as new file mode 100644 index 0000000..b665ab9 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/Watch.as @@ -0,0 +1,162 @@ +package org.flixel.system.debug +{ + import flash.display.Sprite; + import flash.geom.Rectangle; + import org.flixel.system.FlxWindow; + + public class Watch extends FlxWindow + { + + protected static const MAX_LOG_LINES:uint = 1024; + + protected static const LINE_HEIGHT:uint = 15; + + public var editing:Boolean; + + protected var _names:Sprite; + + protected var _values:Sprite; + + protected var _watching:Array; + + public function Watch(param1:String, param2:Number, param3:Number, param4:Boolean = true, param5:Rectangle = null, param6:uint = 2139062143, param7:uint = 2130706432) + { + super(param1,param2,param3,param4,param5,param6,param7); + this._names = new Sprite(); + this._names.x = 2; + this._names.y = 15; + addChild(this._names); + this._values = new Sprite(); + this._values.x = 2; + this._values.y = 15; + addChild(this._values); + this._watching = new Array(); + this.editing = false; + this.removeAll(); + } + + override public function destroy() : void + { + removeChild(this._names); + this._names = null; + removeChild(this._values); + this._values = null; + var _loc1_:* = 0; + var _loc2_:uint = this._watching.length; + while(_loc1_ < _loc2_) + { + (this._watching[_loc1_++] as WatchEntry).destroy(); + } + this._watching = null; + super.destroy(); + } + + public function add(param1:Object, param2:String, param3:String = null) : void + { + var _loc4_:WatchEntry = null; + var _loc5_:* = 0; + var _loc6_:uint = this._watching.length; + while(_loc5_ < _loc6_) + { + _loc4_ = this._watching[_loc5_++] as WatchEntry; + if(_loc4_.object == param1 && _loc4_.field == param2) + { + return; + } + } + _loc4_ = new WatchEntry(this._watching.length * LINE_HEIGHT,_width / 2,_width / 2 - 10,param1,param2,param3); + this._names.addChild(_loc4_.nameDisplay); + this._values.addChild(_loc4_.valueDisplay); + this._watching.push(_loc4_); + } + + public function remove(param1:Object, param2:String = null) : void + { + var _loc3_:WatchEntry = null; + var _loc4_:* = int(this._watching.length - 1); + while(_loc4_ >= 0) + { + _loc3_ = this._watching[_loc4_]; + if(_loc3_.object == param1 && (param2 == null || _loc3_.field == param2)) + { + this._watching.splice(_loc4_,1); + this._names.removeChild(_loc3_.nameDisplay); + this._values.removeChild(_loc3_.valueDisplay); + _loc3_.destroy(); + } + _loc4_--; + } + _loc3_ = null; + _loc4_ = 0; + var _loc5_:uint = this._watching.length; + while(_loc4_ < _loc5_) + { + (this._watching[_loc4_] as WatchEntry).setY(_loc4_ * LINE_HEIGHT); + _loc4_++; + } + } + + public function removeAll() : void + { + var _loc1_:WatchEntry = null; + var _loc2_:int = 0; + var _loc3_:uint = this._watching.length; + while(_loc2_ < _loc3_) + { + _loc1_ = this._watching.pop(); + this._names.removeChild(_loc1_.nameDisplay); + this._values.removeChild(_loc1_.valueDisplay); + _loc1_.destroy(); + _loc2_++; + } + this._watching.length = 0; + } + + public function update() : void + { + this.editing = false; + var _loc1_:uint = 0; + var _loc2_:uint = this._watching.length; + while(_loc1_ < _loc2_) + { + if(!(this._watching[_loc1_++] as WatchEntry).updateValue()) + { + this.editing = true; + } + } + } + + public function submit() : void + { + var _loc3_:WatchEntry = null; + var _loc1_:uint = 0; + var _loc2_:uint = this._watching.length; + while(_loc1_ < _loc2_) + { + _loc3_ = this._watching[_loc1_++] as WatchEntry; + if(_loc3_.editing) + { + _loc3_.submit(); + } + } + this.editing = false; + } + + override protected function updateSize() : void + { + if(_height < this._watching.length * LINE_HEIGHT + 17) + { + _height = this._watching.length * LINE_HEIGHT + 17; + } + super.updateSize(); + this._values.x = _width / 2 + 2; + var _loc1_:* = 0; + var _loc2_:uint = this._watching.length; + while(_loc1_ < _loc2_) + { + (this._watching[_loc1_++] as WatchEntry).updateWidth(_width / 2,_width / 2 - 10); + } + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/debug/WatchEntry.as b/research/inner_decompiled/scripts/org/flixel/system/debug/WatchEntry.as new file mode 100644 index 0000000..93bb553 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/debug/WatchEntry.as @@ -0,0 +1,152 @@ +package org.flixel.system.debug +{ + import flash.events.KeyboardEvent; + import flash.events.MouseEvent; + import flash.text.TextField; + import flash.text.TextFieldType; + import flash.text.TextFormat; + import org.flixel.FlxU; + + public class WatchEntry + { + + public var object:Object; + + public var field:String; + + public var custom:String; + + public var nameDisplay:TextField; + + public var valueDisplay:TextField; + + public var editing:Boolean; + + public var oldValue:Object; + + protected var _whiteText:TextFormat; + + protected var _blackText:TextFormat; + + public function WatchEntry(param1:Number, param2:Number, param3:Number, param4:Object, param5:String, param6:String = null) + { + super(); + this.editing = false; + this.object = param4; + this.field = param5; + this.custom = param6; + this._whiteText = new TextFormat("Courier",12,16777215); + this._blackText = new TextFormat("Courier",12,0); + this.nameDisplay = new TextField(); + this.nameDisplay.y = param1; + this.nameDisplay.multiline = false; + this.nameDisplay.selectable = true; + this.nameDisplay.defaultTextFormat = this._whiteText; + this.valueDisplay = new TextField(); + this.valueDisplay.y = param1; + this.valueDisplay.height = 15; + this.valueDisplay.multiline = false; + this.valueDisplay.selectable = true; + this.valueDisplay.doubleClickEnabled = true; + this.valueDisplay.addEventListener(KeyboardEvent.KEY_UP,this.onKeyUp); + this.valueDisplay.addEventListener(MouseEvent.MOUSE_UP,this.onMouseUp); + this.valueDisplay.background = false; + this.valueDisplay.backgroundColor = 16777215; + this.valueDisplay.defaultTextFormat = this._whiteText; + this.updateWidth(param2,param3); + } + + public function destroy() : void + { + this.object = null; + this.oldValue = null; + this.nameDisplay = null; + this.field = null; + this.custom = null; + this.valueDisplay.removeEventListener(MouseEvent.MOUSE_UP,this.onMouseUp); + this.valueDisplay.removeEventListener(KeyboardEvent.KEY_UP,this.onKeyUp); + this.valueDisplay = null; + } + + public function setY(param1:Number) : void + { + this.nameDisplay.y = param1; + this.valueDisplay.y = param1; + } + + public function updateWidth(param1:Number, param2:Number) : void + { + this.nameDisplay.width = param1; + this.valueDisplay.width = param2; + if(this.custom != null) + { + this.nameDisplay.text = this.custom; + } + else + { + this.nameDisplay.text = ""; + if(param1 > 120) + { + this.nameDisplay.appendText(FlxU.getClassName(this.object,param1 < 240) + "."); + } + this.nameDisplay.appendText(this.field); + } + } + + public function updateValue() : Boolean + { + if(this.editing) + { + return false; + } + this.valueDisplay.text = this.object[this.field].toString(); + return true; + } + + public function onMouseUp(param1:MouseEvent) : void + { + this.editing = true; + this.oldValue = this.object[this.field]; + this.valueDisplay.type = TextFieldType.INPUT; + this.valueDisplay.setTextFormat(this._blackText); + this.valueDisplay.background = true; + } + + public function onKeyUp(param1:KeyboardEvent) : void + { + if(param1.keyCode == 13 || param1.keyCode == 9 || param1.keyCode == 27) + { + if(param1.keyCode == 27) + { + this.cancel(); + } + else + { + this.submit(); + } + } + } + + public function cancel() : void + { + this.valueDisplay.text = this.oldValue.toString(); + this.doneEditing(); + } + + public function submit() : void + { + this.object[this.field] = this.valueDisplay.text; + this.doneEditing(); + } + + protected function doneEditing() : void + { + this.valueDisplay.type = TextFieldType.DYNAMIC; + this.valueDisplay.setTextFormat(this._whiteText); + this.valueDisplay.defaultTextFormat = this._whiteText; + this.valueDisplay.background = false; + this.editing = false; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/input/Input.as b/research/inner_decompiled/scripts/org/flixel/system/input/Input.as new file mode 100644 index 0000000..e3ce99a --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/input/Input.as @@ -0,0 +1,155 @@ +package org.flixel.system.input +{ + public class Input + { + + internal var _lookup:Object; + + internal var _map:Array; + + internal const _total:uint = 256; + + public function Input() + { + super(); + this._lookup = new Object(); + this._map = new Array(this._total); + } + + public function update() : void + { + var _loc2_:Object = null; + var _loc1_:uint = 0; + while(_loc1_ < this._total) + { + _loc2_ = this._map[_loc1_++]; + if(_loc2_ != null) + { + if(_loc2_.last == -1 && _loc2_.current == -1) + { + _loc2_.current = 0; + } + else if(_loc2_.last == 2 && _loc2_.current == 2) + { + _loc2_.current = 1; + } + _loc2_.last = _loc2_.current; + } + } + } + + public function reset() : void + { + var _loc2_:Object = null; + var _loc1_:uint = 0; + while(_loc1_ < this._total) + { + _loc2_ = this._map[_loc1_++]; + if(_loc2_ != null) + { + this[_loc2_.name] = false; + _loc2_.current = 0; + _loc2_.last = 0; + } + } + } + + public function pressed(param1:String) : Boolean + { + return this[param1]; + } + + public function justPressed(param1:String) : Boolean + { + return this._map[this._lookup[param1]].current == 2; + } + + public function unJustPressed(param1:String) : void + { + this._map[this._lookup[param1]].current = 1; + } + + public function justReleased(param1:String) : Boolean + { + return this._map[this._lookup[param1]].current == -1; + } + + public function record() : Array + { + var _loc3_:Object = null; + var _loc1_:Array = null; + var _loc2_:uint = 0; + while(_loc2_ < this._total) + { + _loc3_ = this._map[_loc2_++]; + if(!(_loc3_ == null || _loc3_.current == 0)) + { + if(_loc1_ == null) + { + _loc1_ = new Array(); + } + _loc1_.push({ + "code":_loc2_ - 1, + "value":_loc3_.current + }); + } + } + return _loc1_; + } + + public function playback(param1:Array) : void + { + var _loc4_:Object = null; + var _loc5_:Object = null; + var _loc2_:uint = 0; + var _loc3_:uint = param1.length; + while(_loc2_ < _loc3_) + { + _loc4_ = param1[_loc2_++]; + _loc5_ = this._map[_loc4_.code]; + _loc5_.current = _loc4_.value; + if(_loc4_.value > 0) + { + this[_loc5_.name] = true; + } + } + } + + public function getKeyCode(param1:String) : int + { + return this._lookup[param1]; + } + + public function any() : Boolean + { + var _loc2_:Object = null; + var _loc1_:uint = 0; + while(_loc1_ < this._total) + { + _loc2_ = this._map[_loc1_++]; + if(_loc2_ != null && _loc2_.current > 0) + { + return true; + } + } + return false; + } + + protected function addKey(param1:String, param2:uint) : void + { + this._lookup[param1] = param2; + this._map[param2] = { + "name":param1, + "current":0, + "last":0 + }; + } + + public function destroy() : void + { + this._lookup = null; + this._map = null; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/input/Keyboard.as b/research/inner_decompiled/scripts/org/flixel/system/input/Keyboard.as new file mode 100644 index 0000000..2dcbf6c --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/input/Keyboard.as @@ -0,0 +1,298 @@ +package org.flixel.system.input +{ + import flash.events.KeyboardEvent; + + public class Keyboard extends Input + { + + public var ESCAPE:Boolean; + + public var F1:Boolean; + + public var F2:Boolean; + + public var F3:Boolean; + + public var F4:Boolean; + + public var F5:Boolean; + + public var F6:Boolean; + + public var F7:Boolean; + + public var F8:Boolean; + + public var F9:Boolean; + + public var F10:Boolean; + + public var F11:Boolean; + + public var F12:Boolean; + + public var ONE:Boolean; + + public var TWO:Boolean; + + public var THREE:Boolean; + + public var FOUR:Boolean; + + public var FIVE:Boolean; + + public var SIX:Boolean; + + public var SEVEN:Boolean; + + public var EIGHT:Boolean; + + public var NINE:Boolean; + + public var ZERO:Boolean; + + public var NUMPADONE:Boolean; + + public var NUMPADTWO:Boolean; + + public var NUMPADTHREE:Boolean; + + public var NUMPADFOUR:Boolean; + + public var NUMPADFIVE:Boolean; + + public var NUMPADSIX:Boolean; + + public var NUMPADSEVEN:Boolean; + + public var NUMPADEIGHT:Boolean; + + public var NUMPADNINE:Boolean; + + public var NUMPADZERO:Boolean; + + public var PAGEUP:Boolean; + + public var PAGEDOWN:Boolean; + + public var HOME:Boolean; + + public var END:Boolean; + + public var INSERT:Boolean; + + public var MINUS:Boolean; + + public var NUMPADMINUS:Boolean; + + public var PLUS:Boolean; + + public var NUMPADPLUS:Boolean; + + public var DELETE:Boolean; + + public var BACKSPACE:Boolean; + + public var TAB:Boolean; + + public var Q:Boolean; + + public var W:Boolean; + + public var E:Boolean; + + public var R:Boolean; + + public var T:Boolean; + + public var Y:Boolean; + + public var U:Boolean; + + public var I:Boolean; + + public var O:Boolean; + + public var P:Boolean; + + public var LBRACKET:Boolean; + + public var RBRACKET:Boolean; + + public var BACKSLASH:Boolean; + + public var CAPSLOCK:Boolean; + + public var A:Boolean; + + public var S:Boolean; + + public var D:Boolean; + + public var F:Boolean; + + public var G:Boolean; + + public var H:Boolean; + + public var J:Boolean; + + public var K:Boolean; + + public var L:Boolean; + + public var SEMICOLON:Boolean; + + public var QUOTE:Boolean; + + public var ENTER:Boolean; + + public var SHIFT:Boolean; + + public var Z:Boolean; + + public var X:Boolean; + + public var C:Boolean; + + public var V:Boolean; + + public var B:Boolean; + + public var N:Boolean; + + public var M:Boolean; + + public var COMMA:Boolean; + + public var PERIOD:Boolean; + + public var NUMPADPERIOD:Boolean; + + public var SLASH:Boolean; + + public var NUMPADSLASH:Boolean; + + public var CONTROL:Boolean; + + public var ALT:Boolean; + + public var SPACE:Boolean; + + public var UP:Boolean; + + public var DOWN:Boolean; + + public var LEFT:Boolean; + + public var RIGHT:Boolean; + + public function Keyboard() + { + var _loc1_:uint = 0; + super(); + _loc1_ = 65; + while(_loc1_ <= 90) + { + addKey(String.fromCharCode(_loc1_),_loc1_++); + } + _loc1_ = 48; + addKey("ZERO",_loc1_++); + addKey("ONE",_loc1_++); + addKey("TWO",_loc1_++); + addKey("THREE",_loc1_++); + addKey("FOUR",_loc1_++); + addKey("FIVE",_loc1_++); + addKey("SIX",_loc1_++); + addKey("SEVEN",_loc1_++); + addKey("EIGHT",_loc1_++); + addKey("NINE",_loc1_++); + _loc1_ = 96; + addKey("NUMPADZERO",_loc1_++); + addKey("NUMPADONE",_loc1_++); + addKey("NUMPADTWO",_loc1_++); + addKey("NUMPADTHREE",_loc1_++); + addKey("NUMPADFOUR",_loc1_++); + addKey("NUMPADFIVE",_loc1_++); + addKey("NUMPADSIX",_loc1_++); + addKey("NUMPADSEVEN",_loc1_++); + addKey("NUMPADEIGHT",_loc1_++); + addKey("NUMPADNINE",_loc1_++); + addKey("PAGEUP",33); + addKey("PAGEDOWN",34); + addKey("HOME",36); + addKey("END",35); + addKey("INSERT",45); + _loc1_ = 1; + while(_loc1_ <= 12) + { + addKey("F" + _loc1_,111 + _loc1_++); + } + addKey("ESCAPE",27); + addKey("MINUS",189); + addKey("NUMPADMINUS",109); + addKey("PLUS",187); + addKey("NUMPADPLUS",107); + addKey("DELETE",46); + addKey("BACKSPACE",8); + addKey("LBRACKET",219); + addKey("RBRACKET",221); + addKey("BACKSLASH",220); + addKey("CAPSLOCK",20); + addKey("SEMICOLON",186); + addKey("QUOTE",222); + addKey("ENTER",13); + addKey("SHIFT",16); + addKey("COMMA",188); + addKey("PERIOD",190); + addKey("NUMPADPERIOD",110); + addKey("SLASH",191); + addKey("NUMPADSLASH",191); + addKey("CONTROL",17); + addKey("ALT",18); + addKey("SPACE",32); + addKey("UP",38); + addKey("DOWN",40); + addKey("LEFT",37); + addKey("RIGHT",39); + addKey("TAB",9); + } + + public function handleKeyDown(param1:KeyboardEvent) : void + { + var _loc2_:Object = _map[param1.keyCode]; + if(_loc2_ == null) + { + return; + } + if(_loc2_.current > 0) + { + _loc2_.current = 1; + } + else + { + _loc2_.current = 2; + } + this[_loc2_.name] = true; + } + + public function handleKeyUp(param1:KeyboardEvent) : void + { + var _loc2_:Object = _map[param1.keyCode]; + if(_loc2_ == null) + { + return; + } + if(_loc2_.current > 0) + { + _loc2_.current = -1; + } + else + { + _loc2_.current = 0; + } + this[_loc2_.name] = false; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/input/Mouse.as b/research/inner_decompiled/scripts/org/flixel/system/input/Mouse.as new file mode 100644 index 0000000..ca52a4e --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/input/Mouse.as @@ -0,0 +1,243 @@ +package org.flixel.system.input +{ + import flash.display.Bitmap; + import flash.display.Sprite; + import flash.events.MouseEvent; + import org.flixel.FlxCamera; + import org.flixel.FlxG; + import org.flixel.FlxPoint; + import org.flixel.system.replay.MouseRecord; + + public class Mouse extends FlxPoint + { + + protected var ImgDefaultCursor:Class = Mouse_ImgDefaultCursor; + + public var wheel:int; + + public var screenX:int; + + public var screenY:int; + + protected var _current:int; + + protected var _last:int; + + protected var _cursorContainer:Sprite; + + protected var _cursor:Bitmap; + + protected var _lastX:int; + + protected var _lastY:int; + + protected var _lastWheel:int; + + protected var _point:FlxPoint; + + protected var _screenPosition:FlxPoint; + + public function Mouse(param1:Sprite) + { + super(); + this._cursorContainer = param1; + this._lastX = this.screenX = 0; + this._lastY = this.screenY = 0; + this._lastWheel = this.wheel = 0; + this._current = 0; + this._last = 0; + this._cursor = null; + this._point = new FlxPoint(); + this._screenPosition = new FlxPoint(); + } + + public function destroy() : void + { + this._cursorContainer = null; + this._cursor = null; + this._point = null; + this._screenPosition = null; + } + + public function show(param1:Class = null, param2:Number = 1, param3:int = 0, param4:int = 0) : void + { + this._cursorContainer.visible = true; + if(param1 != null) + { + this.load(param1,param2,param3,param4); + } + else if(this._cursor == null) + { + this.load(); + } + } + + public function hide() : void + { + this._cursorContainer.visible = false; + } + + public function get visible() : Boolean + { + return this._cursorContainer.visible; + } + + public function load(param1:Class = null, param2:Number = 1, param3:int = 0, param4:int = 0) : void + { + if(this._cursor != null) + { + this._cursorContainer.removeChild(this._cursor); + } + if(param1 == null) + { + param1 = this.ImgDefaultCursor; + } + this._cursor = new param1(); + this._cursor.x = param3; + this._cursor.y = param4; + this._cursor.scaleX = param2; + this._cursor.scaleY = param2; + this._cursorContainer.addChild(this._cursor); + } + + public function unload() : void + { + if(this._cursor != null) + { + if(this._cursorContainer.visible) + { + this.load(); + } + else + { + this._cursorContainer.removeChild(this._cursor); + this._cursor = null; + } + } + } + + public function update(param1:int, param2:int) : void + { + this._screenPosition.make(param1,param2); + this.getScreenPosition(null,this._point); + this.screenX = this._point.x; + this.screenY = this._point.y; + this.updateCursor(); + if(this._last == -1 && this._current == -1) + { + this._current = 0; + } + else if(this._last == 2 && this._current == 2) + { + this._current = 1; + } + this._last = this._current; + } + + protected function updateCursor() : void + { + this.getWorldPosition(null,this); + this._cursorContainer.x = this._screenPosition.x; + this._cursorContainer.y = this._screenPosition.y; + } + + public function getWorldPosition(param1:FlxCamera = null, param2:FlxPoint = null) : FlxPoint + { + if(param1 == null) + { + param1 = FlxG.camera; + } + if(param2 == null) + { + param2 = new FlxPoint(); + } + this.getScreenPosition(param1,this._point); + return param2.make(this._point.x + param1.scroll.x,this._point.y + param1.scroll.y); + } + + public function getScreenPosition(param1:FlxCamera = null, param2:FlxPoint = null) : FlxPoint + { + if(param1 == null) + { + param1 = FlxG.camera; + } + if(param2 == null) + { + param2 = new FlxPoint(); + } + return param2.make(this._screenPosition.x / param1.zoom,this._screenPosition.y / param1.zoom); + } + + public function reset() : void + { + this._current = 0; + this._last = 0; + } + + public function pressed() : Boolean + { + return this._current > 0; + } + + public function justPressed() : Boolean + { + return this._current == 2; + } + + public function justReleased() : Boolean + { + return this._current == -1; + } + + public function handleMouseDown(param1:MouseEvent) : void + { + if(this._current > 0) + { + this._current = 1; + } + else + { + this._current = 2; + } + } + + public function handleMouseUp(param1:MouseEvent) : void + { + if(this._current > 0) + { + this._current = -1; + } + else + { + this._current = 0; + } + } + + public function handleMouseWheel(param1:MouseEvent) : void + { + this.wheel = param1.delta; + } + + public function record() : MouseRecord + { + if(this._lastX == this.screenX && this._lastY == this.screenY && this._current == 0 && this._lastWheel == this.wheel) + { + return null; + } + this._lastX = this.screenX; + this._lastY = this.screenY; + this._lastWheel = this.wheel; + return new MouseRecord(this.screenX,this.screenY,this._current,this.wheel); + } + + public function playback(param1:MouseRecord) : void + { + this.screenX = param1.x; + this.screenY = param1.y; + this._current = param1.button; + this.wheel = param1.wheel; + this.updateCursor(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/input/Mouse_ImgDefaultCursor.as b/research/inner_decompiled/scripts/org/flixel/system/input/Mouse_ImgDefaultCursor.as new file mode 100644 index 0000000..6302ff7 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/input/Mouse_ImgDefaultCursor.as @@ -0,0 +1,15 @@ +package org.flixel.system.input +{ + import mx.core.BitmapAsset; + + [Embed(source="/_assets/181_org.flixel.system.input.Mouse_ImgDefaultCursor.png")] + public class Mouse_ImgDefaultCursor extends BitmapAsset + { + + public function Mouse_ImgDefaultCursor() + { + super(); + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/replay/FrameRecord.as b/research/inner_decompiled/scripts/org/flixel/system/replay/FrameRecord.as new file mode 100644 index 0000000..0474b4c --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/replay/FrameRecord.as @@ -0,0 +1,105 @@ +package org.flixel.system.replay +{ + public class FrameRecord + { + + public var frame:int; + + public var keys:Array; + + public var mouse:MouseRecord; + + public function FrameRecord() + { + super(); + this.frame = 0; + this.keys = null; + this.mouse = null; + } + + public function create(param1:Number, param2:Array = null, param3:MouseRecord = null) : FrameRecord + { + this.frame = param1; + this.keys = param2; + this.mouse = param3; + return this; + } + + public function destroy() : void + { + this.keys = null; + this.mouse = null; + } + + public function save() : String + { + var _loc2_:Object = null; + var _loc3_:uint = 0; + var _loc4_:uint = 0; + var _loc1_:String = this.frame + "k"; + if(this.keys != null) + { + _loc3_ = 0; + _loc4_ = this.keys.length; + while(_loc3_ < _loc4_) + { + if(_loc3_ > 0) + { + _loc1_ += ","; + } + _loc2_ = this.keys[_loc3_++]; + _loc1_ += _loc2_.code + ":" + _loc2_.value; + } + } + _loc1_ += "m"; + if(this.mouse != null) + { + _loc1_ += this.mouse.x + "," + this.mouse.y + "," + this.mouse.button + "," + this.mouse.wheel; + } + return _loc1_; + } + + public function load(param1:String) : FrameRecord + { + var _loc2_:uint = 0; + var _loc3_:uint = 0; + var _loc7_:Array = null; + var _loc4_:Array = param1.split("k"); + this.frame = int(_loc4_[0] as String); + _loc4_ = (_loc4_[1] as String).split("m"); + var _loc5_:String = _loc4_[0]; + var _loc6_:String = _loc4_[1]; + if(_loc5_.length > 0) + { + _loc4_ = _loc5_.split(","); + _loc2_ = 0; + _loc3_ = _loc4_.length; + while(_loc2_ < _loc3_) + { + _loc7_ = (_loc4_[_loc2_++] as String).split(":"); + if(_loc7_.length == 2) + { + if(this.keys == null) + { + this.keys = new Array(); + } + this.keys.push({ + "code":int(_loc7_[0] as String), + "value":int(_loc7_[1] as String) + }); + } + } + } + if(_loc6_.length > 0) + { + _loc4_ = _loc6_.split(","); + if(_loc4_.length >= 4) + { + this.mouse = new MouseRecord(int(_loc4_[0] as String),int(_loc4_[1] as String),int(_loc4_[2] as String),int(_loc4_[3] as String)); + } + } + return this; + } + } +} + diff --git a/research/inner_decompiled/scripts/org/flixel/system/replay/MouseRecord.as b/research/inner_decompiled/scripts/org/flixel/system/replay/MouseRecord.as new file mode 100644 index 0000000..b4e7203 --- /dev/null +++ b/research/inner_decompiled/scripts/org/flixel/system/replay/MouseRecord.as @@ -0,0 +1,24 @@ +package org.flixel.system.replay +{ + public class MouseRecord + { + + public var x:int; + + public var y:int; + + public var button:int; + + public var wheel:int; + + public function MouseRecord(param1:int, param2:int, param3:int, param4:int) + { + super(); + this.x = param1; + this.y = param2; + this.button = param3; + this.wheel = param4; + } + } +} + diff --git a/research/inner_decompiled/sounds/10_com.arc.dh.util.Sound_PLAYER_DIE_com.arc.dh.util.Sound_PLAYER_DIE.mp3 b/research/inner_decompiled/sounds/10_com.arc.dh.util.Sound_PLAYER_DIE_com.arc.dh.util.Sound_PLAYER_DIE.mp3 new file mode 100644 index 0000000..5202d8b Binary files /dev/null and b/research/inner_decompiled/sounds/10_com.arc.dh.util.Sound_PLAYER_DIE_com.arc.dh.util.Sound_PLAYER_DIE.mp3 differ diff --git a/research/inner_decompiled/sounds/11_com.arc.dh.util.Sound_EQUIPMENT_com.arc.dh.util.Sound_EQUIPMENT.mp3 b/research/inner_decompiled/sounds/11_com.arc.dh.util.Sound_EQUIPMENT_com.arc.dh.util.Sound_EQUIPMENT.mp3 new file mode 100644 index 0000000..4873c56 Binary files /dev/null and b/research/inner_decompiled/sounds/11_com.arc.dh.util.Sound_EQUIPMENT_com.arc.dh.util.Sound_EQUIPMENT.mp3 differ diff --git a/research/inner_decompiled/sounds/12_com.arc.dh.util.Sound_CHECKPOINT_com.arc.dh.util.Sound_CHECKPOINT.mp3 b/research/inner_decompiled/sounds/12_com.arc.dh.util.Sound_CHECKPOINT_com.arc.dh.util.Sound_CHECKPOINT.mp3 new file mode 100644 index 0000000..408cc27 Binary files /dev/null and b/research/inner_decompiled/sounds/12_com.arc.dh.util.Sound_CHECKPOINT_com.arc.dh.util.Sound_CHECKPOINT.mp3 differ diff --git a/research/inner_decompiled/sounds/13_com.arc.dh.util.Sound_DIAMOND2_com.arc.dh.util.Sound_DIAMOND2.mp3 b/research/inner_decompiled/sounds/13_com.arc.dh.util.Sound_DIAMOND2_com.arc.dh.util.Sound_DIAMOND2.mp3 new file mode 100644 index 0000000..d3bc18c Binary files /dev/null and b/research/inner_decompiled/sounds/13_com.arc.dh.util.Sound_DIAMOND2_com.arc.dh.util.Sound_DIAMOND2.mp3 differ diff --git a/research/inner_decompiled/sounds/14_com.arc.dh.util.Sound_DIAMOND1_com.arc.dh.util.Sound_DIAMOND1.mp3 b/research/inner_decompiled/sounds/14_com.arc.dh.util.Sound_DIAMOND1_com.arc.dh.util.Sound_DIAMOND1.mp3 new file mode 100644 index 0000000..1ff8b0a Binary files /dev/null and b/research/inner_decompiled/sounds/14_com.arc.dh.util.Sound_DIAMOND1_com.arc.dh.util.Sound_DIAMOND1.mp3 differ diff --git a/research/inner_decompiled/sounds/15_com.arc.dh.util.Sound_DIAMOND4_com.arc.dh.util.Sound_DIAMOND4.mp3 b/research/inner_decompiled/sounds/15_com.arc.dh.util.Sound_DIAMOND4_com.arc.dh.util.Sound_DIAMOND4.mp3 new file mode 100644 index 0000000..bcab5f9 Binary files /dev/null and b/research/inner_decompiled/sounds/15_com.arc.dh.util.Sound_DIAMOND4_com.arc.dh.util.Sound_DIAMOND4.mp3 differ diff --git a/research/inner_decompiled/sounds/16_com.arc.dh.util.Sound_WIN_com.arc.dh.util.Sound_WIN.mp3 b/research/inner_decompiled/sounds/16_com.arc.dh.util.Sound_WIN_com.arc.dh.util.Sound_WIN.mp3 new file mode 100644 index 0000000..09cf67b Binary files /dev/null and b/research/inner_decompiled/sounds/16_com.arc.dh.util.Sound_WIN_com.arc.dh.util.Sound_WIN.mp3 differ diff --git a/research/inner_decompiled/sounds/17_com.arc.dh.util.Sound_DIAMOND3_com.arc.dh.util.Sound_DIAMOND3.mp3 b/research/inner_decompiled/sounds/17_com.arc.dh.util.Sound_DIAMOND3_com.arc.dh.util.Sound_DIAMOND3.mp3 new file mode 100644 index 0000000..1587dfb Binary files /dev/null and b/research/inner_decompiled/sounds/17_com.arc.dh.util.Sound_DIAMOND3_com.arc.dh.util.Sound_DIAMOND3.mp3 differ diff --git a/research/inner_decompiled/sounds/18_com.arc.dh.util.Sound_EXPLODE1_com.arc.dh.util.Sound_EXPLODE1.mp3 b/research/inner_decompiled/sounds/18_com.arc.dh.util.Sound_EXPLODE1_com.arc.dh.util.Sound_EXPLODE1.mp3 new file mode 100644 index 0000000..f4ab175 Binary files /dev/null and b/research/inner_decompiled/sounds/18_com.arc.dh.util.Sound_EXPLODE1_com.arc.dh.util.Sound_EXPLODE1.mp3 differ diff --git a/research/inner_decompiled/sounds/19_com.arc.dh.util.Sound_EXPLODE4_com.arc.dh.util.Sound_EXPLODE4.mp3 b/research/inner_decompiled/sounds/19_com.arc.dh.util.Sound_EXPLODE4_com.arc.dh.util.Sound_EXPLODE4.mp3 new file mode 100644 index 0000000..154ad27 Binary files /dev/null and b/research/inner_decompiled/sounds/19_com.arc.dh.util.Sound_EXPLODE4_com.arc.dh.util.Sound_EXPLODE4.mp3 differ diff --git a/research/inner_decompiled/sounds/1_org.flixel.FlxGame_SndBeep_org.flixel.FlxGame_SndBeep.mp3 b/research/inner_decompiled/sounds/1_org.flixel.FlxGame_SndBeep_org.flixel.FlxGame_SndBeep.mp3 new file mode 100644 index 0000000..48da18d Binary files /dev/null and b/research/inner_decompiled/sounds/1_org.flixel.FlxGame_SndBeep_org.flixel.FlxGame_SndBeep.mp3 differ diff --git a/research/inner_decompiled/sounds/20_com.arc.dh.util.Sound_JUMP1_com.arc.dh.util.Sound_JUMP1.mp3 b/research/inner_decompiled/sounds/20_com.arc.dh.util.Sound_JUMP1_com.arc.dh.util.Sound_JUMP1.mp3 new file mode 100644 index 0000000..93b2133 Binary files /dev/null and b/research/inner_decompiled/sounds/20_com.arc.dh.util.Sound_JUMP1_com.arc.dh.util.Sound_JUMP1.mp3 differ diff --git a/research/inner_decompiled/sounds/21_com.arc.dh.util.Sound_EXPLODE5_com.arc.dh.util.Sound_EXPLODE5.mp3 b/research/inner_decompiled/sounds/21_com.arc.dh.util.Sound_EXPLODE5_com.arc.dh.util.Sound_EXPLODE5.mp3 new file mode 100644 index 0000000..43dc891 Binary files /dev/null and b/research/inner_decompiled/sounds/21_com.arc.dh.util.Sound_EXPLODE5_com.arc.dh.util.Sound_EXPLODE5.mp3 differ diff --git a/research/inner_decompiled/sounds/22_com.arc.dh.util.Sound_JUMP2_com.arc.dh.util.Sound_JUMP2.mp3 b/research/inner_decompiled/sounds/22_com.arc.dh.util.Sound_JUMP2_com.arc.dh.util.Sound_JUMP2.mp3 new file mode 100644 index 0000000..4cc5095 Binary files /dev/null and b/research/inner_decompiled/sounds/22_com.arc.dh.util.Sound_JUMP2_com.arc.dh.util.Sound_JUMP2.mp3 differ diff --git a/research/inner_decompiled/sounds/23_com.arc.dh.util.Sound_EXPLODE2_com.arc.dh.util.Sound_EXPLODE2.mp3 b/research/inner_decompiled/sounds/23_com.arc.dh.util.Sound_EXPLODE2_com.arc.dh.util.Sound_EXPLODE2.mp3 new file mode 100644 index 0000000..e812278 Binary files /dev/null and b/research/inner_decompiled/sounds/23_com.arc.dh.util.Sound_EXPLODE2_com.arc.dh.util.Sound_EXPLODE2.mp3 differ diff --git a/research/inner_decompiled/sounds/24_com.arc.dh.util.Sound_JUMP3_com.arc.dh.util.Sound_JUMP3.mp3 b/research/inner_decompiled/sounds/24_com.arc.dh.util.Sound_JUMP3_com.arc.dh.util.Sound_JUMP3.mp3 new file mode 100644 index 0000000..3d9a051 Binary files /dev/null and b/research/inner_decompiled/sounds/24_com.arc.dh.util.Sound_JUMP3_com.arc.dh.util.Sound_JUMP3.mp3 differ diff --git a/research/inner_decompiled/sounds/25_com.arc.dh.util.Sound_EXPLODE3_com.arc.dh.util.Sound_EXPLODE3.mp3 b/research/inner_decompiled/sounds/25_com.arc.dh.util.Sound_EXPLODE3_com.arc.dh.util.Sound_EXPLODE3.mp3 new file mode 100644 index 0000000..84fb721 Binary files /dev/null and b/research/inner_decompiled/sounds/25_com.arc.dh.util.Sound_EXPLODE3_com.arc.dh.util.Sound_EXPLODE3.mp3 differ diff --git a/research/inner_decompiled/sounds/26_com.arc.dh.util.Sound_DIAMOND5_com.arc.dh.util.Sound_DIAMOND5.mp3 b/research/inner_decompiled/sounds/26_com.arc.dh.util.Sound_DIAMOND5_com.arc.dh.util.Sound_DIAMOND5.mp3 new file mode 100644 index 0000000..cab8990 Binary files /dev/null and b/research/inner_decompiled/sounds/26_com.arc.dh.util.Sound_DIAMOND5_com.arc.dh.util.Sound_DIAMOND5.mp3 differ diff --git a/research/inner_decompiled/sounds/27_com.arc.dh.util.Sound_JUMP0_com.arc.dh.util.Sound_JUMP0.mp3 b/research/inner_decompiled/sounds/27_com.arc.dh.util.Sound_JUMP0_com.arc.dh.util.Sound_JUMP0.mp3 new file mode 100644 index 0000000..40e4a81 Binary files /dev/null and b/research/inner_decompiled/sounds/27_com.arc.dh.util.Sound_JUMP0_com.arc.dh.util.Sound_JUMP0.mp3 differ diff --git a/research/inner_decompiled/sounds/28_com.arc.dh.util.Sound_HEART_com.arc.dh.util.Sound_HEART.mp3 b/research/inner_decompiled/sounds/28_com.arc.dh.util.Sound_HEART_com.arc.dh.util.Sound_HEART.mp3 new file mode 100644 index 0000000..1ac8383 Binary files /dev/null and b/research/inner_decompiled/sounds/28_com.arc.dh.util.Sound_HEART_com.arc.dh.util.Sound_HEART.mp3 differ diff --git a/research/inner_decompiled/sounds/29_com.arc.dh.util.Sound_STEELBOX_com.arc.dh.util.Sound_STEELBOX.mp3 b/research/inner_decompiled/sounds/29_com.arc.dh.util.Sound_STEELBOX_com.arc.dh.util.Sound_STEELBOX.mp3 new file mode 100644 index 0000000..9469c13 Binary files /dev/null and b/research/inner_decompiled/sounds/29_com.arc.dh.util.Sound_STEELBOX_com.arc.dh.util.Sound_STEELBOX.mp3 differ diff --git a/research/inner_decompiled/sounds/30_com.arc.dh.util.Sound_PLINK_com.arc.dh.util.Sound_PLINK.mp3 b/research/inner_decompiled/sounds/30_com.arc.dh.util.Sound_PLINK_com.arc.dh.util.Sound_PLINK.mp3 new file mode 100644 index 0000000..1a3c24a Binary files /dev/null and b/research/inner_decompiled/sounds/30_com.arc.dh.util.Sound_PLINK_com.arc.dh.util.Sound_PLINK.mp3 differ diff --git a/research/inner_decompiled/sounds/31_com.arc.dh.util.Sound_RED_DIAMOND_com.arc.dh.util.Sound_RED_DIAMOND.mp3 b/research/inner_decompiled/sounds/31_com.arc.dh.util.Sound_RED_DIAMOND_com.arc.dh.util.Sound_RED_DIAMOND.mp3 new file mode 100644 index 0000000..999ec51 Binary files /dev/null and b/research/inner_decompiled/sounds/31_com.arc.dh.util.Sound_RED_DIAMOND_com.arc.dh.util.Sound_RED_DIAMOND.mp3 differ diff --git a/research/inner_decompiled/sounds/32_com.arc.dh.util.Sound_ACHIEVEMENT_com.arc.dh.util.Sound_ACHIEVEMENT.mp3 b/research/inner_decompiled/sounds/32_com.arc.dh.util.Sound_ACHIEVEMENT_com.arc.dh.util.Sound_ACHIEVEMENT.mp3 new file mode 100644 index 0000000..7e1ce73 Binary files /dev/null and b/research/inner_decompiled/sounds/32_com.arc.dh.util.Sound_ACHIEVEMENT_com.arc.dh.util.Sound_ACHIEVEMENT.mp3 differ diff --git a/research/inner_decompiled/sounds/33_com.arc.dh.util.Sound_MENU_CLICK_com.arc.dh.util.Sound_MENU_CLICK.mp3 b/research/inner_decompiled/sounds/33_com.arc.dh.util.Sound_MENU_CLICK_com.arc.dh.util.Sound_MENU_CLICK.mp3 new file mode 100644 index 0000000..3ebf8a0 Binary files /dev/null and b/research/inner_decompiled/sounds/33_com.arc.dh.util.Sound_MENU_CLICK_com.arc.dh.util.Sound_MENU_CLICK.mp3 differ diff --git a/research/inner_decompiled/sounds/34_com.arc.dh.util.Sound_POT_com.arc.dh.util.Sound_POT.mp3 b/research/inner_decompiled/sounds/34_com.arc.dh.util.Sound_POT_com.arc.dh.util.Sound_POT.mp3 new file mode 100644 index 0000000..8fbabd6 Binary files /dev/null and b/research/inner_decompiled/sounds/34_com.arc.dh.util.Sound_POT_com.arc.dh.util.Sound_POT.mp3 differ diff --git a/research/inner_decompiled/sounds/35_com.arc.dh.util.Sound_HURT_com.arc.dh.util.Sound_HURT.mp3 b/research/inner_decompiled/sounds/35_com.arc.dh.util.Sound_HURT_com.arc.dh.util.Sound_HURT.mp3 new file mode 100644 index 0000000..f9d1673 Binary files /dev/null and b/research/inner_decompiled/sounds/35_com.arc.dh.util.Sound_HURT_com.arc.dh.util.Sound_HURT.mp3 differ diff --git a/research/inner_decompiled/sounds/36_com.arc.dh.util.Sound_MENU_SELECT_com.arc.dh.util.Sound_MENU_SELECT.mp3 b/research/inner_decompiled/sounds/36_com.arc.dh.util.Sound_MENU_SELECT_com.arc.dh.util.Sound_MENU_SELECT.mp3 new file mode 100644 index 0000000..ebc6f2d Binary files /dev/null and b/research/inner_decompiled/sounds/36_com.arc.dh.util.Sound_MENU_SELECT_com.arc.dh.util.Sound_MENU_SELECT.mp3 differ diff --git a/research/inner_decompiled/sounds/37_com.arc.dh.util.Sound_HEART_CRYSTAL_com.arc.dh.util.Sound_HEART_CRYSTAL.mp3 b/research/inner_decompiled/sounds/37_com.arc.dh.util.Sound_HEART_CRYSTAL_com.arc.dh.util.Sound_HEART_CRYSTAL.mp3 new file mode 100644 index 0000000..ac49113 Binary files /dev/null and b/research/inner_decompiled/sounds/37_com.arc.dh.util.Sound_HEART_CRYSTAL_com.arc.dh.util.Sound_HEART_CRYSTAL.mp3 differ diff --git a/research/inner_decompiled/sounds/38_com.arc.dh.util.Sound_BUY_com.arc.dh.util.Sound_BUY.mp3 b/research/inner_decompiled/sounds/38_com.arc.dh.util.Sound_BUY_com.arc.dh.util.Sound_BUY.mp3 new file mode 100644 index 0000000..4d245aa Binary files /dev/null and b/research/inner_decompiled/sounds/38_com.arc.dh.util.Sound_BUY_com.arc.dh.util.Sound_BUY.mp3 differ diff --git a/research/inner_decompiled/sounds/39_com.arc.dh.util.Sound_TITLE_MUSIC_com.arc.dh.util.Sound_TITLE_MUSIC.mp3 b/research/inner_decompiled/sounds/39_com.arc.dh.util.Sound_TITLE_MUSIC_com.arc.dh.util.Sound_TITLE_MUSIC.mp3 new file mode 100644 index 0000000..9b15e11 Binary files /dev/null and b/research/inner_decompiled/sounds/39_com.arc.dh.util.Sound_TITLE_MUSIC_com.arc.dh.util.Sound_TITLE_MUSIC.mp3 differ diff --git a/research/inner_decompiled/sounds/3_com.arc.dh.util.Sound_POWERUP_com.arc.dh.util.Sound_POWERUP.mp3 b/research/inner_decompiled/sounds/3_com.arc.dh.util.Sound_POWERUP_com.arc.dh.util.Sound_POWERUP.mp3 new file mode 100644 index 0000000..dd9d346 Binary files /dev/null and b/research/inner_decompiled/sounds/3_com.arc.dh.util.Sound_POWERUP_com.arc.dh.util.Sound_POWERUP.mp3 differ diff --git a/research/inner_decompiled/sounds/40_com.arc.dh.util.Sound_TEXT_com.arc.dh.util.Sound_TEXT.mp3 b/research/inner_decompiled/sounds/40_com.arc.dh.util.Sound_TEXT_com.arc.dh.util.Sound_TEXT.mp3 new file mode 100644 index 0000000..b7ce71b Binary files /dev/null and b/research/inner_decompiled/sounds/40_com.arc.dh.util.Sound_TEXT_com.arc.dh.util.Sound_TEXT.mp3 differ diff --git a/research/inner_decompiled/sounds/4_com.arc.dh.util.Sound_PLAY_MUSIC2_com.arc.dh.util.Sound_PLAY_MUSIC2.mp3 b/research/inner_decompiled/sounds/4_com.arc.dh.util.Sound_PLAY_MUSIC2_com.arc.dh.util.Sound_PLAY_MUSIC2.mp3 new file mode 100644 index 0000000..8a8690e Binary files /dev/null and b/research/inner_decompiled/sounds/4_com.arc.dh.util.Sound_PLAY_MUSIC2_com.arc.dh.util.Sound_PLAY_MUSIC2.mp3 differ diff --git a/research/inner_decompiled/sounds/5_com.arc.dh.util.Sound_ENEMY_DIE_com.arc.dh.util.Sound_ENEMY_DIE.mp3 b/research/inner_decompiled/sounds/5_com.arc.dh.util.Sound_ENEMY_DIE_com.arc.dh.util.Sound_ENEMY_DIE.mp3 new file mode 100644 index 0000000..0616396 Binary files /dev/null and b/research/inner_decompiled/sounds/5_com.arc.dh.util.Sound_ENEMY_DIE_com.arc.dh.util.Sound_ENEMY_DIE.mp3 differ diff --git a/research/inner_decompiled/sounds/6_com.arc.dh.util.Sound_SHOOT_SMALL_com.arc.dh.util.Sound_SHOOT_SMALL.mp3 b/research/inner_decompiled/sounds/6_com.arc.dh.util.Sound_SHOOT_SMALL_com.arc.dh.util.Sound_SHOOT_SMALL.mp3 new file mode 100644 index 0000000..0466c99 Binary files /dev/null and b/research/inner_decompiled/sounds/6_com.arc.dh.util.Sound_SHOOT_SMALL_com.arc.dh.util.Sound_SHOOT_SMALL.mp3 differ diff --git a/research/inner_decompiled/sounds/7_com.arc.dh.util.Sound_BOSS_MUSIC_com.arc.dh.util.Sound_BOSS_MUSIC.mp3 b/research/inner_decompiled/sounds/7_com.arc.dh.util.Sound_BOSS_MUSIC_com.arc.dh.util.Sound_BOSS_MUSIC.mp3 new file mode 100644 index 0000000..79a5d8f Binary files /dev/null and b/research/inner_decompiled/sounds/7_com.arc.dh.util.Sound_BOSS_MUSIC_com.arc.dh.util.Sound_BOSS_MUSIC.mp3 differ diff --git a/research/inner_decompiled/sounds/8_com.arc.dh.util.Sound_BOX_com.arc.dh.util.Sound_BOX.mp3 b/research/inner_decompiled/sounds/8_com.arc.dh.util.Sound_BOX_com.arc.dh.util.Sound_BOX.mp3 new file mode 100644 index 0000000..8bdda51 Binary files /dev/null and b/research/inner_decompiled/sounds/8_com.arc.dh.util.Sound_BOX_com.arc.dh.util.Sound_BOX.mp3 differ diff --git a/research/inner_decompiled/sounds/9_com.arc.dh.util.Sound_PLAY_MUSIC_com.arc.dh.util.Sound_PLAY_MUSIC.mp3 b/research/inner_decompiled/sounds/9_com.arc.dh.util.Sound_PLAY_MUSIC_com.arc.dh.util.Sound_PLAY_MUSIC.mp3 new file mode 100644 index 0000000..a5d1fcf Binary files /dev/null and b/research/inner_decompiled/sounds/9_com.arc.dh.util.Sound_PLAY_MUSIC_com.arc.dh.util.Sound_PLAY_MUSIC.mp3 differ diff --git a/research/inner_decompiled/symbolClass/symbols.csv b/research/inner_decompiled/symbolClass/symbols.csv new file mode 100644 index 0000000..ce07c0c --- /dev/null +++ b/research/inner_decompiled/symbolClass/symbols.csv @@ -0,0 +1,373 @@ +1;"org.flixel.FlxGame_SndBeep" +2;"com.newgrounds.assets.DefaultMedalIcon" +3;"com.arc.dh.util.Sound_POWERUP" +4;"com.arc.dh.util.Sound_PLAY_MUSIC2" +5;"com.arc.dh.util.Sound_ENEMY_DIE" +6;"com.arc.dh.util.Sound_SHOOT_SMALL" +7;"com.arc.dh.util.Sound_BOSS_MUSIC" +8;"com.arc.dh.util.Sound_BOX" +9;"com.arc.dh.util.Sound_PLAY_MUSIC" +10;"com.arc.dh.util.Sound_PLAYER_DIE" +11;"com.arc.dh.util.Sound_EQUIPMENT" +12;"com.arc.dh.util.Sound_CHECKPOINT" +13;"com.arc.dh.util.Sound_DIAMOND2" +14;"com.arc.dh.util.Sound_DIAMOND1" +15;"com.arc.dh.util.Sound_DIAMOND4" +16;"com.arc.dh.util.Sound_WIN" +17;"com.arc.dh.util.Sound_DIAMOND3" +18;"com.arc.dh.util.Sound_EXPLODE1" +19;"com.arc.dh.util.Sound_EXPLODE4" +20;"com.arc.dh.util.Sound_JUMP1" +21;"com.arc.dh.util.Sound_EXPLODE5" +22;"com.arc.dh.util.Sound_JUMP2" +23;"com.arc.dh.util.Sound_EXPLODE2" +24;"com.arc.dh.util.Sound_JUMP3" +25;"com.arc.dh.util.Sound_EXPLODE3" +26;"com.arc.dh.util.Sound_DIAMOND5" +27;"com.arc.dh.util.Sound_JUMP0" +28;"com.arc.dh.util.Sound_HEART" +29;"com.arc.dh.util.Sound_STEELBOX" +30;"com.arc.dh.util.Sound_PLINK" +31;"com.arc.dh.util.Sound_RED_DIAMOND" +32;"com.arc.dh.util.Sound_ACHIEVEMENT" +33;"com.arc.dh.util.Sound_MENU_CLICK" +34;"com.arc.dh.util.Sound_POT" +35;"com.arc.dh.util.Sound_HURT" +36;"com.arc.dh.util.Sound_MENU_SELECT" +37;"com.arc.dh.util.Sound_HEART_CRYSTAL" +38;"com.arc.dh.util.Sound_BUY" +39;"com.arc.dh.util.Sound_TITLE_MUSIC" +40;"com.arc.dh.util.Sound_TEXT" +41;"com.newgrounds.assets.DefaultSaveIcon" +42;"com.arc.dh.util.ParticleSystem_p_black" +43;"com.arc.dh.state.UI_diamondsSprite" +44;"com.arc.dh.menu.GameOver_spriteMainMenu" +45;"com.arc.dh.state.AG_AG" +47;"com.arc.dh.objects.enemies.FloorPlant_sprite" +46;"com.arc.dh.objects.enemies.DiveBird_sprite" +48;"com.arc.dh.state.StoryMode_CH5O" +50;"com.arc.dh.objects.enemies.Snail_sprite" +49;"com.arc.dh.objects.enemies.ShadowOrb_sprite" +51;"com.arc.dh.objects.enemies.BlobDot_sprite" +53;"com.arc.dh.util.ParticleSystem_p_rebound" +52;"com.arc.dh.util.Fonts_fontOutlineBrownSprite" +54;"com.arc.dh.state.TadpoleMode_ESCAPE_OVERLAY_SPRITE" +55;"com.arc.dh.state.PlayMode_CONTROLS_SPRITE" +56;"com.arc.dh.state.MinigameScreen_buttonBackSprite" +41;"com.newgrounds.assets.DefaultSaveIcon" +57;"com.arc.dh.state.StoryScreen_chooseSprite" +59;"com.arc.dh.state.EscapeScreen_startBackSprite" +58;"com.arc.dh.state.MainScreen_buttonBossSprite" +60;"com.arc.dh.entities.Player_elevatorSprite" +61;"com.arc.dh.menu.StatisticsChapter_bgSprite" +63;"com.arc.dh.objects.powerups.PowerupHeart_sprite" +62;"com.arc.dh.objects.enemies.Tadpole_sprite" +64;"com.arc.dh.state.StoryMode_CH1" +65;"com.arc.dh.objects.enemies.Slime_sprite" +67;"com.arc.dh.state.StoryMode_CH6O" +66;"com.arc.dh.state.StoryMode_CH3" +69;"com.arc.dh.state.StoryMode_CH2" +68;"com.arc.dh.state.BossModeTooltip_spriteTooltipArrow" +72;"com.arc.dh.state.StoryMode_CH5" +71;"org.flixel.system.debug.VCR_ImgRecordOff" +70;"org.flixel.FlxSprite_ImgDefault" +74;"com.arc.dh.state.StoryMode_CH4" +73;"com.arc.dh.objects.enemies.BouncingSlime_sprite" +76;"com.arc.dh.state.StoryMode_CH7" +75;"com.arc.dh.menu.GunComponentBar_bgSprite" +78;"com.arc.dh.state.StoryMode_CH6" +77;"com.arc.dh.util.Fonts_fontOutlineGradientSSprite" +79;"com.arc.dh.util.ParticleSystem_p_cyan" +82;"com.arc.dh.menu.OptionsMenu_resetButton" +81;"com.arc.dh.state.MainMenu_soundButton" +80;"com.arc.dh.menu.GunComponentBar_barSpriteUnobtained" +84;"com.arc.dh.state.MainScreen_buttonOptionsSprite" +83;"com.arc.dh.state.WeaponUI_sprite" +85;"com.arc.dh.util.ParticleSystem_p_blue" +7;"com.arc.dh.util.Sound_BOSS_MUSIC" +86;"org.flixel.system.debug.VCR_ImgPlay" +87;"com.arc.dh.state.CreditsScreen_sprite" +89;"com.arc.dh.objects.enemies.Professor_sadSprite" +88;"com.arc.dh.state.TadpoleMode_ESCAPE_SPRITE" +91;"com.arc.dh.objects.Missile_sprite" +90;"com.arc.dh.menu.GunComponent_sprite" +93;"com.arc.dh.state.StoryMode_CH3O" +92;"com.arc.dh.objects.Checkpoint_sprite" +94;"com.arc.dh.util.ParticleSystem_p_pot" +68;"com.arc.dh.state.EscapeTooltip_spriteTooltipArrow" +95;"com.arc.dh.entities.Player_gunDownSprite" +96;"com.arc.dh.objects.powerups.HeartCrystal_sprite" +98;"com.arc.dh.state.Pegas_AG" +97;"com.arc.dh.objects.powerups.HeartCrystal_sprite_outline" +99;"com.arc.dh.state.MinigameScreen_buttonPlaySprite" +101;"com.arc.dh.state.MainMenu_titleSprite" +100;"com.arc.dh.objects.enemies.Professor_sprite" +102;"com.arc.dh.objects.BossDoor_sprite" +5;"com.arc.dh.util.Sound_ENEMY_DIE" +103;"com.arc.dh.util.ParticleSystem_p_red" +105;"com.arc.dh.state.UI_mg" +104;"com.arc.dh.menu.CharacterPane_heartMeterSprite" +11;"com.arc.dh.util.Sound_EQUIPMENT" +29;"com.arc.dh.util.Sound_STEELBOX" +88;"com.arc.dh.state.RunMode_ESCAPE_SPRITE" +106;"com.arc.dh.entities.Player_dotSprite" +108;"org.flixel.system.debug.VCR_ImgFlixel" +107;"com.arc.dh.objects.enemies.Blade_sprite" +109;"com.arc.dh.state.StoryMode_CH4O" +110;"org.flixel.system.FlxWindow_ImgHandle" +113;"org.flixel.system.debug.VCR_ImgStep" +112;"com.arc.dh.objects.powerups.HeartCrystal_spriteBorder" +111;"com.arc.dh.menu.SkillMeter_barSprite" +114;"com.arc.dh.menu.StatisticsChapter_redDiamondUnobtained" +40;"com.arc.dh.util.Sound_TEXT" +115;"com.arc.dh.menu.GameOver_sprite" +116;"com.arc.dh.util.text.Avatar_SAGA_SPRITE" +117;"com.arc.dh.util.ParticleSystem_p_woodenCrate" +118;"com.arc.dh.menu.OptionsMenu_closeSprite" +119;"com.arc.dh.state.MainScreen_buttonUnlockSprite" +120;"com.arc.dh.util.Fonts_fontOutlineBlueSprite" +122;"com.arc.dh.state.MainScreen_buttonMoreGames" +121;"com.arc.dh.objects.enemies.CeilingPlant_sprite" +123;"com.arc.dh.objects.enemies.Bird_sprite" +125;"com.arc.dh.objects.enemies.Spider_threadSprite" +124;"com.arc.dh.state.BossButton_buttonSprite" +126;"com.arc.dh.objects.enemies.Orb_sprite" +8;"com.arc.dh.util.Sound_BOX" +127;"com.arc.dh.state.PlayMode_T1" +124;"com.arc.dh.state.EscapeButton_buttonSprite" +128;"com.arc.dh.state.PlayMode_T3" +129;"com.arc.dh.state.PlayMode_T2" +130;"com.arc.dh.state.PlayMode_T5" +131;"com.arc.dh.state.PlayMode_T4" +132;"com.arc.dh.state.PlayMode_T7" +134;"com.arc.dh.state.PlayMode_T6" +133;"com.arc.dh.state.PlayMode_xraySprite" +135;"com.arc.dh.menu.OptionsMenu_mouseSprite" +137;"com.arc.dh.menu.OptionsMenu_windowSprite" +136;"com.arc.dh.menu.GunComponentBar_singleBarSpriteUnobtained" +138;"com.arc.dh.state.MainMenu_titleGlowSprite" +84;"com.arc.dh.menu.Menu_optionsButton" +30;"com.arc.dh.util.Sound_PLINK" +34;"com.arc.dh.util.Sound_POT" +139;"com.arc.dh.state.UI_heightSprite" +140;"com.arc.dh.objects.Checkpoint_spriteRed" +143;"com.arc.dh.state.StoryMode_STORY_SPRITE" +142;"com.arc.dh.state.UI_distanceSprite" +141;"com.arc.dh.util.Fonts_fontOutlineBlackSprite" +145;"com.arc.dh.state.UI_sButtonSprite" +144;"com.arc.dh.menu.Menu_spriteCharacterButton" +146;"com.arc.dh.menu.SkillMeter_diamondSprite" +32;"com.arc.dh.util.Sound_ACHIEVEMENT" +146;"com.arc.dh.state.StoryMode_PARTICLES" +147;"com.arc.dh.util.Fonts_fontBevelYellowSprite" +148;"com.arc.dh.util.Fonts_fontSprite" +152;"com.arc.dh.objects.powerups.RedDiamond_sprite" +151;"com.arc.dh.state.EscapeScreen_diamondsSprite" +150;"com.arc.dh.objects.enemies.ProfessorShade_sprite" +149;"com.arc.dh.util.text.TextFrame_frameSprite" +153;"org.flixel.FlxTilemap_ImgAutoAlt" +3;"com.arc.dh.util.Sound_POWERUP" +154;"com.arc.dh.menu.GameOver_spriteComplete" +155;"com.arc.dh.objects.powerups.PowerupFire_sprite" +156;"com.arc.dh.state.HeartMeter_heartFull" +157;"org.flixel.system.debug.VCR_ImgOpen" +159;"com.arc.dh.state.UI_cButtonSprite" +158;"com.arc.dh.objects.BulletRebound_sprite" +160;"com.arc.dh.state.MainScreen_buttonPegas" +39;"com.arc.dh.util.Sound_TITLE_MUSIC" +161;"com.arc.dh.state.StoryMode_CH7O" +162;"com.arc.dh.util.Fonts_fontBevelBlueSprite" +163;"com.arc.dh.state.MaxGames_AG" +164;"com.arc.dh.state.EscapeScreen_escapeSprite" +12;"com.arc.dh.util.Sound_CHECKPOINT" +165;"com.arc.dh.objects.enemies.Spike_sprite" +166;"org.flixel.FlxGame_ImgLogo" +167;"com.arc.dh.menu.OptionsMenu_fastSprite" +9;"com.arc.dh.util.Sound_PLAY_MUSIC" +168;"com.arc.dh.state.MainScreen_buttonMG" +170;"com.arc.dh.state.MainScreen_buttonStorySprite" +169;"com.arc.dh.menu.OptionsMenu_kb2Sprite" +171;"com.arc.dh.state.EscapeMode_LAVA_SPRITE" +172;"com.arc.dh.objects.enemies.StoneBird_sprite" +173;"com.arc.dh.objects.enemies.FloorPlant_spriteGold" +2;"com.newgrounds.assets.DefaultMedalIcon" +174;"com.arc.dh.objects.enemies.Professor_shieldSprite" +175;"com.arc.dh.menu.StatisticsChapter_redDiamondObtained" +176;"org.flixel.FlxBitmapFont_imgDefaultFont" +178;"com.arc.dh.state.MainScreen_buttonBossLockedSprite" +177;"com.arc.dh.menu.OptionsMenu_medSprite" +179;"com.arc.dh.state.Chapter_badgesSprite" +180;"com.arc.dh.state.MainScreen_buttonLikeAG" +181;"org.flixel.system.input.Mouse_ImgDefaultCursor" +182;"com.arc.dh.objects.enemies.Laser_sprite" +183;"com.arc.dh.state.PlayMode_BG1_5" +184;"com.arc.dh.state.PlayMode_BG1_6" +185;"com.arc.dh.state.PlayMode_BG1_7" +186;"com.arc.dh.state.CreditsScreen_buttonHomepageSprite" +37;"com.arc.dh.util.Sound_HEART_CRYSTAL" +187;"com.arc.dh.state.MainMenu_buttonPlay" +189;"com.arc.dh.state.PlayMode_BG1_1" +188;"com.arc.dh.entities.PlayerTadpole_sprite" +189;"com.arc.dh.state.PlayMode_BG1_2" +190;"com.arc.dh.menu.StatisticsChapter_heartCrystalUnobtained" +191;"com.arc.dh.state.PlayMode_BG1_3" +192;"com.arc.dh.state.PlayMode_BG1_4" +33;"com.arc.dh.util.Sound_MENU_CLICK" +171;"com.arc.dh.state.RunMode_LAVA_SPRITE" +194;"com.arc.dh.objects.enemies.SlimeKing_sprite" +193;"com.arc.dh.state.PlayMode_BG2_5" +195;"com.arc.dh.state.PlayMode_BG2_4" +197;"com.arc.dh.state.PlayMode_BG2_7" +196;"com.arc.dh.state.PlayMode_BG3_2" +198;"com.arc.dh.state.PlayMode_BG2_6" +196;"com.arc.dh.state.PlayMode_BG3_1" +201;"com.arc.dh.objects.SteelCrate_sprite" +200;"com.arc.dh.state.PlayMode_BG3_4" +199;"com.arc.dh.state.PlayMode_BG2_1" +203;"com.arc.dh.state.PlayMode_BG3_3" +202;"com.arc.dh.state.MainMenu_buttonHelp" +205;"com.arc.dh.state.PlayMode_BG3_6" +204;"com.arc.dh.state.PlayMode_BG2_3" +206;"com.arc.dh.state.PlayMode_BG3_5" +199;"com.arc.dh.state.PlayMode_BG2_2" +207;"com.arc.dh.objects.Healthbar_barSprite" +56;"com.arc.dh.state.EscapeScreen_buttonBackSprite" +209;"com.arc.dh.state.PlayMode_BG3_7" +208;"com.arc.dh.util.Fonts_fontBevelGraySprite" +68;"com.arc.dh.menu.MenuTooltip_spriteTooltipArrow" +10;"com.arc.dh.util.Sound_PLAYER_DIE" +211;"com.arc.dh.objects.enemies.Plant_sprite" +210;"com.arc.dh.state.StoryMode_STORY_OVERLAY_SPRITE" +212;"com.arc.dh.objects.BulletSpreader_spriteGreen" +213;"com.arc.dh.objects.enemies.Blob_sprite" +214;"com.arc.dh.state.MainScreen_buttonCreditsSprite" +215;"com.arc.dh.objects.powerups.PowerupEquipment_sprite" +56;"com.arc.dh.state.BossScreen_buttonBackSprite" +216;"com.arc.dh.objects.enemies.Tadpole_redSprite" +27;"com.arc.dh.util.Sound_JUMP0" +22;"com.arc.dh.util.Sound_JUMP2" +217;"com.arc.dh.objects.powerups.PowerupMagnet_sprite" +20;"com.arc.dh.util.Sound_JUMP1" +218;"com.arc.dh.menu.MessageLogPane_sprite" +24;"com.arc.dh.util.Sound_JUMP3" +219;"com.arc.dh.state.UI_mButtonSprite" +220;"com.arc.dh.util.ParticleSystem_p_green" +222;"org.flixel.system.debug.Vis_ImgBounds" +221;"com.arc.dh.objects.powerups.PowerupEquipment_spriteBorder" +223;"com.arc.dh.menu.StatisticsPane_refreshSprite" +224;"com.arc.dh.objects.enemies.CeilingPlant_spriteGold" +225;"com.arc.dh.objects.enemies.Spider_sprite" +227;"com.arc.dh.util.ParticleSystem_p_yellow" +226;"com.arc.dh.menu.GunComponentBar_singleBarSprite" +228;"com.arc.dh.util.AchievementWindow_sprite" +146;"com.arc.dh.util.ParticleSystem_p_diamonds" +231;"com.arc.dh.objects.powerups.PowerupShield_sprite" +230;"com.arc.dh.objects.Healthbar_backgroundSprite" +229;"com.arc.dh.menu.StatisticsPane_pegasSprite" +233;"com.arc.dh.objects.BulletPrime_sprite" +232;"com.arc.dh.menu.CompleteWindow_sprite" +234;"com.arc.dh.util.Fonts_fontOutlineGradientSprite" +236;"com.arc.dh.objects.WoodenCrate_sprite" +235;"com.arc.dh.state.PlayMode_MENU_TIP_SPRITE" +237;"com.arc.dh.util.Fonts_fontOutlineBlueSSprite" +238;"com.arc.dh.util.ParticleSystem_p_white" +239;"com.arc.dh.util.ParticleSystem_p_prime" +240;"com.arc.dh.objects.powerups.PowerupHeart_spriteBorder" +241;"com.arc.dh.menu.Menu_backButton" +242;"com.arc.dh.menu.GameOver_spriteRetry" +243;"com.arc.dh.entities.Player_sprite" +244;"com.arc.dh.state.HeartMeter_heartEmpty" +245;"org.flixel.FlxTilemap_ImgAuto" +196;"com.arc.dh.state.MainMenu_BACKGROUND_SPRITE3" +199;"com.arc.dh.state.MainMenu_BACKGROUND_SPRITE2" +16;"com.arc.dh.util.Sound_WIN" +189;"com.arc.dh.state.MainMenu_BACKGROUND_SPRITE1" +246;"com.arc.dh.state.MainScreen_buttonAG" +248;"com.arc.dh.menu.OptionsMenu_slowSprite" +247;"com.arc.dh.menu.StatisticsPane_sprite" +249;"com.arc.dh.objects.enemies.Professor_endingSprite" +215;"com.arc.dh.objects.enemies.Professor_equipmentSprite" +251;"org.flixel.system.debug.VCR_ImgPause" +250;"com.arc.dh.menu.CharacterPane_sprite" +26;"com.arc.dh.util.Sound_DIAMOND5" +252;"com.arc.dh.menu.ConfirmationMenu_window" +253;"com.arc.dh.objects.BulletFragment_sprite" +14;"com.arc.dh.util.Sound_DIAMOND1" +254;"com.arc.dh.menu.ConfirmationMenu_cancel" +56;"com.arc.dh.state.StoryScreen_buttonBackSprite" +13;"com.arc.dh.util.Sound_DIAMOND2" +54;"com.arc.dh.state.RunMode_ESCAPE_OVERLAY_SPRITE" +17;"com.arc.dh.util.Sound_DIAMOND3" +202;"com.arc.dh.state.MainScreen_buttonHelpSprite" +15;"com.arc.dh.util.Sound_DIAMOND4" +255;"com.arc.dh.state.MainScreen_buttonEscapeSprite" +256;"com.arc.dh.state.StoryMode_CH1O" +258;"com.arc.dh.state.MainScreen_buttonMinigameSprite" +257;"com.arc.dh.menu.ConfirmationMenu_quit" +6;"com.arc.dh.util.Sound_SHOOT_SMALL" +259;"com.arc.dh.state.PlayMode_BITMAP_SPRITE" +261;"com.arc.dh.entities.Player_shieldSprite" +260;"com.arc.dh.objects.enemies.Seed_sprite" +35;"com.arc.dh.util.Sound_HURT" +88;"com.arc.dh.state.EscapeMode_ESCAPE_SPRITE" +262;"com.arc.dh.objects.Diamond_sprite" +263;"com.arc.dh.objects.enemies.Laser_spriteV" +28;"com.arc.dh.util.Sound_HEART" +264;"com.arc.dh.menu.Menu_closeButton" +265;"com.arc.dh.util.text.Avatar_PROFESSOR_SPRITE" +266;"com.arc.dh.objects.enemies.SnailKing_sprite" +215;"com.arc.dh.menu.Equipment_icons" +267;"com.arc.dh.objects.enemies.Snake_sprite" +269;"com.arc.dh.state.StoryMode_CH2O" +268;"com.arc.dh.state.MinigameScreen_buttonRunUnlockedSprite" +271;"com.arc.dh.util.ParticleSystem_p_steelCrate" +270;"com.arc.dh.state.EscapeButton_lockSprite" +272;"org.flixel.system.debug.VCR_ImgStop" +273;"com.arc.dh.objects.enemies.Laser_spriteH" +274;"com.arc.dh.state.HelpScreen_sprite" +38;"com.arc.dh.util.Sound_BUY" +275;"com.arc.dh.menu.OptionsMenu_onSprite" +171;"com.arc.dh.state.TadpoleMode_LAVA_SPRITE" +276;"com.arc.dh.menu.GameOver_spriteShort" +277;"com.arc.dh.entities.Player_gunRightSprite" +278;"com.arc.dh.objects.Pot_largeSprite" +279;"com.arc.dh.entities.Player_gunUpSprite" +280;"org.flixel.FlxGame_junk" +281;"com.arc.dh.state.PlayMode_UPGRADE_TIP_SPRITE" +284;"com.arc.dh.state.BossScreen_buttonHeroicSprite" +283;"com.arc.dh.objects.enemies.ClimbingSlime_sprite" +282;"com.arc.dh.state.Trophy_sprite" +285;"com.arc.dh.objects.enemies.SnakeTail_sprite" +287;"com.arc.dh.state.MinigameScreen_buttonLockedSprite" +286;"org.flixel.system.debug.VCR_ImgRecordOn" +54;"com.arc.dh.state.EscapeMode_ESCAPE_OVERLAY_SPRITE" +288;"com.arc.dh.state.BossScreen_buttonHeroicLockedSprite" +289;"com.arc.dh.util.Fonts_fontOutlineBlackSSprite" +36;"com.arc.dh.util.Sound_MENU_SELECT" +290;"com.arc.dh.state.BossScreen_buttonNormalSprite" +292;"com.arc.dh.objects.powerups.RedDiamond_sprite_outline" +291;"com.arc.dh.menu.OptionsMenu_offSprite" +68;"com.arc.dh.state.StoryModeTooltip_spriteTooltipArrow" +293;"com.arc.dh.state.MainScreen_buttonEscapeLockedSprite" +294;"com.arc.dh.state.MainScreen_buttonHost" +4;"com.arc.dh.util.Sound_PLAY_MUSIC2" +295;"com.arc.dh.objects.BulletSpreader_sprite" +296;"com.arc.dh.menu.OptionsMenu_kb1Sprite" +297;"com.arc.dh.menu.GunComponentBar_barSprite" +298;"com.arc.dh.objects.enemies.Plant_spriteGold" +299;"com.arc.dh.util.ParticleSystem_p_purple" +31;"com.arc.dh.util.Sound_RED_DIAMOND" +1;"org.flixel.FlxGame_SndBeep" +300;"com.arc.dh.state.Chapter_sprite" +270;"com.arc.dh.state.BossButton_lockSprite" +18;"com.arc.dh.util.Sound_EXPLODE1" +301;"org.flixel.system.debug.VCR_ImgRestart" +302;"com.arc.dh.objects.powerups.Powerup_POWERUP_DIAMOND_BORDER" +25;"com.arc.dh.util.Sound_EXPLODE3" +23;"com.arc.dh.util.Sound_EXPLODE2" +303;"com.arc.dh.menu.Menu_spriteStatisticsButton" +21;"com.arc.dh.util.Sound_EXPLODE5" +304;"com.arc.dh.menu.StatisticsChapter_heartCrystalObtained" +146;"com.arc.dh.menu.GunComponentBar_diamondsSprite" +19;"com.arc.dh.util.Sound_EXPLODE4" +0;"Main" diff --git a/src/dhii/__init__.py b/src/dhii/__init__.py new file mode 100644 index 0000000..256fbff --- /dev/null +++ b/src/dhii/__init__.py @@ -0,0 +1 @@ +"""Diamond Hollow II Pygame preservation port.""" diff --git a/src/dhii/__main__.py b/src/dhii/__main__.py new file mode 100644 index 0000000..bcbfde6 --- /dev/null +++ b/src/dhii/__main__.py @@ -0,0 +1,5 @@ +from .main import main + + +if __name__ == "__main__": + main() diff --git a/src/dhii/assets.py b/src/dhii/assets.py new file mode 100644 index 0000000..a9b4180 --- /dev/null +++ b/src/dhii/assets.py @@ -0,0 +1,35 @@ +from __future__ import annotations + +from pathlib import Path + +import pygame + + +class AssetManager: + def __init__(self, image_dir: Path, sound_dir: Path) -> None: + self.image_dir = image_dir + self.sound_dir = sound_dir + self._images: dict[str, pygame.Surface] = {} + self._sounds: dict[str, pygame.mixer.Sound] = {} + + def image(self, name: str) -> pygame.Surface: + if name not in self._images: + path = self.image_dir / name + self._images[name] = pygame.image.load(path).convert_alpha() + return self._images[name] + + def frames(self, name: str, frame_width: int, frame_height: int) -> list[pygame.Surface]: + sheet = self.image(name) + frames: list[pygame.Surface] = [] + for y in range(0, sheet.get_height(), frame_height): + for x in range(0, sheet.get_width(), frame_width): + if x + frame_width <= sheet.get_width() and y + frame_height <= sheet.get_height(): + frame = pygame.Surface((frame_width, frame_height), pygame.SRCALPHA) + frame.blit(sheet, (0, 0), (x, y, frame_width, frame_height)) + frames.append(frame) + return frames + + def sound(self, name: str) -> pygame.mixer.Sound: + if name not in self._sounds: + self._sounds[name] = pygame.mixer.Sound(self.sound_dir / name) + return self._sounds[name] diff --git a/src/dhii/camera.py b/src/dhii/camera.py new file mode 100644 index 0000000..95e9f2d --- /dev/null +++ b/src/dhii/camera.py @@ -0,0 +1,26 @@ +from __future__ import annotations + +import pygame + +from . import config + + +class Camera: + def __init__(self, world_width: int, world_height: int) -> None: + self.world_width = world_width + self.world_height = world_height + self.x = 0.0 + self.y = 0.0 + + def follow(self, rect: pygame.Rect) -> None: + self.x = rect.centerx - config.WIDTH / 2 + self.y = rect.centery - config.HEIGHT / 2 + self.x = max(0.0, min(self.x, max(0, self.world_width - config.WIDTH))) + self.y = max(0.0, min(self.y, max(0, self.world_height - config.HEIGHT))) + + def apply(self, rect: pygame.Rect) -> pygame.Rect: + return rect.move(-round(self.x), -round(self.y)) + + def world_mouse(self) -> tuple[int, int]: + mx, my = pygame.mouse.get_pos() + return mx // config.SCALE + round(self.x), my // config.SCALE + round(self.y) diff --git a/src/dhii/config.py b/src/dhii/config.py new file mode 100644 index 0000000..884ba9f --- /dev/null +++ b/src/dhii/config.py @@ -0,0 +1,19 @@ +from pathlib import Path + + +BASE_DIR = Path(__file__).resolve().parents[2] +ASSETS_DIR = BASE_DIR / "assets" +IMAGE_DIR = ASSETS_DIR / "images" +SOUND_DIR = ASSETS_DIR / "sounds" +FONT_DIR = ASSETS_DIR / "fonts" + +WIDTH = 360 +HEIGHT = 240 +SCALE = 2 +WINDOW_SIZE = (WIDTH * SCALE, HEIGHT * SCALE) +FPS = 60 +BLOCK_SIZE = 12 +BLOCK_WIDTH = WIDTH // BLOCK_SIZE +BLOCK_HEIGHT = HEIGHT // BLOCK_SIZE +VERSION = "1.21" +RELEASE = "Pegas Games" diff --git a/src/dhii/entities/__init__.py b/src/dhii/entities/__init__.py new file mode 100644 index 0000000..4ddd8be --- /dev/null +++ b/src/dhii/entities/__init__.py @@ -0,0 +1 @@ +"""Gameplay entities.""" diff --git a/src/dhii/entities/player.py b/src/dhii/entities/player.py new file mode 100644 index 0000000..f350ec2 --- /dev/null +++ b/src/dhii/entities/player.py @@ -0,0 +1,219 @@ +from __future__ import annotations + +import math + +import pygame + +from .. import config +from ..assets import AssetManager +from ..camera import Camera +from ..input import Input +from ..tilemap import ChapterTileMap + + +LEFT = -1 +RIGHT = 1 +HITBOX_OFFSET_X = 5 +HITBOX_OFFSET_Y = 10 +HITBOX_WIDTH = 6 +HITBOX_HEIGHT = 12 +COYOTE_TIME = 0.08 +JUMP_BUFFER_TIME = 0.1 +WALK_FRAME_TIME = 0.18 +STAND_FRAME_TIME = 0.5 + + +class Player: + def __init__(self, assets: AssetManager, x: float, y: float) -> None: + self.frames = assets.frames("player.png", 16, 24) + self.gun_right = assets.frames("player_gun_right.png", 16, 24) + self.gun_up = assets.frames("player_gun_up.png", 16, 24) + self.gun_down = assets.frames("player_gun_down.png", 16, 24) + self.x = x + self.y = y + self.vx = 0.0 + self.vy = 0.0 + self.facing = RIGHT + self.on_ground = False + self.touching_up = False + self.anim = "stand" + self.anim_time = 0.0 + self.anim_index = 0 + self.frame = 6 + self.aim_radians = 0.0 + self.jump_hold = 0.0 + self.jumping = False + self.invulnerable = 0.0 + self.coyote_timer = 0.0 + self.jump_buffer = 0.0 + self.has_gun = False + + @property + def sprite_rect(self) -> pygame.Rect: + return pygame.Rect(round(self.x), round(self.y), 16, 24) + + @property + def hitbox(self) -> pygame.Rect: + return pygame.Rect(round(self.x) + HITBOX_OFFSET_X, round(self.y) + HITBOX_OFFSET_Y, HITBOX_WIDTH, HITBOX_HEIGHT) + + def update(self, dt: float, input_: Input, tilemap: ChapterTileMap, camera: Camera) -> None: + mouse_x, mouse_y = camera.world_mouse() + self.invulnerable = max(0.0, self.invulnerable - dt) + midpoint = self.hitbox.center + self.aim_radians = math.atan2(mouse_y - midpoint[1], mouse_x - midpoint[0]) + self.facing = RIGHT if mouse_x >= self.x else LEFT + + moving_left = input_.pressed(pygame.K_a) or input_.pressed(pygame.K_LEFT) + moving_right = input_.pressed(pygame.K_d) or input_.pressed(pygame.K_RIGHT) + if moving_right and not moving_left: + self.vx = 80 + elif moving_left and not moving_right: + self.vx = -80 + else: + drag = 400 * dt + if self.vx > 0: + self.vx = max(0, self.vx - drag) + elif self.vx < 0: + self.vx = min(0, self.vx + drag) + + jump_pressed = ( + input_.just_pressed(pygame.K_w) + or input_.just_pressed(pygame.K_SPACE) + or input_.just_pressed(pygame.K_z) + or input_.just_pressed(pygame.K_UP) + ) + jump_held = ( + input_.pressed(pygame.K_w) + or input_.pressed(pygame.K_SPACE) + or input_.pressed(pygame.K_z) + or input_.pressed(pygame.K_UP) + ) + if self.on_ground: + self.coyote_timer = COYOTE_TIME + else: + self.coyote_timer = max(0.0, self.coyote_timer - dt) + + if jump_pressed: + self.jump_buffer = JUMP_BUFFER_TIME + else: + self.jump_buffer = max(0.0, self.jump_buffer - dt) + + if self.jump_buffer > 0 and (self.on_ground or self.coyote_timer > 0): + self._start_jump() + elif self.jumping and jump_held and self.jump_hold > 0 and not self.touching_up: + self.jump_hold -= dt + self.vy = -200 + else: + self.jumping = False + + self.vy = min(400, self.vy + 700 * dt) + self._move_x(dt, tilemap) + self._move_y(dt, tilemap) + if self.on_ground: + self.coyote_timer = COYOTE_TIME + self.x = max(-HITBOX_OFFSET_X, min(self.x, config.WIDTH - HITBOX_OFFSET_X - HITBOX_WIDTH)) + self._update_animation(dt) + + def _start_jump(self) -> None: + self.jumping = True + self.jump_hold = 0.2 + self.jump_buffer = 0.0 + self.coyote_timer = 0.0 + self.vy = -200 + self.on_ground = False + + def _move_x(self, dt: float, tilemap: ChapterTileMap) -> None: + self.x += self.vx * dt + rect = self.hitbox + for solid in tilemap.solid_rects_near(rect): + if rect.colliderect(solid): + if self.vx > 0: + rect.right = solid.left + elif self.vx < 0: + rect.left = solid.right + self.x = rect.x - HITBOX_OFFSET_X + self.vx = 0 + + def _move_y(self, dt: float, tilemap: ChapterTileMap) -> None: + self.y += self.vy * dt + rect = self.hitbox + self.on_ground = False + self.touching_up = False + for solid in tilemap.solid_rects_near(rect): + if rect.colliderect(solid): + if self.vy > 0: + rect.bottom = solid.top + self.on_ground = True + elif self.vy < 0: + rect.top = solid.bottom + self.touching_up = True + self.y = rect.y - HITBOX_OFFSET_Y + self.vy = 0 + + def _update_animation(self, dt: float) -> None: + if abs(self.vy) > 1 and not self.on_ground: + self._set_animation("jump", dt) + self.frame = 5 + elif abs(self.vx) > 1: + self._set_animation("walk", dt) + if self.anim_time >= WALK_FRAME_TIME: + self.anim_time -= WALK_FRAME_TIME + self.anim_index = (self.anim_index + 1) % 5 + self.frame = self.anim_index + else: + self._set_animation("stand", dt) + if self.anim_time >= STAND_FRAME_TIME: + self.anim_time -= STAND_FRAME_TIME + self.anim_index = (self.anim_index + 1) % 2 + self.frame = 6 + self.anim_index + + def _set_animation(self, name: str, dt: float) -> None: + if self.anim != name: + self.anim = name + self.anim_time = 0.0 + self.anim_index = 0 + else: + self.anim_time += dt + + def draw(self, surface: pygame.Surface, camera: Camera) -> None: + frame = self.frames[self.frame] + gun_frames = self._gun_frames() + gun_frame = gun_frames[self.frame] if self.frame < len(gun_frames) else gun_frames[0] + dest = camera.apply(self.sprite_rect) + if self.facing == LEFT: + frame = pygame.transform.flip(frame, True, False) + gun_frame = pygame.transform.flip(gun_frame, True, False) + if self.invulnerable > 0: + frame = frame.copy() + gun_frame = gun_frame.copy() + frame.set_alpha(165) + gun_frame.set_alpha(165) + surface.blit(frame, dest) + if self.has_gun: + surface.blit(gun_frame, dest) + + def _gun_frames(self) -> list[pygame.Surface]: + if -2.74 < self.aim_radians <= -0.4 or self.aim_radians > 3.9: + return self.gun_up + if 0.4 <= self.aim_radians < 2.74: + return self.gun_down + return self.gun_right + + def hurt(self, knockback_from_x: float) -> bool: + if self.invulnerable > 0: + return False + self.invulnerable = 1.0 + self.vx = -160 if knockback_from_x > self.x else 160 + self.vy = -80 + return True + + def reset_to(self, x: float, y: float) -> None: + self.x = x + self.y = y + self.vx = 0.0 + self.vy = 0.0 + self.invulnerable = 0.0 + self.on_ground = False + self.jumping = False + self.coyote_timer = 0.0 + self.jump_buffer = 0.0 diff --git a/src/dhii/input.py b/src/dhii/input.py new file mode 100644 index 0000000..e5c373b --- /dev/null +++ b/src/dhii/input.py @@ -0,0 +1,48 @@ +from __future__ import annotations + +import pygame + +from . import config + + +class Input: + def __init__(self) -> None: + self.keys = pygame.key.get_pressed() + self.mouse_buttons = pygame.mouse.get_pressed(3) + self.mouse_pos = (0, 0) + self.held_keys: set[int] = set() + self.just_pressed_keys: set[int] = set() + self.just_pressed_mouse: set[int] = set() + + def begin_frame(self) -> None: + self.just_pressed_keys.clear() + self.just_pressed_mouse.clear() + + def handle_event(self, event: pygame.Event) -> None: + if event.type == pygame.KEYDOWN: + self.held_keys.add(event.key) + self.just_pressed_keys.add(event.key) + elif event.type == pygame.KEYUP: + self.held_keys.discard(event.key) + elif event.type == pygame.MOUSEBUTTONDOWN: + self.just_pressed_mouse.add(event.button) + + def refresh(self) -> None: + self.keys = pygame.key.get_pressed() + self.mouse_buttons = pygame.mouse.get_pressed(3) + mx, my = pygame.mouse.get_pos() + self.mouse_pos = (mx // config.SCALE, my // config.SCALE) + + def pressed(self, key: int) -> bool: + if key in self.held_keys: + return True + try: + return bool(self.keys[key]) + except IndexError: + return False + + def just_pressed(self, key: int) -> bool: + return key in self.just_pressed_keys + + def mouse_just_pressed(self, button: int = 1) -> bool: + return button in self.just_pressed_mouse diff --git a/src/dhii/main.py b/src/dhii/main.py new file mode 100644 index 0000000..d7b88e3 --- /dev/null +++ b/src/dhii/main.py @@ -0,0 +1,59 @@ +from __future__ import annotations + +import pygame + +from . import config +from .assets import AssetManager +from .input import Input +from .state import StateMachine +from .states.main_menu import MainMenu + + +class Game: + def __init__(self) -> None: + pygame.init() + try: + pygame.mixer.init() + except pygame.error: + # Audio is optional during early development and in headless checks. + pass + + pygame.display.set_caption("Diamond Hollow II") + self.window = pygame.display.set_mode(config.WINDOW_SIZE) + self.canvas = pygame.Surface((config.WIDTH, config.HEIGHT)).convert() + self.clock = pygame.time.Clock() + self.input = Input() + self.assets = AssetManager(config.IMAGE_DIR, config.SOUND_DIR) + self.states = StateMachine() + self.states.switch(MainMenu(self.assets, self.states)) + pygame.mouse.set_visible(False) + + def run(self) -> None: + running = True + while running: + dt = self.clock.tick(config.FPS) / 1000.0 + self.input.begin_frame() + for event in pygame.event.get(): + if event.type == pygame.QUIT: + running = False + elif event.type == pygame.KEYDOWN and event.key == pygame.K_F4 and event.mod & pygame.KMOD_ALT: + running = False + self.input.handle_event(event) + + self.input.refresh() + if self.input.just_pressed(pygame.K_ESCAPE): + running = False + + self.states.update(dt, self.input) + self.canvas.fill((51, 51, 51)) + self.states.draw(self.canvas) + + scaled = pygame.transform.scale(self.canvas, config.WINDOW_SIZE) + self.window.blit(scaled, (0, 0)) + pygame.display.flip() + + pygame.quit() + + +def main() -> None: + Game().run() diff --git a/src/dhii/objects/__init__.py b/src/dhii/objects/__init__.py new file mode 100644 index 0000000..0c50d2e --- /dev/null +++ b/src/dhii/objects/__init__.py @@ -0,0 +1 @@ +"""Gameplay objects.""" diff --git a/src/dhii/objects/bullet.py b/src/dhii/objects/bullet.py new file mode 100644 index 0000000..f6857b6 --- /dev/null +++ b/src/dhii/objects/bullet.py @@ -0,0 +1,40 @@ +from __future__ import annotations + +import math + +import pygame + +from .. import config +from ..assets import AssetManager +from ..camera import Camera +from ..tilemap import ChapterTileMap + + +class Bullet: + def __init__(self, assets: AssetManager, x: float, y: float, radians: float) -> None: + self.image = assets.image("bullet_prime.png") + self.x = x + 500 * math.cos(radians) * 0.005 + self.y = y + 500 * math.sin(radians) * 0.005 + self.vx = 500 * math.cos(radians) + self.vy = 500 * math.sin(radians) + self.alive = True + self.damage = 20 + self.impact: tuple[float, float] | None = None + + @property + def rect(self) -> pygame.Rect: + return pygame.Rect(round(self.x) + 1, round(self.y) + 1, 2, 2) + + def update(self, dt: float, tilemap: ChapterTileMap, camera: Camera) -> None: + self.x += self.vx * dt + self.y += self.vy * dt + if tilemap.solid_at_pixel(self.rect.centerx, self.rect.centery): + tilemap.break_tile_at_pixel(self.rect.centerx, self.rect.centery) + self.impact = self.rect.center + self.alive = False + screen = camera.apply(self.rect) + if screen.right < 0 or screen.left > config.WIDTH or screen.bottom < -60 or screen.top > config.HEIGHT + 60: + self.alive = False + + def draw(self, surface: pygame.Surface, camera: Camera) -> None: + surface.blit(self.image, camera.apply(self.image.get_rect(topleft=(round(self.x), round(self.y))))) diff --git a/src/dhii/objects/enemies.py b/src/dhii/objects/enemies.py new file mode 100644 index 0000000..58b053b --- /dev/null +++ b/src/dhii/objects/enemies.py @@ -0,0 +1,185 @@ +from __future__ import annotations + +import random + +import pygame + +from .. import config +from ..assets import AssetManager +from ..camera import Camera +from ..tilemap import ChapterTileMap + + +class Enemy: + def __init__( + self, + frames: list[pygame.Surface], + col: int, + row: int, + hp: int = 50, + static: bool = False, + animation: list[int] | None = None, + can_shoot: bool = False, + behavior: str = "walker", + ) -> None: + self.frames = frames + self.animation = animation or list(range(len(frames))) + self.x = float(col * config.BLOCK_SIZE) + self.y = float(row * config.BLOCK_SIZE) + self.vx = 0.0 if static else random.choice((-50.0, 50.0)) + self.vy = 0.0 + self.hp = hp + self.max_hp = hp + self.alive = True + self.static = static + self.time = random.random() + self.show_health = 0.0 + self.shoot_timer = random.uniform(1.0, 2.5) if static else 0.0 + self.can_shoot = can_shoot + self.behavior = behavior + self.on_ground = False + self.hanging = behavior == "spider" + self.home_y = self.y + self.spider_state = "hanging" if behavior == "spider" else "" + first_frame = frames[self.animation[0]] + self.width = min(10, first_frame.get_width()) + self.height = min(12, first_frame.get_height()) + self.offset_x = max(0, (first_frame.get_width() - self.width) // 2) + self.offset_y = max(0, first_frame.get_height() - self.height) + + @property + def rect(self) -> pygame.Rect: + return pygame.Rect(round(self.x) + self.offset_x, round(self.y) + self.offset_y, self.width, self.height) + + def update(self, dt: float, tilemap: ChapterTileMap, player_rect: pygame.Rect | None = None) -> None: + self.time += dt + self.show_health = max(0.0, self.show_health - dt) + self.shoot_timer = max(0.0, self.shoot_timer - dt) + if self.behavior == "spider": + self._update_spider(dt, player_rect) + return + if self.static: + return + self.vy = min(400, self.vy + 400 * dt) + self.x += self.vx * dt + rect = self.rect + hit_wall = False + for solid in tilemap.solid_rects_near(rect): + if rect.colliderect(solid): + hit_wall = True + if self.vx > 0: + rect.right = solid.left + else: + rect.left = solid.right + self.x = rect.x - self.offset_x + if hit_wall: + self.vx *= -1 + edge_col = int((self.rect.centerx + (6 if self.vx > 0 else -6)) // config.BLOCK_SIZE) + foot_row = int((self.rect.bottom + 2) // config.BLOCK_SIZE) + if self.behavior == "bouncer" and self.on_ground and not tilemap.solid_at(edge_col, foot_row): + self.vy = -250 + self.on_ground = False + elif self.behavior != "bouncer" and not tilemap.solid_at(edge_col, foot_row): + self.vx *= -1 + self.y += self.vy * dt + rect = self.rect + self.on_ground = False + for solid in tilemap.solid_rects_near(rect): + if rect.colliderect(solid): + if self.vy > 0: + rect.bottom = solid.top + self.on_ground = True + elif self.vy < 0: + rect.top = solid.bottom + self.y = rect.y - self.offset_y + self.vy = 0 + + def _update_spider(self, dt: float, player_rect: pygame.Rect | None) -> None: + if self.spider_state == "hanging": + self.vy = 0 + if player_rect is not None and abs(player_rect.centerx - self.rect.centerx) < 18 and player_rect.centery > self.rect.centery: + self.spider_state = "dropping" + self.hanging = False + self.vy = 140 + return + if self.spider_state == "dropping": + self.y += self.vy * dt + if self.y >= self.home_y + 72: + self.spider_state = "rising" + self.vy = -45 + return + if self.spider_state == "rising": + self.y += self.vy * dt + if self.y <= self.home_y: + self.y = self.home_y + self.vy = 0 + self.hanging = True + self.spider_state = "hanging" + + def damage(self, amount: int) -> None: + self.hp -= amount + self.show_health = 2.0 + if self.hp <= 0: + self.alive = False + + def draw(self, surface: pygame.Surface, camera: Camera) -> None: + frame_index = self.animation[int(self.time * 5) % len(self.animation)] + frame = self.frames[frame_index] + if self.vx < 0: + frame = pygame.transform.flip(frame, True, False) + dest = camera.apply(frame.get_rect(topleft=(round(self.x), round(self.y)))) + surface.blit(frame, dest) + if self.show_health > 0 and self.max_hp > 0 and self.hp < self.max_hp: + width = max(10, frame.get_width()) + x = dest.centerx - width // 2 + y = dest.top - 5 + pygame.draw.rect(surface, (28, 18, 18), (x, y, width, 3)) + fill = max(0, round(width * self.hp / self.max_hp)) + pygame.draw.rect(surface, (210, 50, 45), (x, y, fill, 3)) + + +def make_enemy(assets: AssetManager, col: int, row: int, marker: int) -> Enemy | None: + mapping = { + 16711680: ("enemy_slime.png", 14, 11, 50, False, "slime", False, "walker"), + 9699328: ("enemy_bouncing_slime.png", 14, 11, 50, False, "slime", False, "bouncer"), + 7766374: ("enemy_plant.png", 14, 11, 45, True, "first", True, "plant"), + 5069370: ("enemy_plant.png", 14, 11, 45, True, "first", True, "plant"), + 1427036: ("enemy_ceiling_plant.png", 19, 14, 45, True, "first", True, "plant"), + 12221184: ("enemy_spider.png", 13, 10, 50, True, "all", False, "spider"), + 12500670: ("enemy_spike.png", 12, 12, 9999, True, "first", False, "static"), + 7929600: ("enemy_bird.png", 11, 18, 50, False, "all", False, "walker"), + 13369599: ("enemy_slime_king.png", 57, 14, 300, False, "first", False, "walker"), + } + if marker not in mapping: + return None + image, width, height, hp, static, animation_type, default_can_shoot, behavior = mapping[marker] + frames = assets.frames(image, width, height) + if animation_type == "slime": + variant = random.randrange(max(1, len(frames) // 2)) + animation = [variant * 2, variant * 2 + 1] + elif animation_type == "first": + animation = [0] + else: + animation = None + return Enemy(frames, col, row, hp, static, animation, default_can_shoot, behavior) + + +class Seed: + def __init__(self, image: pygame.Surface, x: float, y: float, vx: float) -> None: + self.image = image + self.x = x + self.y = y + self.vx = vx + self.alive = True + + @property + def rect(self) -> pygame.Rect: + return self.image.get_rect(topleft=(round(self.x), round(self.y))) + + def update(self, dt: float, tilemap: ChapterTileMap) -> None: + self.x += self.vx * dt + if any(self.rect.colliderect(rect) for rect in tilemap.solid_rects_near(self.rect)): + self.alive = False + + def draw(self, surface: pygame.Surface, camera: Camera) -> None: + surface.blit(self.image, camera.apply(self.rect)) diff --git a/src/dhii/objects/pickups.py b/src/dhii/objects/pickups.py new file mode 100644 index 0000000..0feeb9b --- /dev/null +++ b/src/dhii/objects/pickups.py @@ -0,0 +1,131 @@ +from __future__ import annotations + +import math + +import pygame + +from .. import config +from ..assets import AssetManager +from ..camera import Camera + + +class Pickup: + def __init__( + self, + image: pygame.Surface, + x: int, + y: int, + value: int = 1, + frames: list[pygame.Surface] | None = None, + fps: int = 8, + kind: str = "diamond", + ) -> None: + self.image = image + self.frames = frames or [image] + self.x = float(x) + self.y = float(y) + self.base_y = float(y) + self.vx = 0.0 + self.vy = 0.0 + self.value = value + self.alive = True + self.time = 0.0 + self.fps = fps + self.kind = kind + + @property + def rect(self) -> pygame.Rect: + return self.frames[0].get_rect(topleft=(round(self.x), round(self.y))) + + def update(self, dt: float, player_rect: pygame.Rect | None = None) -> None: + self.time += dt + if self.kind in ("diamond", "red_diamond") and player_rect is not None: + dx = player_rect.centerx - self.rect.centerx + dy = player_rect.centery - self.rect.centery + distance = math.hypot(dx, dy) + if 0 < distance < 55: + speed = 240 if self.kind == "diamond" else 180 + self.vx = speed * dx / distance + self.vy = speed * dy / distance + elif self.vx or self.vy: + self.vx *= max(0.0, 1 - 8 * dt) + self.vy *= max(0.0, 1 - 8 * dt) + self.x += self.vx * dt + self.y += self.vy * dt + elif self.kind != "checkpoint": + self.y = self.base_y + math.sin(self.time * 3.0) * 2 + + def draw(self, surface: pygame.Surface, camera: Camera) -> None: + frame = self.frames[int(self.time * self.fps) % len(self.frames)] + surface.blit(frame, camera.apply(frame.get_rect(topleft=(round(self.x), round(self.y))))) + + +class Checkpoint(Pickup): + def __init__(self, assets: AssetManager, col: int, row: int) -> None: + self.inactive = assets.image("checkpoint.png") + self.active = assets.image("checkpoint_red.png") + self.activated = False + super().__init__(self.inactive, col * config.BLOCK_SIZE, row * config.BLOCK_SIZE - 5, kind="checkpoint") + + def activate(self) -> None: + self.activated = True + self.image = self.active + self.frames = [self.active] + + +def diamond_value_from_level(level: int) -> int: + if level < 9: + return 1 + if level < 20: + return 2 + if level < 31: + return 3 + if level < 42: + return 4 + if level < 53: + return 5 + if level < 61: + return 6 + return 10 + + +def diamond_frames_for_value(frames: list[pygame.Surface], value: int) -> list[pygame.Surface]: + color_index = {1: 0, 2: 1, 3: 2, 4: 3, 5: 4, 6: 5, 10: 6}.get(value, 0) + start = color_index * 6 + color_frames = frames[start : start + 6] + if len(color_frames) < 6: + return frames[:1] + return color_frames + color_frames[4:0:-1] + + +def make_pickup(assets: AssetManager, col: int, row: int, marker: int, level: int) -> Pickup | Checkpoint | None: + x = col * config.BLOCK_SIZE + y = row * config.BLOCK_SIZE + if marker == 16763904: + frames = assets.frames("diamond.png", 10, 10) + value = diamond_value_from_level(level) + diamond_frames = diamond_frames_for_value(frames, value) + return Pickup(diamond_frames[0], x + 1, y + 1, value, diamond_frames, kind="diamond") + if marker == 8171970: + return Checkpoint(assets, col, row) + if marker == 16711932: + frames = assets.frames("red_diamond.png", 20, 20) + return Pickup(frames[0], x - 1, y - 1, 50, frames, kind="red_diamond") + if 2949120 <= marker <= 2949142: + frames = assets.frames("heart_crystal.png", 17, 17) + return Pickup(frames[0], x - 1, y - 5, 0, frames, kind="heart_crystal") + if marker in (16747367, 6473198, 6746111): + image = { + 16747367: "powerup_fire.png", + 6473198: "powerup_magnet.png", + 6746111: "powerup_shield.png", + }[marker] + frames = assets.frames(image, 13, 13) + kind = {16747367: "fire", 6473198: "magnet", 6746111: "shield"}[marker] + return Pickup(frames[0], x - 1, y - 5, 0, frames, kind=kind) + if marker in (255, 65791, 590079): + frames = assets.frames("powerup_equipment.png", 14, 14) + equipment_frame = {255: 0, 65791: 1, 590079: 5}[marker] + kind = {255: "autofirer", 65791: "lasersight", 590079: "prime"}[marker] + return Pickup(frames[equipment_frame], x - 1, y - 5, 0, [frames[equipment_frame]], fps=0, kind=kind) + return None diff --git a/src/dhii/particles.py b/src/dhii/particles.py new file mode 100644 index 0000000..b779664 --- /dev/null +++ b/src/dhii/particles.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +import random + +import pygame + +from .camera import Camera + + +class Particle: + def __init__(self, x: float, y: float, color: tuple[int, int, int], vx: float, vy: float, life: float) -> None: + self.x = x + self.y = y + self.color = color + self.vx = vx + self.vy = vy + self.life = life + self.max_life = life + + def update(self, dt: float) -> None: + self.life -= dt + self.x += self.vx * dt + self.y += self.vy * dt + self.vy += 120 * dt + + def draw(self, surface: pygame.Surface, camera: Camera) -> None: + if self.life <= 0: + return + alpha = max(0, min(255, int(255 * self.life / self.max_life))) + rect = camera.apply(pygame.Rect(round(self.x), round(self.y), 2, 2)) + image = pygame.Surface((2, 2), pygame.SRCALPHA) + image.fill((*self.color, alpha)) + surface.blit(image, rect) + + +class ParticleSystem: + def __init__(self) -> None: + self.particles: list[Particle] = [] + + def emit(self, x: float, y: float, color: tuple[int, int, int], count: int = 6, speed: float = 70, life: float = 0.45) -> None: + for _ in range(count): + self.particles.append( + Particle( + x, + y, + color, + random.uniform(-speed, speed), + random.uniform(-speed, speed * 0.2), + random.uniform(life * 0.7, life * 1.2), + ) + ) + + def update(self, dt: float) -> None: + for particle in self.particles: + particle.update(dt) + self.particles = [particle for particle in self.particles if particle.life > 0] + + def draw(self, surface: pygame.Surface, camera: Camera) -> None: + for particle in self.particles: + particle.draw(surface, camera) diff --git a/src/dhii/sprites.py b/src/dhii/sprites.py new file mode 100644 index 0000000..b58ddf5 --- /dev/null +++ b/src/dhii/sprites.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Callable + +import pygame + +from .input import Input + + +class Sprite: + def __init__(self, image: pygame.Surface, x: int = 0, y: int = 0) -> None: + self.image = image + self.x = float(x) + self.y = float(y) + self.alpha = 255 + + @property + def rect(self) -> pygame.Rect: + return self.image.get_rect(topleft=(round(self.x), round(self.y))) + + def draw(self, surface: pygame.Surface) -> None: + if self.alpha >= 255: + surface.blit(self.image, self.rect) + return + image = self.image.copy() + image.set_alpha(max(0, min(255, round(self.alpha)))) + surface.blit(image, self.rect) + + +class Button: + def __init__( + self, + frames: list[pygame.Surface], + x: int, + y: int, + callback: Callable[[], None] | None = None, + enabled: bool = True, + ) -> None: + if not frames: + raise ValueError("button requires at least one frame") + self.frames = frames + self.x = x + self.y = y + self.callback = callback + self.enabled = enabled + self.hovered = False + + @property + def rect(self) -> pygame.Rect: + return self.frames[0].get_rect(topleft=(self.x, self.y)) + + def update(self, input_: Input) -> None: + self.hovered = self.rect.collidepoint(input_.mouse_pos) + if self.enabled and self.hovered and input_.mouse_just_pressed(): + if self.callback is not None: + self.callback() + + def draw(self, surface: pygame.Surface) -> None: + frame_index = 1 if self.hovered and len(self.frames) > 1 else 0 + surface.blit(self.frames[frame_index], self.rect) diff --git a/src/dhii/state.py b/src/dhii/state.py new file mode 100644 index 0000000..be832af --- /dev/null +++ b/src/dhii/state.py @@ -0,0 +1,31 @@ +from __future__ import annotations + +from typing import Protocol + +import pygame + +from .input import Input + + +class GameState(Protocol): + def update(self, dt: float, input_: Input) -> None: + ... + + def draw(self, surface: pygame.Surface) -> None: + ... + + +class StateMachine: + def __init__(self) -> None: + self.state: GameState | None = None + + def switch(self, state: GameState) -> None: + self.state = state + + def update(self, dt: float, input_: Input) -> None: + if self.state is not None: + self.state.update(dt, input_) + + def draw(self, surface: pygame.Surface) -> None: + if self.state is not None: + self.state.draw(surface) diff --git a/src/dhii/states/__init__.py b/src/dhii/states/__init__.py new file mode 100644 index 0000000..fbbe8f8 --- /dev/null +++ b/src/dhii/states/__init__.py @@ -0,0 +1 @@ +"""Game states.""" diff --git a/src/dhii/states/main_menu.py b/src/dhii/states/main_menu.py new file mode 100644 index 0000000..b82f127 --- /dev/null +++ b/src/dhii/states/main_menu.py @@ -0,0 +1,173 @@ +from __future__ import annotations + +import random + +import pygame + +from .. import config +from ..assets import AssetManager +from ..input import Input +from ..sprites import Button, Sprite +from ..state import StateMachine +from .story_mode import StoryMode + + +class BackgroundLayer: + def __init__(self, image: pygame.Surface, speed: float) -> None: + self.image = image + self.y = 0.0 + self.speed = speed + + def update(self, dt: float) -> None: + self.y += dt * 20 * self.speed + screen_y = round(self.y) + if screen_y < -420: + self.y = 0 + elif screen_y > 0: + self.y = -420 + screen_y + + def draw(self, surface: pygame.Surface) -> None: + y = round(self.y) + surface.blit(self.image, (0, y)) + surface.blit(self.image, (0, y + 420)) + + +class MainMenu: + def __init__(self, assets: AssetManager, states: StateMachine) -> None: + self.assets = assets + self.states = states + self.rng = random.Random() + self.font = pygame.font.Font(None, 10) + self.title = Sprite(assets.image("main_menu_title.png"), 4, 4) + self.title_glow = Sprite(assets.image("main_menu_title_glow.png"), 4, 4) + self.title_glow.alpha = 255 + self.title_fade_in = False + self.fader_alpha = 255.0 + self.layers = [ + BackgroundLayer(assets.image("main_menu_background_3.png"), 0.4), + BackgroundLayer(assets.image("main_menu_background_2.png"), 0.6), + BackgroundLayer(assets.image("main_menu_background_1.png"), 0.8), + ] + self.buttons: list[Button] = [] + self.tooltip: tuple[str, str] | None = None + self.cursor = assets.image("mouse_cursor.png") + self._build_main_screen() + + def _button( + self, + image_name: str, + x: int, + y: int, + width: int, + height: int, + callback=None, + enabled: bool = True, + ) -> Button: + button = Button(self.assets.frames(image_name, width, height), x, y, callback, enabled) + self.buttons.append(button) + return button + + def _build_main_screen(self) -> None: + self.story = self._button("button_story.png", 43, 103, 87, 26, self._start_story) + self.escape = self._button("button_escape_locked.png", 134, 103, 87, 26, enabled=False) + self.boss = self._button("button_boss_locked.png", 43, 136, 87, 26, enabled=False) + self.minigame = self._button("button_minigame.png", 134, 136, 87, 26, enabled=False) + self.help = self._button("button_help.png", 43, 169, 87, 26, enabled=False) + self.credits = self._button("button_credits.png", 134, 169, 87, 26, enabled=False) + self.pegas = self._button("button_pegas.png", 230, 100, 106, 46, enabled=False) + self.more_games = self._button("button_more_games.png", 240, 145, 87, 26, enabled=False) + self.host = self._button("button_host.png", 240, 170, 87, 26, enabled=False) + self.options = self._button("button_options.png", 160, 213, 34, 29, enabled=False) + + def _start_story(self) -> None: + self.states.switch(StoryMode(self.assets, chapter=1)) + + def update(self, dt: float, input_: Input) -> None: + if self.fader_alpha > 0: + self.fader_alpha = max(0.0, self.fader_alpha - dt * 765) + return + + for layer in self.layers: + layer.update(dt) + + if self.title_fade_in: + self.title_glow.alpha += dt * 255 + if self.title_glow.alpha >= 255: + self.title_glow.alpha = 255 + self.title_fade_in = False + else: + self.title_glow.alpha -= dt * 255 + if self.title_glow.alpha <= 0: + self.title_glow.alpha = 0 + self.title_fade_in = True + + self.tooltip = None + for button in self.buttons: + button.update(input_) + + if self.boss.hovered: + self.tooltip = ("Boss Rush Locked", "Complete chapter 7 of story mode to unlock Boss Rush") + elif self.escape.hovered: + self.tooltip = ("Escape Mode Locked", "Complete chapter 2 of story mode to unlock Escape Mode") + elif self.minigame.hovered or self.help.hovered or self.credits.hovered or self.options.hovered: + self.tooltip = ("Coming Soon", "This screen will be ported after the main menu and chapter 1.") + elif self.pegas.hovered or self.more_games.hovered or self.host.hovered: + self.tooltip = ("External Link Stubbed", "Portal and advertising links are intentionally not ported.") + + def draw(self, surface: pygame.Surface) -> None: + for layer in self.layers: + layer.draw(surface) + + self.title_glow.draw(surface) + self.title.draw(surface) + + for button in self.buttons: + button.draw(surface) + + self._draw_bottom_bar(surface) + if self.tooltip is not None: + self._draw_tooltip(surface, *self.tooltip) + + mx, my = pygame.mouse.get_pos() + surface.blit(self.cursor, (mx // config.SCALE, my // config.SCALE)) + + if self.fader_alpha > 0: + fader = pygame.Surface((config.WIDTH, config.HEIGHT), pygame.SRCALPHA) + fader.fill((0, 0, 0, round(self.fader_alpha))) + surface.blit(fader, (0, 0)) + + def _draw_bottom_bar(self, surface: pygame.Surface) -> None: + bar = pygame.Surface((config.WIDTH, 9), pygame.SRCALPHA) + bar.fill((0, 0, 0, 153)) + surface.blit(bar, (0, 228)) + left = self.font.render("CREATED BY ARKEUS", False, (210, 210, 210)) + right_text = f"VERSION {config.VERSION} - {config.RELEASE.upper()}" + right = self.font.render(right_text, False, (210, 210, 210)) + surface.blit(left, (4, 230)) + surface.blit(right, (config.WIDTH - right.get_width() - 4, 230)) + + def _draw_tooltip(self, surface: pygame.Surface, title: str, body: str) -> None: + mx, my = pygame.mouse.get_pos() + x = min(mx // config.SCALE + 8, 214) + y = min(my // config.SCALE + 8, 196) + box = pygame.Surface((138, 36), pygame.SRCALPHA) + box.fill((12, 10, 18, 220)) + pygame.draw.rect(box, (174, 146, 78), box.get_rect(), 1) + surface.blit(box, (x, y)) + title_image = self.font.render(title.upper(), False, (255, 236, 142)) + surface.blit(title_image, (x + 4, y + 4)) + words = body.split() + line = "" + lines: list[str] = [] + for word in words: + candidate = f"{line} {word}".strip() + if len(candidate) > 28: + lines.append(line) + line = word + else: + line = candidate + if line: + lines.append(line) + for index, text in enumerate(lines[:2]): + image = self.font.render(text, False, (230, 230, 230)) + surface.blit(image, (x + 4, y + 15 + index * 9)) diff --git a/src/dhii/states/story_mode.py b/src/dhii/states/story_mode.py new file mode 100644 index 0000000..8769753 --- /dev/null +++ b/src/dhii/states/story_mode.py @@ -0,0 +1,261 @@ +from __future__ import annotations + +import pygame + +from .. import config +from ..assets import AssetManager +from ..camera import Camera +from ..entities.player import Player +from ..input import Input +from ..objects.bullet import Bullet +from ..objects.enemies import Enemy, Seed, make_enemy +from ..objects.pickups import Checkpoint, Pickup, make_pickup +from ..particles import ParticleSystem +from ..tilemap import ChapterTileMap + + +class StaticObject: + def __init__(self, image: pygame.Surface, x: int, y: int) -> None: + self.image = image + self.x = x + self.y = y + + @property + def rect(self) -> pygame.Rect: + return self.image.get_rect(topleft=(self.x, self.y)) + + def draw(self, surface: pygame.Surface, camera: Camera) -> None: + surface.blit(self.image, camera.apply(self.rect)) + + +class ParallaxLayer: + def __init__(self, image: pygame.Surface, factor: float) -> None: + self.image = image + self.factor = factor + + def draw(self, surface: pygame.Surface, camera: Camera) -> None: + y = -round(camera.y * self.factor) % 420 - 420 + while y < config.HEIGHT: + surface.blit(self.image, (0, y)) + y += 420 + + +class StoryMode: + def __init__(self, assets: AssetManager, chapter: int = 1) -> None: + if chapter != 1: + raise ValueError("only Chapter 1 is implemented") + self.assets = assets + self.tilemap = ChapterTileMap(assets) + self.camera = Camera(self.tilemap.pixel_width, self.tilemap.pixel_height) + self.start_pos = (128.0, float(self.tilemap.pixel_height - 36)) + self.checkpoint_pos = self.start_pos + self.player = Player(assets, *self.start_pos) + self.camera.follow(self.player.hitbox) + self.layers = [ + ParallaxLayer(assets.image("ch1_bg3.png"), 0.4), + ParallaxLayer(assets.image("ch1_bg2.png"), 0.6), + ParallaxLayer(assets.image("ch1_bg1.png"), 0.8), + ] + self.cursor = assets.image("mouse_cursor.png") + self.bullets: list[Bullet] = [] + self.pickups: list[Pickup] = [] + self.enemies: list[Enemy] = [] + self.enemy_projectiles: list[Seed] = [] + self.static_objects: list[StaticObject] = [] + self.diamonds = 0 + self.red_diamonds = 0 + self.hp = 3 + self.max_hp = 3 + self.shoot_timer = 0.0 + self.font = pygame.font.Font(None, 14) + self.large_font = pygame.font.Font(None, 24) + self.complete = False + self.message = "Find SAGA and escape the cave." + self.message_timer = 4.0 + self.seed_image = assets.image("enemy_seed.png") + self.heart_full = assets.image("heart_full.png") + self.heart_empty = assets.image("heart_empty.png") + self.diamond_icon = assets.image("ui_diamonds.png") + self.particles = ParticleSystem() + self._spawn_markers() + + def _spawn_markers(self) -> None: + for col, row, marker in self.tilemap.object_markers: + level = int((1 - (row * config.BLOCK_SIZE) / self.tilemap.pixel_height) * 10 + 1) + pickup = make_pickup(self.assets, col, row, marker, level) + if pickup is not None: + self.pickups.append(pickup) + continue + enemy = make_enemy(self.assets, col, row, marker) + if enemy is not None: + self.enemies.append(enemy) + continue + if marker == 8750469: + self.static_objects.append(StaticObject(self.assets.image("boss_door.png"), col * config.BLOCK_SIZE, row * config.BLOCK_SIZE - 12)) + + def update(self, dt: float, input_: Input) -> None: + if self.complete: + return + self.shoot_timer = max(0.0, self.shoot_timer - dt) + self.message_timer = max(0.0, self.message_timer - dt) + self.player.update(dt, input_, self.tilemap, self.camera) + if self.player.has_gun and input_.mouse_buttons[0] and self.shoot_timer <= 0: + cx, cy = self.player.hitbox.center + self.bullets.append(Bullet(self.assets, cx - 2, cy - 2, self.player.aim_radians)) + self.shoot_timer = 0.3 + + for bullet in self.bullets: + bullet.update(dt, self.tilemap, self.camera) + if bullet.impact is not None: + self.particles.emit(*bullet.impact, (245, 238, 160), count=4, speed=45, life=0.25) + bullet.impact = None + for enemy in self.enemies: + enemy.update(dt, self.tilemap, self.player.hitbox) + if enemy.can_shoot and enemy.shoot_timer <= 0 and abs(enemy.rect.centery - self.player.hitbox.centery) < 120: + direction = -1 if self.player.hitbox.centerx < enemy.rect.centerx else 1 + self.enemy_projectiles.append(Seed(self.seed_image, enemy.rect.centerx, enemy.rect.centery - 2, 100 * direction)) + enemy.shoot_timer = 2.5 + for projectile in self.enemy_projectiles: + projectile.update(dt, self.tilemap) + for pickup in self.pickups: + pickup.update(dt, self.player.hitbox) + self.particles.update(dt) + + self._handle_overlaps() + self.bullets = [bullet for bullet in self.bullets if bullet.alive] + self.enemy_projectiles = [projectile for projectile in self.enemy_projectiles if projectile.alive] + self.enemies = [enemy for enemy in self.enemies if enemy.alive] + self.pickups = [pickup for pickup in self.pickups if pickup.alive or isinstance(pickup, Checkpoint)] + if self.player.y > self.tilemap.pixel_height + 60 or self.hp <= 0: + self._restart() + if self.player.y < 36 or (self.player.y < 260 and not any(enemy.max_hp >= 300 for enemy in self.enemies)): + self.complete = True + self.camera.follow(self.player.hitbox) + + def _handle_overlaps(self) -> None: + for bullet in self.bullets: + if not bullet.alive: + continue + for enemy in self.enemies: + if enemy.alive and bullet.rect.colliderect(enemy.rect): + was_alive = enemy.alive + enemy.damage(bullet.damage) + self.particles.emit(bullet.rect.centerx, bullet.rect.centery, (220, 60, 55), count=4, speed=55, life=0.3) + if was_alive and not enemy.alive: + self.particles.emit(enemy.rect.centerx, enemy.rect.centery, (210, 40, 40), count=12, speed=90, life=0.5) + bullet.alive = False + break + + player_rect = self.player.hitbox + for pickup in self.pickups: + if not pickup.alive and not isinstance(pickup, Checkpoint): + continue + if isinstance(pickup, Checkpoint): + if self._close_enough(player_rect, pickup.rect, 26) and not pickup.activated: + pickup.activate() + self.checkpoint_pos = (pickup.x + 4, pickup.y + 12) + self.hp = self.max_hp + self.particles.emit(pickup.rect.centerx, pickup.rect.centery, (255, 40, 40), count=16, speed=95, life=0.6) + self._show_message("Checkpoint activated.") + elif self._close_enough(player_rect, pickup.rect, 26) and pickup.activated: + self.hp = self.max_hp + continue + if player_rect.colliderect(pickup.rect): + self._activate_pickup(pickup) + self.particles.emit(pickup.rect.centerx, pickup.rect.centery, (255, 235, 80), count=6, speed=60, life=0.35) + pickup.alive = False + + for enemy in self.enemies: + if enemy.alive and player_rect.colliderect(enemy.rect): + if self.player.hurt(enemy.x): + self.hp -= 1 + + for projectile in self.enemy_projectiles: + if projectile.alive and player_rect.colliderect(projectile.rect): + projectile.alive = False + self.particles.emit(projectile.rect.centerx, projectile.rect.centery, (120, 220, 90), count=4, speed=50, life=0.25) + if self.player.hurt(projectile.x): + self.hp -= 1 + + def _close_enough(self, a: pygame.Rect, b: pygame.Rect, distance: int) -> bool: + dx = a.centerx - b.centerx + dy = a.centery - b.centery + return dx * dx + dy * dy <= distance * distance + + def _activate_pickup(self, pickup: Pickup) -> None: + if pickup.kind == "diamond": + self.diamonds += pickup.value + elif pickup.kind == "red_diamond": + self.red_diamonds += 1 + self.diamonds += pickup.value + self._show_message("Red diamond obtained.") + elif pickup.kind == "heart_crystal": + self.max_hp += 1 + self.hp = self.max_hp + self._show_message("Heart crystal obtained.") + elif pickup.kind == "prime": + self.player.has_gun = True + self._show_message("SAGA rescued. Mouse button shoots.", 5.0) + elif pickup.kind in ("fire", "magnet", "shield"): + self._show_message(f"{pickup.kind.title()} powerup obtained.") + elif pickup.kind in ("autofirer", "lasersight"): + self._show_message(f"{pickup.kind.title()} chip obtained.") + + def _show_message(self, text: str, duration: float = 3.0) -> None: + self.message = text + self.message_timer = duration + + def _restart(self) -> None: + self.hp = self.max_hp + self.player.reset_to(*self.checkpoint_pos) + self.camera.follow(self.player.hitbox) + + def draw(self, surface: pygame.Surface) -> None: + for layer in self.layers: + layer.draw(surface, self.camera) + self.tilemap.draw(surface, self.camera) + for pickup in self.pickups: + if pickup.alive or isinstance(pickup, Checkpoint): + pickup.draw(surface, self.camera) + for obj in self.static_objects: + obj.draw(surface, self.camera) + for enemy in self.enemies: + enemy.draw(surface, self.camera) + for projectile in self.enemy_projectiles: + projectile.draw(surface, self.camera) + for bullet in self.bullets: + bullet.draw(surface, self.camera) + self.particles.draw(surface, self.camera) + self.player.draw(surface, self.camera) + self._draw_ui(surface) + if self.complete: + self._draw_complete(surface) + mx, my = pygame.mouse.get_pos() + surface.blit(self.cursor, (mx // config.SCALE, my // config.SCALE)) + + def _draw_ui(self, surface: pygame.Surface) -> None: + for index in range(min(self.max_hp, 8)): + heart = self.heart_full if index < self.hp else self.heart_empty + surface.blit(heart, (6 + index * 10, 5)) + surface.blit(self.diamond_icon, (6, 20)) + diamonds = self.font.render(str(self.diamonds), False, (255, 240, 120)) + surface.blit(diamonds, (23, 21)) + if self.red_diamonds: + red = self.font.render(f"RED {self.red_diamonds}", False, (255, 90, 120)) + surface.blit(red, (70, 21)) + if not self.player.has_gun: + hint = self.font.render("Find SAGA", False, (255, 235, 128)) + surface.blit(hint, (config.WIDTH - hint.get_width() - 6, 6)) + if self.message_timer > 0: + box = pygame.Surface((config.WIDTH - 24, 24), pygame.SRCALPHA) + box.fill((0, 0, 0, 155)) + surface.blit(box, (12, config.HEIGHT - 34)) + text = self.font.render(self.message, False, (240, 230, 205)) + surface.blit(text, (18, config.HEIGHT - 27)) + + def _draw_complete(self, surface: pygame.Surface) -> None: + overlay = pygame.Surface((config.WIDTH, config.HEIGHT), pygame.SRCALPHA) + overlay.fill((0, 0, 0, 150)) + surface.blit(overlay, (0, 0)) + image = self.large_font.render("CHAPTER 1 COMPLETE", False, (255, 235, 128)) + surface.blit(image, ((config.WIDTH - image.get_width()) // 2, 103)) diff --git a/src/dhii/states/story_placeholder.py b/src/dhii/states/story_placeholder.py new file mode 100644 index 0000000..d54c5be --- /dev/null +++ b/src/dhii/states/story_placeholder.py @@ -0,0 +1,28 @@ +from __future__ import annotations + +import pygame + +from .. import config +from ..input import Input + + +class StoryPlaceholder: + def __init__(self) -> None: + self.font = pygame.font.Font(None, 16) + + def update(self, dt: float, input_: Input) -> None: + _ = dt, input_ + + def draw(self, surface: pygame.Surface) -> None: + surface.fill((18, 16, 28)) + lines = [ + "Chapter 1 port starts here next.", + "Menu path is wired; gameplay is not implemented yet.", + "Press ESC to quit.", + ] + y = 96 + for line in lines: + image = self.font.render(line, False, (235, 235, 235)) + x = (config.WIDTH - image.get_width()) // 2 + surface.blit(image, (x, y)) + y += 16 diff --git a/src/dhii/tilemap.py b/src/dhii/tilemap.py new file mode 100644 index 0000000..552ebed --- /dev/null +++ b/src/dhii/tilemap.py @@ -0,0 +1,253 @@ +from __future__ import annotations + +import random + +import pygame + +from . import config +from .assets import AssetManager +from .camera import Camera + + +GRASS = 5228053 +GRASS2 = 2652672 +DIRT = 10052885 +WATER = 32511 +LAVA = 14045513 +WOODEN_CRATE = 7028992 +STEEL_CRATE = 1579032 +RED_DIAMOND = 16711932 +WHITE = 16777215 +TILES = (GRASS, GRASS2, DIRT, WATER, LAVA) +OBJECT_TILES = (WOODEN_CRATE, STEEL_CRATE) + + +class ChapterTileMap: + def __init__(self, assets: AssetManager) -> None: + self.rng = random.Random(1) + self.object_counter = 2 + self.level_pixels = assets.image("ch1_map.png") + self.overlay_pixels = assets.image("ch1_overlay.png") + self.tile_frames = assets.frames("ch1_tiles.png", config.BLOCK_SIZE, config.BLOCK_SIZE) + self.width = self.level_pixels.get_width() + self.height = self.level_pixels.get_height() + self.pixel_width = self.width * config.BLOCK_SIZE + self.pixel_height = self.height * config.BLOCK_SIZE + self.tiles: list[list[int]] = [] + self.object_markers: list[tuple[int, int, int]] = [] + self._decode() + + def _decode(self) -> None: + for row in range(self.height): + tile_row: list[int] = [] + for col in range(self.width): + color = self.get_layer_tile(col, row, include_objects=True) + tile_id = self.color_to_tile_id(color, col, row) + tile_row.append(tile_id) + marker = self.get_pixel(self.level_pixels, col, row) + if marker not in TILES and marker not in OBJECT_TILES and marker != WHITE: + self.object_markers.append((col, row, marker)) + self.tiles.append(tile_row) + + def get_pixel(self, surface: pygame.Surface, col: int, row: int) -> int: + if col < 0 or row < 0 or col >= surface.get_width() or row >= surface.get_height(): + return 0 + color = surface.get_at((col, row)) + return color.r << 16 | color.g << 8 | color.b + + def get_layer_tile(self, col: int, row: int, include_objects: bool = False) -> int: + base = self.get_pixel(self.level_pixels, col, row) + overlay = self.get_pixel(self.overlay_pixels, col, row) + for color in TILES: + if base == color or overlay == color: + return color + if include_objects: + for color in OBJECT_TILES: + if base == color or overlay == color: + return color + return 0 + + def is_tile_color(self, color: int) -> bool: + return color in (GRASS, DIRT) + + def rand(self, start: int, end: int) -> int: + return self.rng.randint(start, end) + + def color_to_tile_id(self, color: int, col: int, row: int, overlay_pass: bool = False) -> int: + if not overlay_pass and self.is_tile_color(self.get_pixel(self.overlay_pixels, col, row)): + return 0 + + up = self.get_layer_tile(col, row - 1) + right = self.get_layer_tile(col + 1, row) + down = self.get_layer_tile(col, row + 1) + left = self.get_layer_tile(col - 1, row) + down_right = self.get_layer_tile(col + 1, row + 1) + down_left = self.get_layer_tile(col - 1, row + 1) + up_right = self.get_layer_tile(col + 1, row - 1) + up_left = self.get_layer_tile(col - 1, row - 1) + + has_left = left != 0 or col == 0 + has_right = right != 0 or col == config.BLOCK_WIDTH - 1 + has_up = up != 0 + has_down = down != 0 or row == self.height - 1 + has_down_right = down_right != 0 or row == self.height - 1 or col == config.BLOCK_WIDTH - 1 + has_down_left = down_left != 0 or row == self.height - 1 or col == 0 + + water_left = left == WATER + water_right = right == WATER + water_up_left = up_left == WATER + water_up_right = up_right == WATER + water_down_left = down_left == WATER + water_down_right = down_right == WATER + water_down = down == WATER + + lava_left = left == LAVA + lava_right = right == LAVA + lava_up_left = up_left == LAVA + lava_up_right = up_right == LAVA + lava_down_left = down_left == LAVA + lava_down_right = down_right == LAVA + lava_down = down == LAVA + + liquid_left = water_left or lava_left + liquid_right = water_right or lava_right + liquid_up_left = water_up_left or lava_up_left + liquid_up_right = water_up_right or lava_up_right + liquid_down_left = water_down_left or lava_down_left + liquid_down_right = water_down_right or lava_down_right + liquid_down = water_down or lava_down + + solid_left = has_left and not liquid_left + solid_right = has_right and not liquid_right + solid_down = has_down and not liquid_down + solid_down_left = has_down_left and not liquid_down_left + solid_down_right = has_down_right and not liquid_down_right + + tile_id = 0 + if color == DIRT: + if solid_left and solid_right and solid_down and solid_down_left and solid_down_right: + if left == GRASS: + tile_id = 132 + elif right == GRASS: + tile_id = 133 + elif left == GRASS2: + tile_id = 134 + elif right == GRASS2: + tile_id = 135 + else: + tile_id = self.rand(136, 159) + elif solid_left and solid_right and solid_down and solid_down_left and liquid_down_right: + tile_id = 101 if water_down_right else 103 if lava_down_right else 0 + elif solid_left and solid_right and solid_down and solid_down_right and liquid_down_left: + tile_id = 100 if water_down_left else 102 if lava_down_left else 0 + elif solid_left and solid_right and solid_down and has_down_left and not has_down_right: + tile_id = 117 if water_right else 119 if lava_right else 86 + elif solid_left and solid_right and solid_down and not has_down_left and has_down_right: + tile_id = 116 if water_left else 118 if lava_left else 85 + elif solid_left and solid_down: + if water_right: + tile_id = 117 if water_up_right else 129 + elif lava_right: + tile_id = 119 if lava_up_right else 131 + else: + tile_id = 87 + elif solid_right and solid_down: + if water_left: + tile_id = 116 if water_up_left else 128 + elif lava_left: + tile_id = 118 if lava_up_left else 130 + else: + tile_id = 84 + elif solid_left and solid_right: + tile_id = self.rand(21, 22) if water_down else self.rand(25, 26) if lava_down else self.rand(5, 6) + elif solid_left: + tile_id = 23 if water_down else 27 if lava_down else 7 + elif solid_right: + tile_id = 20 if water_down else 24 if lava_down else 4 + elif color == GRASS: + if has_left and has_right and not liquid_left and not liquid_right: + tile_id = self.rand(81, 82) + elif has_left and not liquid_left: + tile_id = 109 if water_up_right else 111 if lava_up_right else 113 if water_right else 115 if lava_right else 83 + elif water_up_left: + tile_id = 108 + elif lava_up_left: + tile_id = 110 + elif water_left: + tile_id = 112 + elif lava_left: + tile_id = 114 + else: + tile_id = 80 + elif color == GRASS2: + if has_left and has_right and not liquid_left and not liquid_right: + tile_id = self.rand(97, 98) + elif has_left and not liquid_left: + tile_id = 121 if water_up_right else 123 if lava_up_right else 125 if water_right else 127 if lava_right else 99 + elif water_up_left: + tile_id = 120 + elif lava_up_left: + tile_id = 122 + elif water_left: + tile_id = 124 + elif lava_left: + tile_id = 126 + else: + tile_id = 96 + elif color == WATER: + tile_id = 8 if self.get_pixel(self.overlay_pixels, col, row - 1) == WHITE and self.get_pixel(self.level_pixels, col, row - 1) != DIRT else 12 + elif color == LAVA: + tile_id = 9 if self.get_pixel(self.overlay_pixels, col, row - 1) == WHITE and self.get_pixel(self.level_pixels, col, row - 1) != DIRT else 13 + elif color == WOODEN_CRATE: + tile_id = 52 + elif color == STEEL_CRATE: + tile_id = 53 + + if self.get_pixel(self.level_pixels, col, row) == WHITE and tile_id == 0 and not overlay_pass and down in (DIRT, GRASS): + self.object_counter -= 1 + if self.object_counter <= 0 and down_left != 0 and down_right != 0: + tile_id = self.rand(68, 75) + self.object_counter = self.rand(5, 11) + return tile_id + + def solid_at(self, col: int, row: int) -> bool: + if col < 0 or row < 0 or col >= self.width or row >= self.height: + return True + color = self.get_layer_tile(col, row, include_objects=True) + return color in (GRASS, GRASS2, DIRT, WOODEN_CRATE, STEEL_CRATE) + + def solid_at_pixel(self, x: float, y: float) -> bool: + return self.solid_at(int(x) // config.BLOCK_SIZE, int(y) // config.BLOCK_SIZE) + + def break_tile_at_pixel(self, x: float, y: float) -> None: + col = int(x) // config.BLOCK_SIZE + row = int(y) // config.BLOCK_SIZE + if 0 <= col < self.width and 0 <= row < self.height and self.get_layer_tile(col, row, include_objects=True) == WOODEN_CRATE: + self.tiles[row][col] = 0 + self.level_pixels.set_at((col, row), (255, 255, 255, 255)) + + def solid_rects_near(self, rect: pygame.Rect) -> list[pygame.Rect]: + left = max(0, rect.left // config.BLOCK_SIZE - 1) + right = min(self.width - 1, rect.right // config.BLOCK_SIZE + 1) + top = max(0, rect.top // config.BLOCK_SIZE - 1) + bottom = min(self.height - 1, rect.bottom // config.BLOCK_SIZE + 1) + rects: list[pygame.Rect] = [] + for row in range(top, bottom + 1): + for col in range(left, right + 1): + if self.solid_at(col, row): + rects.append(pygame.Rect(col * config.BLOCK_SIZE, row * config.BLOCK_SIZE, config.BLOCK_SIZE, config.BLOCK_SIZE)) + return rects + + def draw(self, surface: pygame.Surface, camera: Camera) -> None: + start_col = max(0, int(camera.x) // config.BLOCK_SIZE) + end_col = min(self.width, (int(camera.x) + config.WIDTH) // config.BLOCK_SIZE + 2) + start_row = max(0, int(camera.y) // config.BLOCK_SIZE) + end_row = min(self.height, (int(camera.y) + config.HEIGHT) // config.BLOCK_SIZE + 2) + for row in range(start_row, end_row): + for col in range(start_col, end_col): + tile_id = self.tiles[row][col] + if 0 < tile_id < len(self.tile_frames): + surface.blit( + self.tile_frames[tile_id], + (col * config.BLOCK_SIZE - round(camera.x), row * config.BLOCK_SIZE - round(camera.y)), + )