STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
229595
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2595 · P5190

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/30487763?noj=FRM30487763-22DC" width="1" height="1"></div>

virus.swf

This is the info page for
Flash #47826

(Click the ID number above for more basic data on this flash file.)


Text
FPS:

<p align="right"></p>

WAVE

<p align="right"></p>

<p align="right"></p>

<p align="right"></p>

<p align="right"></p>

Use the mouse to shoot enemies.
If they reach the bottom, you lose life.

Use the mouse to shoot enemies.
If they reach the bottom, you lose life.

When you get a bomb, press '1', '2', or '3' to fire it at the cursor.
1 - Destroy enemies
2 - Destroy hexes
3 - Freeze enemies
Hint: Multipliers and health regen can only be obtained by using bombs.
"P" pauses the game, "M" mutes audio.

[ CLICK TO CONTINUE ]

splash screen placeholder

GAME PAUSED

GAME OVER

HIGH SCORE DETECTED

Please enter your user identification

>

[CLICK TO CONTINUE]

> access high_scores +r
Accessing... scores loaded.
> display scores(10) > sort
Displaying scores... done.

[VIRUS] HIGH SCORES

<p align="center"><font face="Isonorm" size="18" color="#ffffff" letterSpacing="2.000000" kerning="0">SPONSORED BY</font></p>

sP0N5oR3D BY

<p align="center"><font face="Isonorm" size="22" color="#ffffff" letterSpacing="0.000000" kerning="1">font embed</font></p>

SOUND : ON

SOUND : OFF

PLAY GAME

PLAY MORE GAMES AT

HIGH SCORES

Developed by Diffusion Games - www.difFusiongames.com

v1.0

ActionScript [AS3]

Section 1
//RandomUtils (math.RandomUtils) package math { public class RandomUtils { public static function random_range(_arg1:Number, _arg2:Number):Number{ return ((_arg1 + ((_arg2 - _arg1) * Math.random()))); } public static function get_orient_angle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; _local5 = (_arg3 - _arg1); _local6 = (_arg4 - _arg2); _local7 = ((_local5 * _local5) + (_local6 * _local6)); if (_local7 > 0.001){ _local7 = Math.sqrt(_local7); _local5 = (_local5 / _local7); _local6 = (_local6 / _local7); _local8 = ((Math.atan2(_local6, _local5) - (Math.PI * 0.5)) * (180 / Math.PI)); return (_local8); }; return (0); } } }//package math
Section 2
//Vector2D (math.Vector2D) package math { public class Vector2D { public var x:Number; public var y:Number; public function Vector2D(_arg1:Number=0, _arg2:Number=0){ x = _arg1; y = _arg2; } public function set(_arg1:Number, _arg2:Number){ x = _arg1; y = _arg2; } public function normalize():void{ var _local1:*; _local1 = Math.sqrt(((x * x) + (y * y))); if (Math.abs(_local1) > 1E-6){ x = (x / _local1); y = (y / _local1); } else { x = 1; y = 0; }; } public static function random_vector_2D():Vector2D{ var _local1:Vector2D; _local1 = new Vector2D(((Math.random() * 2) - 1), ((Math.random() * 2) - 1)); _local1.normalize(); return (_local1); } public static function distance_2D(_arg1:Vector2D, _arg2:Vector2D):Number{ var _local3:Number; var _local4:Number; _local3 = (_arg2.x - _arg1.x); _local4 = (_arg2.y - _arg1.y); return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4)))); } } }//package math
Section 3
//IntUtil (utils.IntUtil) package utils { public class IntUtil { private static var hexChars:String = "0123456789abcdef"; public static function toHex(_arg1:int, _arg2:Boolean=false):String{ var _local3:String; var _local4:int; var _local5:int; _local3 = ""; if (_arg2){ _local4 = 0; while (_local4 < 4) { _local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15)))); _local4++; }; } else { _local5 = 0; while (_local5 < 4) { _local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15)))); _local5++; }; }; return (_local3); } public static function ror(_arg1:int, _arg2:int):uint{ var _local3:int; _local3 = (32 - _arg2); return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3)))); } public static function rol(_arg1:int, _arg2:int):int{ return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2)))); } } }//package utils
Section 4
//MD5 (utils.MD5) package utils { public class MD5 { private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } private static function createBlocks(_arg1:String):Array{ var _local2:Array; var _local3:int; var _local4:int; var _local5:int; _local2 = new Array(); _local3 = (_arg1.length * 8); _local4 = 0xFF; _local5 = 0; while (_local5 < _local3) { _local2[(_local5 >> 5)] = (_local2[(_local5 >> 5)] | ((_arg1.charCodeAt((_local5 / 8)) & _local4) << (_local5 % 32))); _local5 = (_local5 + 8); }; _local2[(_local3 >> 5)] = (_local2[(_local3 >> 5)] | (128 << (_local3 % 32))); _local2[((((_local3 + 64) >>> 9) << 4) + 14)] = _local3; return (_local2); } private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } private static function f(_arg1:int, _arg2:int, _arg3:int):int{ return (((_arg1 & _arg2) | (~(_arg1) & _arg3))); } private static function g(_arg1:int, _arg2:int, _arg3:int):int{ return (((_arg1 & _arg3) | (_arg2 & ~(_arg3)))); } private static function h(_arg1:int, _arg2:int, _arg3:int):int{ return (((_arg1 ^ _arg2) ^ _arg3)); } private static function i(_arg1:int, _arg2:int, _arg3:int):int{ return ((_arg2 ^ (_arg1 | ~(_arg3)))); } private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{ var _local9:int; _local9 = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8); return ((IntUtil.rol(_local9, _arg7) + _arg3)); } private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } public static function hash(_arg1:String):String{ var _local2:int; var _local3:int; var _local4:int; var _local5:int; var _local6:int; var _local7:int; var _local8:int; var _local9:int; var _local10:Array; var _local11:int; var _local12:int; _local2 = 1732584193; _local3 = -271733879; _local4 = -1732584194; _local5 = 271733878; _local10 = createBlocks(_arg1); _local11 = _local10.length; _local12 = 0; while (_local12 < _local11) { _local6 = _local2; _local7 = _local3; _local8 = _local4; _local9 = _local5; _local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 7, -680876936); _local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 1)], 12, -389564586); _local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 17, 606105819); _local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 3)], 22, -1044525330); _local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 7, -176418897); _local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 5)], 12, 1200080426); _local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 17, -1473231341); _local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 7)], 22, -45705983); _local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 7, 1770035416); _local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 9)], 12, -1958414417); _local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 17, -42063); _local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 11)], 22, -1990404162); _local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 7, 1804603682); _local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 13)], 12, -40341101); _local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 17, -1502002290); _local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 15)], 22, 1236535329); _local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 5, -165796510); _local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 6)], 9, -1069501632); _local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 14, 643717713); _local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 0)], 20, -373897302); _local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 5, -701558691); _local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 10)], 9, 38016083); _local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 14, -660478335); _local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 4)], 20, -405537848); _local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 5, 568446438); _local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 14)], 9, -1019803690); _local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 14, -187363961); _local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 8)], 20, 1163531501); _local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 5, -1444681467); _local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 2)], 9, -51403784); _local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 14, 1735328473); _local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 12)], 20, -1926607734); _local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 4, -378558); _local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 8)], 11, -2022574463); _local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 16, 1839030562); _local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 14)], 23, -35309556); _local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 4, -1530992060); _local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 4)], 11, 1272893353); _local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 16, -155497632); _local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 10)], 23, -1094730640); _local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 4, 681279174); _local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 0)], 11, -358537222); _local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 16, -722521979); _local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 6)], 23, 76029189); _local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 4, -640364487); _local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 12)], 11, -421815835); _local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 16, 530742520); _local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 2)], 23, -995338651); _local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 6, -198630844); _local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 7)], 10, 1126891415); _local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 15, -1416354905); _local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 5)], 21, -57434055); _local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 6, 1700485571); _local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 3)], 10, -1894986606); _local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 15, -1051523); _local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 1)], 21, -2054922799); _local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 6, 1873313359); _local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 15)], 10, -30611744); _local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 15, -1560198380); _local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 13)], 21, 1309151649); _local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 6, -145523070); _local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 11)], 10, -1120210379); _local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 15, 718787259); _local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 9)], 21, -343485551); _local2 = (_local2 + _local6); _local3 = (_local3 + _local7); _local4 = (_local4 + _local8); _local5 = (_local5 + _local9); _local12 = (_local12 + 16); }; return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5))); } private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } } }//package utils
Section 5
//ArmorPreloadScreen (Virus.ArmorPreloadScreen) package Virus { import flash.events.*; import flash.display.*; import flash.net.*; public class ArmorPreloadScreen extends IScreen { var spawned_url:Boolean; var menu_clip:MovieClip; override public function update(_arg1:Number):void{ if (menu_clip.currentFrame >= 175){ dynamic_transition_desired = IScreen.IS_MAIN_MENU; }; } override public function mouse_down_handler(_arg1:MouseEvent):void{ if (spawned_url == false){ spawned_url = true; navigateToURL(new URLRequest("http://www.gamegarage.co.uk"), "_blank"); }; } override public function get_id():int{ return (IScreen.IS_ARMOR_PRELOAD); } override public function exit_screen():void{ Application.get_singleton().layer_menu.removeChild(menu_clip); menu_clip = null; } override public function enter_screen():void{ menu_clip = new armor_splash(); menu_clip.x = 300; menu_clip.y = 300; Application.get_singleton().layer_menu.addChild(menu_clip); spawned_url = false; } } }//package Virus
Section 6
//ClusterBrain (Virus.ClusterBrain) package Virus { import math.*; public class ClusterBrain extends IBrain { override public function calculate_next_target(_arg1:Vector2D, _arg2:Vector2D):void{ var _local3:Number; var _local4:Number; _local3 = Math.random(); _local4 = 0; _local4 = 200; _arg2.x = (_arg1.x + ((Math.random() * 200) - 100)); if (_arg2.x < 25){ _arg2.x = 25; }; if (_arg2.y > 575){ _arg2.y = 575; }; _arg2.y = (_arg1.y + _local4); } } }//package Virus
Section 7
//ClusterEnemy (Virus.ClusterEnemy) package Virus { import math.*; public class ClusterEnemy extends IEnemy { override public function update(_arg1:Number):void{ super.update(_arg1); } override public function initialize():void{ clip_data = new EnemyCluster(); move_speed = 75; damage_archetype_id = 1; spline_interpolate = true; brain = new ClusterBrain(); arbitrary_rotation = true; rotation_speed = RandomUtils.random_range(-200, 200); super.initialize(); } override public function destroy():void{ super.destroy(); } } }//package Virus
Section 8
//ClusterSpawnBrain (Virus.ClusterSpawnBrain) package Virus { import math.*; public class ClusterSpawnBrain extends IBrain { override public function calculate_next_target(_arg1:Vector2D, _arg2:Vector2D):void{ var _local3:Number; var _local4:Number; _local3 = Math.random(); _local4 = 0; _local4 = 200; _arg2.x = (_arg1.x + ((Math.random() * 200) - 100)); if (_arg2.x < 25){ _arg2.x = 25; }; if (_arg2.y > 575){ _arg2.y = 575; }; _arg2.y = (_arg1.y + _local4); } } }//package Virus
Section 9
//ClusterSpawnEnemy (Virus.ClusterSpawnEnemy) package Virus { public class ClusterSpawnEnemy extends IEnemy { override public function initialize():void{ clip_data = new EnemyClusterSpawn(); move_speed = 50; damage_archetype_id = 2; spline_interpolate = true; brain = new ClusterSpawnBrain(); arbitrary_rotation = false; super.initialize(); } } }//package Virus
Section 10
//CollisionUtils (Virus.CollisionUtils) package Virus { public class CollisionUtils { public static function ray_box_collide(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):Number{ var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:*; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; _local9 = -10000000; _local10 = 10000000; _local11 = (_arg5 - _arg1); _local12 = (_arg6 - _arg2); _local15 = 0; _local16 = _local11; _local17 = _arg3; if (Math.abs(_local17) > 1E-8){ _local13 = ((_local16 + _arg7) / _local17); _local14 = ((_local16 - _arg7) / _local17); if (_local13 > _local14){ _local15 = _local13; _local13 = _local14; _local14 = _local15; }; if (_local13 > _local9){ _local9 = _local13; }; if (_local14 < _local10){ _local10 = _local14; }; if (_local9 > _local10){ return (-1); }; if (_local10 < 0){ return (-1); }; } else { if (((((-(_local16) - _arg7) > 0)) || (((-(_local16) + _arg7) < 0)))){ return (-1); }; }; _local16 = _local12; _local17 = _arg4; if (Math.abs(_local17) > 1E-8){ _local13 = ((_local16 + _arg8) / _local17); _local14 = ((_local16 - _arg8) / _local17); if (_local13 > _local14){ _local15 = _local13; _local13 = _local14; _local14 = _local15; }; if (_local13 > _local9){ _local9 = _local13; }; if (_local14 < _local10){ _local10 = _local14; }; if (_local9 > _local10){ return (-1); }; if (_local10 < 0){ return (-1); }; } else { if (((((-(_local16) - _arg8) > 0)) || (((-(_local16) + _arg8) < 0)))){ return (-1); }; }; if (_local9 > 0){ return (_local9); }; return (_local10); } public static function box_overlap_2D(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):Boolean{ var _local9:Boolean; var _local10:Boolean; var _local11:*; var _local12:*; var _local13:*; var _local14:*; var _local15:*; var _local16:*; var _local17:*; var _local18:*; _local9 = false; _local10 = false; _local11 = (_arg1 - (_arg3 * 0.5)); _local12 = (_arg1 + (_arg3 * 0.5)); _local13 = (_arg2 - (_arg4 * 0.5)); _local14 = (_arg2 + (_arg4 * 0.5)); _local15 = (_arg5 - (_arg7 * 0.5)); _local16 = (_arg5 + (_arg7 * 0.5)); _local17 = (_arg6 - (_arg8 * 0.5)); _local18 = (_arg6 + (_arg8 * 0.5)); if ((((_local11 > _local15)) && ((_local11 < _local16)))){ _local9 = true; } else { if ((((_local12 > _local15)) && ((_local12 < _local16)))){ _local9 = true; } else { if ((((_local15 > _local11)) && ((_local15 < _local12)))){ _local9 = true; } else { if ((((_local16 > _local11)) && ((_local16 < _local12)))){ _local9 = true; }; }; }; }; if ((((_local13 > _local17)) && ((_local13 < _local18)))){ _local10 = true; } else { if ((((_local14 > _local17)) && ((_local14 < _local18)))){ _local10 = true; } else { if ((((_local17 > _local13)) && ((_local17 < _local14)))){ _local10 = true; } else { if ((((_local18 > _local13)) && ((_local18 < _local14)))){ _local10 = true; }; }; }; }; return (((_local9) && (_local10))); } } }//package Virus
Section 11
//DamageArchetype (Virus.DamageArchetype) package Virus { public class DamageArchetype { var AOE_amount:Number; var name:String; var damage_glow_color:uint; var enemy_spawn_count:int; var enemy_spawn_type:int; var spawn_AOE_damage:Boolean; var AOE_radius:Number; var damage_particles:Boolean; var death_particles:Boolean; var damage_particle_id:int; var death_particle_id:int; var damage_glow:Boolean; var damage_glow_time:int; var spawn_enemies:Boolean; var total_health:Number; var spawn_debris:Boolean; } }//package Virus
Section 12
//DamageData (Virus.DamageData) package Virus { public class DamageData { static var DCT_PLAYER:int = 0; static var DCT_ENEMY:int = 1; } }//package Virus
Section 13
//DamageEvent (Virus.DamageEvent) package Virus { public class DamageEvent { public var npc:IEnemy; public var position_y:Number; public var position_x:Number; public var hp_amount:int; public static var TYPE_AOE:int = 1; public static var TYPE_PROJECTILE:int = 0; } }//package Virus
Section 14
//DamageInstance (Virus.DamageInstance) package Virus { import math.*; import flash.filters.*; public class DamageInstance { var parent_ptr:IEnemy; var current_health:Number; var death_pending:Boolean; var glow_counter:int; var damage_pending:Boolean; var damage_archetype:DamageArchetype; var glow_time:int; static var temp_vd:Vector2D = new Vector2D(); public function DamageInstance(){ damage_pending = false; death_pending = false; glow_time = 0; } public function update(_arg1:Number):void{ var _local2:int; var _local3:IEnemy; var _local4:GlowFilter; if (damage_pending == true){ damage_pending = false; if (damage_archetype.damage_particles){ ParticleManager.PTR.create_particle_system(damage_archetype.damage_particle_id, parent_ptr.position.x, parent_ptr.position.y); }; }; if (death_pending == true){ if (damage_archetype.death_particles){ ParticleManager.PTR.create_particle_system(damage_archetype.death_particle_id, parent_ptr.position.x, parent_ptr.position.y); }; if (damage_archetype.spawn_debris){ HexGrid.PTR.activate_hex(parent_ptr.position.x, parent_ptr.position.y); }; if (damage_archetype.spawn_enemies){ _local2 = 0; while (_local2 < damage_archetype.enemy_spawn_count) { _local3 = Populator.PTR.spawn_npc(damage_archetype.enemy_spawn_type); temp_vd = Vector2D.random_vector_2D(); _local3.spline.points[0].x = parent_ptr.position.x; _local3.spline.points[0].y = parent_ptr.position.y; _local3.spline.points[1].x = (parent_ptr.position.x + (temp_vd.x * 30)); _local3.spline.points[1].y = (parent_ptr.position.y + (temp_vd.x * 30)); _local3.spline.points[2].x = (parent_ptr.position.x + (temp_vd.x * 100)); _local3.spline.points[2].y = ((parent_ptr.position.y + 100) + (temp_vd.y * 100)); _local3.spline.points[3].x = (parent_ptr.position.x + (temp_vd.x * 200)); _local3.spline.points[3].y = (parent_ptr.position.y + 150); _local3.spline.initialize(); _local2++; }; }; SoundManager.PTR.sfx_event(SoundManager.SM_NPC_DEATH); }; if (glow_counter > 0){ glow_counter--; if (glow_counter > 0){ _local4 = new GlowFilter(); _local4.alpha = (glow_counter / glow_time); _local4.quality = BitmapFilterQuality.LOW; _local4.strength = 3; _local4.blurX = 15; _local4.blurY = 15; _local4.color = damage_archetype.damage_glow_color; parent_ptr.clip_data.filters = new Array(_local4); } else { parent_ptr.clip_data.filters = null; }; }; } public function initialize(_arg1:DamageArchetype, _arg2:IEnemy){ parent_ptr = _arg2; damage_archetype = _arg1; current_health = damage_archetype.total_health; } public function process_damage_event(_arg1:DamageEvent):void{ current_health = (current_health - _arg1.hp_amount); damage_pending = true; if (current_health < 0){ death_pending = true; current_health = 0; }; if (damage_archetype.damage_glow){ glow_time = damage_archetype.damage_glow_time; glow_counter = glow_time; }; } } }//package Virus
Section 15
//DamageSystem (Virus.DamageSystem) package Virus { public class DamageSystem implements IGameSystem { var archetype_list:Array; static var PTR:DamageSystem; public function update(_arg1:Number):void{ var _local2:Boolean; } public function initialize():void{ var _local1:DamageArchetype; archetype_list = new Array(); _local1 = new DamageArchetype(); _local1.name = "ZipperEnemy"; _local1.total_health = 10; _local1.damage_glow = true; _local1.damage_glow_color = 0xFF; _local1.damage_glow_time = 6; _local1.death_particles = true; _local1.death_particle_id = 0; archetype_list.push(_local1); _local1 = new DamageArchetype(); _local1.name = "ClusterEnemy"; _local1.total_health = 150; _local1.damage_glow = true; _local1.damage_glow_color = 0xFF0000; _local1.damage_glow_time = 8; _local1.death_particles = true; _local1.death_particle_id = 0; _local1.spawn_debris = true; _local1.spawn_enemies = true; _local1.enemy_spawn_type = NPCDatabase.NT_CLUSTER_SPAWN; _local1.enemy_spawn_count = 3; archetype_list.push(_local1); _local1 = new DamageArchetype(); _local1.name = "ClusterEnemySpawn"; _local1.total_health = 10; _local1.damage_glow = true; _local1.damage_glow_color = 0xFFFFFF; _local1.damage_glow_time = 7; _local1.death_particles = true; _local1.death_particle_id = 1; archetype_list.push(_local1); } public function destroy():void{ } public function get_damage_instance(_arg1:int, _arg2:IEnemy):DamageInstance{ var _local3:DamageInstance; if (_arg1 < archetype_list.length){ _local3 = new DamageInstance(); _local3.initialize(archetype_list[_arg1], _arg2); return (_local3); }; return (null); } } }//package Virus
Section 16
//DarterBrain (Virus.DarterBrain) package Virus { import math.*; public class DarterBrain extends IBrain { override public function calculate_next_target(_arg1:Vector2D, _arg2:Vector2D):void{ var _local3:Number; var _local4:Number; _local3 = Math.random(); _local4 = 0; _local4 = 200; _arg2.x = (_arg1.x + ((Math.random() * 50) - 25)); if (_arg2.x < 25){ _arg2.x = 25; }; if (_arg2.y > 575){ _arg2.y = 575; }; _arg2.y = (_arg1.y + _local4); } } }//package Virus
Section 17
//DarterEnemy (Virus.DarterEnemy) package Virus { public class DarterEnemy extends IEnemy { override public function update(_arg1:Number):void{ super.update(_arg1); } override public function initialize():void{ clip_data = new EnemyDarter(); move_speed = 250; damage_archetype_id = 0; spline_interpolate = true; brain = new DarterBrain(); super.initialize(); } override public function destroy():void{ super.destroy(); } } }//package Virus
Section 18
//EnterScoreScreen (Virus.EnterScoreScreen) package Virus { import flash.events.*; import flash.display.*; import flash.ui.*; public class EnterScoreScreen extends IScreen { var menu_clip:MovieClip; override public function update(_arg1:Number):void{ } override public function key_down_handler(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == Keyboard.ENTER){ Application.get_singleton().score_API.submit_score(menu_clip.name_input.text, ScoreManager.PTR.get_score()); dynamic_transition_desired = IScreen.IS_DISPLAY_SCORES; }; } override public function get_id():int{ return (IScreen.IS_ENTER_SCORE); } override public function exit_screen():void{ Application.get_singleton().layer_menu.removeChild(menu_clip); menu_clip = null; } override public function enter_screen():void{ menu_clip = new EnterScoreMenu(); menu_clip.x = 0; menu_clip.y = 0; Application.get_singleton().layer_menu.addChild(menu_clip); menu_clip.name_input.restrict = "A-Z a-z 0-9 _"; dynamic_transition_desired = -1; } } }//package Virus
Section 19
//FleaBrain (Virus.FleaBrain) package Virus { import math.*; public class FleaBrain extends IBrain { override public function calculate_next_target(_arg1:Vector2D, _arg2:Vector2D):void{ var _local3:Number; var _local4:Number; _local3 = Math.random(); _local4 = 0; if (_local3 < 0.9){ _local4 = 200; _arg2.x = (_arg1.x + ((Math.random() * 200) - 100)); if (_arg2.x < 25){ _arg2.x = 25; }; if (_arg2.y > 575){ _arg2.y = 575; }; _arg2.y = (_arg1.y + _local4); } else { _local4 = ((Math.random() * 50) + 100); if (_arg1.x < 300){ _arg2.x = (_arg1.x + (150 + (Math.random() * 100))); } else { _arg2.x = (_arg1.x - (150 + (Math.random() * 100))); }; _arg2.y = (_arg1.y + _local4); }; } } }//package Virus
Section 20
//FleaEnemy (Virus.FleaEnemy) package Virus { public class FleaEnemy extends IEnemy { override public function update(_arg1:Number):void{ HexGrid.PTR.activate_hex(clip_data.x, clip_data.y); super.update(_arg1); } override public function initialize():void{ clip_data = new EnemyFlea(); move_speed = 100; damage_archetype_id = 0; spline_interpolate = true; brain = new FleaBrain(); super.initialize(); } override public function destroy():void{ super.destroy(); } } }//package Virus
Section 21
//Game (Virus.Game) package Virus { import flash.events.*; import flash.ui.*; public class Game extends IScreen { var pause_splash:PauseSplash; var player:Player; var game_paused:Boolean; var game_over_splash:GameOverSplash; var system_list:Array; var game_over_counter:int; override public function mouse_up_handler(_arg1:MouseEvent):void{ player.mouse_event(_arg1); } override public function update(_arg1:Number):void{ var _local2:int; if (game_over_counter > 0){ game_over_counter--; if (game_over_counter <= 10){ shutdown_systems(); if (Application.get_singleton().score_API.is_score_valid(ScoreManager.PTR.get_score())){ dynamic_transition_desired = IScreen.IS_ENTER_SCORE; } else { dynamic_transition_desired = IScreen.IS_DISPLAY_SCORES; }; return; }; }; if (game_paused){ return; }; _local2 = 0; while (_local2 < system_list.length) { system_list[_local2].update(_arg1); _local2++; }; ScoreManager.PTR.update(_arg1); player.update(_arg1); if (ScoreManager.PTR.health <= 0){ game_paused = true; game_over_counter = 150; game_over_splash = new GameOverSplash(); Application.get_singleton().layer_interface.addChild(game_over_splash); SoundManager.PTR.music_fade_out(); SoundManager.PTR.sfx_event(SoundManager.SM_GAME_OVER); Application.get_singleton().score_API.gg_submit_score(ScoreManager.PTR.get_score()); Application.get_singleton().score_API.retrieve_scores(); }; } override public function mouse_left_window():void{ } override public function mouse_enter_window():void{ } override public function key_down_handler(_arg1:KeyboardEvent):void{ var _local2:Boolean; player.keydown_event(_arg1); if (_arg1.keyCode == 80){ game_paused = !(game_paused); if (game_paused){ pause_splash = new PauseSplash(); Application.get_singleton().layer_interface.addChild(pause_splash); } else { Application.get_singleton().layer_interface.removeChild(pause_splash); pause_splash = null; }; } else { if (_arg1.keyCode == 77){ _local2 = SoundManager.PTR.sound_enabled; SoundManager.PTR.enable_sound(!(_local2)); }; }; } override public function mouse_down_handler(_arg1:MouseEvent):void{ player.mouse_event(_arg1); } override public function get_id():int{ return (IScreen.IS_PLAYING_GAME); } override public function exit_screen():void{ if (game_over_splash){ Application.get_singleton().layer_interface.removeChild(game_over_splash); game_over_splash = null; }; } override public function enter_screen():void{ var _local1:int; Application.get_singleton().score_API.gg_tracking(); system_list = new Array(); WarpBackground.PTR = new WarpBackground(); system_list.push(WarpBackground.PTR); MessageBoard.PTR = new MessageBoard(); system_list.push(MessageBoard.PTR); GameUI.PTR = new GameUI(); system_list.push(GameUI.PTR); ProjectileManager.PTR = new ProjectileManager(); system_list.push(ProjectileManager.PTR); ParticleManager.PTR = new ParticleManager(); system_list.push(ParticleManager.PTR); PlayerInterface.PTR = new PlayerInterface(); system_list.push(PlayerInterface.PTR); DamageSystem.PTR = new DamageSystem(); system_list.push(DamageSystem.PTR); HexGrid.PTR = new HexGrid(); system_list.push(HexGrid.PTR); Populator.PTR = new Populator(); system_list.push(Populator.PTR); _local1 = 0; while (_local1 < system_list.length) { system_list[_local1].initialize(); _local1++; }; ScoreManager.PTR.initialize(); game_paused = false; game_over_counter = 0; player = new Player(); player.initialize(); Mouse.hide(); dynamic_transition_desired = -1; SoundManager.PTR.start_music(1, 0.2); } public function shutdown_systems():void{ var _local1:int; player.destroy(); player = null; Mouse.show(); _local1 = 0; while (_local1 < system_list.length) { system_list[_local1].destroy(); system_list[_local1] = null; _local1++; }; system_list = null; } } }//package Virus
Section 22
//GameUI (Virus.GameUI) package Virus { import flash.filters.*; public class GameUI implements IGameSystem { public var clip_ptr:UIOverlay; var flash_health:Boolean; var flash_bomb:Boolean; var health_counter:int; var bomb_counter:int; public static var PTR:GameUI; public function signal_flash_bomb():void{ flash_bomb = true; } public function update(_arg1:Number):void{ var _local2:GlowFilter; var _local3:Number; var _local4:Number; if (flash_health){ flash_health = false; health_counter = 14; }; if (health_counter > 0){ health_counter--; _local2 = new GlowFilter(); _local2.alpha = (0.5 + (health_counter / 14)); _local2.quality = BitmapFilterQuality.LOW; _local2.strength = (1 + (health_counter / 2)); _local2.blurX = 12; _local2.blurY = 12; _local3 = (1 - (health_counter / 14)); _local4 = (health_counter / 14); _local2.color = (0xFF0000 + ((_local3 * 0xFF) << 8)); clip_ptr.health_icon.filters = new Array(_local2); }; if (flash_bomb){ flash_bomb = false; bomb_counter = 14; }; if (bomb_counter > 0){ bomb_counter--; _local2 = new GlowFilter(); _local2.alpha = (1 + (bomb_counter / 14)); _local2.quality = BitmapFilterQuality.LOW; _local2.strength = (1.5 + (bomb_counter / 2)); _local2.blurX = 12; _local2.blurY = 12; _local2.color = 13311; clip_ptr.bomb_icon.filters = new Array(_local2); }; } public function initialize():void{ clip_ptr = new UIOverlay(); Application.get_singleton().layer_background.addChild(clip_ptr); } public function signal_flash_health():void{ flash_health = true; } public function destroy():void{ Application.get_singleton().layer_background.removeChild(clip_ptr); clip_ptr = null; } } }//package Virus
Section 23
//HexCell (Virus.HexCell) package Virus { import flash.display.*; import flash.filters.*; public class HexCell { var invuln_counter; public var hp:int; public var array_x:int; public var array_y:int; public var clip_data:MovieClip; public var chain_detonate:Boolean; public function HexCell(){ clip_data = new Hex(); clip_data.cacheAsBitmap = true; clip_data.enabled = false; clip_data.mouseEnabled = false; hp = 0; chain_detonate = false; invuln_counter = 0; } public function update(_arg1:Number):Boolean{ var _local2:GlowFilter; _local2 = new GlowFilter(); _local2.alpha = (invuln_counter / 20); _local2.quality = BitmapFilterQuality.LOW; _local2.strength = 4; _local2.blurX = 15; _local2.blurY = 15; _local2.color = 16768511; clip_data.filters = new Array(_local2); invuln_counter--; if (invuln_counter == 0){ clip_data.filters = null; return (false); }; return (true); } public function activate_hex():void{ if (hp == 0){ hp = 3; clip_data.gotoAndStop(hp); invuln_counter = 20; }; } public function is_active():Boolean{ return (!((hp == 0))); } public function notify_hit():void{ if (invuln_counter > 0){ return; }; if (hp == 0){ return; }; hp--; clip_data.gotoAndStop(hp); if (hp == 0){ }; } } }//package Virus
Section 24
//HexGrid (Virus.HexGrid) package Virus { public class HexGrid implements IGameSystem { var hex_origin_x:Number; var hex_origin_y:Number; var neighbor_array_x:Array; var neighbor_array_y:Array; var hex_grid_height:int; var hex_size:Number; var chain_list:Array; var chain_detonate_count:int; var hex_grid_width:int; var check_chain_detonate:Boolean; var hex_array:Array; var update_hex_list:Array; static var PTR:HexGrid; public function HexGrid(){ hex_grid_width = 9; hex_grid_height = 21; hex_size = 20; update_hex_list = new Array(); neighbor_array_x = new Array(6); neighbor_array_y = new Array(6); check_chain_detonate = false; chain_detonate_count = 0; chain_list = new Array(); } public function chain_neighbors(_arg1:int, _arg2:int){ var _local3:int; var _local4:int; var _local5:HexCell; if ((_arg2 & 1) == 0){ neighbor_array_x[0] = (_arg1 - 1); neighbor_array_y[0] = (_arg2 - 1); neighbor_array_x[1] = (_arg1 + 0); neighbor_array_y[1] = (_arg2 - 2); neighbor_array_x[2] = (_arg1 - 0); neighbor_array_y[2] = (_arg2 - 1); neighbor_array_x[3] = (_arg1 + 0); neighbor_array_y[3] = (_arg2 + 1); neighbor_array_x[4] = (_arg1 - 0); neighbor_array_y[4] = (_arg2 + 2); neighbor_array_x[5] = (_arg1 - 1); neighbor_array_y[5] = (_arg2 + 1); } else { neighbor_array_x[0] = (_arg1 + 0); neighbor_array_y[0] = (_arg2 - 1); neighbor_array_x[1] = (_arg1 + 0); neighbor_array_y[1] = (_arg2 - 2); neighbor_array_x[2] = (_arg1 + 1); neighbor_array_y[2] = (_arg2 - 1); neighbor_array_x[3] = (_arg1 + 1); neighbor_array_y[3] = (_arg2 + 1); neighbor_array_x[4] = (_arg1 + 0); neighbor_array_y[4] = (_arg2 + 2); neighbor_array_x[5] = (_arg1 + 0); neighbor_array_y[5] = (_arg2 + 1); }; _local3 = 0; while (_local3 < 6) { if ((((neighbor_array_x[_local3] >= 0)) && ((neighbor_array_x[_local3] < hex_grid_width)))){ if ((((neighbor_array_y[_local3] >= 0)) && ((neighbor_array_y[_local3] < hex_grid_height)))){ _local4 = (neighbor_array_x[_local3] + (neighbor_array_y[_local3] * hex_grid_width)); _local5 = hex_array[_local4]; if (_local5.is_active() == true){ if (_local5.chain_detonate == false){ _local5.chain_detonate = true; }; }; }; }; _local3++; }; } public function get_closest_hex(_arg1:Number, _arg2:Number):HexCell{ var _local3:HexCell; var _local4:Number; var _local5:int; var _local6:int; var _local7:HexCell; var _local8:Number; _local3 = null; _local4 = 1000; _local5 = 0; while (_local5 < hex_grid_height) { _local6 = 0; while (_local6 < hex_grid_width) { _local7 = hex_array[(_local6 + (_local5 * hex_grid_width))]; _local8 = (((_local7.clip_data.x - _arg1) * (_local7.clip_data.x - _arg1)) + ((_local7.clip_data.y - _arg2) * (_local7.clip_data.y - _arg2))); if (_local8 < _local4){ _local3 = _local7; _local4 = _local8; }; _local6++; }; _local5++; }; return (_local3); } public function activate_hex(_arg1:Number, _arg2:Number){ var _local3:HexCell; _local3 = get_closest_hex(_arg1, _arg2); if (_local3){ if (_local3.is_active() == false){ _local3.activate_hex(); update_hex_list.push(_local3); }; }; } public function initialize():void{ var _local1:HexCell; var _local2:int; var _local3:int; var _local4:int; var _local5:int; var _local6:Number; var _local7:Number; _local1 = null; hex_array = new Array((hex_grid_width * hex_grid_height)); hex_origin_x = 50; hex_origin_y = 100; _local2 = 0; _local3 = 0; _local4 = 0; while (_local4 < hex_grid_height) { _local2 = 0; _local5 = 0; while (_local5 < hex_grid_width) { _local1 = new HexCell(); _local6 = (hex_origin_x + ((hex_size * 3) * _local5)); _local7 = (hex_origin_y + (((hex_size * 1.732) * 0.5) * _local4)); if ((_local3 & 1) == 1){ _local6 = (_local6 + (hex_size * 1.5)); }; _local1.array_x = _local2; _local1.array_y = _local3; _local1.clip_data.x = _local6; _local1.clip_data.y = _local7; Application.get_singleton().layer_hexgrid.addChild(_local1.clip_data); hex_array[(_local2 + (_local3 * hex_grid_width))] = _local1; _local5++; _local2++; }; _local4++; _local3++; }; } public function update(_arg1:Number):void{ var _local2:int; var _local3:Boolean; var _local4:int; var _local5:int; var _local6:HexCell; var _local7:int; _local2 = 0; while (_local2 < update_hex_list.length) { if (update_hex_list[_local2].update(_arg1) == false){ if (_local2 != (update_hex_list.length - 1)){ update_hex_list[_local2] = update_hex_list[(update_hex_list.length - 1)]; _local2--; }; update_hex_list.pop(); }; _local2++; }; if (check_chain_detonate){ chain_list.length = 0; _local3 = false; _local4 = 0; while (_local4 < hex_grid_height) { _local5 = 0; while (_local5 < hex_grid_width) { _local6 = hex_array[(_local5 + (_local4 * hex_grid_width))]; if (_local6.chain_detonate){ _local3 = true; _local6.invuln_counter = 0; _local6.notify_hit(); if (_local6.hp == 0){ chain_list.push(_local6); }; }; _local5++; }; _local4++; }; _local4 = 0; while (_local4 < chain_list.length) { chain_neighbors(chain_list[_local4].array_x, chain_list[_local4].array_y); _local4++; }; _local4 = 0; while (_local4 < chain_list.length) { chain_detonate_count++; chain_list[_local4].chain_detonate = false; _local4++; }; if (_local3 == false){ if (chain_detonate_count > 0){ _local7 = (chain_detonate_count / 4); MessageBoard.PTR.add_line((((("Genome detonation. " + chain_detonate_count.toString()) + " cells destroyed. ") + _local7.toString()) + " health regained.")); ScoreManager.PTR.add_score((50 * chain_detonate_count)); ScoreManager.PTR.restore_health(_local7); if (chain_detonate_count > 20){ ScoreManager.PTR.increase_multiplier(int((chain_detonate_count / 20))); }; }; check_chain_detonate = false; chain_detonate_count = 0; }; }; } public function projectile_collide(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{ var _local6:Boolean; var _local7:int; var _local8:int; var _local9:Number; var _local10:int; var _local11:Number; var _local12:int; var _local13:int; var _local14:HexCell; var _local15:Number; var _local16:Number; var _local17:Number; _local6 = false; _local7 = -1; _local8 = -1; _local9 = 0; _local10 = ((_arg1 - hex_origin_x) / (hex_size * 3)); _local11 = (_arg2 + (_arg4 * _arg5)); _local12 = (_local10 - 1); while (_local12 <= (_local10 + 1)) { _local13 = 0; while (_local13 < hex_grid_height) { if ((((_local12 < 0)) || ((_local12 >= hex_grid_width)))){ } else { if ((((_local13 < 0)) || ((_local13 >= hex_grid_height)))){ } else { _local14 = hex_array[(_local12 + (_local13 * hex_grid_width))]; if (_local14.is_active() == false){ } else { _local15 = (_local14.clip_data.x - hex_size); _local16 = (_local14.clip_data.x + hex_size); _local17 = (_local14.clip_data.y + hex_size); if ((((_arg1 >= _local15)) && ((_arg1 <= _local16)))){ if ((((_local17 < _arg2)) && ((_local17 > _local11)))){ if (_local6){ //unresolved if } else { _local6 = true; _local7 = _local12; _local8 = _local13; _local9 = _local17; }; }; }; }; }; }; _local13++; }; _local12++; }; if (_local6){ hex_array[(_local7 + (_local8 * hex_grid_width))].notify_hit(); }; return (_local6); } public function radius_detonate(_arg1:Number, _arg2:Number, _arg3:Number){ var _local4:int; var _local5:Number; var _local6:int; var _local7:int; var _local8:HexCell; var _local9:Number; _local4 = 0; _local5 = (_arg3 * _arg3); _local6 = 0; while (_local6 < hex_grid_height) { _local7 = 0; while (_local7 < hex_grid_width) { _local8 = hex_array[(_local7 + (_local6 * hex_grid_width))]; if (_local8.is_active()){ _local9 = (((_local8.clip_data.x - _arg1) * (_local8.clip_data.x - _arg1)) + ((_local8.clip_data.y - _arg2) * (_local8.clip_data.y - _arg2))); if (_local9 < _local5){ _local8.chain_detonate = true; _local4++; }; }; _local7++; }; _local6++; }; check_chain_detonate = true; } public function destroy():void{ var _local1:int; var _local2:int; var _local3:HexCell; _local1 = 0; while (_local1 < hex_grid_height) { _local2 = 0; while (_local2 < hex_grid_width) { _local3 = hex_array[(_local2 + (_local1 * hex_grid_width))]; Application.get_singleton().layer_hexgrid.removeChild(_local3.clip_data); hex_array[(_local2 + (_local1 * hex_grid_width))] = null; _local2++; }; _local1++; }; hex_array = null; } } }//package Virus
Section 25
//HighScoreScreen (Virus.HighScoreScreen) package Virus { import flash.display.*; public class HighScoreScreen extends IScreen { var menu_clip:MovieClip; var displayed_scores:Boolean; override public function update(_arg1:Number):void{ var _local2:WebScoreAPI; var _local3:int; if (displayed_scores == false){ _local2 = Application.get_singleton().score_API; if (_local2.scores_available() == true){ displayed_scores = true; _local3 = 0; while (_local3 < 9) { menu_clip.score_number.text = (menu_clip.score_number.text + ((_local3 + 1).toString() + ".\n")); menu_clip.score_name.text = (menu_clip.score_name.text + (_local2.hs_names[_local3] + "\n")); menu_clip.score_score.text = (menu_clip.score_score.text + (_local2.hs_scores[_local3].toString() + "\n")); _local3++; }; }; }; } override public function get_id():int{ return (IScreen.IS_DISPLAY_SCORES); } override public function exit_screen():void{ Application.get_singleton().layer_menu.removeChild(menu_clip); menu_clip = null; } override public function enter_screen():void{ menu_clip = new HighScoreMenu(); menu_clip.x = 0; menu_clip.y = 0; Application.get_singleton().layer_menu.addChild(menu_clip); displayed_scores = false; if (Application.get_singleton().score_API.scores_available() == false){ Application.get_singleton().score_API.retrieve_scores(); }; click_transition = IScreen.IS_MAIN_MENU; } } }//package Virus
Section 26
//IBrain (Virus.IBrain) package Virus { import math.*; public class IBrain { public function calculate_next_target(_arg1:Vector2D, _arg2:Vector2D):void{ } } }//package Virus
Section 27
//IEnemy (Virus.IEnemy) package Virus { import math.*; import flash.display.*; public class IEnemy { var rotation_speed:Number; var spline:CRSpline; var spline_interpolate:Boolean; var last_position:Vector2D; var move_speed:Number; var freeze_timer:int; var frozen:Boolean; var damage_archetype_id:int; public var position:Vector2D; var arbitrary_rotation:Boolean; public var bounds_x:Number; public var damage:DamageInstance; var kill_score:int; var current_t:Number; public var bounds_y:Number; public var clip_data:MovieClip; var brain:IBrain; public function update(_arg1:Number):void{ var _local2:Number; var _local3:Number; _local2 = ((move_speed * _arg1) / spline.current_length); if (frozen){ _local2 = (_local2 * 0.1); freeze_timer--; if (freeze_timer <= 0){ frozen = false; freeze_timer = 0; }; }; current_t = (current_t + _local2); if (current_t > 1){ spline.points[0].x = spline.points[1].x; spline.points[0].y = spline.points[1].y; spline.points[1].x = spline.points[2].x; spline.points[1].y = spline.points[2].y; spline.points[2].x = spline.points[3].x; spline.points[2].y = spline.points[3].y; brain.calculate_next_target(last_position, spline.points[3]); current_t = (current_t - 1); spline.initialize(); }; spline.evaluate(current_t, position); if (arbitrary_rotation){ _local3 = (rotation_speed * _arg1); if (frozen){ _local3 = (_local3 * 0.1); }; clip_data.rotation = (clip_data.rotation + _local3); } else { clip_data.rotation = RandomUtils.get_orient_angle(last_position.x, last_position.y, position.x, position.y); }; last_position.x = position.x; last_position.y = position.y; clip_data.x = position.x; clip_data.y = position.y; update_damage(_arg1); } public function initialize():void{ if (!clip_data){ }; Application.get_singleton().layer_objects.addChild(clip_data); current_t = 0; bounds_x = clip_data.width; bounds_y = clip_data.height; spline = new CRSpline(); initialize_position(); spline.initialize(); position = new Vector2D(spline.points[1].x, spline.points[1].y); last_position = new Vector2D(position.x, position.y); damage = DamageSystem.PTR.get_damage_instance(damage_archetype_id, this); if (arbitrary_rotation){ clip_data.rotation = (Math.random() * 360); }; kill_score = 10; } public function freeze():void{ frozen = true; freeze_timer = ((30 * 5) + (Math.random() * 30)); } public function process_damage_event(_arg1:DamageEvent):void{ damage.process_damage_event(_arg1); } public function destroy():void{ spline = null; Application.get_singleton().layer_objects.removeChild(clip_data); clip_data = null; } public function update_damage(_arg1:Number):void{ damage.update(_arg1); } public function initialize_position(){ var _local1:Number; spline_interpolate = true; _local1 = ((Math.random() * 400) + 100); spline.points[0].x = _local1; spline.points[0].y = -150; spline.points[1].x = _local1; spline.points[1].y = -100; spline.points[2].x = _local1; spline.points[2].y = -50; spline.points[3].x = _local1; spline.points[3].y = 50; } } }//package Virus
Section 28
//IGameSystem (Virus.IGameSystem) package Virus { interface IGameSystem { function initialize():void; function update(_arg1:Number):void; function destroy():void; } }//package Virus
Section 29
//InstructionsScreen (Virus.InstructionsScreen) package Virus { import flash.display.*; public class InstructionsScreen extends IScreen { var menu_clip:MovieClip; override public function update(_arg1:Number):void{ } override public function get_id():int{ return (IScreen.IS_INSTRUCTIONS); } override public function exit_screen():void{ SoundManager.PTR.music_fade_out(); Application.get_singleton().layer_menu.removeChild(menu_clip); menu_clip = null; } override public function enter_screen():void{ menu_clip = new ScreenInstructions(); menu_clip.x = -30; menu_clip.y = 0; Application.get_singleton().layer_menu.addChild(menu_clip); click_transition = IScreen.IS_PLAYING_GAME; SoundManager.PTR.start_music(0); } } }//package Virus
Section 30
//MainMenuScreen (Virus.MainMenuScreen) package Virus { import flash.display.*; import flash.filters.*; public class MainMenuScreen extends IScreen { var rotate:Number; var menu_clip:MovieClip; var highlight_target:int; override public function update(_arg1:Number):void{ var _local2:int; var _local3:GlowFilter; rotate = (rotate + (_arg1 * 15)); menu_clip.c1.rotation = (rotate * 1.4); menu_clip.c2.rotation = (rotate * -2.2); menu_clip.c3.rotation = (rotate * -2.57); _local2 = get_clip_at_location(Application.get_singleton().stage.mouseX, Application.get_singleton().stage.mouseY); if (_local2 != highlight_target){ if (highlight_target != -1){ clip_switch_array[highlight_target].filters = null; }; highlight_target = _local2; if (highlight_target != -1){ _local3 = new GlowFilter(); _local3.alpha = 1; _local3.quality = BitmapFilterQuality.MEDIUM; _local3.strength = 3; _local3.blurX = 12; _local3.blurY = 12; _local3.color = 3355647; clip_switch_array[highlight_target].filters = new Array(_local3); }; }; } override public function get_id():int{ return (IScreen.IS_MAIN_MENU); } override public function exit_screen():void{ SoundManager.PTR.music_fade_out(); Application.get_singleton().layer_menu.removeChild(menu_clip); menu_clip = null; } override public function enter_screen():void{ menu_clip = new ScreenMenu(); menu_clip.x = 0; menu_clip.y = 0; Application.get_singleton().layer_menu.addChild(menu_clip); clip_switch_active = true; clip_switch_array = new Array(); clip_switch_target = new Array(); clip_switch_array.push(menu_clip.btn_play_game); clip_switch_target.push(IScreen.IS_INSTRUCTIONS); clip_switch_array.push(menu_clip.btn_more_games); clip_switch_target.push(IScreen.IS_MORE_GAMES); clip_switch_array.push(menu_clip.btn_high_scores); clip_switch_target.push(IScreen.IS_DISPLAY_SCORES); clip_switch_array.push(menu_clip.btn_sound); clip_switch_target.push(IScreen.IS_TOGGLE_SOUND); clip_switch_active = true; rotate = 0; SoundManager.PTR.start_music(0); highlight_target = -1; } } }//package Virus
Section 31
//MessageBoard (Virus.MessageBoard) package Virus { import flash.text.*; import flash.filters.*; public class MessageBoard implements IGameSystem { var board_y:int; var line_count:int; var line_format:TextFormat; var glow_timer:int; var line_pointers:Array; var line_spacing:int; var board_x:int; public static var PTR:MessageBoard; public function MessageBoard(){ line_count = 20; line_spacing = 20; board_x = 30; board_y = 75; line_pointers = new Array(line_count); line_format = new TextFormat(); line_format.font = "Isonorm"; line_format.size = 16; } public function add_line(_arg1:String):void{ var _local2:int; var _local3:int; glow_timer = 20; _local2 = 0; while (_local2 < (line_count - 1)) { line_pointers[_local2].text = line_pointers[(_local2 + 1)].text; if (_local2 < 15){ _local3 = 0; while (_local3 < line_pointers[_local2].text.length) { if (Math.random() < 0.05){ line_pointers[_local2].text = ((line_pointers[_local2].text.substr(0, (_local3 - 1)) + String.fromCharCode(int((Math.random() * 0xFF)))) + line_pointers[_local2].text.substr((_local3 + 1), ((line_pointers[_local2].text.length - 1) - _local3))); }; _local3++; }; }; _local2++; }; line_pointers[(line_count - 1)].text = _arg1; } public function update(_arg1:Number):void{ var _local2:GlowFilter; if (glow_timer > 0){ glow_timer--; if (glow_timer > 0){ _local2 = new GlowFilter(); _local2.alpha = (glow_timer / 20); _local2.strength = 4; _local2.blurX = 15; _local2.blurY = 15; _local2.color = 16729139; line_pointers[(line_count - 1)].filters = new Array(_local2); } else { line_pointers[(line_count - 1)].filters = null; }; }; } public function initialize():void{ var _local1:int; var _local2:TextField; var _local3:uint; _local1 = 0; while (_local1 < line_count) { _local2 = new TextField(); _local2.embedFonts = true; _local2.autoSize = TextFieldAutoSize.LEFT; _local2.defaultTextFormat = line_format; _local2.antiAliasType = AntiAliasType.ADVANCED; _local2.selectable = false; _local2.width = 300; if (_local1 != (line_count - 1)){ _local3 = (128 * (Number(_local1) / 20)); _local2.textColor = ((_local3 | (_local3 << 8)) | (_local3 << 16)); } else { _local2.textColor = 0xFFFFFF; }; _local2.x = board_x; _local2.y = (board_y + (_local1 * line_spacing)); line_pointers[_local1] = _local2; Application.get_singleton().layer_background.addChild(line_pointers[_local1]); _local1++; }; } public function destroy():void{ var _local1:int; _local1 = 0; while (_local1 < line_count) { Application.get_singleton().layer_background.removeChild(line_pointers[_local1]); line_pointers[_local1] = null; _local1++; }; } } }//package Virus
Section 32
//NPCDatabase (Virus.NPCDatabase) package Virus { public class NPCDatabase { static var NT_CLUSTER:int = 1; static var NT_DARTER:int = 4; static var NT_ZIPPER:int = 0; static var NT_FLEA:int = 3; static var NT_CLUSTER_SPAWN:int = 2; public static function create_enemy(_arg1:int):IEnemy{ if (_arg1 == NT_ZIPPER){ return (new ZipperEnemy()); }; if (_arg1 == NT_CLUSTER){ return (new ClusterEnemy()); }; if (_arg1 == NT_CLUSTER_SPAWN){ return (new ClusterSpawnEnemy()); }; if (_arg1 == NT_FLEA){ return (new FleaEnemy()); }; if (_arg1 == NT_DARTER){ return (new DarterEnemy()); }; return (null); } } }//package Virus
Section 33
//Particle (Virus.Particle) package Virus { import math.*; import flash.display.*; public class Particle { var angle:Number; var lifetime:Number; var angle_velocity:Number; var archetype:ParticleArchetype; var current_time:Number; var position:Vector2D; var clip_data:MovieClip; var ready_to_delete:Boolean; var velocity:Vector2D; public function Particle(_arg1:ParticleArchetype){ archetype = _arg1; ready_to_delete = false; lifetime = (archetype.lifetime_min + (Math.random() * (archetype.lifetime_max - archetype.lifetime_min))); current_time = 0; clip_data = ParticleDatabase.get_clip_ptr(_arg1.clip_id); Application.get_singleton().layer_effects.addChild(clip_data); clip_data.cacheAsBitmap = true; clip_data.blendMode = BlendMode.ADD; angle = (Math.random() * 1000); } public function destroy(){ Application.get_singleton().layer_effects.removeChild(clip_data); clip_data = null; } public function update(_arg1:Number){ var _local2:Number; current_time = (current_time + _arg1); if (current_time > lifetime){ ready_to_delete = true; return; }; position.x = (position.x + (velocity.x * _arg1)); position.y = (position.y + (velocity.y * _arg1)); if (archetype.position_jitter){ position.x = (position.x + (archetype.position_jitter_magnitude * ((Math.random() * 2) - 1))); position.y = (position.y + (archetype.position_jitter_magnitude * ((Math.random() * 2) - 1))); }; angle = (angle + (angle_velocity * _arg1)); if (archetype.velocity_damping != 1){ velocity.x = (velocity.x * archetype.velocity_damping); velocity.y = (velocity.y * archetype.velocity_damping); }; _local2 = (current_time / lifetime); if (((!((archetype.scale_start == 1))) || (!((archetype.scale_end == 1))))){ clip_data.scaleX = (archetype.scale_start + (_local2 * (archetype.scale_end - archetype.scale_start))); clip_data.scaleY = clip_data.scaleX; }; clip_data.alpha = (1 - _local2); clip_data.rotation = (angle * 57.2957795130823); clip_data.x = position.x; clip_data.y = position.y; } } }//package Virus
Section 34
//ParticleArchetype (Virus.ParticleArchetype) package Virus { public class ParticleArchetype { var velocity_damping:Number; var lifetime_min:Number; var scale_end:Number; var position_jitter:Boolean; var clip_id:int; var scale_start:Number; var lifetime_max:Number; var position_jitter_magnitude:Number; } }//package Virus
Section 35
//ParticleDatabase (Virus.ParticleDatabase) package Virus { import flash.display.*; public class ParticleDatabase { public static function get_clip_ptr(_arg1:int):MovieClip{ if (_arg1 == 0){ return (new ParticleBlueFlare()); }; if (_arg1 == 1){ return (new ParticlePieces()); }; if (_arg1 == 2){ return (new ParticlePieces2()); }; if (_arg1 == 3){ return (new ParticleCSpawnDeath()); }; if (_arg1 == 4){ return (new ParticleExplosion1()); }; if (_arg1 == 5){ return (new ParticleExplosion2()); }; if (_arg1 == 6){ return (new ParticleStar()); }; if (_arg1 == 7){ return (new ParticleIce()); }; if (_arg1 == 8){ return (new ParticleExplosion3()); }; return (null); } public static function load_data(_arg1:ParticleManager){ var _local2:ParticleArchetype; var _local3:ParticleEmitterArchetype; _local2 = new ParticleArchetype(); _local2.clip_id = 0; _local2.velocity_damping = 0.95; _local2.lifetime_min = 0.5; _local2.lifetime_max = 1.5; _local2.scale_start = 2; _local2.scale_end = 0; _local2.position_jitter = true; _local2.position_jitter_magnitude = 2; _arg1.particle_archetypes.push(_local2); _local2 = new ParticleArchetype(); _local2.clip_id = 1; _local2.velocity_damping = 0.9; _local2.lifetime_min = 0.5; _local2.lifetime_max = 1; _local2.scale_start = 1; _local2.scale_end = 1; _local2.position_jitter = false; _local2.position_jitter_magnitude = 0; _arg1.particle_archetypes.push(_local2); _local2 = new ParticleArchetype(); _local2.clip_id = 2; _local2.velocity_damping = 0.9; _local2.lifetime_min = 0.5; _local2.lifetime_max = 1; _local2.scale_start = 1; _local2.scale_end = 1; _local2.position_jitter = false; _local2.position_jitter_magnitude = 0; _arg1.particle_archetypes.push(_local2); _local2 = new ParticleArchetype(); _local2.clip_id = 3; _local2.velocity_damping = 0.9; _local2.lifetime_min = 0.2; _local2.lifetime_max = 0.5; _local2.scale_start = 1; _local2.scale_end = 1; _local2.position_jitter = false; _local2.position_jitter_magnitude = 0; _arg1.particle_archetypes.push(_local2); _local2 = new ParticleArchetype(); _local2.clip_id = 4; _local2.velocity_damping = 1; _local2.lifetime_min = 0.8; _local2.lifetime_max = 0.8; _local2.scale_start = 1; _local2.scale_end = 1; _local2.position_jitter = false; _local2.position_jitter_magnitude = 0; _arg1.particle_archetypes.push(_local2); _local2 = new ParticleArchetype(); _local2.clip_id = 5; _local2.velocity_damping = 1; _local2.lifetime_min = 0.6; _local2.lifetime_max = 1.4; _local2.scale_start = 0.2; _local2.scale_end = 2; _local2.position_jitter = false; _local2.position_jitter_magnitude = 0; _arg1.particle_archetypes.push(_local2); _local2 = new ParticleArchetype(); _local2.clip_id = 6; _local2.velocity_damping = 1; _local2.lifetime_min = 0.6; _local2.lifetime_max = 0.9; _local2.scale_start = 1.2; _local2.scale_end = 0.4; _local2.position_jitter = false; _local2.position_jitter_magnitude = 0; _arg1.particle_archetypes.push(_local2); _local2 = new ParticleArchetype(); _local2.clip_id = 7; _local2.velocity_damping = 0.9; _local2.lifetime_min = 1; _local2.lifetime_max = 2; _local2.scale_start = 1.5; _local2.scale_end = 0.6; _local2.position_jitter = false; _local2.position_jitter_magnitude = 0; _arg1.particle_archetypes.push(_local2); _local2 = new ParticleArchetype(); _local2.clip_id = 8; _local2.velocity_damping = 0.9; _local2.lifetime_min = 0.7; _local2.lifetime_max = 1.5; _local2.scale_start = 0.7; _local2.scale_end = 1.5; _local2.position_jitter = false; _local2.position_jitter_magnitude = 0; _arg1.particle_archetypes.push(_local2); _local3 = new ParticleEmitterArchetype(); _local3.emit_type = _arg1.particle_archetypes[0]; _local3.emitter_rate = 100; _local3.emitter_total_particles = 6; _local3.velocity_range_min = 30; _local3.velocity_range_max = 200; _local3.angle_velocity_range_min = -5; _local3.angle_velocity_range_max = 5; _arg1.emitter_archetypes.push(_local3); _local3 = new ParticleEmitterArchetype(); _local3.emit_type = _arg1.particle_archetypes[1]; _local3.emitter_rate = 100; _local3.emitter_total_particles = 3; _local3.velocity_range_min = 120; _local3.velocity_range_max = 300; _local3.angle_velocity_range_min = -4; _local3.angle_velocity_range_max = 4; _arg1.emitter_archetypes.push(_local3); _local3 = new ParticleEmitterArchetype(); _local3.emit_type = _arg1.particle_archetypes[2]; _local3.emitter_rate = 100; _local3.emitter_total_particles = 2; _local3.velocity_range_min = 120; _local3.velocity_range_max = 300; _local3.angle_velocity_range_min = -4; _local3.angle_velocity_range_max = 4; _arg1.emitter_archetypes.push(_local3); _local3 = new ParticleEmitterArchetype(); _local3.emit_type = _arg1.particle_archetypes[3]; _local3.emitter_rate = 100; _local3.emitter_total_particles = 4; _local3.velocity_range_min = 60; _local3.velocity_range_max = 200; _local3.angle_velocity_range_min = 0; _local3.angle_velocity_range_max = 0; _arg1.emitter_archetypes.push(_local3); _local3 = new ParticleEmitterArchetype(); _local3.emit_type = _arg1.particle_archetypes[6]; _local3.emitter_rate = 100; _local3.emitter_total_particles = 3; _local3.velocity_range_min = 0; _local3.velocity_range_max = 0; _local3.angle_velocity_range_min = -2; _local3.angle_velocity_range_max = 2; _arg1.emitter_archetypes.push(_local3); _local3 = new ParticleEmitterArchetype(); _local3.emit_type = _arg1.particle_archetypes[1]; _local3.emitter_rate = 500; _local3.emitter_total_particles = 10; _local3.velocity_range_min = 350; _local3.velocity_range_max = 375; _local3.angle_velocity_range_min = 0; _local3.angle_velocity_range_max = 0; _arg1.emitter_archetypes.push(_local3); _local3 = new ParticleEmitterArchetype(); _local3.emit_type = _arg1.particle_archetypes[5]; _local3.emitter_rate = 500; _local3.emitter_total_particles = 5; _local3.velocity_range_min = 15; _local3.velocity_range_max = 20; _local3.angle_velocity_range_min = -1; _local3.angle_velocity_range_max = 1; _arg1.emitter_archetypes.push(_local3); _local3 = new ParticleEmitterArchetype(); _local3.emit_type = _arg1.particle_archetypes[7]; _local3.emitter_rate = 500; _local3.emitter_total_particles = 7; _local3.velocity_range_min = 415; _local3.velocity_range_max = 620; _local3.radial_orientation = true; _arg1.emitter_archetypes.push(_local3); _local3 = new ParticleEmitterArchetype(); _local3.emit_type = _arg1.particle_archetypes[8]; _local3.emitter_rate = 500; _local3.emitter_total_particles = 3; _local3.velocity_range_min = 15; _local3.velocity_range_max = 40; _local3.angle_velocity_range_min = -1; _local3.angle_velocity_range_max = 1; _arg1.emitter_archetypes.push(_local3); } } }//package Virus
Section 36
//ParticleEmitter (Virus.ParticleEmitter) package Virus { public class ParticleEmitter { public var emitter_archetype:ParticleEmitterArchetype; public var emitter_count:int; public function ParticleEmitter(_arg1:ParticleEmitterArchetype){ emitter_archetype = _arg1; emitter_count = 0; } } }//package Virus
Section 37
//ParticleEmitterArchetype (Virus.ParticleEmitterArchetype) package Virus { import math.*; public class ParticleEmitterArchetype { var velocity_range_max:Number; var emitter_total_particles:int; var emitter_radius:Number; var emit_type:ParticleArchetype; var velocity_range_min:Number; var radial_orientation:Boolean; var emitter_rate:Number; var angle_velocity_range_max:Number; var angle_velocity_range_min:Number; public function ParticleEmitterArchetype(){ radial_orientation = false; } public function process_emitter(_arg1:Number, _arg2:ParticleEmitter, _arg3:ParticleSystem){ var _local4:int; var _local5:int; var _local6:int; var _local7:Particle; var _local8:Number; var _local9:Number; _local4 = (_arg3.current_time * emitter_rate); if (_arg2.emitter_count <= _local4){ _local5 = (_local4 - _arg2.emitter_count); _local6 = 0; while (_local6 < _local5) { if (_arg2.emitter_count < emitter_total_particles){ _local7 = new Particle(emit_type); _arg3.add_particle(_local7); _local7.position = new Vector2D(_arg3.emitter_position.x, _arg3.emitter_position.y); _local7.velocity = Vector2D.random_vector_2D(); _local8 = ((Math.random() * (velocity_range_max - velocity_range_min)) + velocity_range_min); _local7.velocity.x = (_local7.velocity.x * _local8); _local7.velocity.y = (_local7.velocity.y * _local8); if (radial_orientation){ _local7.angle = (RandomUtils.get_orient_angle(_local7.position.x, _local7.position.y, (_local7.position.x + _local7.velocity.x), (_local7.position.y + _local7.velocity.y)) / 57.2957795130823); _local7.angle_velocity = 0; } else { _local9 = ((Math.random() * (angle_velocity_range_max - angle_velocity_range_min)) + angle_velocity_range_min); _local7.angle_velocity = _local9; }; _arg2.emitter_count++; } else { break; }; _local6++; }; }; } } }//package Virus
Section 38
//ParticleManager (Virus.ParticleManager) package Virus { public class ParticleManager implements IGameSystem { var particle_archetypes:Array; var system_list:Array; var emitter_archetypes:Array; static var PTR:ParticleManager; public function create_particle_system(_arg1:int, _arg2:Number, _arg3:Number){ var _local4:ParticleSystem; var _local5:int; _local4 = new ParticleSystem(); if (_arg1 == 0){ _local4.emitter_list.push(new ParticleEmitter(emitter_archetypes[0])); _local4.emitter_list.push(new ParticleEmitter(emitter_archetypes[1])); _local4.emitter_list.push(new ParticleEmitter(emitter_archetypes[2])); } else { if (_arg1 == 1){ _local4.emitter_list.push(new ParticleEmitter(emitter_archetypes[3])); } else { if (_arg1 == 2){ _local4.emitter_list.push(new ParticleEmitter(emitter_archetypes[4])); _local4.emitter_list.push(new ParticleEmitter(emitter_archetypes[5])); } else { if (_arg1 == 3){ _local4.emitter_list.push(new ParticleEmitter(emitter_archetypes[6])); } else { if (_arg1 == 4){ _local4.emitter_list.push(new ParticleEmitter(emitter_archetypes[7])); _local4.emitter_list.push(new ParticleEmitter(emitter_archetypes[8])); }; }; }; }; }; _local4.emitter_position.x = _arg2; _local4.emitter_position.y = _arg3; _local5 = 0; while (_local5 < system_list.length) { if (system_list[_local5] == null){ system_list[_local5] = _local4; return; }; _local5++; }; system_list.push(_local4); } public function update(_arg1:Number):void{ var _local2:int; _local2 = 0; while (_local2 < system_list.length) { if (system_list[_local2] != null){ system_list[_local2].update(_arg1); if (system_list[_local2].ready_to_delete == true){ system_list[_local2].destroy(); system_list[_local2] = null; }; }; _local2++; }; } public function initialize():void{ system_list = new Array(); particle_archetypes = new Array(); emitter_archetypes = new Array(); ParticleDatabase.load_data(this); } public function destroy():void{ var _local1:int; _local1 = 0; while (_local1 < system_list.length) { if (system_list[_local1] != null){ system_list[_local1].destroy(); }; _local1++; }; system_list = null; } } }//package Virus
Section 39
//ParticleSystem (Virus.ParticleSystem) package Virus { import math.*; public class ParticleSystem { var current_time:Number; var emitter_list:Array; var ready_to_delete:Boolean; var particle_list:Array; var emitter_position:Vector2D; public function ParticleSystem(){ ready_to_delete = false; particle_list = new Array(); emitter_list = new Array(); emitter_position = new Vector2D(); current_time = 0; } public function add_particle(_arg1:Particle):void{ var _local2:int; _local2 = 0; while (_local2 < particle_list.length) { if (particle_list[_local2] == null){ particle_list[_local2] = _arg1; return; }; _local2++; }; particle_list.push(_arg1); } public function update(_arg1:Number){ var _local2:int; var _local3:Boolean; var _local4:int; current_time = (current_time + _arg1); _local2 = 0; while (_local2 < emitter_list.length) { emitter_list[_local2].emitter_archetype.process_emitter(_arg1, emitter_list[_local2], this); _local2++; }; _local3 = false; _local4 = 0; while (_local4 < particle_list.length) { if (particle_list[_local4]){ if (particle_list[_local4].ready_to_delete == false){ _local3 = true; particle_list[_local4].update(_arg1); } else { particle_list[_local4].destroy(); particle_list[_local4] = null; }; }; _local4++; }; if (!_local3){ ready_to_delete = true; }; } public function initialize():void{ } public function destroy():void{ var _local1:int; _local1 = 0; while (_local1 < particle_list.length) { if (particle_list[_local1]){ particle_list[_local1].destroy(); particle_list[_local1] = null; }; _local1++; }; particle_list = null; } } }//package Virus
Section 40
//Player (Virus.Player) package Virus { import flash.events.*; import math.*; public class Player { public var fire_desired:Boolean; public var avatar:PlayerAvatar; public var fire_delay:int; public function mouse_event(_arg1:MouseEvent){ if (_arg1.buttonDown){ fire_desired = true; } else { fire_desired = false; }; } public function update(_arg1:Number):void{ avatar.update(_arg1); if (fire_desired){ if (fire_delay <= 0){ ProjectileManager.PTR.create(Projectile.PT_PLAYER_BEAM, avatar.x, (avatar.y - (40 + (Math.random() * 20)))); fire_delay = 3; } else { fire_delay--; }; }; } public function initialize():void{ avatar = new PlayerAvatar(); Application.get_singleton().layer_objects.addChild(avatar); avatar.initialize(); fire_delay = 0; } public function destroy():void{ avatar.destroy(); Application.get_singleton().layer_objects.removeChild(avatar); avatar = null; } public function keydown_event(_arg1:KeyboardEvent){ var _local2:Vector2D; var _local3:Projectile; if ((((((_arg1.charCode == 49)) || ((_arg1.charCode == 50)))) || ((_arg1.charCode == 51)))){ if (ScoreManager.PTR.bombs == 0){ return; }; GameUI.PTR.signal_flash_bomb(); SoundManager.PTR.sfx_event(SoundManager.SM_BOMB_FIRE); _local2 = new Vector2D(); _local2.x = (PlayerInterface.PTR.crosshair_x - avatar.x); _local2.y = (PlayerInterface.PTR.crosshair_y - avatar.y); _local2.normalize(); if (_arg1.charCode == 49){ _local3 = ProjectileManager.PTR.create(Projectile.PT_PLAYER_BOMB_NORMAL, avatar.x, (avatar.y - 10)); _local3.velocity_x = (_local2.x * 800); _local3.velocity_y = (_local2.y * 800); _local3.detonation_radius = 180; _local3.detonation_boundary = PlayerInterface.PTR.crosshair_y; _local3.detonation_effect = 3; } else { if (_arg1.charCode == 50){ _local3 = ProjectileManager.PTR.create(Projectile.PT_PLAYER_BOMB_DEBRIS, avatar.x, (avatar.y - 10)); _local3.velocity_x = (_local2.x * 800); _local3.velocity_y = (_local2.y * 800); _local3.detonation_radius = 80; _local3.detonation_boundary = PlayerInterface.PTR.crosshair_y; _local3.detonation_effect = 3; } else { if (_arg1.charCode == 51){ _local3 = ProjectileManager.PTR.create(Projectile.PT_PLAYER_BOMB_FREEZE, avatar.x, (avatar.y - 10)); _local3.velocity_x = (_local2.x * 800); _local3.velocity_y = (_local2.y * 800); _local3.detonation_radius = 800; _local3.detonation_boundary = PlayerInterface.PTR.crosshair_y; _local3.detonation_effect = 3; }; }; }; ScoreManager.PTR.bomb_fired(); }; } } }//package Virus
Section 41
//PlayerAvatar (Virus.PlayerAvatar) package Virus { import flash.display.*; import flash.filters.*; public class PlayerAvatar extends MovieClip { var last_mx:int; var blur_filter:BlurFilter; public function destroy():void{ this.filters = null; } public function initialize():void{ this.x = 300; this.y = 550; last_mx = this.x; } public function update(_arg1:Number):void{ var _local2:Number; var _local3:Number; var _local4:*; var _local5:*; _local2 = PlayerInterface.PTR.crosshair_x; _local3 = PlayerInterface.PTR.crosshair_y; _local4 = (_local2 - last_mx); _local5 = _local2; last_mx = stage.mouseX; if (_local5 < 20){ _local5 = 20; }; if (_local5 > 580){ _local5 = 580; }; this.x = _local5; this.y = y; if (Math.abs(_local4) > 20){ blur_filter = new BlurFilter(); blur_filter.quality = 2; blur_filter.blurX = Math.abs((_local4 / 3)); this.filters = new Array(blur_filter); } else { this.filters = null; }; } } }//package Virus
Section 42
//PlayerInterface (Virus.PlayerInterface) package Virus { import flash.display.*; public class PlayerInterface implements IGameSystem { var cross_clip:MovieClip; public var crosshair_x:int; public var crosshair_y:int; static var PTR:PlayerInterface; public function update(_arg1:Number):void{ var _local2:Stage; _local2 = Application.get_singleton().stage; crosshair_x = _local2.mouseX; crosshair_y = _local2.mouseY; if (crosshair_y > 500){ crosshair_y = 500; }; cross_clip.x = crosshair_x; cross_clip.y = crosshair_y; } public function initialize():void{ cross_clip = new Crosshair(); Application.get_singleton().layer_interface.addChild(cross_clip); cross_clip.blendMode = BlendMode.ADD; } public function destroy():void{ Application.get_singleton().layer_interface.removeChild(cross_clip); cross_clip = null; } } }//package Virus
Section 43
//Populator (Virus.Populator) package Virus { public class Populator implements IGameSystem { var spawn_counter:int; var wave_list:Array; var active_npc_count:int; var max_wave:int; var wave_counter:int; var npc_list:Array; var wave_timer:int; static var PTR:Populator; public function add_npc(_arg1:IEnemy):void{ var _local2:int; _local2 = 0; while (_local2 < npc_list.length) { if (npc_list[_local2] == null){ npc_list[_local2] = _arg1; return; }; _local2++; }; npc_list.push(_arg1); } public function update(_arg1:Number):void{ var _local2:Boolean; var _local3:PopulatorWave; var _local4:Boolean; var _local5:int; _local2 = true; if (wave_counter < max_wave){ wave_timer--; if (wave_timer <= 0){ if (wave_list[wave_counter].wait_for_clear == true){ if (active_npc_count > 0){ _local2 = false; } else { advance_wave(); }; } else { advance_wave(); }; }; }; _local3 = wave_list[(wave_counter - 1)]; spawn_counter--; if (spawn_counter <= 0){ if (_local2){ spawn_npc(_local3.generate_enemy()); spawn_counter = (_local3.launch_rate + (_local3.launch_randomness * Math.random())); }; }; active_npc_count = 0; _local5 = 0; while (_local5 < npc_list.length) { _local4 = false; if (npc_list[_local5] != null){ active_npc_count++; npc_list[_local5].update(_arg1); if (npc_list[_local5].damage.death_pending){ _local4 = true; }; if (npc_list[_local5].position.y > 575){ _local4 = true; ScoreManager.PTR.damage_player(); }; if (_local4){ npc_list[_local5].destroy(); npc_list[_local5] = null; }; }; _local5++; }; } public function initialize():void{ var _local1:PopulatorWave; wave_counter = 0; spawn_counter = 0; active_npc_count = 0; npc_list = new Array(); wave_list = new Array(); _local1 = new PopulatorWave(); _local1.enemy_list[0] = NPCDatabase.NT_ZIPPER; _local1.enemy_probabilities[0] = 1; _local1.launch_rate = 35; _local1.launch_randomness = 10; _local1.wave_time = 15; wave_list.push(_local1); _local1 = new PopulatorWave(); _local1.enemy_list[0] = NPCDatabase.NT_DARTER; _local1.enemy_list[1] = NPCDatabase.NT_ZIPPER; _local1.enemy_probabilities[0] = 0.2; _local1.enemy_probabilities[1] = 0.8; _local1.launch_rate = 25; _local1.launch_randomness = 5; _local1.wave_time = 15; wave_list.push(_local1); _local1 = new PopulatorWave(); _local1.enemy_list[0] = NPCDatabase.NT_CLUSTER; _local1.enemy_list[1] = NPCDatabase.NT_ZIPPER; _local1.enemy_probabilities[0] = 0.3; _local1.enemy_probabilities[1] = 0.7; _local1.launch_rate = 20; _local1.launch_randomness = 5; _local1.wave_time = 5; wave_list.push(_local1); wave_list.push(_local1); _local1 = new PopulatorWave(); _local1.enemy_list[0] = NPCDatabase.NT_DARTER; _local1.enemy_probabilities[0] = 1; _local1.launch_rate = 10; _local1.launch_randomness = 5; _local1.wave_time = 10; _local1.wait_for_clear = true; wave_list.push(_local1); _local1 = new PopulatorWave(); _local1.enemy_list[0] = NPCDatabase.NT_FLEA; _local1.enemy_list[1] = NPCDatabase.NT_ZIPPER; _local1.enemy_probabilities[0] = 0.1; _local1.enemy_probabilities[1] = 0.9; _local1.launch_rate = 20; _local1.launch_randomness = 5; _local1.wave_time = 20; wave_list.push(_local1); _local1 = new PopulatorWave(); _local1.enemy_list[0] = NPCDatabase.NT_FLEA; _local1.enemy_list[1] = NPCDatabase.NT_ZIPPER; _local1.enemy_list[2] = NPCDatabase.NT_CLUSTER; _local1.enemy_probabilities[0] = 0.1; _local1.enemy_probabilities[1] = 0.6; _local1.enemy_probabilities[2] = 0.3; _local1.launch_rate = 20; _local1.launch_randomness = 5; _local1.wave_time = 15; wave_list.push(_local1); wave_list.push(_local1); wave_list.push(_local1); _local1 = new PopulatorWave(); _local1.enemy_list[0] = NPCDatabase.NT_DARTER; _local1.enemy_probabilities[0] = 1; _local1.launch_rate = 5; _local1.launch_randomness = 5; _local1.wave_time = 10; _local1.wait_for_clear = true; wave_list.push(_local1); _local1 = new PopulatorWave(); _local1.enemy_list[0] = NPCDatabase.NT_FLEA; _local1.enemy_list[1] = NPCDatabase.NT_ZIPPER; _local1.enemy_list[2] = NPCDatabase.NT_CLUSTER; _local1.enemy_probabilities[0] = 0.1; _local1.enemy_probabilities[1] = 0.6; _local1.enemy_probabilities[2] = 0.3; _local1.launch_rate = 18; _local1.launch_randomness = 10; _local1.wave_time = 30; wave_list.push(_local1); wave_list.push(_local1); wave_list.push(_local1); wave_list.push(_local1); _local1 = new PopulatorWave(); _local1.enemy_list[0] = NPCDatabase.NT_ZIPPER; _local1.enemy_probabilities[0] = 1; _local1.launch_rate = 4; _local1.launch_randomness = 3; _local1.wave_time = 10; _local1.wait_for_clear = true; wave_list.push(_local1); _local1 = new PopulatorWave(); _local1.enemy_list[0] = NPCDatabase.NT_FLEA; _local1.enemy_list[1] = NPCDatabase.NT_ZIPPER; _local1.enemy_list[2] = NPCDatabase.NT_CLUSTER; _local1.enemy_list[3] = NPCDatabase.NT_DARTER; _local1.enemy_probabilities[0] = 0.2; _local1.enemy_probabilities[1] = 0.55; _local1.enemy_probabilities[2] = 0.2; _local1.enemy_probabilities[3] = 0.05; _local1.launch_rate = 12; _local1.launch_randomness = 5; _local1.wave_time = 30; wave_list.push(_local1); wave_list.push(_local1); wave_list.push(_local1); wave_list.push(_local1); _local1 = new PopulatorWave(); _local1.enemy_list[0] = NPCDatabase.NT_FLEA; _local1.enemy_list[1] = NPCDatabase.NT_ZIPPER; _local1.enemy_list[2] = NPCDatabase.NT_CLUSTER; _local1.enemy_list[3] = NPCDatabase.NT_DARTER; _local1.enemy_probabilities[0] = 0.2; _local1.enemy_probabilities[1] = 0.4; _local1.enemy_probabilities[2] = 0.2; _local1.enemy_probabilities[3] = 0.2; _local1.launch_rate = 10; _local1.launch_randomness = 5; _local1.wave_time = 30; wave_list.push(_local1); max_wave = 20; advance_wave(); } public function radius_collide(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean):Boolean{ var _local5:Number; var _local6:IEnemy; var _local7:int; var _local8:int; var _local9:DamageEvent; var _local10:int; _local5 = (_arg3 * _arg3); _local6 = null; _local7 = 0; _local8 = 0; while (_local8 < npc_list.length) { if (npc_list[_local8] != null){ _local6 = npc_list[_local8]; if ((((_arg1 - _local6.position.x) * (_arg1 - _local6.position.x)) + ((_arg2 - _local6.position.y) * (_arg2 - _local6.position.y))) <= _local5){ if (_arg4){ _local6.freeze(); } else { _local9 = new DamageEvent(); _local9.npc = _local6; _local9.position_x = _arg1; _local9.position_y = _arg2; _local9.hp_amount = 500; ScoreManager.PTR.add_score(_local6.kill_score); _local6.process_damage_event(_local9); _local7++; }; }; }; _local8++; }; if (_local7 > 3){ _local10 = (_local7 / 3); ScoreManager.PTR.increase_multiplier(_local10); }; return ((_local7 > 0)); } public function advance_wave():void{ wave_counter++; wave_timer = (wave_list[(wave_counter - 1)].wave_time * 30); MessageBoard.PTR.add_line((("Wave " + wave_counter.toString()) + " reached.")); GameUI.PTR.clip_ptr.wave.text = wave_counter.toString(); if (wave_counter == 5){ WarpBackground.PTR.set_background_state(1); }; if (wave_counter == 10){ WarpBackground.PTR.set_background_state(2); }; if (wave_counter == 15){ WarpBackground.PTR.set_background_state(3); }; SoundManager.PTR.sfx_event(SoundManager.SM_LEVEL_CHANGE); } public function spawn_npc(_arg1:int):IEnemy{ var _local2:IEnemy; _local2 = NPCDatabase.create_enemy(_arg1); if (!_local2){ return (null); }; _local2.initialize(); add_npc(_local2); return (_local2); } public function projectile_collide(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{ var _local6:IEnemy; var _local7:int; var _local8:Number; var _local9:DamageEvent; _local6 = null; _local7 = 0; while (_local7 < npc_list.length) { if (npc_list[_local7] != null){ _local6 = npc_list[_local7]; _local8 = CollisionUtils.ray_box_collide(_arg1, _arg2, _arg3, _arg4, _local6.position.x, _local6.position.y, (_local6.bounds_x * 0.7), (_local6.bounds_y * 0.7)); if (_local8 != -1){ if ((((_local8 >= 0)) && ((_local8 <= _arg5)))){ _local9 = new DamageEvent(); _local9.npc = _local6; _local9.position_x = (_arg1 + (_arg3 * _local8)); _local9.position_y = (_arg2 + (_arg4 * _local8)); _local9.hp_amount = 50; _local6.process_damage_event(_local9); ScoreManager.PTR.add_score(_local6.kill_score); return (true); }; }; }; _local7++; }; return (false); } public function destroy():void{ var _local1:int; _local1 = 0; while (_local1 < npc_list.length) { if (npc_list[_local1]){ npc_list[_local1].destroy(); npc_list[_local1] = null; }; _local1++; }; npc_list = null; } } }//package Virus
Section 44
//PopulatorWave (Virus.PopulatorWave) package Virus { public class PopulatorWave { var launch_rate:int; var launch_randomness:int; var wave_time:int; var wait_for_clear:Boolean; var enemy_list:Array; var enemy_probabilities:Array; public function PopulatorWave(){ wave_time = 30; enemy_list = new Array(); enemy_probabilities = new Array(); launch_rate = 15; launch_randomness = 15; wait_for_clear = false; } public function generate_enemy():int{ var _local1:Number; var _local2:Number; var _local3:int; _local1 = Math.random(); _local2 = 0; _local3 = 0; while (_local3 < enemy_list.length) { _local2 = (_local2 + enemy_probabilities[_local3]); if (_local1 <= _local2){ return (enemy_list[_local3]); }; _local3++; }; return (-1); } } }//package Virus
Section 45
//Projectile (Virus.Projectile) package Virus { import flash.display.*; public class Projectile { var clip_data:MovieClip; var detonation_effect:int; var detonation_radius:Number; var death_pending:Boolean; var velocity_x:Number; var velocity_y:Number; var position_x:Number; var position_y:Number; var detonation_boundary:Number; var collision_group:int; var type:int; public static var PT_PLAYER_BOMB_NORMAL:int = 1; public static var PT_PLAYER_BEAM:int = 0; public static var PT_PLAYER_BOMB_DEBRIS:int = 2; public static var PT_PLAYER_BOMB_FREEZE:int = 3; public function destroy(){ Application.get_singleton().layer_effects.removeChild(clip_data); clip_data = null; } public function create(_arg1:int){ type = _arg1; if (type == PT_PLAYER_BEAM){ clip_data = new PlayerProjectile(); } else { clip_data = new BombProjectile1(); }; Application.get_singleton().layer_effects.addChild(clip_data); velocity_x = 0; velocity_y = ((Math.random() * 500) + -2500); collision_group = DamageData.DCT_PLAYER; death_pending = false; detonation_radius = 0; detonation_boundary = 0; detonation_effect = -1; } } }//package Virus
Section 46
//ProjectileManager (Virus.ProjectileManager) package Virus { public class ProjectileManager implements IGameSystem { var projectile_list:Array; static var PTR:ProjectileManager; public function update(_arg1:Number):void{ var _local2:Boolean; var _local3:int; var _local4:Projectile; process_collisions(_arg1); _local3 = 0; while (_local3 < projectile_list.length) { _local4 = projectile_list[_local3]; if (!_local4){ } else { if (_local4.death_pending){ projectile_list[_local3].destroy(); projectile_list[_local3] = null; } else { _local4.position_x = (_local4.position_x + (_local4.velocity_x * _arg1)); _local4.position_y = (_local4.position_y + (_local4.velocity_y * _arg1)); if ((((_local4.position_y < 100)) || ((_local4.position_y > 600)))){ _local4.death_pending = true; }; _local4.clip_data.x = _local4.position_x; _local4.clip_data.y = _local4.position_y; }; }; _local3++; }; } public function initialize():void{ projectile_list = new Array(); } public function process_collisions(_arg1:Number):void{ var _local2:int; var _local3:Projectile; var _local4:Boolean; _local2 = 0; while (_local2 < projectile_list.length) { _local3 = projectile_list[_local2]; if (!_local3){ } else { _local4 = false; if (_local3.detonation_radius == 0){ _local4 = Populator.PTR.projectile_collide(_local3.position_x, _local3.position_y, 0, -1, (Math.abs(_local3.velocity_y) * _arg1)); if (_local4 == false){ _local4 = HexGrid.PTR.projectile_collide(_local3.position_x, _local3.position_y, 0, -1, (Math.abs(_local3.velocity_y) * _arg1)); }; } else { if (_local3.position_y < _local3.detonation_boundary){ if (_local3.type == Projectile.PT_PLAYER_BOMB_NORMAL){ _local4 = Populator.PTR.radius_collide(_local3.position_x, _local3.position_y, _local3.detonation_radius, false); ParticleManager.PTR.create_particle_system(2, _local3.position_x, _local3.position_y); SoundManager.PTR.sfx_event(SoundManager.SM_BOMB_1); } else { if (_local3.type == Projectile.PT_PLAYER_BOMB_FREEZE){ _local4 = Populator.PTR.radius_collide(_local3.position_x, _local3.position_y, _local3.detonation_radius, true); ParticleManager.PTR.create_particle_system(4, _local3.position_x, _local3.position_y); SoundManager.PTR.sfx_event(SoundManager.SM_BOMB_2); } else { if (_local3.type == Projectile.PT_PLAYER_BOMB_DEBRIS){ HexGrid.PTR.radius_detonate(_local3.position_x, _local3.position_y, _local3.detonation_radius); ParticleManager.PTR.create_particle_system(3, _local3.position_x, _local3.position_y); SoundManager.PTR.sfx_event(SoundManager.SM_BOMB_3); }; }; }; projectile_list[_local2].death_pending = true; }; }; if (_local4){ projectile_list[_local2].death_pending = true; }; }; _local2++; }; } public function destroy():void{ var _local1:int; _local1 = 0; while (_local1 < projectile_list.length) { if (projectile_list[_local1]){ projectile_list[_local1].destroy(); projectile_list[_local1] = null; }; _local1++; }; projectile_list[_local1] = null; } public function create(_arg1:int, _arg2:Number, _arg3:Number):Projectile{ var _local4:Projectile; var _local5:int; _local4 = new Projectile(); _local4.create(_arg1); _local4.clip_data.x = (_local4.position_x = _arg2); _local4.clip_data.y = (_local4.position_y = _arg3); _local5 = 0; while (_local5 < projectile_list.length) { if (projectile_list[_local5] == null){ projectile_list[_local5] = _local4; return (_local4); }; _local5++; }; projectile_list.push(_local4); return (_local4); } } }//package Virus
Section 47
//ScoreManager (Virus.ScoreManager) package Virus { public class ScoreManager implements IGameSystem { var multiplier:int; var bombs:int; var score:int; var display_score:int; var multiplier_timer:int; var bomb_counter:int; var health:int; var hash_key:int; public static var PTR:ScoreManager; public function update(_arg1:Number):void{ var _local2:int; if (GameUI.PTR == null){ return; }; _local2 = get_score(); if (display_score < _local2){ if (display_score < 10000){ display_score = (display_score + 50); } else { if (display_score < 100000){ display_score = (display_score + 500); } else { display_score = (display_score + 2500); }; }; if (display_score > _local2){ display_score = _local2; }; }; if (multiplier_timer > 0){ multiplier_timer--; if (multiplier_timer == 0){ multiplier = (multiplier - 1); if (multiplier < 1){ multiplier = 1; } else { multiplier_timer = (10 * 30); }; MessageBoard.PTR.add_line((("Multiplier decreased. (" + int(multiplier).toString()) + "X)")); }; }; GameUI.PTR.clip_ptr.score.text = display_score.toString(); GameUI.PTR.clip_ptr.multiplier.text = (int(multiplier).toString() + "X"); GameUI.PTR.clip_ptr.bombs.text = int(bombs).toString(); } public function initialize():void{ reset(); } public function bomb_fired():void{ if (bombs > 0){ bombs--; bomb_counter = 0; }; } public function increase_multiplier(_arg1:int):void{ if (multiplier < 10){ multiplier = (multiplier + _arg1); if (multiplier > 10){ multiplier = 10; }; multiplier_timer = (multiplier_timer + (5 * 30)); MessageBoard.PTR.add_line((("Multiplier increased. (" + multiplier.toString()) + "X)")); }; } public function reset():void{ hash_key = 2836909730; encrypt_score(0); multiplier = 1; display_score = 0; health = 99; bombs = 0; bomb_counter = 0; if (GameUI.PTR){ GameUI.PTR.clip_ptr.health.text = health.toString(); }; } public function get_score():int{ return ((score ^ hash_key)); } public function restore_health(_arg1:int):void{ health = (health + _arg1); if (health > 99){ health = 99; }; GameUI.PTR.clip_ptr.health.text = health.toString(); GameUI.PTR.signal_flash_health(); } public function damage_player():void{ health = (health - 5); GameUI.PTR.signal_flash_health(); SoundManager.PTR.sfx_event(SoundManager.SM_PLAYER_HIT); if (health <= 0){ health = 0; }; GameUI.PTR.clip_ptr.health.text = health.toString(); } public function add_score(_arg1:int):void{ var _local2:int; _local2 = get_score(); _local2 = (_local2 + ((_arg1 * multiplier) * (1 + int((Populator.PTR.wave_counter / 4))))); bomb_counter++; if (bomb_counter > 25){ SoundManager.PTR.sfx_event(SoundManager.SM_BOMB_ACQUIRE); MessageBoard.PTR.add_line("Bomb acquired."); bombs++; bomb_counter = 0; }; encrypt_score(_local2); } public function destroy():void{ } public function encrypt_score(_arg1:int):void{ score = (_arg1 ^ hash_key); } } }//package Virus
Section 48
//WarpBackground (Virus.WarpBackground) package Virus { import flash.display.*; public class WarpBackground implements IGameSystem { var clip_ptr:MovieClip; public static var PTR:WarpBackground; public function WarpBackground(){ clip_ptr = new WBackground(); Application.get_singleton().layer_background.addChild(clip_ptr); } public function update(_arg1:Number):void{ } public function initialize():void{ clip_ptr.x = 300; clip_ptr.y = 300; set_background_state(0); } public function destroy():void{ Application.get_singleton().layer_background.removeChild(clip_ptr); clip_ptr = null; } public function set_background_state(_arg1:int):void{ if (_arg1 == 0){ clip_ptr.gotoAndPlay(1); } else { if (_arg1 == 1){ clip_ptr.gotoAndPlay(20); } else { if (_arg1 == 2){ clip_ptr.gotoAndPlay(40); } else { if (_arg1 == 3){ clip_ptr.gotoAndPlay(60); }; }; }; }; } } }//package Virus
Section 49
//ZipperBrain (Virus.ZipperBrain) package Virus { import math.*; public class ZipperBrain extends IBrain { override public function calculate_next_target(_arg1:Vector2D, _arg2:Vector2D):void{ var _local3:Number; var _local4:Number; _local3 = Math.random(); _local4 = 0; if (_local3 < 0.9){ _local4 = 200; _arg2.x = (_arg1.x + ((Math.random() * 200) - 100)); if (_arg2.x < 25){ _arg2.x = 25; }; if (_arg2.y > 575){ _arg2.y = 575; }; _arg2.y = (_arg1.y + _local4); } else { _local4 = ((Math.random() * 50) + 100); if (_arg1.x < 300){ _arg2.x = (_arg1.x + (150 + (Math.random() * 100))); } else { _arg2.x = (_arg1.x - (150 + (Math.random() * 100))); }; _arg2.y = (_arg1.y + _local4); }; } } }//package Virus
Section 50
//ZipperEnemy (Virus.ZipperEnemy) package Virus { public class ZipperEnemy extends IEnemy { override public function update(_arg1:Number):void{ super.update(_arg1); } override public function initialize():void{ clip_data = new EnemyShooter(); move_speed = 150; damage_archetype_id = 0; spline_interpolate = true; brain = new ZipperBrain(); super.initialize(); } override public function destroy():void{ super.destroy(); } } }//package Virus
Section 51
//AssetPreloader_10 (virus_fla.AssetPreloader_10) package virus_fla { import flash.display.*; public dynamic class AssetPreloader_10 extends MovieClip { public function AssetPreloader_10(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package virus_fla
Section 52
//BtnSound_3 (virus_fla.BtnSound_3) package virus_fla { import flash.display.*; public dynamic class BtnSound_3 extends MovieClip { public function BtnSound_3(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package virus_fla
Section 53
//Application (Application) package { import flash.events.*; import Virus.*; import flash.display.*; import flash.net.*; import flash.system.*; import flash.utils.*; public class Application extends MovieClip { public var layer_background:Sprite; public var layer_hexgrid:Sprite; public var layer_effects:Sprite; public var layer_objects:Sprite; var frame_counter:int; var time_offset:int; public var screen_list:Array; public var keystate:ApplicationKeystate; public var display_debug:Boolean; public var debug_interface:MovieClip; public var preload_complete:Boolean; public var layer_menu:Sprite; public var active_screen:IScreen; public var score_API:WebScoreAPI; public var layer_interface:Sprite; public var current_time:Number; public var audio:SoundManager; public var game:IScreen; public static var APPLICATION:Application; public function Application(){ Security.allowDomain("www.diffusiongames.com"); Security.allowInsecureDomain("www.diffusiongames.com"); Security.allowDomain("www.gamegarage.co.uk"); Security.allowInsecureDomain("www.gamegarage.co.uk"); preload_complete = false; stop(); addEventListener(Event.ADDED_TO_STAGE, added_to_stage); } public function mouse_down_handler(_arg1:MouseEvent):void{ var _local2:int; var _local3:int; var _local4:Boolean; if (active_screen){ active_screen.mouse_down_handler(_arg1); }; if (active_screen.clip_switch_active == true){ if (active_screen.clip_switch_array){ _local2 = active_screen.get_clip_at_location(stage.mouseX, stage.mouseY); if (_local2 != -1){ _local3 = active_screen.clip_switch_target[_local2]; if (_local3 == IScreen.IS_TOGGLE_SOUND){ _local4 = SoundManager.PTR.sound_enabled; if (_local4){ SoundManager.PTR.enable_sound(false); active_screen.clip_switch_array[_local2].gotoAndStop(2); } else { SoundManager.PTR.enable_sound(true); active_screen.clip_switch_array[_local2].gotoAndStop(1); }; return; } else { if (_local3 == IScreen.IS_MORE_GAMES){ navigateToURL(new URLRequest("http://www.gamegarage.co.uk"), "_blank"); return; }; }; switch_screen(_local3); return; }; }; }; if (active_screen.click_transition != -1){ switch_screen(active_screen.click_transition); }; } public function mouse_move_handler(_arg1:MouseEvent){ stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouse_move_handler); if (active_screen){ active_screen.mouse_enter_window(); }; } public function keyup_listener(_arg1:KeyboardEvent):void{ keystate.keyup_listener(_arg1); } public function get_screen(_arg1:int):IScreen{ var _local2:int; _local2 = 0; while (_local2 < screen_list.length) { if (screen_list[_local2].get_id() == _arg1){ return (screen_list[_local2]); }; _local2++; }; return (null); } public function mouse_up_handler(_arg1:MouseEvent):void{ if (active_screen){ active_screen.mouse_up_handler(_arg1); }; } public function initialize(){ APPLICATION = this; display_debug = false; keystate = null; time_offset = -1; frame_counter = 0; score_API = new WebScoreAPI(); ScoreManager.PTR = new ScoreManager(); ScoreManager.PTR.initialize(); addEventListener(Event.ENTER_FRAME, update); audio = new SoundManager(); SoundManager.PTR = audio; stage.scaleMode = StageScaleMode.NO_SCALE; layer_background = new Sprite(); addChild(layer_background); layer_hexgrid = new Sprite(); addChild(layer_hexgrid); layer_objects = new Sprite(); addChild(layer_objects); layer_effects = new Sprite(); addChild(layer_effects); layer_interface = new Sprite(); addChild(layer_interface); layer_menu = new Sprite(); addChild(layer_menu); keystate = new ApplicationKeystate(); stage.addEventListener(KeyboardEvent.KEY_DOWN, keydown_listener); stage.addEventListener(KeyboardEvent.KEY_UP, keyup_listener); stage.addEventListener(MouseEvent.MOUSE_DOWN, mouse_down_handler); stage.addEventListener(MouseEvent.MOUSE_UP, mouse_up_handler); active_screen.enter_screen(); } public function mouse_leave_handler(_arg1:Event){ stage.addEventListener(MouseEvent.MOUSE_MOVE, mouse_move_handler); if (active_screen){ active_screen.mouse_left_window(); }; } public function added_to_stage(_arg1:Event){ screen_list = new Array(); screen_list.push(new ArmorPreloadScreen()); screen_list.push(new MainMenuScreen()); screen_list.push(new Game()); screen_list.push(new InstructionsScreen()); screen_list.push(new HighScoreScreen()); screen_list.push(new EnterScoreScreen()); active_screen = screen_list[0]; stage.addEventListener(Event.MOUSE_LEAVE, mouse_leave_handler); initialize(); MochiBot.track(this, "67503c32"); } public function keydown_listener(_arg1:KeyboardEvent):void{ keystate.keydown_listener(_arg1); if (active_screen){ active_screen.key_down_handler(_arg1); if (active_screen.click_transition != -1){ switch_screen(active_screen.click_transition); }; }; } public function update(_arg1:Event):void{ var _local2:Number; var _local3:Number; var _local4:int; var _local5:Number; var _local6:int; var _local7:Number; var _local8:Number; var _local9:int; _local2 = getTimer(); _local3 = (_local2 - current_time); if (time_offset == -1){ time_offset = _local2; }; _local4 = (_local2 - time_offset); _local5 = (1 / 33); _local6 = (_local4 * _local5); if (_local6 > frame_counter){ frame_counter++; if ((_local6 - frame_counter) > 10){ frame_counter = _local6; }; if (active_screen){ active_screen.update(_local5); if (active_screen.dynamic_transition_desired != -1){ switch_screen(active_screen.dynamic_transition_desired); }; }; audio.update(); }; _local7 = getTimer(); _local8 = (_local7 - _local2); _local9 = (((_local7 - _local2) / (_local8 + _local3)) * 100); if (display_debug){ if (!debug_interface){ debug_interface = new DebugInterface(); addChild(debug_interface); debug_interface.x = 180; debug_interface.y = 70; }; debug_interface.app_timing.text = (((((("App: " + _local8) + "ms (") + _local9) + "%) - flash: ") + _local3) + "ms"); } else { if (debug_interface){ removeChild(debug_interface); debug_interface = null; }; }; current_time = _local7; } public function switch_screen(_arg1:int){ var _local2:IScreen; if (active_screen){ active_screen.exit_screen(); }; _local2 = get_screen(_arg1); _local2.enter_screen(); active_screen = _local2; } public static function get_singleton():Application{ return (APPLICATION); } } }//package
Section 54
//ApplicationKeystate (ApplicationKeystate) package { import flash.events.*; public class ApplicationKeystate { var buffered_presses:Object; var key_array:Object; public function ApplicationKeystate(){ key_array = new Object(); buffered_presses = new Object(); } public function keyup_listener(_arg1:KeyboardEvent):void{ delete key_array[_arg1.keyCode]; } public function keydown_listener(_arg1:KeyboardEvent):void{ key_array[_arg1.keyCode] = true; buffered_presses[_arg1.keyCode] = true; } public function get_buffered_press(_arg1:uint):Boolean{ var _local2:Boolean; _local2 = (_arg1 in buffered_presses); if (_local2){ delete buffered_presses[_arg1]; }; return (_local2); } public function is_key_down(_arg1:uint):Boolean{ return (Boolean((_arg1 in key_array))); } } }//package
Section 55
//armor_splash (armor_splash) package { import flash.display.*; public dynamic class armor_splash extends MovieClip { public function armor_splash(){ addFrameScript(133, frame134, 174, frame175); } function frame175(){ stop(); } function frame134(){ } } }//package
Section 56
//BombProjectile1 (BombProjectile1) package { import flash.display.*; public dynamic class BombProjectile1 extends MovieClip { } }//package
Section 57
//Crosshair (Crosshair) package { import flash.display.*; public dynamic class Crosshair extends MovieClip { } }//package
Section 58
//CRSpline (CRSpline) package { import math.*; public class CRSpline { public var points:Array; public var current_length:Number; static var temp_v:Vector2D = new Vector2D(); public function CRSpline(){ points = new Array(); points.push(new Vector2D()); points.push(new Vector2D()); points.push(new Vector2D()); points.push(new Vector2D()); } public function initialize():void{ compute_approximate_length(); } public function evaluate(_arg1:Number, _arg2:Vector2D):void{ var _local3:Number; var _local4:Number; _local3 = (_arg1 * _arg1); _local4 = (_local3 * _arg1); _arg2.x = (0.5 * ((((2 * points[1].x) + (_arg1 * (-(points[0].x) + points[2].x))) + (_local3 * ((((points[0].x * 2) + (points[1].x * -5)) + (points[2].x * 4)) + (points[3].x * -1)))) + (_local4 * ((((points[0].x * -1) + (points[1].x * 3)) + (points[2].x * -3)) + points[3].x)))); _arg2.y = (0.5 * ((((2 * points[1].y) + (_arg1 * (-(points[0].y) + points[2].y))) + (_local3 * ((((points[0].y * 2) + (points[1].y * -5)) + (points[2].y * 4)) + (points[3].y * -1)))) + (_local4 * ((((points[0].y * -1) + (points[1].y * 3)) + (points[2].y * -3)) + points[3].y)))); } public function compute_approximate_length():void{ var _local1:int; var _local2:Number; var _local3:Number; var _local4:Number; var _local5:int; var _local6:Number; _local1 = 8; _local2 = 0; _local3 = 0; _local4 = 0; _local5 = 0; while (_local5 <= _local1) { _local6 = (_local5 / _local1); evaluate(_local6, temp_v); if (_local5 > 1){ _local2 = (_local2 + Math.sqrt((((_local3 - temp_v.x) * (_local3 - temp_v.x)) + ((_local4 - temp_v.y) * (_local4 - temp_v.y))))); }; _local3 = temp_v.x; _local4 = temp_v.y; _local5++; }; current_length = _local2; } } }//package
Section 59
//DebugInterface (DebugInterface) package { import flash.display.*; import flash.text.*; public dynamic class DebugInterface extends MovieClip { public var app_timing:TextField; public var fps:TextField; } }//package
Section 60
//EnemyCluster (EnemyCluster) package { import flash.display.*; public dynamic class EnemyCluster extends MovieClip { } }//package
Section 61
//EnemyClusterSpawn (EnemyClusterSpawn) package { import flash.display.*; public dynamic class EnemyClusterSpawn extends MovieClip { } }//package
Section 62
//EnemyDarter (EnemyDarter) package { import flash.display.*; public dynamic class EnemyDarter extends MovieClip { } }//package
Section 63
//EnemyFlea (EnemyFlea) package { import flash.display.*; public dynamic class EnemyFlea extends MovieClip { } }//package
Section 64
//EnemyShooter (EnemyShooter) package { import flash.display.*; public dynamic class EnemyShooter extends MovieClip { } }//package
Section 65
//EnterScoreMenu (EnterScoreMenu) package { import flash.display.*; import flash.text.*; public dynamic class EnterScoreMenu extends MovieClip { public var name_input:TextField; } }//package
Section 66
//GameOverSplash (GameOverSplash) package { import flash.display.*; public dynamic class GameOverSplash extends MovieClip { } }//package
Section 67
//Hex (Hex) package { import flash.display.*; public dynamic class Hex extends MovieClip { public function Hex(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package
Section 68
//HighScoreMenu (HighScoreMenu) package { import flash.display.*; import flash.text.*; public dynamic class HighScoreMenu extends MovieClip { public var score_name:TextField; public var score_number:TextField; public var score_score:TextField; } }//package
Section 69
//IScreen (IScreen) package { import flash.events.*; public class IScreen { public var clip_switch_active:Boolean; public var click_transition:int; public var clip_switch_target:Array; public var dynamic_transition_desired:int; public var clip_switch_array:Array; public static const IS_MORE_GAMES:int = 9; public static const IS_DISPLAY_SCORES:int = 6; public static const IS_GAME_OVER:int = 3; public static const IS_SPLASH_SCREEN:int = 1; public static const IS_MAIN_MENU:int = 0; public static const IS_ENTER_SCORE:int = 5; public static const IS_PLAYING_GAME:int = 2; public static const IS_TOGGLE_SOUND:int = 8; public static const IS_INSTRUCTIONS:int = 4; public static const IS_ARMOR_PRELOAD:int = 7; public function IScreen(){ clip_switch_active = false; click_transition = -1; dynamic_transition_desired = -1; } public function get_id():int{ return (-1); } public function mouse_left_window():void{ } public function mouse_enter_window():void{ } public function exit_screen():void{ } public function enter_screen():void{ } public function mouse_down_handler(_arg1:MouseEvent):void{ } public function mouse_up_handler(_arg1:MouseEvent):void{ } public function get_clip_at_location(_arg1:int, _arg2:int):int{ var _local3:int; var _local4:int; var _local5:int; var _local6:int; var _local7:int; var _local8:int; var _local9:int; if (clip_switch_array){ _local3 = 0; while (_local3 < clip_switch_array.length) { _local4 = clip_switch_array[_local3].width; _local5 = clip_switch_array[_local3].height; _local6 = (clip_switch_array[_local3].x - (_local4 / 2)); _local7 = (clip_switch_array[_local3].x + (_local4 / 2)); _local8 = (clip_switch_array[_local3].y - (_local5 / 2)); _local9 = (clip_switch_array[_local3].y + (_local5 / 2)); if ((((((((_arg1 >= _local6)) && ((_arg1 <= _local7)))) && ((_arg2 >= _local8)))) && ((_arg2 <= _local9)))){ return (_local3); }; _local3++; }; }; return (-1); } public function key_down_handler(_arg1:KeyboardEvent):void{ } public function update(_arg1:Number):void{ } } }//package
Section 70
//MochiBot (MochiBot) package { import flash.display.*; import flash.net.*; import flash.system.*; public dynamic class MochiBot extends Sprite { public static function track(_arg1:Sprite, _arg2:String):MochiBot{ var _local3:MochiBot; var _local4:String; var _local5:URLVariables; var _local6:String; var _local7:URLRequest; var _local8:Loader; if (Security.sandboxType == "localWithFile"){ return (null); }; _local3 = new (MochiBot); _arg1.addChild(_local3); Security.allowDomain("core.mochibot.com"); Security.allowInsecureDomain("core.mochibot.com"); _local4 = "http://core.mochibot.com/my/core.swf"; _local5 = new URLVariables(); _local5["sb"] = Security.sandboxType; _local5["v"] = Capabilities.version; _local5["swfid"] = _arg2; _local5["mv"] = "8"; _local5["fv"] = "9"; _local6 = _local3.root.loaderInfo.loaderURL; if (_local6.indexOf("http") == 0){ _local5["url"] = _local6; } else { _local5["url"] = "local"; }; _local7 = new URLRequest(_local4); _local7.contentType = "application/x-www-form-urlencoded"; _local7.method = URLRequestMethod.POST; _local7.data = _local5; _local8 = new Loader(); _local3.addChild(_local8); _local8.load(_local7); return (_local3); } } }//package
Section 71
//MusicLevel (MusicLevel) package { import flash.media.*; public dynamic class MusicLevel extends Sound { } }//package
Section 72
//MusicMenu (MusicMenu) package { import flash.media.*; public dynamic class MusicMenu extends Sound { } }//package
Section 73
//ParticleBlueFlare (ParticleBlueFlare) package { import flash.display.*; public dynamic class ParticleBlueFlare extends MovieClip { } }//package
Section 74
//ParticleCSpawnDeath (ParticleCSpawnDeath) package { import flash.display.*; public dynamic class ParticleCSpawnDeath extends MovieClip { } }//package
Section 75
//ParticleExplosion1 (ParticleExplosion1) package { import flash.display.*; public dynamic class ParticleExplosion1 extends MovieClip { } }//package
Section 76
//ParticleExplosion2 (ParticleExplosion2) package { import flash.display.*; public dynamic class ParticleExplosion2 extends MovieClip { } }//package
Section 77
//ParticleExplosion3 (ParticleExplosion3) package { import flash.display.*; public dynamic class ParticleExplosion3 extends MovieClip { } }//package
Section 78
//ParticleIce (ParticleIce) package { import flash.display.*; public dynamic class ParticleIce extends MovieClip { } }//package
Section 79
//ParticlePieces (ParticlePieces) package { import flash.display.*; public dynamic class ParticlePieces extends MovieClip { } }//package
Section 80
//ParticlePieces2 (ParticlePieces2) package { import flash.display.*; public dynamic class ParticlePieces2 extends MovieClip { } }//package
Section 81
//ParticleStar (ParticleStar) package { import flash.display.*; public dynamic class ParticleStar extends MovieClip { } }//package
Section 82
//PauseSplash (PauseSplash) package { import flash.display.*; public dynamic class PauseSplash extends MovieClip { } }//package
Section 83
//PlayerProjectile (PlayerProjectile) package { import flash.display.*; public dynamic class PlayerProjectile extends MovieClip { } }//package
Section 84
//Preloader (Preloader) package { import flash.events.*; import flash.display.*; import flash.system.*; public dynamic class Preloader extends MovieClip { var app:Application; var preloader_clip:PreloaderClip; var preload_complete:Boolean; public static var PTR:Preloader; public function Preloader(){ Security.allowDomain("www.diffusiongames.com"); Security.allowInsecureDomain("www.diffusiongames.com"); Security.allowDomain("*"); Security.allowInsecureDomain("*"); PTR = this; preload_complete = false; app = null; preloader_clip = new PreloaderClip(); addChild(preloader_clip); preloader_clip.x = 300; preloader_clip.y = 300; this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoadProgress); this.loaderInfo.addEventListener(Event.COMPLETE, completeHandler); stop(); } public function start_application():void{ var _local1:Application; _local1 = new Application(); addChild(_local1); } private function onLoadProgress(_arg1:ProgressEvent):void{ var _local2:int; var _local3:int; var _local4:int; if (preloader_clip.preload_text){ _local2 = ((_arg1.bytesLoaded / _arg1.bytesTotal) * 100); _local3 = (_arg1.bytesTotal / 1000000); _local4 = ((_arg1.bytesTotal - (_local3 * 1000000)) / 10000); }; } private function completeHandler(_arg1:Event):void{ preload_complete = true; removeChild(preloader_clip); preloader_clip = null; gotoAndStop(10); start_application(); } } }//package
Section 85
//PreloaderClip (PreloaderClip) package { import flash.display.*; import flash.text.*; public dynamic class PreloaderClip extends MovieClip { public var preload_text:TextField; } }//package
Section 86
//ScreenInstructions (ScreenInstructions) package { import flash.display.*; public dynamic class ScreenInstructions extends MovieClip { public function ScreenInstructions(){ addFrameScript(170, frame171); } function frame171(){ stop(); } } }//package
Section 87
//ScreenMenu (ScreenMenu) package { import flash.display.*; public dynamic class ScreenMenu extends MovieClip { public var btn_play_game:MovieClip; public var btn_more_games:MovieClip; public var c1:MovieClip; public var c3:MovieClip; public var c2:MovieClip; public var btn_sound:MovieClip; public var btn_high_scores:MovieClip; public var logo:MovieClip; public var scanline:MovieClip; public function ScreenMenu(){ addFrameScript(0, frame1, 59, frame60); } function frame1(){ } function frame60(){ stop(); } } }//package
Section 88
//ScreenSplash (ScreenSplash) package { import flash.display.*; public dynamic class ScreenSplash extends MovieClip { } }//package
Section 89
//SFXBomb1 (SFXBomb1) package { import flash.media.*; public dynamic class SFXBomb1 extends Sound { } }//package
Section 90
//SFXBomb2 (SFXBomb2) package { import flash.media.*; public dynamic class SFXBomb2 extends Sound { } }//package
Section 91
//SFXBomb3 (SFXBomb3) package { import flash.media.*; public dynamic class SFXBomb3 extends Sound { } }//package
Section 92
//SFXBombAcquire (SFXBombAcquire) package { import flash.media.*; public dynamic class SFXBombAcquire extends Sound { } }//package
Section 93
//SFXBombFire (SFXBombFire) package { import flash.media.*; public dynamic class SFXBombFire extends Sound { } }//package
Section 94
//SFXExplode1 (SFXExplode1) package { import flash.media.*; public dynamic class SFXExplode1 extends Sound { } }//package
Section 95
//SFXExplode2 (SFXExplode2) package { import flash.media.*; public dynamic class SFXExplode2 extends Sound { } }//package
Section 96
//SFXExplode3 (SFXExplode3) package { import flash.media.*; public dynamic class SFXExplode3 extends Sound { } }//package
Section 97
//SFXExplode4 (SFXExplode4) package { import flash.media.*; public dynamic class SFXExplode4 extends Sound { } }//package
Section 98
//SFXGameOver (SFXGameOver) package { import flash.media.*; public dynamic class SFXGameOver extends Sound { } }//package
Section 99
//SFXLevelChange (SFXLevelChange) package { import flash.media.*; public dynamic class SFXLevelChange extends Sound { } }//package
Section 100
//SFXPlayerHit (SFXPlayerHit) package { import flash.media.*; public dynamic class SFXPlayerHit extends Sound { } }//package
Section 101
//SoundManager (SoundManager) package { import flash.media.*; public class SoundManager { public var sound_enabled:Boolean; var fading_out:Boolean; var music_transform:SoundTransform; var music_files:Array; var last_volume:Number; var music_channel:SoundChannel; var active_music:int; var music_volume:Number; var last_active_music:int; public static const SM_PLAYER_HIT:int = 7; public static const SM_GAME_OVER:int = 5; public static const SM_LEVEL_CHANGE:int = 1; public static const SM_NPC_DEATH:int = 0; public static const SM_BOMB_FIRE:int = 6; public static const SM_BOMB_1:int = 2; public static const SM_BOMB_2:int = 3; public static const SM_BOMB_3:int = 4; public static const SM_BOMB_ACQUIRE:int = 8; public static var PTR:SoundManager; public function SoundManager(){ active_music = -1; sound_enabled = true; fading_out = false; music_volume = 0; music_files = new Array(); music_files.push(new MusicMenu()); music_files.push(new MusicLevel()); } public function start_music(_arg1:uint, _arg2=0.65){ if (music_files[_arg1] == null){ return; }; if (sound_enabled == false){ return; }; if (_arg1 == active_music){ return; }; fading_out = false; music_volume = _arg2; active_music = _arg1; last_active_music = active_music; last_volume = _arg2; music_transform = new SoundTransform(music_volume, 0); music_channel = music_files[active_music].play(0, 999, music_transform); } public function update():void{ if (active_music != -1){ if (fading_out){ music_volume = (music_volume - 0.04); if (music_volume < 0){ music_volume = 0; fading_out = false; music_channel.stop(); } else { music_transform.volume = music_volume; music_channel.soundTransform = music_transform; }; }; }; } public function enable_sound(_arg1:Boolean):void{ if (_arg1 != sound_enabled){ sound_enabled = _arg1; if (_arg1 == false){ music_stop(); } else { start_music(last_active_music, last_volume); }; }; } public function music_stop(){ if (active_music != -1){ music_volume = 0; fading_out = false; if (music_channel){ music_channel.stop(); }; active_music = -1; }; } public function sfx_event(_arg1:int){ var _local2:Sound; var _local3:int; var _local4:Number; var _local5:SoundTransform; if (sound_enabled == false){ return; }; _local4 = 1; if (_arg1 == SM_NPC_DEATH){ _local4 = 0.5; _local3 = (Math.random() * 4); if (_local3 == 0){ _local2 = new SFXExplode1(); } else { if (_local3 == 1){ _local2 = new SFXExplode2(); } else { if (_local3 == 2){ _local2 = new SFXExplode3(); } else { if (_local3 == 3){ _local2 = new SFXExplode4(); }; }; }; }; } else { if (_arg1 == SM_LEVEL_CHANGE){ _local2 = new SFXLevelChange(); } else { if (_arg1 == SM_BOMB_1){ _local2 = new SFXBomb1(); } else { if (_arg1 == SM_BOMB_2){ _local2 = new SFXBomb2(); } else { if (_arg1 == SM_BOMB_3){ _local2 = new SFXBomb3(); } else { if (_arg1 == SM_BOMB_FIRE){ _local2 = new SFXBombFire(); } else { if (_arg1 == SM_BOMB_ACQUIRE){ _local2 = new SFXBombAcquire(); } else { if (_arg1 == SM_PLAYER_HIT){ _local2 = new SFXPlayerHit(); } else { if (_arg1 == SM_GAME_OVER){ _local2 = new SFXGameOver(); }; }; }; }; }; }; }; }; }; if (_local2){ if (_local4 != 1){ _local5 = new SoundTransform(_local4, 0); _local2.play(0, 0, _local5); } else { _local2.play(); }; }; } public function music_fade_out(){ fading_out = true; } } }//package
Section 102
//UIOverlay (UIOverlay) package { import flash.display.*; import flash.text.*; public dynamic class UIOverlay extends MovieClip { public var bombs:TextField; public var health:TextField; public var health_icon:MovieClip; public var score:TextField; public var multiplier:TextField; public var wave:TextField; public var bomb_icon:MovieClip; } }//package
Section 103
//WBackground (WBackground) package { import flash.display.*; public dynamic class WBackground extends MovieClip { public function WBackground(){ addFrameScript(18, frame19, 38, frame39, 58, frame59, 76, frame77); } function frame77(){ stop(); } function frame19(){ stop(); } function frame39(){ stop(); } function frame59(){ stop(); } } }//package
Section 104
//WebScoreAPI (WebScoreAPI) package { import flash.events.*; import utils.*; import flash.net.*; public class WebScoreAPI { var scores_ready:Boolean; var encrypt:MD5; public var hs_scores:Array; var submit_loader:URLLoader; public var hs_names:Array; static var HK:String = "dg314159"; public function WebScoreAPI(){ hs_names = new Array(10); hs_scores = new Array(10); encrypt = new MD5(); submit_loader = new URLLoader(); submit_loader.dataFormat = URLLoaderDataFormat.VARIABLES; submit_loader.addEventListener(Event.COMPLETE, submit_callback); scores_ready = false; } public function gg_submit_score(_arg1:int){ var _local2:URLRequest; var _local3:URLVariables; var _local4:URLLoader; _local2 = new URLRequest("http://www.gamegarage.co.uk/scripts/score.php"); _local2.method = URLRequestMethod.POST; _local3 = new URLVariables(); _local3.game_id = Preloader.PTR.loaderInfo.parameters["game_id"]; _local3.user_id = Preloader.PTR.loaderInfo.parameters["user_id"]; _local3.score = _arg1; _local3.alg = (((_local3.game_id + _local3.user_id) + _arg1) + "a83l9xj"); _local2.data = _local3; _local4 = new URLLoader(_local2); _local4.dataFormat = URLLoaderDataFormat.VARIABLES; _local4.load(_local2); } public function scores_available():Boolean{ return (scores_ready); } public function retrieve_scores(){ var i:int; var view_loader:URLLoader; var variables:URLVariables; var request:URLRequest; scores_ready = false; i = 0; while (i < 10) { hs_names[i] = null; hs_scores[i] = null; i = (i + 1); }; view_loader = new URLLoader(); view_loader.dataFormat = URLLoaderDataFormat.VARIABLES; view_loader.addEventListener(Event.COMPLETE, view_callback); variables = new URLVariables(); variables.game_id = "virus"; variables.scores = "10"; request = new URLRequest(); request.url = "http://www.gamegarage.co.uk/scripts/highscores.php"; request.method = URLRequestMethod.POST; request.data = variables; try { view_loader.load(request); } catch(error:Error) { }; } public function is_score_valid(_arg1:int):Boolean{ if (scores_ready == false){ return (false); }; if (hs_scores[9] < _arg1){ return (true); }; return (false); } public function submit_score(_arg1:String, _arg2:int){ } public function df_retrieve_scores(){ var i:int; var variables:URLVariables; var request:URLRequest; scores_ready = false; i = 0; while (i < 10) { hs_names[i] = null; hs_scores[i] = null; i = (i + 1); }; variables = new URLVariables(); variables.viewtype = "FLASH"; variables.ck = int((Math.random() * 100000)).toString(); request = new URLRequest(); request.url = "http://www.diffusiongames.com/virus_scores.php"; request.method = URLRequestMethod.GET; request.data = variables; try { } catch(error:Error) { }; } public function submit_callback(_arg1:Event):void{ if (_arg1.currentTarget.data.SUCCESS == "1"){ } else { if (_arg1.currentTarget.data.SUCCESS == "2"){ } else { if (_arg1.currentTarget.data.SUCCESS == "0"){ }; }; }; } public function gg_tracking(){ var _local1:URLRequest; var _local2:URLVariables; var _local3:URLLoader; _local1 = new URLRequest("http://www.gamegarage.co.uk/scripts/tracking.php"); _local1.method = URLRequestMethod.POST; _local2 = new URLVariables(); _local2.game_id = Preloader.PTR.loaderInfo.parameters["game_id"]; _local2.user_id = Preloader.PTR.loaderInfo.parameters["user_id"]; _local1.data = _local2; _local3 = new URLLoader(_local1); _local3.dataFormat = URLLoaderDataFormat.VARIABLES; _local3.load(_local1); } public function df_submit_score(_arg1:String, _arg2:int){ var s_input:String; var s_result:String; var variables:URLVariables; var request:URLRequest; var player_name = _arg1; var player_score = _arg2; scores_ready = false; s_input = ((player_name + player_score) + HK); s_result = MD5.hash(s_input); variables = new URLVariables(); variables.username = player_name; variables.highscore = player_score; variables.action = "ADD"; variables.hash = s_result; variables.ck = int((Math.random() * 100000)).toString(); request = new URLRequest(); request.url = "http://www.diffusiongames.com/virus_scores.php"; request.method = URLRequestMethod.GET; request.data = variables; try { submit_loader.load(request); } catch(error:Error) { }; } public function view_callback(_arg1:Event):void{ scores_ready = true; hs_names[0] = _arg1.currentTarget.data.name0; hs_scores[0] = _arg1.currentTarget.data.score0; hs_names[1] = _arg1.currentTarget.data.name1; hs_scores[1] = _arg1.currentTarget.data.score1; hs_names[2] = _arg1.currentTarget.data.name2; hs_scores[2] = _arg1.currentTarget.data.score2; hs_names[3] = _arg1.currentTarget.data.name3; hs_scores[3] = _arg1.currentTarget.data.score3; hs_names[4] = _arg1.currentTarget.data.name4; hs_scores[4] = _arg1.currentTarget.data.score4; hs_names[5] = _arg1.currentTarget.data.name5; hs_scores[5] = _arg1.currentTarget.data.score5; hs_names[6] = _arg1.currentTarget.data.name6; hs_scores[6] = _arg1.currentTarget.data.score6; hs_names[7] = _arg1.currentTarget.data.name7; hs_scores[7] = _arg1.currentTarget.data.score7; hs_names[8] = _arg1.currentTarget.data.name8; hs_scores[8] = _arg1.currentTarget.data.score8; hs_names[9] = _arg1.currentTarget.data.name9; hs_scores[9] = _arg1.currentTarget.data.score9; } } }//package

Library Items

Symbol 1 FontUsed by:2
Symbol 2 EditableTextUses:1Used by:6
Symbol 3 FontUsed by:4 5 88
Symbol 4 EditableTextUses:3Used by:6
Symbol 5 EditableTextUses:3Used by:6
Symbol 6 MovieClip {DebugInterface}Uses:2 4 5
Symbol 7 BitmapUsed by:8
Symbol 8 GraphicUses:7Used by:9
Symbol 9 MovieClip {ParticleCSpawnDeath}Uses:8
Symbol 10 GraphicUsed by:11
Symbol 11 MovieClip {EnemyClusterSpawn}Uses:10
Symbol 12 GraphicUsed by:13
Symbol 13 MovieClip {EnemyCluster}Uses:12
Symbol 14 GraphicUsed by:15
Symbol 15 MovieClip {EnemyFlea}Uses:14
Symbol 16 GraphicUsed by:17
Symbol 17 MovieClip {EnemyShooter}Uses:16
Symbol 18 GraphicUsed by:19
Symbol 19 MovieClip {EnemyDarter}Uses:18
Symbol 20 GraphicUsed by:21
Symbol 21 MovieClip {ParticlePieces2}Uses:20
Symbol 22 GraphicUsed by:23
Symbol 23 MovieClip {ParticlePieces}Uses:22
Symbol 24 BitmapUsed by:25
Symbol 25 GraphicUses:24Used by:26
Symbol 26 MovieClip {ParticleBlueFlare}Uses:25
Symbol 27 GraphicUsed by:31
Symbol 28 GraphicUsed by:31
Symbol 29 GraphicUsed by:31
Symbol 30 GraphicUsed by:31
Symbol 31 MovieClip {BombProjectile1}Uses:27 28 29 30
Symbol 32 GraphicUsed by:34
Symbol 33 GraphicUsed by:34
Symbol 34 MovieClip {Hex}Uses:32 33
Symbol 35 FontUsed by:36 37 38 39 40 41 58 59 60 61 63 75 76 77 79 81 82 83 84 85 86 93 96 107 108 109 113 115 123
Symbol 36 EditableTextUses:35Used by:49
Symbol 37 EditableTextUses:35Used by:49
Symbol 38 EditableTextUses:35Used by:49
Symbol 39 EditableTextUses:35Used by:49
Symbol 40 EditableTextUses:35Used by:49
Symbol 41 EditableTextUses:35Used by:49
Symbol 42 GraphicUsed by:43
Symbol 43 MovieClipUses:42Used by:49
Symbol 44 GraphicUsed by:45
Symbol 45 MovieClipUses:44Used by:49 62
Symbol 46 BitmapUsed by:47
Symbol 47 GraphicUses:46Used by:48
Symbol 48 MovieClipUses:47Used by:49 114
Symbol 49 MovieClip {UIOverlay}Uses:36 37 38 39 40 41 43 45 48
Symbol 50 GraphicUsed by:51
Symbol 51 MovieClip {PlayerProjectile}Uses:50Used by:62
Symbol 52 GraphicUsed by:53
Symbol 53 MovieClip {Crosshair}Uses:52Used by:62
Symbol 54 GraphicUsed by:55
Symbol 55 MovieClip {Virus.PlayerAvatar}Uses:54Used by:62
Symbol 56 BitmapUsed by:57
Symbol 57 GraphicUses:56Used by:62 126 140
Symbol 58 TextUses:35Used by:62
Symbol 59 TextUses:35Used by:62
Symbol 60 TextUses:35Used by:62
Symbol 61 TextUses:35Used by:62
Symbol 62 MovieClip {ScreenInstructions}Uses:57 58 55 53 51 59 60 45 61
Symbol 63 TextUses:35Used by:64
Symbol 64 MovieClip {ScreenSplash}Uses:63
Symbol 65 GraphicUsed by:66
Symbol 66 MovieClipUses:65Used by:69 72
Symbol 67 FontUsed by:68 70 93 107 111 124
Symbol 68 TextUses:67Used by:69
Symbol 69 MovieClip {PauseSplash}Uses:66 68
Symbol 70 TextUses:67Used by:71
Symbol 71 MovieClipUses:70Used by:72
Symbol 72 MovieClip {GameOverSplash}Uses:66 71
Symbol 73 BitmapUsed by:74
Symbol 74 GraphicUses:73Used by:80 87 139
Symbol 75 TextUses:35Used by:80
Symbol 76 TextUses:35Used by:80
Symbol 77 TextUses:35Used by:80
Symbol 78 GraphicUsed by:80
Symbol 79 EditableTextUses:35Used by:80
Symbol 80 MovieClip {EnterScoreMenu}Uses:74 75 76 77 78 79
Symbol 81 EditableTextUses:35Used by:87
Symbol 82 EditableTextUses:35Used by:87
Symbol 83 EditableTextUses:35Used by:87
Symbol 84 TextUses:35Used by:87
Symbol 85 TextUses:35Used by:87
Symbol 86 TextUses:35Used by:87
Symbol 87 MovieClip {HighScoreMenu}Uses:74 81 82 83 84 85 86
Symbol 88 EditableTextUses:3Used by:89
Symbol 89 MovieClip {PreloaderClip}Uses:88
Symbol 90 BitmapUsed by:91
Symbol 91 GraphicUses:90Used by:92
Symbol 92 MovieClipUses:91Used by:101
Symbol 93 EditableTextUses:35 67Used by:94
Symbol 94 MovieClipUses:93Used by:101
Symbol 95 SoundUsed by:101
Symbol 96 EditableTextUses:35Used by:97
Symbol 97 MovieClipUses:96Used by:101
Symbol 98 BitmapUsed by:99
Symbol 99 GraphicUses:98Used by:100
Symbol 100 MovieClipUses:99Used by:101
Symbol 101 MovieClip {armor_splash}Uses:92 94 95 97 100
Symbol 102 BitmapUsed by:103
Symbol 103 GraphicUses:102Used by:125
Symbol 104 BitmapUsed by:105
Symbol 105 GraphicUses:104Used by:106
Symbol 106 MovieClipUses:105Used by:125
Symbol 107 EditableTextUses:35 67Used by:125
Symbol 108 TextUses:35Used by:110
Symbol 109 TextUses:35Used by:110
Symbol 110 MovieClip {virus_fla.BtnSound_3}Uses:108 109Used by:125
Symbol 111 TextUses:67Used by:112
Symbol 112 MovieClipUses:111Used by:125
Symbol 113 TextUses:35Used by:114
Symbol 114 MovieClipUses:113 48Used by:125
Symbol 115 TextUses:35Used by:116
Symbol 116 MovieClipUses:115Used by:125
Symbol 117 BitmapUsed by:118
Symbol 118 GraphicUses:117Used by:119
Symbol 119 MovieClipUses:118Used by:125
Symbol 120 BitmapUsed by:121
Symbol 121 GraphicUses:120Used by:122
Symbol 122 MovieClipUses:121Used by:125
Symbol 123 TextUses:35Used by:125
Symbol 124 TextUses:67Used by:125
Symbol 125 MovieClip {ScreenMenu}Uses:103 106 107 110 112 114 116 119 122 123 124Used by:Timeline
Symbol 126 MovieClipUses:57Used by:140
Symbol 127 BitmapUsed by:128
Symbol 128 GraphicUses:127Used by:129 140
Symbol 129 MovieClipUses:128Used by:140
Symbol 130 BitmapUsed by:131
Symbol 131 GraphicUses:130Used by:140
Symbol 132 BitmapUsed by:133
Symbol 133 GraphicUses:132Used by:140
Symbol 134 BitmapUsed by:135
Symbol 135 GraphicUses:134Used by:140
Symbol 136 BitmapUsed by:137
Symbol 137 GraphicUses:136Used by:138
Symbol 138 MovieClipUses:137Used by:140
Symbol 139 MovieClipUses:74Used by:140
Symbol 140 MovieClip {WBackground}Uses:126 57 129 131 133 135 128 138 139Used by:179
Symbol 141 BitmapUsed by:142 143
Symbol 142 GraphicUses:141Used by:152
Symbol 143 GraphicUses:141Used by:152
Symbol 144 BitmapUsed by:145
Symbol 145 GraphicUses:144Used by:152
Symbol 146 BitmapUsed by:147
Symbol 147 GraphicUses:146Used by:152
Symbol 148 BitmapUsed by:149
Symbol 149 GraphicUses:148Used by:152
Symbol 150 BitmapUsed by:151
Symbol 151 GraphicUses:150Used by:152
Symbol 152 MovieClip {ParticleExplosion1}Uses:142 143 145 147 149 151Used by:179
Symbol 153 BitmapUsed by:154
Symbol 154 GraphicUses:153Used by:155
Symbol 155 MovieClip {ParticleExplosion2}Uses:154Used by:179
Symbol 156 BitmapUsed by:157
Symbol 157 GraphicUses:156Used by:158
Symbol 158 MovieClip {ParticleExplosion3}Uses:157Used by:179
Symbol 159 BitmapUsed by:160
Symbol 160 GraphicUses:159Used by:161
Symbol 161 MovieClip {ParticleIce}Uses:160Used by:179
Symbol 162 BitmapUsed by:163
Symbol 163 GraphicUses:162Used by:164
Symbol 164 MovieClip {ParticleStar}Uses:163Used by:179
Symbol 165 Sound {SFXExplode2}Used by:179
Symbol 166 Sound {SFXLevelChange}Used by:179
Symbol 167 Sound {SFXPlayerHit}Used by:179
Symbol 168 Sound {MusicMenu}Used by:179
Symbol 169 Sound {SFXBomb2}Used by:179
Symbol 170 Sound {SFXBomb3}Used by:179
Symbol 171 Sound {SFXBomb1}Used by:179
Symbol 172 Sound {SFXGameOver}Used by:179
Symbol 173 Sound {SFXExplode4}Used by:179
Symbol 174 Sound {SFXExplode3}Used by:179
Symbol 175 Sound {SFXExplode1}Used by:179
Symbol 176 Sound {SFXBombFire}Used by:179
Symbol 177 Sound {SFXBombAcquire}Used by:179
Symbol 178 Sound {MusicLevel}Used by:179
Symbol 179 MovieClip {virus_fla.AssetPreloader_10}Uses:140 152 155 158 161 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178Used by:Timeline

Instance Names

"fps"Symbol 6 MovieClip {DebugInterface} Frame 1Symbol 4 EditableText
"app_timing"Symbol 6 MovieClip {DebugInterface} Frame 1Symbol 5 EditableText
"score"Symbol 49 MovieClip {UIOverlay} Frame 1Symbol 36 EditableText
"wave"Symbol 49 MovieClip {UIOverlay} Frame 1Symbol 38 EditableText
"health"Symbol 49 MovieClip {UIOverlay} Frame 1Symbol 39 EditableText
"bombs"Symbol 49 MovieClip {UIOverlay} Frame 1Symbol 40 EditableText
"multiplier"Symbol 49 MovieClip {UIOverlay} Frame 1Symbol 41 EditableText
"health_icon"Symbol 49 MovieClip {UIOverlay} Frame 1Symbol 43 MovieClip
"bomb_icon"Symbol 49 MovieClip {UIOverlay} Frame 1Symbol 45 MovieClip
"name_input"Symbol 80 MovieClip {EnterScoreMenu} Frame 1Symbol 79 EditableText
"score_number"Symbol 87 MovieClip {HighScoreMenu} Frame 1Symbol 81 EditableText
"score_name"Symbol 87 MovieClip {HighScoreMenu} Frame 1Symbol 82 EditableText
"score_score"Symbol 87 MovieClip {HighScoreMenu} Frame 1Symbol 83 EditableText
"preload_text"Symbol 89 MovieClip {PreloaderClip} Frame 1Symbol 88 EditableText
"c3"Symbol 125 MovieClip {ScreenMenu} Frame 1Symbol 106 MovieClip
"c2"Symbol 125 MovieClip {ScreenMenu} Frame 1Symbol 106 MovieClip
"c1"Symbol 125 MovieClip {ScreenMenu} Frame 1Symbol 106 MovieClip
"btn_sound"Symbol 125 MovieClip {ScreenMenu} Frame 1Symbol 110 MovieClip {virus_fla.BtnSound_3}
"btn_play_game"Symbol 125 MovieClip {ScreenMenu} Frame 1Symbol 112 MovieClip
"btn_more_games"Symbol 125 MovieClip {ScreenMenu} Frame 1Symbol 114 MovieClip
"btn_high_scores"Symbol 125 MovieClip {ScreenMenu} Frame 1Symbol 116 MovieClip
"scanline"Symbol 125 MovieClip {ScreenMenu} Frame 1Symbol 119 MovieClip
"scanline"Symbol 125 MovieClip {ScreenMenu} Frame 1Symbol 119 MovieClip
"logo"Symbol 125 MovieClip {ScreenMenu} Frame 23Symbol 122 MovieClip

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata not present, AS3.
Protect (24)Timeline Frame 131 bytes "..$1$Lr$50TrfnlOlH9BFMP/ZyDgK/."




http://swfchan.com/10/47826/info.shtml
Created: 1/5 -2019 02:01:55 Last modified: 1/5 -2019 02:01:55 Server time: 22/12 -2024 23:53:04