Section 1
//LoadVars (meez.compat.LoadVars)
package meez.compat {
import flash.events.*;
import meez.*;
import flash.net.*;
public class LoadVars {
public var onLoad:Function;// = null
public var data:Object;
private var lvClient:URLLoader;
public function LoadVars(){
onLoad = null;
data = {};
super();
this.lvClient = new URLLoader();
this.lvClient.dataFormat = URLLoaderDataFormat.VARIABLES;
}
public function onHttpStatus(_arg1:HTTPStatusEvent):void{
Logger.debug((("Response received (status=" + _arg1.status) + ")"));
}
public function onLoadError(_arg1:IOErrorEvent):void{
Logger.warn((("LoadVars failed (e=" + _arg1) + ")"));
this.onLoad(false);
}
public function load(_arg1:String){
var apiRequest:URLRequest;
var url = _arg1;
apiRequest = new URLRequest(url);
this.lvClient.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
this.lvClient.addEventListener(Event.COMPLETE, onLoadComplete);
this.lvClient.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHttpStatus);
try {
this.lvClient.load(apiRequest);
} catch(e:SecurityError) {
Logger.error((("LoadVars failed (e=" + e) + ")"));
this.onLoad(false);
};
}
public function onLoadComplete(_arg1:Event):void{
Logger.warn((("LoadVars worked (evt=" + _arg1) + ")"));
this.data = this.lvClient.data;
this.onLoad(true);
}
}
}//package meez.compat
Section 2
//Core (meez.Core)
package meez {
import flash.net.*;
import flash.external.*;
public class Core {
public var cfg:Object;
private var js:Object;
private var lc:Object;
private static var _singleton:Core = null;
public function Core(_arg1:Object){
this.cfg = _arg1;
if (((_arg1.export_javascript) && (ExternalInterface.available))){
Logger.debug("Exporting javascript events");
this.js = {enabled:true};
enableJSTracing();
enableContainerEventHandler();
};
if (_arg1.export_flash){
Logger.debug((("Exporting flash events to local connection '" + _arg1.export_flash) + "'"));
this.lc = {id:_arg1.export_flash, conn:new LocalConnection()};
};
}
public function sendLocal(_arg1:String, _arg2:Object=null, _arg3:Object=null):void{
this.lc.conn.send(this.lc.id, _arg1, _arg2, _arg3);
}
public function enableContainerEventHandler():void{
ExternalInterface.addCallback("containerEvent", onContainerEvent);
Logger.debug("Enabled JS handler 'containerEvent'");
}
public function enableJSTracing():void{
Logger.externalLogger = function (_arg1:Number, _arg2:String){
ExternalInterface.call("meezTrace", _arg2);
};
}
public function onContainerEvent(_arg1:String, _arg2:String):void{
Logger.debug(((("[Container] '" + _arg1) + "' : ") + _arg2));
}
public function isJavascriptExportEnabled():Boolean{
return ((this.js) ? true : false);
}
public function isFlashExportEnabled():Boolean{
return ((this.lc) ? true : false);
}
public static function getInstance(_arg1:Object):Core{
if (_singleton){
return (_singleton);
};
_singleton = new Core(_arg1);
return (_singleton);
}
public static function validNumber(_arg1:String, _arg2:Object):Number{
if (!_arg2){
Logger.error((("'" + _arg1) + "' must be a valid Number"));
};
return (Number(_arg2));
}
public static function validString(_arg1:String, _arg2:Object, _arg3:Object=null):String{
var _local4:*;
var _local5:*;
if (!_arg2){
Logger.error((("'" + _arg1) + "' must be a valid String"));
};
if (_arg3){
if (((_arg3.maxLength) && ((_arg2.length > _arg3.maxLength)))){
Logger.warn((((("'" + _arg1) + "' cannot be greater than ") + _arg3.maxLength) + " characters"));
};
if (((_arg3.enum) && (!(_arg3.enum[_arg2.toUpperCase()])))){
_local4 = [];
for (_local5 in _arg3.enum) {
_local4.push(_local5.toUpperCase());
};
Logger.warn(((((("'" + _arg2.toUpperCase()) + "' (") + _arg1) + ") is not one of ") + _local4.join(",")));
};
};
return (String(_arg2));
}
}
}//package meez
Section 3
//FlashUtil (meez.FlashUtil)
package meez {
import flash.display.*;
public class FlashUtil {
public static function loadFlashVars(_arg1:Object):Object{
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = LoaderInfo(_arg1.loaderInfo).parameters;
_local3 = {};
for (_local4 in _local2) {
_local3[_local4] = String(_local2[_local4]);
};
return (_local3);
}
}
}//package meez
Section 4
//Games (meez.Games)
package meez {
import meez.compat.*;
import flash.net.*;
import flash.external.*;
public class Games {
private var resourceRoot:String;
private var lastGameplayId:Number;
private var core:Core;
private var cfg:Object;
private var platform:Object;
public static var DEFAULT_SUCCESS = defaultSuccessHandler;
public static var DEFAULT_ERROR = defaultErrorHandler;
public static var Emotion = {SADDEST:0, SADDER:2, SAD:3, NORMAL:5, HAPPY:7, HAPPIER:8, HAPPIEST:10};
public static var VERSION = "1.1.5";
public static var Event = {LOADED:"LOADED", NEWGAME:"NEWGAME", INGAMEREG:"INGAMEREG", CHECKPOINT:"CHECKPOINT", GAMEOVER:"GAMEOVER", WINAMOUNT:"WINAMOUNT", WINAWARD:"WINAWARD", WINITEM:"WINITEM"};
public function Games(_arg1:Object){
this.core = Core.getInstance(_arg1);
this.cfg = _arg1;
this.resourceRoot = ((_arg1.game_resource_root) || (""));
if (_arg1.game_api_host){
this.platform = {cfg:_arg1, host:_arg1.game_api_host};
Logger.debug((("Arcadia Platform (host='" + this.platform.host) + "')"));
};
Logger.debug((("Meez Games Client API (" + VERSION) + ") initialized"));
Logger.debug(((" - game='" + _arg1.game_id) + "'"));
}
public function postGameScore(_arg1:String, _arg2:Number, _arg3:String, _arg4:String, _arg5:Function=null, _arg6:Function=null):void{
var _local7:*;
var _local8:*;
var _local9:*;
_arg1 = getFullGameId(_arg1);
Core.validString("postScore.gameId", _arg1);
Core.validNumber("postScore.score", _arg2);
Core.validString("postScore.scoreDetail", _arg3, {maxLength:64});
Core.validString("postScore.scoreEvent", _arg4, {enum:Games.Event});
_arg5 = ((_arg5) || (DEFAULT_SUCCESS));
_arg6 = ((_arg6) || (DEFAULT_ERROR));
Logger.debug((((((("postScore(" + _arg2) + ",") + _arg3) + ",") + _arg4) + ")"));
broadcastEvent(_arg4, _arg1);
if (!this.platform){
_arg6("501", "Platform not available");
return;
};
_local7 = (this.platform.host + "/api.fv/v1/score.postScore");
_local7 = (_local7 + ("?game_id=" + _arg1));
_local7 = (_local7 + ("&player_id=" + this.platform.cfg.game_player_id));
_local7 = (_local7 + ("&game_score=" + _arg2));
_local7 = (_local7 + ("&score_detail=" + _arg3));
_local8 = getGameplayId(_arg4);
if (_local8 > 0){
_local7 = (_local7 + ("&score_gameplay_id=" + _local8));
};
_local7 = (_local7 + ("&score_auth=" + calcA9Auth(this.platform.cfg.game_auth)));
_local9 = createWinEventHandler(_arg5);
execRequest(_local7, _local9, _arg6);
}
public function getLatestGameScore(_arg1:String, _arg2:Function, _arg3:Function=null):void{
var url:*;
var successHandlerFn:*;
var gameId = _arg1;
var successFn = _arg2;
var errorFn = _arg3;
gameId = getFullGameId(gameId);
Core.validString("postScore.gameId", gameId);
errorFn = ((errorFn) || (DEFAULT_ERROR));
if (!this.platform){
errorFn("501", "Platform not available");
return;
};
url = (this.platform.host + "/api.fv/v1/score.getLatest");
url = (url + ("?game_id=" + gameId));
url = (url + ("&player_id=" + this.platform.cfg.game_player_id));
url = (url + ("&random=" + Math.round((Math.random() * 1000000)).toString(16)));
successHandlerFn = function (_arg1){
var _local2:*;
if (_arg1["scores.0.playerId"]){
_local2 = {playerId:_arg1["scores.0.playerId"], displayName:_arg1["scores.0.displayName"], score:Number(_arg1["scores.0.score"]), scoreDetail:_arg1["scores.0.scoreDetail"]};
};
successFn(_local2);
};
execRequest(url, successHandlerFn, errorFn);
}
private function execRequest(_arg1, _arg2, _arg3):void{
var apiRequest:LoadVars;
var url = _arg1;
var successFn = _arg2;
var errorFn = _arg3;
if (this.platform.cfg.site_auth){
url = ((url + "&site_auth=") + this.platform.cfg.site_auth);
};
apiRequest = new LoadVars();
apiRequest.onLoad = function (_arg1:Boolean){
var _local2:*;
_local2 = ((this.data) || (this));
if (_arg1){
if (_local2.code == 200){
Logger.debug("- 200 OK");
successFn(_local2);
} else {
Logger.debug(((("- " + _local2.code) + " ") + _local2.msg));
errorFn(_local2.code, _local2.msg);
};
} else {
Logger.debug("- 500 Unable to access platform");
errorFn(500, "Unable to access platform");
};
};
Logger.debug((("Request('" + url) + "')"));
apiRequest.load(url);
}
public function getResourceRoot():String{
return (this.resourceRoot);
}
public function postScore(_arg1:Number, _arg2:String, _arg3:String, _arg4:Function=null, _arg5:Function=null):void{
postGameScore(this.platform.cfg.game_id, _arg1, _arg2, _arg3, _arg4, _arg5);
}
private function broadcastWinEvents(_arg1:Object, _arg2:String, _arg3:String):Number{
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
_local4 = Number(_arg1[(_arg2 + ".count")]);
if (_local4 > 0){
_local5 = 0;
while (_local5 < _local4) {
_local6 = _arg1[(((_arg2 + ".") + _local5) + ".id")];
if (!_local6){
} else {
_local7 = _arg1[(((_arg2 + ".") + _local5) + ".updateValue")];
_local8 = _arg1[(((_arg2 + ".") + _local5) + ".newValue")];
_local9 = _local6;
_local9 = (_local9 + (_local7) ? ("|" + _local7) : "");
_local9 = (_local9 + (_local8) ? ("|" + _local8) : "");
broadcastEvent(_arg3, _local9);
};
_local5++;
};
};
return (_local4);
}
public function getLatestScore(_arg1:Function, _arg2:Function=null):void{
getLatestGameScore(this.platform.cfg.game_id, _arg1, _arg2);
}
public function broadcastEvent(_arg1:String, _arg2:String=null):void{
_arg1 = _arg1.toUpperCase();
Core.validString("broadcastEvent.event", _arg1, {enum:Games.Event});
Logger.debug((((("Games.broadcastEvent(" + _arg1) + ",") + _arg2) + ")"));
if (_arg1 == Event.NEWGAME){
this.lastGameplayId = 0;
};
if (this.core.isJavascriptExportEnabled()){
ExternalInterface.call("meezEvent", _arg1, _arg2);
};
if (this.core.isFlashExportEnabled()){
this.core.sendLocal("event", _arg1, _arg2);
};
}
public function inGameReg():void{
broadcastEvent(Event.INGAMEREG);
}
public function getPlayer(_arg1:Function, _arg2:Function):void{
var url:*;
var successHandlerFn:*;
var successFn = _arg1;
var errorFn = _arg2;
errorFn = ((errorFn) || (DEFAULT_ERROR));
if (!this.platform){
errorFn("501", "Platform not available");
return;
};
url = (this.platform.host + "/api.fv/v1/player.get");
url = (url + ("?player_id=" + this.platform.cfg.game_player_id));
url = (url + ("&random=" + Math.round((Math.random() * 1000000)).toString(16)));
successHandlerFn = function (_arg1){
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = {id:_arg1["playerId"], name:_arg1["name"], tag:_arg1["tag"], avatarId:_arg1["avatar"], attribs:{}};
for (_local3 in _arg1) {
_local4 = Util.stringStartsWith("attrib.", _local3);
if (!_local4){
} else {
_local2.attribs[_local3.substring(7)] = _arg1[_local3];
};
};
successFn(_local2);
};
execRequest(url, successHandlerFn, errorFn);
}
private function getFullGameId(_arg1:String=null):String{
if (!_arg1){
return (this.cfg.game_id);
};
if (_arg1.indexOf(".") == -1){
return (((this.cfg.game_id + ".") + _arg1));
};
return (_arg1);
}
private function calcC1Auth(_arg1, _arg2){
return (((("c1" + _arg1) + ":") + _arg2));
}
public function postChallengeScore(_arg1:String, _arg2:Number, _arg3:String, _arg4:Function, _arg5:Function):void{
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
_local6 = getFullGameId();
_local7 = Event.GAMEOVER;
Core.validString("postChallengeScore.gameId", _local6);
Core.validNumber("postChallengeScore.score", _arg2);
Core.validString("postChallengeScore.scoreDetail", _arg3, {maxLength:64});
Core.validString("postChallengeScore.scoreEvent", _local7, {enum:Games.Event});
_arg4 = ((_arg4) || (DEFAULT_SUCCESS));
_arg5 = ((_arg5) || (DEFAULT_ERROR));
if (!this.platform){
_arg5("501", "Platform not available");
return;
};
Logger.debug((((((((("postChallengeScore(" + _arg1) + ",") + _arg2) + ",") + _arg3) + ",") + _local7) + ")"));
broadcastEvent(_local7, _local6);
_local8 = (this.platform.host + "/api.fv/v1/challenge.postScore");
_local8 = (_local8 + ("?game_id=" + _local6));
_local8 = (_local8 + ("&challenge_id=" + _arg1));
_local8 = (_local8 + ("&player_id=" + this.platform.cfg.game_player_id));
_local8 = (_local8 + ("&game_score=" + _arg2));
_local8 = (_local8 + ("&score_detail=" + _arg3));
_local8 = (_local8 + ("&score_auth=" + calcC1Auth(_arg1, this.platform.cfg.game_auth)));
_local9 = createWinEventHandler(_arg4);
execRequest(_local8, _local9, _arg5);
}
private function createWinEventHandler(_arg1:Function):Function{
var callback:*;
var successHandlerFn:*;
var successFn = _arg1;
callback = this;
successHandlerFn = function (_arg1){
if (callback.broadcastWinEvents(_arg1, "winAmount", Event.WINAMOUNT) > 0){
callback.emote(Emotion.HAPPY);
};
if ((((callback.broadcastWinEvents(_arg1, "winItem", Event.WINITEM) > 0)) || ((callback.broadcastWinEvents(_arg1, "winAward", Event.WINAWARD) > 0)))){
callback.emote(Emotion.HAPPIEST);
};
successFn(_arg1);
};
return (successHandlerFn);
}
public function newGame(_arg1:String=null){
_arg1 = getFullGameId(_arg1);
broadcastEvent(Event.NEWGAME, _arg1);
}
private function calcA9Auth(_arg1:String):String{
var _local2:*;
_local2 = new Date();
return (((("a9" + (_local2.getTime() / 1000).toString(16)) + ":") + _arg1));
}
public function emote(_arg1:Object):void{
Core.validString("emote.emotion", _arg1);
Logger.debug((("Games.emote(" + _arg1) + ")"));
if (this.core.isJavascriptExportEnabled()){
ExternalInterface.call("meezEmote", _arg1);
};
if (this.core.isFlashExportEnabled()){
this.core.sendLocal("emote", _arg1);
};
}
private function getGameplayId(_arg1:String):String{
var _local2:*;
var _local3:*;
if (_arg1 == Event.GAMEOVER){
_local2 = ((this.lastGameplayId) || (0));
this.lastGameplayId = 0;
} else {
if (((this.lastGameplayId) && ((this.lastGameplayId > 0)))){
_local2 = this.lastGameplayId;
} else {
_local3 = new Date();
_local2 = Math.floor((_local3.getTime() / 1000));
};
this.lastGameplayId = _local2;
};
return (_local2);
}
public function checkChallenge(_arg1:String, _arg2:Function, _arg3:Function){
var _local4:*;
Core.validString("checkChallenge.challengeId", _arg1);
if (!this.platform){
_arg3("501", "Platform not available");
return;
};
_local4 = (this.platform.host + "/api.fv/v1/challenge.check");
_local4 = (_local4 + ("?game_id=" + this.platform.cfg.game_id));
_local4 = (_local4 + ("&challenge_id=" + _arg1));
_local4 = (_local4 + ("&player_id=" + this.platform.cfg.game_player_id));
_local4 = (_local4 + ("&random=" + Math.round((Math.random() * 1000000)).toString(16)));
execRequest(_local4, _arg2, _arg3);
}
public static function defaultErrorHandler(_arg1, _arg2):void{
Logger.error((((("[error:" + _arg1) + ":") + _arg2) + "]"));
}
public static function defaultSuccessHandler(_arg1):void{
Logger.debug("[success]");
}
public static function O2S(_arg1):String{
var _local2:*;
var _local3:*;
var _local4:Number;
_local2 = "";
for (_local3 in _arg1) {
if (_arg1[_local3] == null){
} else {
_local4 = Number(_arg1[_local3]);
if (!isNaN(_local4)){
_local2 = (_local2 + (_local3 + _arg1[_local3]));
} else {
Logger.warn((((("Value of '" + _local3) + "' is not a number ('") + _arg1[_local3]) + "') - ignoring"));
};
};
};
return (_local2);
}
public static function S2O(_arg1):Object{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local2 = {};
_local5 = 0;
while (_local5 < _arg1.length) {
_local3 = "";
while ((((((_local5 < _arg1.length)) && ((_arg1.charAt(_local5) >= "a")))) && ((_arg1.charAt(_local5) <= "z")))) {
var _temp1 = _local5;
_local5 = (_local5 + 1);
_local3 = (_local3 + _arg1.charAt(_temp1));
};
_local4 = "";
while ((((((_local5 < _arg1.length)) && ((_arg1.charAt(_local5) >= "0")))) && ((_arg1.charAt(_local5) <= "9")))) {
var _temp2 = _local5;
_local5 = (_local5 + 1);
_local4 = (_local4 + _arg1.charAt(_temp2));
};
_local2[_local3] = Number(_local4);
};
return (_local2);
}
}
}//package meez
Section 5
//Logger (meez.Logger)
package meez {
public class Logger {
public static var Level:Object = {DEBUG:0, WARN:1, ERROR:2, INFO:3};
public static var externalLogger:Function;
public static var LevelStr:Array = ["DEBUG", "WARN", "ERROR", "INFO"];
public static function debug(_arg1:String):void{
log(Level.DEBUG, _arg1);
}
public static function log(_arg1:Number, _arg2:String):void{
if (externalLogger != null){
externalLogger(_arg1, _arg2);
//unresolved jump
};
}
public static function warn(_arg1:String):void{
log(Level.WARN, _arg1);
}
public static function info(_arg1:String):void{
log(Level.INFO, _arg1);
}
public static function error(_arg1:String):void{
log(Level.ERROR, _arg1);
}
}
}//package meez
Section 6
//Util (meez.Util)
package meez {
public class Util {
public static function stringStartsWith(_arg1:String, _arg2:String):Boolean{
return ((_arg2.substring(0, _arg1.length) == _arg1));
}
}
}//package meez
Section 7
//clip_sd88detincelle_283 (monstersdenk_fla.clip_sd88detincelle_283)
package monstersdenk_fla {
import flash.display.*;
public dynamic class clip_sd88detincelle_283 extends MovieClip {
public function clip_sd88detincelle_283(){
addFrameScript(13, frame14);
}
function frame14(){
stop();
}
}
}//package monstersdenk_fla
Section 8
//CorridorSegment_67 (monstersdenk_fla.CorridorSegment_67)
package monstersdenk_fla {
import flash.display.*;
public dynamic class CorridorSegment_67 extends MovieClip {
public function CorridorSegment_67(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package monstersdenk_fla
Section 9
//Eye1_63 (monstersdenk_fla.Eye1_63)
package monstersdenk_fla {
import flash.display.*;
public dynamic class Eye1_63 extends MovieClip {
public function Eye1_63(){
addFrameScript(32, frame33, 91, frame92);
}
function frame92(){
if (Math.random() < 0.7){
this.gotoAndPlay("WaitLeft");
};
}
function frame33(){
if (Math.random() < 0.7){
this.gotoAndPlay("WaitRight");
};
}
}
}//package monstersdenk_fla
Section 10
//Eye2_64 (monstersdenk_fla.Eye2_64)
package monstersdenk_fla {
import flash.display.*;
public dynamic class Eye2_64 extends MovieClip {
public function Eye2_64(){
addFrameScript(71, frame72, 123, frame124);
}
function frame72(){
if (Math.random() < 0.7){
this.gotoAndPlay("WaitLeft");
};
}
function frame124(){
if (Math.random() < 0.7){
this.gotoAndPlay("WaitRight");
};
}
}
}//package monstersdenk_fla
Section 11
//FadeScreenDarker_47 (monstersdenk_fla.FadeScreenDarker_47)
package monstersdenk_fla {
import flash.display.*;
public dynamic class FadeScreenDarker_47 extends MovieClip {
public function FadeScreenDarker_47(){
addFrameScript(5, frame6);
}
function frame6(){
this.gotoAndStop(6);
}
}
}//package monstersdenk_fla
Section 12
//freeinternetgames_282 (monstersdenk_fla.freeinternetgames_282)
package monstersdenk_fla {
import flash.display.*;
public dynamic class freeinternetgames_282 extends MovieClip {
public function freeinternetgames_282(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package monstersdenk_fla
Section 13
//LoadingSymbol_45 (monstersdenk_fla.LoadingSymbol_45)
package monstersdenk_fla {
import flash.display.*;
public dynamic class LoadingSymbol_45 extends MovieClip {
public function LoadingSymbol_45(){
addFrameScript(3, frame4);
}
function frame4(){
this.gotoAndStop(4);
}
}
}//package monstersdenk_fla
Section 14
//player_arrow_impact_234 (monstersdenk_fla.player_arrow_impact_234)
package monstersdenk_fla {
import flash.display.*;
public dynamic class player_arrow_impact_234 extends MovieClip {
public var hit:MovieClip;
public function player_arrow_impact_234(){
addFrameScript(11, frame12);
}
function frame12(){
this.gotoAndStop(12);
}
}
}//package monstersdenk_fla
Section 15
//poisonbubble_226 (monstersdenk_fla.poisonbubble_226)
package monstersdenk_fla {
import flash.display.*;
public dynamic class poisonbubble_226 extends MovieClip {
public function poisonbubble_226(){
addFrameScript(24, frame25);
}
function frame25(){
this.gotoAndStop(25);
}
}
}//package monstersdenk_fla
Section 16
//SelectArrow_34 (monstersdenk_fla.SelectArrow_34)
package monstersdenk_fla {
import flash.display.*;
public dynamic class SelectArrow_34 extends MovieClip {
public function SelectArrow_34(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package monstersdenk_fla
Section 17
//shield_gleam_206 (monstersdenk_fla.shield_gleam_206)
package monstersdenk_fla {
import flash.display.*;
public dynamic class shield_gleam_206 extends MovieClip {
public function shield_gleam_206(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
this.gotoAndStop(15);
}
function frame1(){
this.gotoAndStop(1);
}
}
}//package monstersdenk_fla
Section 18
//TitleText_59 (monstersdenk_fla.TitleText_59)
package monstersdenk_fla {
import flash.display.*;
public dynamic class TitleText_59 extends MovieClip {
public function TitleText_59(){
addFrameScript(49, frame50);
}
function frame50(){
this.stop();
}
}
}//package monstersdenk_fla
Section 19
//UpdateFlashButton_285 (monstersdenk_fla.UpdateFlashButton_285)
package monstersdenk_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.external.*;
public dynamic class UpdateFlashButton_285 extends MovieClip {
public function UpdateFlashButton_285(){
addFrameScript(0, frame1);
}
public function getFlashLink(_arg1:MouseEvent):void{
var url:*;
var e = _arg1;
url = "http://www.adobe.com/go/getflashplayer";
try {
ExternalInterface.call("window.open", url, "_blank", "");
} catch(error) {
navigateToURL(new URLRequest(url), "_blank");
};
}
function frame1(){
this.gotoAndStop(1);
this.addEventListener(MouseEvent.MOUSE_DOWN, getFlashLink);
}
}
}//package monstersdenk_fla
Section 20
//vert_slash_231 (monstersdenk_fla.vert_slash_231)
package monstersdenk_fla {
import flash.display.*;
public dynamic class vert_slash_231 extends MovieClip {
public var slash:MovieClip;
public function vert_slash_231(){
addFrameScript(11, frame12);
}
function frame12(){
this.gotoAndStop(12);
}
}
}//package monstersdenk_fla
Section 21
//Armor (Armor)
package {
public class Armor extends Equipment {
private var _type:int;// = 0
static const medium = 1;
static const light = 0;
static const heavy = 2;
static const special = 3;
public function Armor(){
_type = 0;
super();
item_name = "Armor";
item_level = 1;
type = Armor.light;
}
override public function generateItem(_arg1:int):void{
var _local2:*;
var _local3:*;
_local2 = false;
_local3 = false;
getItemModifiers();
if (item_rarity == Item.green){
if (DungeonMain.RandomNum(0, 100) >= 50){
_local3 = true;
} else {
_local2 = true;
};
};
if ((((item_rarity == Item.blue)) || (_local3))){
prefix = rollForPrefix(item_rarity);
};
if ((((item_rarity == Item.blue)) || (_local2))){
suffix = rollForSuffix(item_rarity);
};
if (prefix >= 0){
applyPrefix();
};
if (suffix >= 0){
applySuffix();
};
armor_rating = scaleArmorForLevel((base_armor_rating * (1 + (base_armor_mod / 100))));
if (materials.length){
material = rollForMaterial(item_rarity, materials);
scaleArmorForMaterial(material);
} else {
material = -1;
};
if (material >= 0){
item_name = ((materials[material] + " ") + item_name);
};
if (prefix >= 0){
item_name = ((prefixes[prefix][0] + " ") + item_name);
};
if (suffix >= 0){
item_name = ((item_name + " of ") + suffixes[suffix][0]);
};
if (item_rarity == Item.grey){
item_name = ((grey_name + " ") + item_name);
};
}
public function get type():int{
return (this._type);
}
override public function getItemTypeString(){
return ("Armor");
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
public function modifyBaseArmorForSlot():void{
var _local1:*;
if (!base_armor_rating){
return;
};
_local1 = 1;
if (slot == Equipment.boots){
_local1 = 1;
} else {
if (slot == Equipment.gloves){
_local1 = 1;
} else {
if (slot == Equipment.legs){
_local1 = 1.2;
} else {
if (slot == Equipment.armor){
_local1 = 1.5;
} else {
if (slot == Equipment.head){
_local1 = 1.2;
};
};
};
};
};
base_armor_rating = Math.round((base_armor_rating * _local1));
}
public function set type(_arg1:int):void{
this._type = _arg1;
}
override public function itemStatsString(_arg1:String):String{
if (armor_rating){
_arg1 = (_arg1 + (String(armor_rating) + " Armor Rating\n"));
};
return (super.itemStatsString(_arg1));
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
if (prefixes[_local1][0] == "Thick"){
armor_rating = Math.round((armor_rating * prefixes[_local1][1]));
return;
};
super.applyPrefix();
}
public function scaleArmorForMaterial(_arg1:int){
var _local2:*;
_local2 = (1 + ((_arg1 + 1) * 0.05));
armor_rating = Math.round((armor_rating * _local2));
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Thick", 1.2]);
prefixes.push(["Soothing", 5]);
prefixes.push(["Purifying", 30]);
suffixes.push(["Reflection", 10]);
suffixes.push(["Tenacity", 30]);
suffixes.push(["Might", base_item_stat_bonus]);
suffixes.push(["Deftness", base_item_stat_bonus]);
}
}
}//package
Section 22
//armor_buff_effect (armor_buff_effect)
package {
import flash.display.*;
public dynamic class armor_buff_effect extends MovieClip {
public var shield:MovieClip;
public function armor_buff_effect(){
addFrameScript(0, frame1, 4, frame5, 9, frame10, 49, frame50);
}
function frame10(){
this.shield.gotoAndPlay(2);
}
function frame1(){
dm.sound.play(SoundControl.armorBuff);
}
function frame5(){
this.shield.gotoAndStop(1);
}
function frame50(){
this.stop();
}
}
}//package
Section 23
//armor_buff_sound (armor_buff_sound)
package {
import flash.media.*;
public dynamic class armor_buff_sound extends Sound {
}
}//package
Section 24
//arrow_fire_sound (arrow_fire_sound)
package {
import flash.media.*;
public dynamic class arrow_fire_sound extends Sound {
}
}//package
Section 25
//BackButton (BackButton)
package {
import flash.display.*;
public dynamic class BackButton extends MovieClip {
}
}//package
Section 26
//basilisk_sound (basilisk_sound)
package {
import flash.media.*;
public dynamic class basilisk_sound extends Sound {
}
}//package
Section 27
//battle_start2 (battle_start2)
package {
import flash.media.*;
public dynamic class battle_start2 extends Sound {
}
}//package
Section 28
//BattleActionsBar (BattleActionsBar)
package {
import flash.display.*;
public dynamic class BattleActionsBar extends Sprite {
public var retreat_all_skill:SkillIcon;
public var pass_skill:SkillIcon;
public var retreat_skill:SkillIcon;
}
}//package
Section 29
//Battlefield (Battlefield)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
import flash.utils.*;
import flash.ui.*;
import flash.filters.*;
public class Battlefield extends MovieClip {
const PASS_TURN_DELAY = 600;
const max_blur = 30;
const color_white:uint = 0xFFFFFF;
const pass_animation_frame = 11;
const immune_animation_frame = 9;
const blur_steps = 3;
const stunned_animation_frame = 10;
const miss_animation_frame = 8;
const color_red:uint = 0xE90000;
public var active_info_panel:BattleInfoPanel;
var horde:Horde;
public var skillbar:SkillBar;
var passing:Boolean;// = false
public var bg:MovieClip;
var bonusAttackPending:Boolean;// = false
var monsterTurnDelayTimer:Timer;
var npc_portraits:Array;
public var help_btn:HelpButton;
var retreatAll:Boolean;// = false
var damageSpongeMonster:MonsterCharacter;
private var exitedSafely:Boolean;
public var selected_skill_text:TextField;
var turn;// = 0
var usedSkill:Boolean;// = false
public var pc2:EmptyPortrait;
public var target_info_panel:BattleInfoPanel;
public var pc6:EmptyPortrait;
public var pc1:EmptyPortrait;
public var pc3:EmptyPortrait;
public var pc4:EmptyPortrait;
public var pc5:EmptyPortrait;
private var numTargets:int;// = 0
private var exitTimer:Timer;
var playerRegenTimer:Timer;
var delayedHit:int;// = -1
var delayedHitsAttacker:Array;
var delayedHitsDelay:int;// = 300
var pc_portraits:Array;
var blurTimer:Timer;
public var sound_btn:SoundButton;
var hover:Character;
public var messages:BattleMessageBox;
var do_eor:Boolean;// = false
var speedlist:Array;
public var npc1:EmptyPortrait;
public var npc2:EmptyPortrait;
public var npc3:EmptyPortrait;
public var npc4:EmptyPortrait;
public var npc6:EmptyPortrait;
var damageSpongePlayer:PlayerCharacter;
public var npc5:EmptyPortrait;
var phl:CurrentPortraitHighlight;
var currentBlur:int;// = 0
public var initDisplay:InitiativeList;
var pc_party:Party;
var combat_grid:Array;
var doNothingTimer:Timer;
var doLethalAnim:Boolean;// = false
var delayedHitsSkill:Array;
var valid_targets:Array;
var valid_targets_portraits:Array;
var delayedHitsDamage:Array;
var bonusAttackTarget:Character;
var turnDelayTimer:Timer;
var hadMonsterDelay:Boolean;// = false
var delayedHitsTarget:Array;
public var actionsbar:BattleActionsBar;
public function Battlefield(){
pc_portraits = new Array();
npc_portraits = new Array();
speedlist = new Array(11);
turn = 0;
combat_grid = new Array(3);
valid_targets = new Array();
valid_targets_portraits = new Array();
bonusAttackPending = false;
do_eor = false;
retreatAll = false;
delayedHit = -1;
delayedHitsDamage = new Array();
delayedHitsSkill = new Array();
delayedHitsTarget = new Array();
delayedHitsAttacker = new Array();
delayedHitsDelay = 300;
currentBlur = 0;
usedSkill = false;
hadMonsterDelay = false;
numTargets = 0;
doLethalAnim = false;
passing = false;
super();
addEventListener(Event.ADDED_TO_STAGE, added);
}
private function PlayerCanHit(_arg1:int){
var _local2:*;
var _local3:*;
var _local4:PlayerCharacter;
var _local5:MonsterCharacter;
var _local6:*;
_local4 = PlayerCharacter(speedlist[turn]);
if (_arg1 > 6){
return;
};
if (_arg1 < 1){
return;
};
if (_arg1 > 3){
_local2 = (_arg1 % 4);
} else {
_local2 = (_arg1 - 1);
};
_local3 = (Math.ceil((_arg1 / 3)) - 1);
if (combat_grid[_local2][_local3] == null){
return;
};
_local5 = MonsterCharacter(combat_grid[_local2][_local3]);
if (MonsterCharacter(_local5).health <= 0){
return;
};
if (MonsterCharacter(_local5).hiding){
return;
};
if (((skillbar.getSelectedSkill().targetsStunned) && (!(_local5.stunned_duration)))){
return;
};
if (((!((damageSpongeMonster == null))) && (!((damageSpongeMonster == _local5))))){
return;
};
_local6 = PortraitFromCharacter(_local5);
if (_local6 != null){
addPlayerTarget(_local5);
};
}
function EndTurn(){
var _local1:*;
var _local2:*;
speedlist[turn].hadCombatTurn = true;
if ((speedlist[turn] is PlayerCharacter)){
if (getChildByName("skillbar") != null){
removeChild(skillbar);
};
if (getChildByName("actionsbar") != null){
removeChild(actionsbar);
};
this.removeEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelEvent);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
selected_skill_text.text = "";
};
RemoveTargetInfo();
_local2 = 1500;
if (passing){
_local2 = PASS_TURN_DELAY;
passing = false;
};
if (speedlist[turn].stunned_duration){
_local2 = PASS_TURN_DELAY;
};
if ((((speedlist[turn] is PlayerCharacter)) && (((speedlist[turn].retreated) || (speedlist[turn].retreating))))){
_local2 = 600;
};
turnDelayTimer = new Timer(_local2, 1);
turnDelayTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onTurnDelayComplete);
turnDelayTimer.start();
}
private function modifySkillDamage(_arg1:int, _arg2:Skill, _arg3:Character, _arg4:Character, _arg5:int, _arg6:Boolean){
var _local7:*;
var _local8:*;
var _local9:*;
if (_arg3.invulnerable){
return (0);
};
if (((_arg2.onlyDamagesUndead) && (!((_arg3.type == Horde.undead))))){
return (0);
};
if (((_arg2.splashDamageMultiplier) && (!(_arg6)))){
_arg1 = (_arg1 * _arg2.splashDamageMultiplier);
};
if (((_arg2.undeadMultiplier) && ((_arg3.type == Horde.undead)))){
_arg1 = (_arg1 * _arg2.undeadMultiplier);
};
if ((((_arg4 is PlayerCharacter)) && (_arg1))){
_arg1 = PlayerCharacter(_arg4).multiplyDamageForTargetType(_arg1, _arg3.type);
};
if (((((_arg2.damageBonusVsCreatureType) && (_arg1))) && ((_arg3 is MonsterCharacter)))){
if (_arg2.damageBonusVsCreatureType == MonsterCharacter(_arg3).type){
_arg1 = (_arg1 * _arg2.damageBonusVsCreatureModifier);
};
};
if (_arg1){
_local7 = _arg3.damageAfterArmor(_arg1);
if (_arg2.ignoresArmor){
_arg1 = Math.max(_arg1, _local7);
} else {
_arg1 = _local7;
};
};
if (((((_arg1) && ((_arg3 is MonsterCharacter)))) && (MonsterCharacter(_arg3).ethereal))){
if (_arg2.isPhysical()){
_arg1 = Math.round((_arg1 * (1 - (MonsterCharacter(_arg3).ethereal / 100))));
if (_arg1 == 0){
_arg1 = 1;
};
};
};
doLethalAnim = false;
if (((((_arg1) && (((((_arg2.addsPowerToLethality) || (_arg2.lethality))) || (_arg4.getLethality()))))) && (!(_arg3.lethalityImmune)))){
_local8 = _arg2.lethality;
if (_arg2.addsPowerToLethality){
_local8 = (_local8 + _arg5);
};
_local8 = (_local8 + Math.ceil((_arg4.getLethality() / numTargets)));
_local9 = dm.randomNum(0, 100);
if (_local9 < _local8){
_arg1 = _arg3.health;
doLethalAnim = true;
};
};
if (((_arg2.nonLethal) && ((_arg1 >= _arg3.health)))){
_arg1 = (_arg3.health - 1);
};
return (Math.round(_arg1));
}
function clickRetreatAll(_arg1:MouseEvent):void{
if ((speedlist[turn] is PlayerCharacter)){
retreatAll = true;
clickRetreat(_arg1);
};
}
private function UpdateCombatGrid():void{
var _local1:*;
var _local2:*;
_local1 = 0;
_local2 = 0;
_local1 = 0;
while (_local1 < 3) {
combat_grid[_local1] = new Array(4);
_local2 = 0;
while (_local2 < 4) {
combat_grid[_local1][_local2] = null;
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < speedlist.length) {
AddCharToCombatGrid(speedlist[_local1]);
_local1++;
};
}
public function ValidTargetsForPlayer(_arg1:Skill){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:PlayerCharacter;
_local2 = speedlist[turn];
_local8 = false;
_local9 = false;
valid_targets.length = 0;
valid_targets_portraits.length = 0;
RemoveTargetInfo();
selected_skill_text.text = skillbar.getSelectedSkill().skillname;
dm.embolden(selected_skill_text);
if (_arg1.usesWeaponRange){
if (_local2.gear[Equipment.weapon]){
if ((_local2.gear[Equipment.weapon] is MeleeWeapon)){
_local9 = true;
} else {
if ((_local2.gear[Equipment.weapon] is RangedWeapon)){
_local8 = true;
};
};
};
};
_local10 = PlayerCharacter(_local2).gear[Equipment.weapon];
if (!_arg1.usable()){
selected_skill_text.textColor = color_red;
return;
};
selected_skill_text.textColor = color_white;
if (_arg1.targetsSelf){
_local12 = PortraitFromCharacter(speedlist[turn]);
if (_local12 != null){
addPlayerTarget(speedlist[turn]);
};
return;
};
if (_arg1.targetsFriendlies){
_local5 = 0;
for (;_local5 < pc_portraits.length;_local5++) {
_local13 = pc_portraits[_local5].char_ref;
if (PlayerCharacter(_local13).retreated){
} else {
if (_arg1.resurrects){
if (Character(_local13).health > 0){
continue;
};
} else {
if (Character(_local13).health <= 0){
continue;
};
};
if (skillbar.getSelectedSkill().targetsFriendlyFrontRow){
//unresolved if
//unresolved if
} else {
addPlayerTarget(_local13);
};
};
};
return;
};
if (((_arg1.rangedAttack) || (_local8))){
_local5 = 1;
while (_local5 <= 6) {
PlayerCanHit(_local5);
_local5++;
};
return;
};
_local11 = IsPlayerMeleeBlocked(PlayerCharacter(_local2));
if ((((_local2.pos < 4)) || ((((_local2.pos > 3)) && (!(_local11)))))){
if (damageSpongeMonster != null){
PlayerCanHit(damageSpongeMonster.pos);
};
_local3 = 0;
_local5 = 0;
while (_local5 < 3) {
if (combat_grid[_local5][1] != null){
if (Character(combat_grid[_local5][1]).health > 0){
if (Character(combat_grid[_local5][1]).hiding){
} else {
_local3++;
_local7 = Character(combat_grid[_local5][1]).pos;
};
};
};
_local5++;
};
if (_local3 == 1){
PlayerCanHit(_local7);
} else {
if (_local3 > 1){
if (_local2.pos < 4){
PlayerCanHit((_local2.pos + 3));
if ((_local2.pos + 4) <= 6){
PlayerCanHit((_local2.pos + 4));
};
if ((_local2.pos + 2) >= 4){
PlayerCanHit((_local2.pos + 2));
};
} else {
PlayerCanHit(_local2.pos);
if ((_local2.pos + 1) <= 6){
PlayerCanHit((_local2.pos + 1));
};
if ((_local2.pos - 1) >= 4){
PlayerCanHit((_local2.pos - 1));
};
};
} else {
if (_local3 == 0){
_local4 = 0;
_local5 = 0;
while (_local5 < 3) {
if (combat_grid[_local5][0] != null){
if (Character(combat_grid[_local5][0]).health > 0){
if (Character(combat_grid[_local5][0]).hiding){
} else {
_local4++;
_local7 = Character(combat_grid[_local5][0]).pos;
};
};
};
_local5++;
};
if (_local4 == 1){
PlayerCanHit(_local7);
} else {
if (_local4 > 1){
if (_local2.pos < 4){
PlayerCanHit(_local2.pos);
if ((_local2.pos + 1) <= 3){
PlayerCanHit((_local2.pos + 1));
};
if ((_local2.pos - 1) >= 1){
PlayerCanHit((_local2.pos - 1));
};
} else {
PlayerCanHit((_local2.pos - 3));
if ((_local2.pos - 2) <= 3){
PlayerCanHit((_local2.pos - 2));
};
if ((_local2.pos - 4) >= 1){
PlayerCanHit((_local2.pos - 4));
};
};
};
};
};
};
};
};
}
function mouseMoveEvent(_arg1:MouseEvent):void{
}
private function replaceChar(_arg1:Character, _arg2:Character):void{
var _local3:*;
var _local4:*;
var _local5:*;
_local3 = 0;
while (_local3 < horde.members.length) {
if (horde.members[_local3] == _arg1){
horde.members[_local3] = _arg2;
};
_local3++;
};
_local4 = 0;
while (_local4 < 3) {
_local5 = 0;
while (_local5 < 4) {
if (combat_grid[_local4][_local5] == _arg1){
combat_grid[_local4][_local5] = _arg2;
return;
};
_local5++;
};
_local4++;
};
}
private function IsPlayerMeleeBlocked(_arg1:PlayerCharacter):Boolean{
var _local2:*;
var _local3:*;
_local2 = 0;
_local3 = false;
if (_arg1.pos > 3){
_local2 = 0;
while (_local2 < 3) {
if (combat_grid[_local2][2] != null){
if ((((((combat_grid[_local2][2].health > 0)) && (!(combat_grid[_local2][2].retreated)))) && (!(combat_grid[_local2][2].hiding)))){
_local3 = true;
};
};
_local2++;
};
};
if (_arg1.gear[Equipment.weapon] != null){
if ((_arg1.gear[Equipment.weapon] is iSpear)){
_local3 = false;
};
};
return (_local3);
}
function unBlurDone(_arg1:TimerEvent):void{
blurTimer.removeEventListener(TimerEvent.TIMER, unBlurStep);
blurTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, unBlurDone);
this.filters = null;
}
private function AddCharToCombatGrid(_arg1:Character):void{
var _local2:*;
var _local3:*;
if (_arg1 == null){
return;
};
if (_arg1.pos > 3){
_local2 = (_arg1.pos % 4);
} else {
_local2 = (_arg1.pos - 1);
};
_local3 = (Math.ceil((_arg1.pos / 3)) - 1);
if ((_arg1 is PlayerCharacter)){
_local3 = (_local3 + 2);
};
combat_grid[_local2][_local3] = _arg1;
}
private function PassTurn(){
var _local1:CharacterPortrait;
_local1 = PortraitFromCharacter(speedlist[turn]);
passing = true;
messages.addMessage((speedlist[turn].charname + " passes."), "");
_local1.addAnimationFrame(pass_animation_frame, (PASS_TURN_DELAY + 500));
if (!speedlist[turn].cancelPowerRegen){
speedlist[turn].powerRegenMod = 2;
};
_local1.updateBars();
EndTurn();
}
public function onTurnDelayComplete(_arg1:TimerEvent):void{
var _local2:*;
turnDelayTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTurnDelayComplete);
updateAllBars();
doNothingTimer = new Timer(500, 1);
doNothingTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onDoNothingDelayComplete);
doNothingTimer.start();
}
private function IncrementTurn():Boolean{
var i:*;
var j:*;
var players_alive:Boolean;
var monsters_alive:Boolean;
var next_turn:Boolean;
var err_txt:*;
var err_dlg:*;
players_alive = false;
monsters_alive = false;
next_turn = false;
turn++;
if (turn >= speedlist.length){
turn = 0;
i = 0;
while (i < speedlist.length) {
if (((!((speedlist[i] == null))) && ((speedlist[i] is Character)))){
speedlist[i].hadCombatTurn = false;
};
i = (i + 1);
};
};
i = 0;
while (i < horde.members.length) {
if (horde.members[i].health > 0){
monsters_alive = true;
};
i = (i + 1);
};
i = 0;
while (i < pc_party.members.length) {
if (pc_party.members[i].health > 0){
if (PlayerCharacter(pc_party.members[i]).retreated == false){
players_alive = true;
};
};
i = (i + 1);
};
if (!monsters_alive){
horde.defeated = true;
};
if (((players_alive) && (monsters_alive))){
next_turn = true;
} else {
next_turn = false;
};
if (next_turn){
try {
initDisplay.turnOf(speedlist[turn], true);
} catch(error:Error) {
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Update Initiative Error: " + error.name) + "\n"));
if (speedlist[turn] != null){
err_txt = (err_txt + (((((("turn: " + turn) + "/") + String((speedlist.length - 1))) + " - ") + speedlist[turn].charname) + "\n"));
};
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
} finally {
var _local4:* = true;
//unresolved jump
1;
return (_local4);
};
//unresolved jump
};
return (false);
}
function blurDone(_arg1:TimerEvent):void{
blurTimer.removeEventListener(TimerEvent.TIMER, blurStep);
blurTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, blurDone);
setBlur(max_blur);
}
private function playerRegenShown(_arg1:Event):void{
playerRegenTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, playerRegenShown);
if (usedSkill){
return;
};
PortraitFromCharacter(speedlist[turn]).updateBars();
if (speedlist[turn].health <= 0){
EndTurn();
};
}
function mousedOverEvent(_arg1:MouseEvent):void{
var _local2:*;
_local2 = CharacterPortrait(_arg1.currentTarget).char_ref;
if (_local2 == null){
return;
};
hover = _local2;
UpdateInfoPanels();
initDisplay.highlightChar(_local2);
drawEffectedTargets();
}
public function cleanup():void{
var _local1:*;
help_btn.cleanup();
sound_btn.cleanup();
skillbar.cleanup();
messages.cleanup();
removeEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelEvent);
if (stage != null){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
};
actionsbar.pass_skill.cleanup();
actionsbar.pass_skill.removeEventListener(MouseEvent.MOUSE_DOWN, clickPassTurn);
actionsbar.retreat_skill.cleanup();
actionsbar.retreat_skill.removeEventListener(MouseEvent.MOUSE_DOWN, clickRetreat);
actionsbar.retreat_all_skill.cleanup();
actionsbar.retreat_all_skill.removeEventListener(MouseEvent.MOUSE_DOWN, clickRetreatAll);
_local1 = 0;
while (_local1 < npc_portraits.length) {
npc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_OVER, mousedOverEvent);
npc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_OVER, mouseMoveEvent);
npc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_OUT, mousedOutEvent);
_local1++;
};
_local1 = 0;
while (_local1 < pc_portraits.length) {
pc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_OVER, mousedOverEvent);
pc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_OVER, mouseMoveEvent);
pc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_OUT, mousedOutEvent);
_local1++;
};
initDisplay.cleanup();
initDisplay = null;
}
function PortraitFromCharacter(_arg1:Character):CharacterPortrait{
var _local2:*;
var _local3:*;
if ((_arg1 is PlayerCharacter)){
_local2 = pc_portraits;
} else {
_local2 = npc_portraits;
};
_local3 = 0;
while (_local3 < _local2.length) {
if (_local2[_local3].char_ref == _arg1){
return (_local2[_local3]);
};
_local3++;
};
return (null);
}
private function exitBlur(_arg1:TimerEvent=null):void{
blurTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, exitBlur);
currentBlur = 0;
blurTimer = new Timer(50, blur_steps);
blurTimer.addEventListener(TimerEvent.TIMER, blurStep);
blurTimer.addEventListener(TimerEvent.TIMER_COMPLETE, blurDone);
blurTimer.start();
}
function onMouseWheelEvent(_arg1:MouseEvent):void{
if ((speedlist[turn] is MonsterCharacter)){
return;
};
if (_arg1.delta > 0){
skillbar.decrementSkill();
} else {
if (_arg1.delta < 0){
skillbar.incrementSkill();
};
};
ValidTargetsForPlayer(skillbar.getSelectedSkill());
if (hover != null){
drawEffectedTargets();
};
}
private function checkAccuracyMiss(_arg1:Character, _arg2:Skill, _arg3:int, _arg4:Boolean, _arg5:Boolean=false):Boolean{
var _local6:*;
var _local7:*;
var _local8:*;
_local6 = false;
_local7 = dm.randomNum(1, 100);
_local8 = _arg1.getAccuracy();
if (_arg2.attacksWithAccuracyMod != 1){
_local8 = Math.round((_local8 * _arg2.attacksWithAccuracyMod));
};
if (((_arg2.piercesColumn) && (!(_arg5)))){
if (_arg4){
_local7 = (_local8 - 1);
} else {
_local7 = (_local8 + 1);
};
};
if (_local7 > _local8){
if (_arg1.canMissWith(_arg2)){
_local6 = true;
} else {
_local6 = false;
};
};
return (_local6);
}
public function addMonsterPortrait(_arg1:MonsterCharacter):CharacterPortrait{
var _local2:CharacterPortrait;
var _local3:*;
_local2 = new CharacterPortrait();
_local2.setChar(_arg1);
_local3 = EmptyPortrait(getChildByName(("npc" + String(_arg1.pos))));
if (_local3 == null){
return (null);
};
_local3.empty.addChild(_local2);
_local2.addEventListener(MouseEvent.MOUSE_OVER, mousedOverEvent);
_local2.addEventListener(MouseEvent.MOUSE_OVER, mouseMoveEvent);
_local2.addEventListener(MouseEvent.MOUSE_OUT, mousedOutEvent);
npc_portraits.push(_local2);
return (_local2);
}
private function getEffectedTargets(_arg1:Character, _arg2:Skill):Array{
var _local3:*;
var _local4:*;
var _local5:Array;
_local5 = new Array();
if (_arg2.targetsSelf){
_local5.push(_arg1);
} else {
if (_arg2.hitsAllEnemies){
_local3 = 0;
while (_local3 < horde.members.length) {
if (horde.members[_local3].health <= 0){
} else {
_local5.push(horde.members[_local3]);
};
_local3++;
};
} else {
if (_arg2.hitsAllFriendlies){
_local3 = 0;
while (_local3 < pc_party.members.length) {
if (pc_party.members[_local3].health <= 0){
} else {
if (pc_party.members[_local3].retreated){
} else {
_local5.push(pc_party.members[_local3]);
};
};
_local3++;
};
} else {
if (_arg2.hitsAllMeleeRange){
_local5 = valid_targets;
} else {
if (_arg2.piercesColumn){
if (_arg1.pos < 4){
if (horde.memberInPos((_arg1.pos + 3)) != null){
_local5.push(horde.memberInPos((_arg1.pos + 3)));
};
} else {
if (horde.memberInPos((_arg1.pos - 3)) != null){
_local5.push(horde.memberInPos((_arg1.pos - 3)));
};
};
_local5.push(_arg1);
} else {
if (_arg2.splashDamageMultiplier){
if (_arg1.pos < 4){
if (horde.memberInPos((_arg1.pos + 3)) != null){
_local5.push(horde.memberInPos((_arg1.pos + 3)));
};
} else {
if (horde.memberInPos((_arg1.pos - 3)) != null){
_local5.push(horde.memberInPos((_arg1.pos - 3)));
};
if (pc_party.memberInPos((_arg1.pos - 3)) != null){
_local5.push(pc_party.memberInPos((_arg1.pos - 3)));
};
};
if (((!((_arg1.pos == 4))) && (!((horde.memberInPos((_arg1.pos - 1)) == null))))){
_local5.push(horde.memberInPos((_arg1.pos - 1)));
};
if (((!((_arg1.pos == 3))) && (!((horde.memberInPos((_arg1.pos + 1)) == null))))){
_local5.push(horde.memberInPos((_arg1.pos + 1)));
};
_local5.push(_arg1);
} else {
_local5.push(_arg1);
};
};
};
};
};
};
_local3 = 0;
while (_local3 < _local5.length) {
if (_local5[_local3].health <= 0){
_local5.splice(_local3, 1);
_local3--;
};
_local3++;
};
return (_local5);
}
public function onDoNothingDelayComplete(_arg1:TimerEvent):void{
var err_txt:String;
var err_dlg:ErrorDialog;
var next_turn:Boolean;
var incremented:Boolean;
var event = _arg1;
incremented = false;
try {
doNothingTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onDoNothingDelayComplete);
if (bonusAttackPending){
bonusAttackOn(bonusAttackTarget);
if (!bonusAttackPending){
return;
};
};
next_turn = IncrementTurn();
incremented = true;
} catch(error:Error) {
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("End Turn Error: " + error.name) + "\n"));
if (speedlist[turn] != null){
err_txt = (err_txt + (((((("turn: " + turn) + "/") + String((speedlist.length - 1))) + " - ") + speedlist[turn].charname) + "\n"));
};
err_txt = (err_txt + (("next turn: " + String(next_turn)) + "\n"));
err_txt = (err_txt + (("incremented: " + String(incremented)) + "\n"));
err_txt = (err_txt + (("bonusAttackPending: " + String(bonusAttackPending)) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
try {
if (next_turn){
RunTurn();
};
} catch(error:Error) {
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Next Turn Error: " + error.name) + "\n"));
if (speedlist[turn] != null){
err_txt = (err_txt + (((((("turn: " + turn) + "/") + String((speedlist.length - 1))) + " - ") + speedlist[turn].charname) + "\n"));
};
err_txt = (err_txt + (("next turn: " + String(next_turn)) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
try {
if (!next_turn){
EndBattle();
};
} catch(error:Error) {
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("End Battle Error: " + error.name) + "\n"));
if (speedlist[turn] != null){
err_txt = (err_txt + (((((("turn: " + turn) + "/") + String((speedlist.length - 1))) + " - ") + speedlist[turn].charname) + "\n"));
};
err_txt = (err_txt + (("next turn: " + String(next_turn)) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
}
private function updateAllBars():void{
var _local1:*;
_local1 = 0;
while (_local1 < npc_portraits.length) {
npc_portraits[_local1].updateBars();
_local1++;
};
_local1 = 0;
while (_local1 < pc_portraits.length) {
pc_portraits[_local1].updateBars();
_local1++;
};
}
function added(_arg1:Event):void{
var _local2 = ??pushnamespace
;
var _local3:*;
removeEventListener(Event.ADDED_TO_STAGE, added);
_local2 = 8;
if (((DungeonMain.showHints) && (!(Dungeon.hintShown(_local2))))){
_local3 = new HintDialog("Battle Start!", "You have encountered a group of enemies, and must now face them in battle. \n\nFirst, set your party's formation by dragging their character portraits. Melee fighters should be in the front row, and more vulnerable ranged fighters or spellcasters in the back row. The front row protects the back row from enemy melee attacks.", true, true);
DungeonMain.hints = (DungeonMain.hints + _local2);
stage.addChild(_local3);
dm.main.saveInterface();
};
entryBlur();
}
private function UpdateInfoPanels(_arg1:Character=null){
if (_arg1 == null){
_arg1 = speedlist[turn];
};
if (turn != -1){
if (!this.contains(active_info_panel)){
addChild(active_info_panel);
};
active_info_panel.setChar(_arg1);
};
if (hover != null){
if (!this.contains(target_info_panel)){
addChild(target_info_panel);
};
target_info_panel.setChar(hover);
} else {
if (this.contains(target_info_panel)){
removeChild(target_info_panel);
};
};
}
function delayedHitsTimerComplete(_arg1:TimerEvent):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:Character;
var _local6:Character;
var _local7:*;
var _local8:Boolean;
var _local9:*;
if (delayedHit >= delayedHitsDamage.length){
return;
};
_local2 = "";
updateAllBars();
_local3 = delayedHitsDamage[delayedHit];
_local4 = delayedHitsSkill[delayedHit];
_local5 = delayedHitsTarget[delayedHit];
_local6 = delayedHitsAttacker[delayedHit];
_local7 = PortraitFromCharacter(_local5);
_local8 = checkAccuracyMiss(_local6, _local4, 0, false);
if (_local8){
_local7.addAnimationFrame(miss_animation_frame, delayedHitsDelay);
_local2 = "(Miss)";
dm.sound.playMissSound(_local4, _local6, true);
} else {
_local9 = doSkillDamage(_local6, _local5, _local3, _local4);
addPortraitAnim(_local5, _local7, _local4, _local6);
_local2 = String(_local9);
};
delayedHit++;
if (delayedHit >= delayedHitsDamage.length){
_local2 = (_local2 + " damage!");
};
messages.updateMostRecent("", (" + " + _local2));
}
private function drawEffectedTargets():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:Array;
var _local5:*;
var _local6:*;
var _local7:PortraitEffected;
removePortraitEffected();
if (!(speedlist[turn] is PlayerCharacter)){
return;
};
_local1 = false;
if (getChildByName("skillbar") == null){
return;
};
_local2 = 0;
while (_local2 < valid_targets.length) {
if (hover == valid_targets[_local2]){
_local1 = true;
};
_local2++;
};
if (_local1){
_local3 = skillbar.getSelectedSkill();
_local4 = getEffectedTargets(hover, _local3);
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = PortraitFromCharacter(_local4[_local5]);
_local7 = new PortraitEffected();
_local7.x = _local6.parent.parent.x;
_local7.y = _local6.parent.parent.y;
_local7.name = ("ei" + _local5);
bg.addChildAt(_local7, 1);
_local5++;
};
};
}
public function powerPreview(){
var _local1:*;
if ((speedlist[turn] is MonsterCharacter)){
return;
};
PortraitFromCharacter(speedlist[turn]).endPowerCostPreview();
_local1 = skillbar.getSelectedSkill().power_cost;
if (skillbar.getSelectedSkill().costsRemainingPower){
_local1 = speedlist[turn].power;
};
PortraitFromCharacter(speedlist[turn]).startPowerCostPreview(_local1);
}
private function addPlayerTarget(_arg1:Character):void{
var _local2:CharacterPortrait;
var _local3:*;
var _local4:PortraitHighlight;
_local2 = CharacterPortrait(PortraitFromCharacter(_arg1));
_local3 = 0;
while (_local3 < valid_targets.length) {
if (valid_targets[_local3] == _arg1){
return;
};
_local3++;
};
valid_targets.push(_arg1);
valid_targets_portraits.push(_local2);
_local2.addEventListener(MouseEvent.MOUSE_DOWN, clickAttack);
_local4 = new PortraitHighlight();
_local4.name = "highlight";
_local2.addChild(_local4);
}
private function useSkill(_arg1:Character, _arg2:Skill, _arg3:Character){
var i:*;
var j:*;
var lethality:*;
var chars:Array;
var portraits:Array;
var miss:*;
var reflect_dmg:*;
var total_damage:*;
var total_healing:*;
var total_power_damage:*;
var missed_targets:*;
var res:*;
var quicknessChange:*;
var staggerHits:*;
var staggerHitsDelay:int;
var message1:String;
var message2:String;
var p:CharacterPortrait;
var damage:*;
var power_damage:*;
var oldPower:*;
var healing:*;
var tchars:Array;
var second_index:*;
var secondary:Character;
var t:*;
var splash_x:*;
var splash_y:*;
var splash_char:*;
var summon_pos:int;
var summon_row:*;
var summon_col:*;
var summon_class:*;
var summon:*;
var summon_portrait:*;
var old_chars_length:*;
var err_txt:*;
var err_dlg:ErrorDialog;
var temp_healing:*;
var temp_damage:*;
var oldPoison:*;
var actual_damage:*;
var actual_power_damage:*;
var delayedHitsTimer:Timer;
var regen:*;
var stun_chance:*;
var stun_roll:*;
var doPoisonAmount:int;
var transformed:*;
var transformed_portrait:*;
var pd:*;
var pr:*;
var c = _arg1;
var skill = _arg2;
var target = _arg3;
lethality = 0;
chars = new Array();
portraits = new Array();
miss = false;
reflect_dmg = 0;
total_damage = 0;
total_healing = 0;
total_power_damage = 0;
missed_targets = 0;
res = false;
quicknessChange = false;
staggerHits = false;
staggerHitsDelay = 0;
message1 = "";
message2 = "";
try {
p = PortraitFromCharacter(c);
usedSkill = true;
damage = skill.getDamage();
power_damage = skill.powerDamage;
if (skill.powerRestore){
power_damage = -(skill.powerRestore);
};
damage = Math.round((damage * c.buff_damage));
if (damage){
damage = Math.round((damage * c.damageMod));
c.damageMod = 1;
};
bonusAttackPending = false;
delayedHit = -1;
delayedHitsDamage.length = 0;
delayedHitsSkill.length = 0;
delayedHitsTarget.length = 0;
delayedHitsAttacker.length = 0;
if (skill.hitsAllMeleeRange){
if ((c is PlayerCharacter)){
chars = valid_targets.concat();
portraits = valid_targets_portraits.concat();
} else {
chars = findMonsterTargets(MonsterCharacter(c), skill);
j = 0;
while (j < chars.length) {
portraits.push(PortraitFromCharacter(chars[j]));
j = (j + 1);
};
};
} else {
if (skill.attacksTwoTargets){
staggerHits = true;
staggerHitsDelay = 400;
if ((c is PlayerCharacter)){
chars.push(target);
portraits.push(PortraitFromCharacter(target));
} else {
tchars = findMonsterTargets(MonsterCharacter(c), skill);
if (tchars.length == 1){
chars.push(target);
chars.push(target);
} else {
if (tchars.length == 2){
chars = tchars;
} else {
if (tchars.length > 2){
chars.push(target);
i = 0;
while (i < tchars.length) {
if (tchars[i] == target){
tchars.splice(i, 1);
};
i = (i + 1);
};
chars.push(tchars[dm.randomNum(0, (tchars.length - 1))]);
} else {
chars.push(target);
};
};
};
j = 0;
while (j < chars.length) {
portraits.push(PortraitFromCharacter(chars[j]));
j = (j + 1);
};
};
} else {
if (skill.piercesColumn){
if (target.pos > 3){
second_index = (target.pos - 3);
} else {
second_index = (target.pos + 3);
};
if ((target is MonsterCharacter)){
secondary = horde.memberInPos(second_index);
} else {
secondary = pc_party.memberInPos(second_index);
};
chars.push(target);
portraits.push(PortraitFromCharacter(target));
if (secondary != null){
chars.push(secondary);
portraits.push(PortraitFromCharacter(secondary));
};
} else {
if (skill.hitsAllEnemies){
if ((c is PlayerCharacter)){
chars = horde.members.concat();
portraits = npc_portraits.concat();
} else {
chars = pc_party.members.concat();
portraits = pc_portraits.concat();
};
} else {
if (skill.hitsAllFriendlies){
if ((c is MonsterCharacter)){
chars = horde.members.concat();
portraits = npc_portraits.concat();
} else {
chars = pc_party.members.concat();
portraits = pc_portraits.concat();
};
} else {
if (skill.splashDamageMultiplier){
chars.push(target);
t = target.pos;
splash_x = 0;
splash_y = 0;
if (t < 4){
splash_x = (t - 1);
} else {
splash_x = (t - 4);
};
if (t < 4){
splash_y = 0;
} else {
splash_y = 1;
};
if ((target is PlayerCharacter)){
splash_y = (splash_y + 2);
};
splash_char = validCharFromGrid((splash_x - 1), splash_y);
if (splash_char != null){
chars.push(splash_char);
};
splash_char = validCharFromGrid((splash_x + 1), splash_y);
if (splash_char != null){
chars.push(splash_char);
};
splash_char = validCharFromGrid(splash_x, (splash_y - 1));
if (splash_char != null){
chars.push(splash_char);
};
splash_char = validCharFromGrid(splash_x, (splash_y + 1));
if (splash_char != null){
chars.push(splash_char);
};
j = 0;
while (j < chars.length) {
portraits.push(PortraitFromCharacter(chars[j]));
j = (j + 1);
};
} else {
if (skill.summonsCreatureClass != null){
if (((!((c is MonsterCharacter))) || ((horde.members.length == 6)))){
return;
};
summon_pos = 0;
summon_row = 1;
while (summon_row >= 0) {
summon_col = 0;
while (summon_col < 3) {
if (combat_grid[summon_col][summon_row] == null){
summon_pos = combatGridToPos(summon_col, summon_row);
break;
};
summon_col = (summon_col + 1);
};
if (summon_pos > 0){
break;
};
summon_row = (summon_row - 1);
};
if (summon_pos > 0){
summon_class = skill.summonsCreatureClass;
summon = new summon_class.constructor(c.level);
summon.pos = summon_pos;
horde.members.push(summon);
AddCharToCombatGrid(summon);
summon_portrait = addMonsterPortrait(summon);
summon_portrait.addPortraitAnimation(PortraitAnimation.summon);
quicknessChange = true;
};
} else {
chars.push(target);
portraits.push(PortraitFromCharacter(target));
};
};
};
};
};
};
};
if (skill.attacksMultipleTimes > 1){
old_chars_length = chars.length;
j = 1;
while (j < skill.attacksMultipleTimes) {
i = 0;
while (i < old_chars_length) {
chars.push(chars[i]);
portraits.push(portraits[i]);
i = (i + 1);
};
j = (j + 1);
};
staggerHits = true;
staggerHitsDelay = Math.round((1200 / chars.length));
};
if (skill.extraSpeedAttacks){
if (c.getQuickness() > target.getQuickness()){
staggerHits = true;
staggerHitsDelay = Math.round((1200 / skill.extraSpeedAttacks));
j = 0;
while (j < skill.extraSpeedAttacks) {
chars.push(target);
portraits.push(PortraitFromCharacter(target));
j = (j + 1);
};
};
};
oldPower = c.power;
c.reducePower(skill.power_cost);
if (skill.costsRemainingPower){
c.power = 0;
};
numTargets = chars.length;
healing = skill.scaleHeal(skill.healing, numTargets);
} catch(error:Error) {
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Skill target selection error: " + error.name) + "\n"));
if (skill != null){
err_txt = (err_txt + (("skill: " + skill.skillname) + "\n"));
};
if (speedlist[turn] != null){
err_txt = (err_txt + (((((("turn: " + turn) + "/") + String((speedlist.length - 1))) + " - ") + speedlist[turn].charname) + "\n"));
};
if (target != null){
err_txt = (err_txt + (("target: " + target.charname) + "\n"));
};
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
try {
i = 0;
while (i < chars.length) {
if (chars[i] == null){
} else {
if (!(chars[i] is Character)){
} else {
if ((((chars[i].health <= 0)) && (!(skill.resurrects)))){
} else {
if ((((chars[i] is PlayerCharacter)) && (chars[i].retreated))){
} else {
temp_healing = healing;
if (skill.clonesPlayers){
if ((chars[i] is PlayerCharacter)){
createClone(PlayerCharacter(chars[i]));
quicknessChange = true;
};
};
if (skill.cannotDie){
chars[i].cannotDie = skill.cannotDie;
chars[i].cannotDieMin = skill.getDefianceHealth();
};
if (skill.invulnerable){
chars[i].invulnerable = skill.invulnerable;
};
if (skill.makeDamageSponge){
if ((chars[i] is PlayerCharacter)){
damageSpongePlayer = chars[i];
} else {
damageSpongeMonster = chars[i];
};
message2 = (chars[i].charname + " is now protecting allies!");
};
if (skill.tempDamageResistance){
chars[i].temp_damage_resistance = skill.tempDamageResistance;
};
if (skill.powerRegenMod != 1){
chars[i].powerRegenMod = (chars[i].powerRegenMod * skill.powerRegenMod);
};
if (skill.hidesTarget){
chars[i].hiding = true;
portraits[i].setHiding(true);
};
temp_damage = modifySkillDamage(damage, skill, chars[i], c, oldPower, (chars[i] == target));
if ((((i > 0)) && (staggerHits))){
if (delayedHit == -1){
delayedHit = 0;
};
delayedHitsDamage.push(temp_damage);
delayedHitsSkill.push(skill);
delayedHitsTarget.push(chars[i]);
delayedHitsAttacker.push(c);
delayedHitsDelay = staggerHitsDelay;
delayedHitsTimer = new Timer((staggerHitsDelay * i), 1);
delayedHitsTimer.addEventListener(TimerEvent.TIMER_COMPLETE, delayedHitsTimerComplete);
delayedHitsTimer.start();
} else {
miss = checkAccuracyMiss(c, skill, total_damage, (missed_targets == 0), (i == 0));
if (miss){
portraits[i].addAnimationFrame(miss_animation_frame, skill.portraitAnimationDuration);
missed_targets = (missed_targets + 1);
} else {
if (skill.allyBonusAttack){
bonusAttackPending = true;
bonusAttackTarget = chars[i];
};
if (skill.cancelPowerRegen){
chars[i].cancelPowerRegen = true;
chars[i].powerRegenMod = 1;
chars[i].buff_powerRegen = 0;
};
if (skill.crippling){
chars[i].crippled = Math.max(skill.crippling, chars[i].crippled);
initDisplay.updateIcon(chars[i]);
quicknessChange = true;
};
if (skill.curse){
chars[i].cursed = Math.max(skill.curse, chars[i].cursed);
};
if (skill.removesCurse){
chars[i].cursed = 0;
};
chars[i].damageMod = Math.max(skill.targetDamageMod, chars[i].damageMod);
if (skill.buff_resistPoison){
chars[i].buff_resistPoison = Math.max(chars[i].buff_resistPoison, skill.buff_resistPoison);
};
if (skill.buff_resistStun){
chars[i].buff_resistStun = Math.max(chars[i].buff_resistStun, skill.buff_resistStun);
};
if (skill.buff_damageResist){
chars[i].buff_damageResist = Math.max(chars[i].buff_damageResist, skill.buff_damageResist);
};
if (skill.buff_damageReflect){
chars[i].buff_damageReflect = Math.max(chars[i].buff_damageReflect, skill.buff_damageReflect);
};
if (skill.buff_powerRegen){
chars[i].buff_powerRegen = Math.max(chars[i].buff_powerRegen, skill.buff_powerRegen);
};
if (skill.buff_vampiric){
chars[i].buff_vampiric = Math.max(chars[i].buff_vampiric, skill.buff_vampiric);
};
if (skill.buff_stun){
chars[i].buff_stun = Math.max(chars[i].buff_stun, skill.buff_stun);
};
if (skill.buff_quickness){
chars[i].buff_quickness = Math.max(chars[i].buff_quickness, skill.buff_quickness);
initDisplay.updateIcon(chars[i]);
quicknessChange = true;
};
if (skill.buff_damage > chars[i].buff_damage){
chars[i].buff_damage = skill.buff_damage;
};
if (skill.buff_accuracy){
chars[i].buff_accuracy = Math.max(chars[i].buff_accuracy, skill.buff_accuracy);
};
if (skill.buff_healthRegen){
regen = skill.buff_healthRegen;
if ((((skill.increasesWith >= Skill.strength)) && ((skill.increasesWith <= Skill.intellect)))){
regen = skill.scaleHeal(skill.buff_healthRegen);
};
chars[i].buff_healthRegen = Math.max(chars[i].buff_healthRegen, regen);
};
if (skill.resurrects){
if (chars[i].health <= 0){
portraits[i].setAlive();
res = true;
};
};
oldPoison = chars[i].poisoned;
if (temp_healing){
portraits[i].setHealthPreview(-(temp_healing));
};
actual_damage = 0;
if (temp_damage){
actual_damage = doSkillDamage(c, chars[i], temp_damage, skill);
};
if (power_damage){
portraits[i].setPowerPreview(power_damage);
};
actual_power_damage = chars[i].reducePower(power_damage);
total_damage = (total_damage + actual_damage);
total_power_damage = (total_power_damage + actual_power_damage);
total_healing = (total_healing + chars[i].increaseHealth(temp_healing, skill.resurrects));
if (skill.stun_percent){
stun_chance = (skill.stun_percent + Math.ceil((c.getStunChance() / chars.length)));
if (target.invulnerable){
stun_chance = 0;
};
stun_roll = dm.randomNum(1, 100);
if (stun_roll <= stun_chance){
portraits[i].stunAnim();
chars[i].stun(1);
if (!skill.suppressStunAnim){
portraits[i].checkStun();
};
};
};
if (skill.poisonDamage){
doPoisonAmount = (skill.scalePoison() + Math.ceil((c.getPoisonDamage() / chars.length)));
if (chars[i].poison(doPoisonAmount)){
portraits[i].setPoisoned(true);
};
};
if (skill.damageAccuracy){
chars[i].accuracy_penalty = Math.max(chars[i].accuracy_penalty, skill.damageAccuracy);
};
if (res){
CalculateInitiative(false);
initDisplay.insertChar(chars[i], speedlist[turn]);
};
if (((((skill.gainPowerFromKill) && (actual_damage))) && (!(chars[i].health)))){
p.setPowerPreview(-(skill.gainPowerFromKill));
c.increasePower(skill.gainPowerFromKill);
};
addPortraitAnim(chars[i], portraits[i], skill, c);
if (oldPoison < chars[i].poisoned){
portraits[i].addPortraitAnimation(PortraitAnimation.poison);
};
if (skill.removesPoison){
chars[i].poisoned = 0;
portraits[i].setPoisoned(false);
};
if (((skill.powerDrain) && (actual_power_damage))){
p.setPowerPreview(-(actual_power_damage));
c.increasePower(actual_power_damage);
p.addPortraitAnimation(PortraitAnimation.gainPower);
};
if (skill.transformCreatureClass != null){
transformed = skill.transformCreatureClass;
transformed.pos = chars[i].pos;
if ((chars[i] is MonsterCharacter)){
replaceChar(chars[i], transformed);
transformed_portrait = portraits[i];
chars[i].clearStatusEffects();
transformed_portrait.setChar(transformed, true);
transformed_portrait.addPortraitAnimation(PortraitAnimation.transform);
if (chars[i] == speedlist[turn]){
speedlist[turn] = transformed;
};
chars[i] = transformed;
quicknessChange = true;
};
};
};
};
};
};
};
};
i = (i + 1);
};
message1 = (((c.charname + " ") + skill.verbage) + "!");
if (total_power_damage > 0){
pd = (total_power_damage + " power ");
if (skill.powerDrain){
pd = (pd + "drained");
} else {
pd = (pd + "damage");
};
message2 = pd;
} else {
if (total_power_damage < 0){
pr = (-(total_power_damage) + " power restored");
message2 = pr;
};
};
if (((skill.healing) || (healing))){
message2 = (total_healing + " damage healed");
};
if (((staggerHits) && (damage))){
if (missed_targets){
message2 = "(Miss)";
} else {
message2 = String(total_damage);
};
} else {
if (((skill.damage) || (damage))){
message2 = (total_damage + " damage");
};
};
if (((chars.length) && ((missed_targets == chars.length)))){
message2 = "Miss!";
dm.sound.playMissSound(skill, c);
} else {
dm.sound.playSoundForSkill(skill, c);
};
messages.addMessage(message1, message2);
if (((!(res)) && (!(quicknessChange)))){
initDisplay.removeDead();
};
if (quicknessChange){
if (CalculateInitiative(false)){
initDisplay.refill(speedlist[turn]);
};
};
} catch(error:Error) {
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (((("Skill use error: " + error.name) + " ") + error.message) + "\n"));
if (skill != null){
err_txt = (err_txt + (("skill: " + skill.skillname) + "\n"));
};
if (speedlist[turn] != null){
err_txt = (err_txt + (((((("turn: " + turn) + "/") + String((speedlist.length - 1))) + " - ") + speedlist[turn].charname) + "\n"));
};
if (target != null){
err_txt = (err_txt + (("target: " + target.charname) + "\n"));
};
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
} finally {
UpdateInfoPanels();
EndTurn();
doLethalAnim = false;
};
}
function clickRetreat(_arg1:MouseEvent):void{
if ((speedlist[turn] is PlayerCharacter)){
if (PlayerCharacter(speedlist[turn]).canQuickRetreat()){
RetreatCharacter(speedlist[turn]);
} else {
PlayerCharacter(speedlist[turn]).retreating = true;
messages.addMessage((speedlist[turn].charname + " is retreating."), "");
PortraitFromCharacter(speedlist[turn]).updateBars();
EndTurn();
};
};
}
private function CanPlayerHit(_arg1:PlayerCharacter, _arg2:MonsterCharacter):Boolean{
var _local3:*;
var _local4:*;
var _local5:*;
_local5 = 0;
if (IsPlayerMeleeBlocked(_arg1)){
return (false);
};
if (((!((damageSpongeMonster == null))) && ((_arg2 == damageSpongeMonster)))){
return (true);
};
if (_arg2.pos > 3){
if ((((((((((((_arg2.pos == _arg1.pos)) || ((_arg2.pos == (_arg1.pos + 1))))) || ((_arg2.pos == (_arg1.pos - 1))))) || ((_arg2.pos == (_arg1.pos + 4))))) || ((_arg2.pos == (_arg1.pos + 3))))) || ((_arg2.pos == (_arg1.pos + 2))))){
return (true);
};
return (false);
//unresolved jump
};
_local3 = 0;
while (_local3 < 3) {
if (combat_grid[_local3][1] != null){
if ((((Character(combat_grid[_local3][1]).health > 0)) && (!(Character(combat_grid[_local3][1]).hiding)))){
_local5++;
};
};
_local3++;
};
if (_local5){
return (false);
};
if ((((((((((((_arg2.pos == _arg1.pos)) || ((_arg2.pos == (_arg1.pos + 1))))) || ((_arg2.pos == (_arg1.pos - 1))))) || ((_arg2.pos == (_arg1.pos - 4))))) || ((_arg2.pos == (_arg1.pos - 3))))) || ((_arg2.pos == (_arg1.pos - 2))))){
return (true);
};
return (false);
}
private function areEnemies(_arg1:Character, _arg2:Character):Boolean{
if ((((_arg1 is PlayerCharacter)) && ((_arg2 is MonsterCharacter)))){
return (true);
};
if ((((_arg1 is MonsterCharacter)) && ((_arg2 is PlayerCharacter)))){
return (true);
};
return (false);
}
private function skillBeneficial(_arg1:Skill, _arg2:Character):Boolean{
var _local3:Character;
_local3 = _arg1.char_ref;
if (((_arg1.damage) && (areEnemies(_arg2, _local3)))){
return (true);
};
if (((_arg1.vampiric_percent) && ((_local3.health < _local3.health_max)))){
return (true);
};
if (((_arg1.healing) && ((_arg2.health < _arg2.health_max)))){
return (true);
};
if (((_arg1.powerRestore) && ((_arg2.power < _arg2.power_max)))){
return (true);
};
if ((_arg1.tempDamageResistance > _arg2.temp_damage_resistance)){
return (true);
};
if (((_arg1.powerDamage) && (_arg2.power))){
return (true);
};
if (((_arg1.powerDrain) && ((_local3.power < _local3.power_max)))){
return (true);
};
if (_arg1.clonesPlayers){
return (true);
};
if (_arg1.transformCreatureClass != null){
return (true);
};
if (((_arg1.cancelPowerRegen) && (!(_arg2.cancelPowerRegen)))){
return (true);
};
if (((((_arg1.stun_percent) && (!(_arg2.stunned_duration)))) && ((_arg2.getStunResist() < 100)))){
return (true);
};
if (((_arg1.poisonDamage) && ((_arg2.getPoisonResist() < 100)))){
return (true);
};
if (((((_arg1.lethality) || (_arg1.addsPowerToLethality))) && (!(_arg2.lethalityImmune)))){
return (true);
};
if (((_arg1.removesCurse) && (_arg2.cursed))){
return (true);
};
if (((_arg1.removesPoison) && (_arg2.poisoned))){
return (true);
};
if (((_arg1.cannotDie) && (!(_arg2.cannotDie)))){
return (true);
};
if (((_arg1.invulnerable) && (!(_arg2.invulnerable)))){
return (true);
};
if (((_arg1.hidesTarget) && (!(_arg2.hiding)))){
return (true);
};
if (_arg1.damageAccuracy > _arg2.accuracy_penalty){
return (true);
};
if (_arg1.crippling > _arg2.crippled){
return (true);
};
if (_arg1.buff_resistPoison > _arg2.buff_resistPoison){
return (true);
};
if (_arg1.buff_resistStun > _arg2.buff_resistStun){
return (true);
};
if (_arg1.buff_damageResist > _arg2.buff_damageResist){
return (true);
};
if (_arg1.buff_damageReflect > _arg2.buff_damageReflect){
return (true);
};
if (_arg1.buff_healthRegen > _arg2.buff_healthRegen){
return (true);
};
if (_arg1.buff_powerRegen > _arg2.buff_powerRegen){
return (true);
};
if (_arg1.buff_vampiric > _arg2.buff_vampiric){
return (true);
};
if (_arg1.buff_stun > _arg2.buff_stun){
return (true);
};
if (_arg1.buff_quickness > _arg2.buff_quickness){
return (true);
};
if (_arg1.buff_damage > _arg2.buff_damage){
return (true);
};
if (_arg1.buff_accuracy > _arg2.buff_accuracy){
return (true);
};
if (_arg1.buff_quickness > _arg2.buff_quickness){
return (true);
};
if (_arg1.targetDamageMod != 1){
if (areEnemies(_local3, _arg2)){
if (_arg1.targetDamageMod < _arg2.damageMod){
return (true);
};
} else {
if (_arg1.targetDamageMod > _arg2.damageMod){
return (true);
};
};
};
if (_arg1.makeDamageSponge){
if ((((_arg2 is PlayerCharacter)) && ((damageSpongePlayer == null)))){
return (true);
};
if ((((_arg2 is MonsterCharacter)) && ((damageSpongeMonster == null)))){
return (true);
};
};
return (false);
}
private function EndBattle():void{
var err_txt:String;
var err_dlg:ErrorDialog;
var r:int;
var p:PlayerCharacter;
var duration:int;
try {
for each (p in pc_party.members) {
if (p.health <= 0){
} else {
r = p.getReplenishing();
if (r){
p.increaseHealthByPercentage(r);
p.increasePowerByPercentage(r);
};
};
};
} catch(error:Error) {
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Replenish Error: " + error.name) + "\n"));
if (p != null){
err_txt = (err_txt + (("char: " + p..charname) + "\n"));
};
err_txt = (err_txt + (("r: " + r) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
try {
duration = 500;
dm.main.battle_theme.fadeOut(duration);
exitedSafely = false;
exitTimer = new Timer(duration, 1);
exitTimer.addEventListener(TimerEvent.TIMER_COMPLETE, exitBattleTimer);
exitTimer.start();
blurTimer = new Timer((duration - 150), 1);
blurTimer.addEventListener(TimerEvent.TIMER_COMPLETE, exitBlur);
blurTimer.start();
} catch(error:Error) {
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("End Battle Timer Error: " + error.name) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
exitBattleTimer(null);
};
}
private function removePortraitEffected():void{
var _local1:*;
var _local2:*;
_local1 = 0;
while (_local1 < 12) {
_local2 = bg.getChildByName(("ei" + _local1));
if (_local2 == null){
} else {
bg.removeChild(_local2);
};
_local1++;
};
}
private function convertPlayerPos(_arg1:int):int{
if (_arg1 < 4){
return ((_arg1 + 3));
};
if (_arg1 > 3){
return ((_arg1 - 3));
};
return (0);
}
private function RetreatCharacter(_arg1:PlayerCharacter):void{
_arg1.retreating = false;
_arg1.retreated = true;
_arg1.clearStatusEffects();
messages.addMessage((_arg1.charname + " leaves the battle!"), "");
PortraitFromCharacter(_arg1).setRetreated();
initDisplay.removeDead();
EndTurn();
}
function mousedOutEvent(_arg1:MouseEvent):void{
hover = null;
UpdateInfoPanels();
removePortraitEffected();
initDisplay.setNormalColors();
}
function stopDragging(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:EmptyPortrait;
var _local7:CharacterPortrait;
var _local8:EmptyPortrait;
var _local9:int;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:PlayerCharacter;
var _local14:CharacterPortrait;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 500;
if (_arg1.currentTarget == null){
return;
};
_local7 = CharacterPortrait(_arg1.currentTarget);
_local9 = 0;
this.addChild(_local7);
_local7.stopDrag();
_local10 = (_local7.x + (_local7.width / 2));
_local11 = (_local7.y + (_local7.height / 2));
_local12 = 0;
while (_local12 < 6) {
_local8 = EmptyPortrait(getChildByName(("pc" + String((_local12 + 1)))));
_local2 = (_local8.x + (_local8.width / 2));
_local3 = (_local8.y + (_local8.height / 2));
_local4 = DistanceBetween(_local2, _local3, _local10, _local11);
if (_local4 > 80){
} else {
if (_local4 < _local5){
_local5 = _local4;
_local6 = _local8;
_local9 = (_local12 + 1);
};
};
_local12++;
};
if (_local5 == 500){
_local7.x = EmptyPortrait(getChildByName(("pc" + String(_local7.char_ref.pos)))).x;
_local7.y = EmptyPortrait(getChildByName(("pc" + String(_local7.char_ref.pos)))).y;
} else {
_local13 = pc_party.memberInPos(_local9);
_local14 = PortraitFromCharacter(_local13);
if (_local13 != null){
_local13.pos = _local7.char_ref.pos;
_local14.x = EmptyPortrait(getChildByName(("pc" + String(_local7.char_ref.pos)))).x;
_local14.y = EmptyPortrait(getChildByName(("pc" + String(_local7.char_ref.pos)))).y;
};
_local7.x = _local6.x;
_local7.y = _local6.y;
_local7.char_ref.pos = _local9;
};
}
private function doTurnRegen(_arg1:Character, _arg2:CharacterPortrait):Boolean{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:String;
var _local7:String;
_local3 = 0;
_local4 = 0;
_local4 = _arg1.getPowerRegen();
if (_arg1.cancelPowerRegen){
_local4 = 0;
};
_arg1.powerRegenMod = 1;
_local3 = _arg1.getHealthRegen();
if (_arg1.poisoned){
_local5 = _arg1.poisoned;
_local3 = (_local3 - _local5);
_arg2.addPortraitAnimation(PortraitAnimation.poison);
_local6 = (((_arg1.charname + " takes ") + _local5) + " damage from poison!");
_local7 = "";
if ((_arg1.health + _local3) <= 0){
_local7 = (_arg1.charname + " has died!");
};
messages.addMessage(_local6, _local7);
};
_arg2.setHealthPreview(-(_local3));
_arg2.setPowerPreview(-(_local4));
_arg1.increaseHealth(_local3);
_arg1.increasePower(_local4);
UpdateInfoPanels();
return (true);
}
private function validTargetForMonster(_arg1:Character, _arg2:Skill):Boolean{
if (_arg1 != null){
if ((_arg1 is PlayerCharacter)){
if (PlayerCharacter(_arg1).retreated){
return (false);
};
if (((!((damageSpongePlayer == null))) && (!((damageSpongePlayer == _arg1))))){
return (false);
};
};
if (((_arg2.targetsFriendlyFrontRow) && ((_arg1.pos < 4)))){
return (false);
};
if (((_arg2.aiTargetsBackRow) && ((_arg1.pos <= 3)))){
return (false);
};
if (((_arg2.makeDamageSponge) && (!((damageSpongeMonster == null))))){
return (false);
};
if (((_arg2.targetsStunned) && (!(_arg1.stunned_duration)))){
return (false);
};
if (_arg1.hiding){
return (false);
};
if (_arg2.resurrects){
if (_arg1.health <= 0){
return (true);
};
return (false);
};
if (((_arg2.healing) && ((_arg1.health >= _arg1.health_max)))){
return (false);
};
if (_arg1.health > 0){
return (true);
};
};
return (false);
}
function exitBattleTimer(_arg1:TimerEvent):void{
if (exitedSafely){
return;
};
exitedSafely = true;
if (exitTimer != null){
exitTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, exitBattleTimer);
};
if (dm.main != null){
dm.main.PostBattle(horde);
} else {
if (parent != null){
DungeonMain(parent).PostBattle(horde);
};
};
}
private function doSkillDamage(_arg1:Character, _arg2:Character, _arg3:int, _arg4:Skill):int{
var inflicted:int;
var targetPortrait:CharacterPortrait;
var p:CharacterPortrait;
var stun_chance:*;
var stun_roll:*;
var poison_dmg:*;
var acc_dmg:*;
var health_delta:int;
var v_pc:int;
var reflect:*;
var curseAdd:*;
var err_txt:*;
var err_dlg:*;
var c = _arg1;
var target = _arg2;
var damage = _arg3;
var skill = _arg4;
inflicted = 0;
try {
targetPortrait = PortraitFromCharacter(target);
p = PortraitFromCharacter(c);
if (damage <= 0){
var _local6:* = 0;
//unresolved jump
0;
return (_local6);
};
targetPortrait.setHealthPreview(damage);
inflicted = target.reduceHealth(damage);
if (((c.getStunChance()) && (!(skill.stun_percent)))){
stun_chance = Math.ceil((c.getStunChance() / numTargets));
if (target.invulnerable){
stun_chance = 0;
};
stun_roll = dm.randomNum(1, 100);
if (stun_roll <= stun_chance){
targetPortrait.stunAnim();
target.stun(1);
if (!skill.suppressStunAnim){
targetPortrait.checkStun();
};
};
};
if (((c.getPoisonDamage()) && (!(skill.poisonDamage)))){
poison_dmg = Math.ceil((c.getPoisonDamage() / numTargets));
if (target.poison(poison_dmg)){
PortraitFromCharacter(target).setPoisoned(true);
};
};
if (((c.getAccuracyDamage()) && (!(skill.damageAccuracy)))){
acc_dmg = Math.ceil((c.getAccuracyDamage() / numTargets));
target.accuracy_penalty = Math.max(target.accuracy_penalty, acc_dmg);
};
if (inflicted){
health_delta = 0;
if (((skill.vampiric_percent) || (c.getVampiric()))){
v_pc = (skill.vampiric_percent + c.getVampiric());
health_delta = Math.ceil(((v_pc / 100) * inflicted));
if ((c is PlayerCharacter)){
health_delta = Math.min(health_delta, (c.health_max / 2));
};
p.addPortraitAnimation(PortraitAnimation.gainHealth);
};
if (((((target.getDamageReflection()) || (c.cursed))) && (inflicted))){
reflect = Math.round((inflicted * (target.getDamageReflection() / 100)));
if (c.cursed){
curseAdd = Math.round((c.cursed * inflicted));
if (curseAdd > 0){
reflect = (reflect + curseAdd);
p.addPortraitAnimation(PortraitAnimation.curse);
};
};
health_delta = (health_delta - reflect);
};
p.setHealthPreview(-(health_delta));
c.increaseHealth(health_delta);
};
} catch(error:Error) {
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (((("Do Skill Damage error: " + error.name) + " ") + error.message) + "\n"));
if (skill != null){
err_txt = (err_txt + (("skill: " + skill.skillname) + "\n"));
};
if (c != null){
err_txt = (err_txt + (("user: " + c.charname) + "\n"));
};
if (target != null){
err_txt = (err_txt + (("target: " + target.charname) + "\n"));
};
err_txt = (err_txt + (("damage: " + inflicted) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
} finally {
var _local8:* = inflicted;
//unresolved jump
2;
return (_local8);
};
}
private function RunTurn():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:Skill;
var _local9:*;
var _local10:Array;
var _local11:Character;
var _local12:Character;
var _local13:int;
var _local14:*;
var _local15:*;
var _local16:*;
var _local17:*;
var _local18:*;
var _local19:*;
var _local20:SkillIcon;
var _local21:*;
_local4 = 0;
while ((((((speedlist[turn].health <= 0)) || (speedlist[turn].hadCombatTurn))) || ((((speedlist[turn] is PlayerCharacter)) && (PlayerCharacter(speedlist[turn]).retreated))))) {
IncrementTurn();
++_local4;
if (_local4 > speedlist.length){
EndBattle();
};
};
_local5 = speedlist[turn];
_local6 = PortraitFromCharacter(_local5);
if (_local5.temp_damage_resistance){
_local5.temp_damage_resistance = 0;
};
if (_local5.cannotDie){
_local5.cannotDie--;
};
if (_local5.invulnerable){
_local5.invulnerable--;
};
if (_local5.hiding){
_local5.hiding = false;
_local6.setHiding(false);
};
if (((!((damageSpongeMonster == null))) && ((damageSpongeMonster.health <= 0)))){
damageSpongeMonster = null;
};
if (((!((damageSpongePlayer == null))) && ((damageSpongePlayer.health <= 0)))){
damageSpongePlayer = null;
};
usedSkill = false;
if ((_local5 is PlayerCharacter)){
phl.x = EmptyPortrait(getChildByName(("pc" + _local5.pos))).x;
phl.y = EmptyPortrait(getChildByName(("pc" + _local5.pos))).y;
if (damageSpongePlayer == _local5){
damageSpongePlayer = null;
};
} else {
if ((_local5 is MonsterCharacter)){
phl.x = EmptyPortrait(getChildByName(("npc" + _local5.pos))).x;
phl.y = EmptyPortrait(getChildByName(("npc" + _local5.pos))).y;
if (damageSpongeMonster == _local5){
damageSpongeMonster = null;
};
};
};
UpdateInfoPanels();
if ((((_local5 is MonsterCharacter)) && (hadMonsterDelay))){
_local6.updateBars();
} else {
_local7 = doTurnRegen(_local5, _local6);
if (!_local7){
return;
};
};
if (_local5.stunned_duration > 0){
_local5.stunned_duration--;
_local6.addAnimationFrame(stunned_animation_frame, (PASS_TURN_DELAY + 500));
messages.addMessage((_local5.charname + " is stunned!"), "");
EndTurn();
return;
};
if ((((_local5 is MonsterCharacter)) && (!(hadMonsterDelay)))){
monsterTurnDelayTimer = new Timer(300, 1);
monsterTurnDelayTimer.addEventListener(TimerEvent.TIMER_COMPLETE, monsterTurnDelayComplete);
monsterTurnDelayTimer.start();
return;
};
hadMonsterDelay = false;
if ((_local5 is PlayerCharacter)){
if (_local5.retreating){
RetreatCharacter(_local5);
return;
};
if (retreatAll){
clickRetreat(null);
return;
};
};
if ((_local5 is PlayerCharacter)){
playerRegenTimer = new Timer(500, 1);
playerRegenTimer.addEventListener(TimerEvent.TIMER_COMPLETE, playerRegenShown);
playerRegenTimer.start();
};
if ((_local5 is MonsterCharacter)){
if (!_local5.skills.length){
PassTurn();
return;
};
_local9 = null;
_local10 = new Array(0);
_local13 = 0;
if (MonsterCharacter(_local5).mindless){
_local1 = 0;
while (_local1 < _local5.skills.length) {
_local8 = _local5.skills[_local1];
_local9 = findMonsterTargets(_local5, _local8);
if (_local8.makeDamageSponge){
_local14 = 0;
_local15 = 0;
while (_local15 < horde.members.length) {
if (horde.members[_local15].health > 0){
_local14++;
};
_local15++;
};
if ((((_local9.length > 1)) || ((_local14 > 1)))){
_local10.push(_local8);
};
} else {
if (_local9.length >= 1){
_local10.push(_local8);
};
};
_local1++;
};
if (!_local10.length){
PassTurn();
return;
};
if (_local10.length == 1){
_local8 = _local10[0];
} else {
_local8 = _local10[dm.randomNum(0, (_local10.length - 1))];
};
_local9 = findMonsterTargets(_local5, _local8);
_local12 = _local9[0];
if (((_local8.targetsFriendlies) && ((_local9.length > 1)))){
if (_local8.makeDamageSponge){
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].getEffectiveHealth() > _local13){
_local13 = _local9[_local1].getEffectiveHealth();
_local12 = _local9[_local1];
};
_local1++;
};
} else {
if (_local8.damage){
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].health > _local13){
_local13 = _local9[_local1].health;
_local12 = _local9[_local1];
};
_local1++;
};
} else {
if (_local8.healing){
_local13 = 9999;
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].health < _local13){
_local13 = _local9[_local1].health;
_local12 = _local9[_local1];
};
_local1++;
};
};
};
};
_local11 = _local12;
} else {
_local11 = _local9[dm.randomNum(0, (_local9.length - 1))];
};
} else {
_local1 = 0;
while (_local1 < _local5.skills.length) {
_local8 = _local5.skills[_local1];
_local9 = findMonsterTargets(_local5, _local8);
if (_local9.length >= 1){
_local10.push(_local8);
};
_local1++;
};
if (!_local10.length){
PassTurn();
return;
};
if (_local10.length == 1){
_local8 = _local10[0];
} else {
_local16 = false;
_local1 = 0;
while (_local1 < _local10.length) {
if (_local10[_local1].aiLowestPriority){
_local10.splice(_local1, 1);
_local1--;
} else {
if (_local10[_local1].aiTopPriority){
_local8 = _local10[_local1];
_local16 = true;
break;
} else {
if (((_local10[_local1].makeDamageSponge) && ((damageSpongeMonster == null)))){
_local8 = _local10[_local1];
_local16 = true;
break;
};
};
};
_local1++;
};
if (!_local16){
_local8 = _local10[dm.randomNum(0, (_local10.length - 1))];
};
if (((!(_local8.power_cost)) && ((dm.randomNum(0, 500) > 250)))){
_local1 = 0;
while (_local1 < _local10.length) {
if (((_local10[_local1].power_cost) && (!(_local10[_local1].aiCastCount)))){
_local8 = _local10[_local1];
if (dm.randomNum(0, 500) > 250){
break;
};
};
_local1++;
};
};
};
_local9 = findMonsterTargets(_local5, _local8);
_local12 = _local9[0];
if (((_local8.targetsFriendlies) && ((_local9.length > 1)))){
if (_local8.makeDamageSponge){
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].getEffectiveHealth() > _local13){
_local13 = _local9[_local1].getEffectiveHealth();
_local12 = _local9[_local1];
};
_local1++;
};
} else {
if (((_local8.damage) || (_local8.aiTargetHealthiest))){
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].health > _local13){
_local13 = _local9[_local1].health;
_local12 = _local9[_local1];
};
_local1++;
};
} else {
if (_local8.healing){
_local13 = 9999;
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].health < _local13){
_local13 = _local9[_local1].health;
_local12 = _local9[_local1];
};
_local1++;
};
};
};
};
_local11 = _local12;
} else {
_local17 = false;
if (_local8.damage){
if (_local8.aiTargetHealthiest){
_local13 = 0;
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].health > _local13){
_local13 = _local9[_local1].health;
_local12 = _local9[_local1];
};
_local1++;
};
} else {
_local13 = 9999;
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].getEffectiveHealth() < _local8.damage){
_local11 = _local9[_local1];
_local17 = true;
break;
} else {
if (_local9[_local1].getEffectiveHealth() < _local13){
_local13 = _local9[_local1].getEffectiveHealth();
_local12 = _local9[_local1];
};
};
_local1++;
};
};
if (!_local17){
_local11 = _local12;
};
};
if (!_local17){
_local11 = _local9[dm.randomNum(0, (_local9.length - 1))];
};
};
};
if (((!((_local8 == null))) && (!((_local11 == null))))){
useMonsterSkill(_local8, _local11);
} else {
PassTurn();
};
} else {
if ((_local5 is PlayerCharacter)){
actionsbar.retreat_skill.setSkill(new sRetreat(_local5));
actionsbar.retreat_all_skill.setSkill(new sRetreatAll(_local5));
actionsbar.pass_skill.setSkill(new sPassTurn(_local5));
if (!this.contains(actionsbar)){
addChild(actionsbar);
};
this.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelEvent);
stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
_local18 = skillbar.x;
_local19 = skillbar.y;
skillbar = null;
skillbar = new SkillBar();
skillbar.x = _local18;
skillbar.y = _local19;
skillbar.name = "skillbar";
addChild(skillbar);
_local1 = 0;
while (_local1 < _local5.skills.length) {
if (_local5.skills[_local1].active == false){
} else {
_local20 = new SkillIcon();
_local20.setSkill(_local5.skills[_local1]);
_local20.setOwner(PlayerCharacter(_local5));
skillbar.addIcon(_local20);
};
_local1++;
};
powerPreview();
ValidTargetsForPlayer(skillbar.getSelectedSkill());
if (hover != null){
drawEffectedTargets();
};
if (((DungeonMain.showHints) && (!(Dungeon.hintShown(64))))){
_local21 = new HintDialog("Player Turn", "It is your character's turn. A turn involves selecting a skill and then a target for the skill. Player characters start with three skills, but may later use up to six.\n\nIf you do not (or cannot) use a skill this turn, you may also Pass or Retreat. Pass means the character takes no action, but recovers power more quickly. Retreat causes the character to leave the battle, and can prevent the total defeat of the party.", true, true);
DungeonMain.hints = (DungeonMain.hints + 64);
stage.addChild(_local21);
dm.main.saveInterface();
};
};
};
}
function unBlurStep(_arg1:TimerEvent):void{
setBlur((currentBlur - Math.round((max_blur / blur_steps))));
}
private function addPortraitAnim(_arg1:Character, _arg2:CharacterPortrait, _arg3:Skill, _arg4:Character):void{
if (showImmune(_arg1, _arg2, _arg3, _arg4)){
_arg2.addAnimationFrame(immune_animation_frame, 1500);
} else {
if (_arg3.hasPortraitAnimation){
_arg2.addAnimationFrame(_arg3.portraitAnimationFrame, _arg3.portraitAnimationDuration);
};
if (((_arg3.showWeaponAnimation) && (_arg4.skills[0].specialAnimation))){
_arg2.addPortraitAnimation(_arg4.skills[0].specialAnimation);
};
if (_arg3.specialAnimation){
_arg2.addPortraitAnimation(_arg3.specialAnimation);
};
if (doLethalAnim){
_arg2.addPortraitAnimation(PortraitAnimation.lethal);
doLethalAnim = false;
};
};
}
private function bonusAttackOn(_arg1:Character){
var _local2:Array;
var _local3:*;
var _local4:*;
if (_arg1 == null){
return;
};
if (_arg1.health <= 0){
return;
};
_local2 = new Array();
if ((_arg1 is MonsterCharacter)){
_local3 = 0;
for (;_local3 < pc_party.members.length;_local3++) {
if (pc_party.members[_local3].health <= 0){
} else {
if (pc_party.members[_local3] == speedlist[turn]){
} else {
if (pc_party.members[_local3].retreated){
} else {
if (pc_party.members[_local3].retreating){
} else {
if (pc_party.members[_local3].stunned_duration){
} else {
if (pc_party.members[_local3].gear[Equipment.weapon] == null){
} else {
if ((((pc_party.members[_local3].gear[Equipment.weapon] is RangedWeapon)) || ((pc_party.members[_local3].gear[Equipment.weapon] is MageWeapon)))){
_local2.push(pc_party.members[_local3]);
} else {
if (CanPlayerHit(pc_party.members[_local3], MonsterCharacter(_arg1))){
_local2.push(pc_party.members[_local3]);
} else {
continue;
};
};
};
};
};
};
};
};
};
if (_local2.length){
bonusAttackPending = false;
_local4 = dm.randomNum(0, (_local2.length - 1));
phl.x = EmptyPortrait(getChildByName(("pc" + _local2[_local4].pos))).x;
phl.y = EmptyPortrait(getChildByName(("pc" + _local2[_local4].pos))).y;
UpdateInfoPanels();
useSkill(_local2[_local4], PlayerCharacter(_local2[_local4]).skills[0], _arg1);
};
};
}
private function combatGridToPos(_arg1:int, _arg2:int):int{
if ((((_arg2 < 2)) && ((_arg2 >= 0)))){
return (((_arg1 + 1) + (_arg2 * 3)));
};
if (_arg2 < 4){
return (((_arg1 + 1) + ((_arg2 - 2) * 3)));
};
return (-1);
}
private function RemoveTargetInfo(){
var _local1:*;
var _local2:PortraitHighlight;
_local1 = 0;
while (_local1 < npc_portraits.length) {
npc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, clickAttack);
_local2 = PortraitHighlight(npc_portraits[_local1].getChildByName("highlight"));
if (_local2 != null){
npc_portraits[_local1].removeChild(_local2);
_local2 = null;
};
_local1++;
};
_local1 = 0;
while (_local1 < pc_portraits.length) {
pc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, clickAttack);
_local2 = PortraitHighlight(pc_portraits[_local1].getChildByName("highlight"));
if (_local2 != null){
pc_portraits[_local1].removeChild(_local2);
_local2 = null;
};
_local1++;
};
removePortraitEffected();
}
function monsterTurnDelayComplete(_arg1:Event):void{
hadMonsterDelay = true;
monsterTurnDelayTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, monsterTurnDelayComplete);
if (speedlist[turn].health <= 0){
hadMonsterDelay = false;
initDisplay.removeDead();
EndTurn();
return;
};
RunTurn();
}
private function validCharFromGrid(_arg1:int, _arg2:int):Character{
if (_arg1 > 2){
return (null);
};
if (_arg1 < 0){
return (null);
};
if (_arg2 < 0){
return (null);
};
if (_arg2 > 3){
return (null);
};
return (combat_grid[_arg1][_arg2]);
}
private function useMonsterSkill(_arg1:Skill, _arg2:Character){
PortraitFromCharacter(speedlist[turn]).setPowerPreview(_arg1.power_cost);
useSkill(speedlist[turn], _arg1, _arg2);
_arg1.aiCastCount++;
}
private function createClone(_arg1:PlayerCharacter):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:Boolean;
var _local7:*;
_local2 = false;
_local3 = 0;
_local4 = _arg1.getEvilClone();
if (_arg1.pos < 4){
_local4.pos = (_arg1.pos + 3);
} else {
if (_arg1.pos != 5){
_local4.pos = (_arg1.pos - 3);
} else {
_local6 = (_arg1.pos < 4);
_local7 = pc_party.findEmptySlot(_local6);
if (!_local7){
return;
};
_local4.pos = convertPlayerPos(_local7);
};
};
AddCharToCombatGrid(_local4);
horde.members.push(_local4);
_local5 = addMonsterPortrait(_local4);
_local5.setClone();
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.SPACE){
PassTurn();
} else {
if (_arg1.charCode == 114){
clickRetreat(null);
} else {
if (String.fromCharCode(_arg1.charCode) == "1"){
skillbar.setSelectedSkillByPosition(1);
} else {
if (String.fromCharCode(_arg1.charCode) == "2"){
skillbar.setSelectedSkillByPosition(2);
} else {
if (String.fromCharCode(_arg1.charCode) == "3"){
skillbar.setSelectedSkillByPosition(3);
} else {
if (String.fromCharCode(_arg1.charCode) == "4"){
skillbar.setSelectedSkillByPosition(4);
} else {
if (String.fromCharCode(_arg1.charCode) == "5"){
skillbar.setSelectedSkillByPosition(5);
} else {
if (String.fromCharCode(_arg1.charCode) == "6"){
skillbar.setSelectedSkillByPosition(6);
} else {
if (((DungeonMain.debug) && ((_arg1.charCode == 107)))){
speedlist[turn].health = 0;
initDisplay.removeDead();
EndTurn();
};
};
};
};
};
};
};
};
};
if (hover != null){
drawEffectedTargets();
};
}
private function battleReady(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
turn = 0;
phl = new CurrentPortraitHighlight();
addChild(phl);
messages.removeEventListener(MouseEvent.MOUSE_DOWN, battleReady);
messages.clearAll();
_local2 = 0;
while (_local2 < pc_party.members.length) {
pc_portraits[_local2].removeEventListener(MouseEvent.MOUSE_DOWN, startDragging);
pc_portraits[_local2].removeEventListener(MouseEvent.MOUSE_UP, stopDragging);
if (this.contains(pc_portraits[_local2])){
removeChild(pc_portraits[_local2]);
};
pc_portraits[_local2].x = 0;
pc_portraits[_local2].y = 0;
_local5 = EmptyPortrait(getChildByName(("pc" + String(pc_party.members[_local2].pos))));
if (_local5 != null){
_local5.empty.addChild(pc_portraits[_local2]);
};
_local2++;
};
actionsbar.pass_skill.addEventListener(MouseEvent.MOUSE_DOWN, clickPassTurn);
actionsbar.retreat_skill.addEventListener(MouseEvent.MOUSE_DOWN, clickRetreat);
actionsbar.retreat_all_skill.addEventListener(MouseEvent.MOUSE_DOWN, clickRetreatAll);
UpdateInfoPanels();
UpdateCombatGrid();
this.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelEvent);
RunTurn();
}
function blurStep(_arg1:TimerEvent):void{
setBlur((currentBlur + Math.round((max_blur / blur_steps))));
}
function clickPassTurn(_arg1:MouseEvent):void{
if ((speedlist[turn] is PlayerCharacter)){
PassTurn();
};
}
private function showImmune(_arg1:Character, _arg2:CharacterPortrait, _arg3:Skill, _arg4:Character):Boolean{
if (!_arg1.invulnerable){
return (false);
};
if (_arg4 == _arg1){
return (false);
};
if (_arg3.damage){
return (true);
};
if (_arg3.stun_percent){
return (true);
};
if (_arg3.poisonDamage){
return (true);
};
return (false);
}
private function findMonsterTargets(_arg1:MonsterCharacter, _arg2:Skill):Array{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:Array;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:Array;
var _local13:*;
_local6 = new Array(0);
_local9 = 0;
_local10 = 0;
_local11 = _arg1.pos;
if (!_arg1.hasPowerForSkill(_arg2)){
return (_local6);
};
if (((!((_arg2.aiCastLimit == -1))) && ((_arg2.aiCastCount >= _arg2.aiCastLimit)))){
return (_local6);
};
if (((_arg2.aiNotUnlessHurt) && ((_arg1.health == _arg1.health_max)))){
return (_local6);
};
if (((_arg2.aiNotUnlessLowPower) && ((_arg1.power > 20)))){
return (_local6);
};
if (_local11 > 3){
_local9 = (_local11 % 4);
} else {
_local9 = (_local11 - 1);
};
_local10 = (Math.ceil((_local11 / 3)) - 1);
if (_arg2.targetsEmpty){
if (_arg2.summonsCreatureClass != null){
if (horde.members.length < 6){
_local6.push(_arg1);
return (_local6);
};
};
} else {
if (_arg2.hitsAllFriendlies){
_local3 = 0;
while (_local3 < horde.members.length) {
if (validTargetForMonster(horde.members[_local3], _arg2)){
if (horde.members[_local3] != _arg1){
_local6.push(horde.members[_local3]);
};
};
_local3++;
};
} else {
if (_arg2.targetsFriendlies){
_local3 = 0;
while (_local3 < horde.members.length) {
if (validTargetForMonster(horde.members[_local3], _arg2)){
if (horde.members[_local3] != _arg1){
_local6.push(horde.members[_local3]);
};
};
_local3++;
};
} else {
if (_arg2.targetsSelf){
if (((!(_arg2.aiAllowSuicide)) && ((_arg1.health <= _arg2.damage)))){
return (_local6);
};
_local6.push(_arg1);
} else {
if (_arg2.rangedAttack){
_local3 = 0;
while (_local3 < pc_party.members.length) {
if (validTargetForMonster(pc_party.members[_local3], _arg2)){
_local6.push(pc_party.members[_local3]);
};
_local3++;
};
} else {
_local13 = false;
if (_local11 < 4){
_local3 = 0;
while (_local3 < 3) {
if (combat_grid[_local3][1] != null){
if ((((combat_grid[_local3][1].health > 0)) && (!(combat_grid[_local3][1].hiding)))){
_local13 = true;
};
};
_local3++;
};
};
if (damageSpongePlayer != null){
_local6.push(damageSpongePlayer);
};
if ((((_local11 > 3)) || ((((_local11 < 4)) && (!(_local13)))))){
_local7 = 0;
_local3 = 0;
while (_local3 < 3) {
if (validTargetForMonster(combat_grid[_local3][2], _arg2)){
_local7++;
_local5 = Character(combat_grid[_local3][2]);
};
_local3++;
};
if (_local7 == 1){
_local6.push(_local5);
} else {
if (_local7 > 0){
if (validTargetForMonster(combat_grid[_local9][2], _arg2)){
_local6.push(combat_grid[_local9][2]);
};
if ((_local9 - 1) >= 0){
if (validTargetForMonster(combat_grid[(_local9 - 1)][2], _arg2)){
_local6.push(combat_grid[(_local9 - 1)][2]);
};
};
if ((_local9 + 1) < 3){
if (validTargetForMonster(combat_grid[(_local9 + 1)][2], _arg2)){
_local6.push(combat_grid[(_local9 + 1)][2]);
};
};
} else {
if (_local7 == 0){
_local8 = 0;
_local3 = 0;
while (_local3 < 3) {
if (validTargetForMonster(combat_grid[_local3][3], _arg2)){
_local8++;
_local5 = Character(combat_grid[_local3][3]);
};
_local3++;
};
if (_local8 == 1){
_local6.push(_local5);
} else {
if (_local8 > 0){
if (validTargetForMonster(combat_grid[_local9][3], _arg2)){
_local6.push(combat_grid[_local9][3]);
};
if ((_local9 - 1) >= 0){
if (validTargetForMonster(combat_grid[(_local9 - 1)][3], _arg2)){
_local6.push(combat_grid[(_local9 - 1)][3]);
};
};
if ((_local9 + 1) < 3){
if (validTargetForMonster(combat_grid[(_local9 + 1)][3], _arg2)){
_local6.push(combat_grid[(_local9 + 1)][3]);
};
};
};
};
};
};
};
};
};
};
};
};
};
_local12 = new Array();
_local3 = 0;
while (_local3 < _local6.length) {
if (skillBeneficial(_arg2, _local6[_local3])){
_local12.push(_local6[_local3]);
};
_local3++;
};
return (_local12);
}
public function layoutBoard(){
var _local1:EmptyPortrait;
var _local2:int;
var _local3:int;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:int;
var _local8:*;
turn = -1;
_local2 = 0;
while (_local2 < pc_party.members.length) {
pc_party.members[_local2].retreating = false;
pc_party.members[_local2].retreated = false;
pc_party.members[_local2].hadCombatTurn = false;
_local6 = pc_party.members[_local2].gear[Equipment.weapon];
_local7 = 1;
if (pc_party.members[_local2].skills[0] != null){
_local7 = pc_party.members[_local2].skills[0].position;
};
if (_local6 != null){
if ((_local6 is MeleeWeapon)){
pc_party.members[_local2].skills[0] = new sWeaponAttack(pc_party.members[_local2]);
} else {
if ((_local6 is RangedWeapon)){
pc_party.members[_local2].skills[0] = new sRangedAttack(pc_party.members[_local2]);
} else {
if ((_local6 is MageWeapon)){
pc_party.members[_local2].skills[0] = new sMageAttack(pc_party.members[_local2]);
};
};
};
pc_party.members[_local2].skills[0].active = true;
} else {
pc_party.members[_local2].skills[0] = new sUnarmedAttack(pc_party.members[_local2]);
pc_party.members[_local2].skills[0].active = true;
};
pc_party.members[_local2].skills[0].position = _local7;
_local8 = new CharacterPortrait();
_local8.setChar(pc_party.members[_local2]);
if (pc_party.members[_local2].pos == 0){
pc_party.setMemberPos(_local2, (_local2 + 1));
};
_local1 = EmptyPortrait(getChildByName(("pc" + String(pc_party.members[_local2].pos))));
_local8.x = _local1.x;
_local8.y = _local1.y;
this.addChild(_local8);
_local8.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
_local8.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
_local8.addEventListener(MouseEvent.MOUSE_OVER, mousedOverEvent);
_local8.addEventListener(MouseEvent.MOUSE_OVER, mouseMoveEvent);
_local8.addEventListener(MouseEvent.MOUSE_OUT, mousedOutEvent);
pc_portraits.push(_local8);
_local2++;
};
_local2 = (horde.members.length - 1);
for (;_local2 >= 0;_local2--) {
if (horde.members[_local2].isSummoned()){
horde.members.splice(_local2, 1);
continue;
} else {
if (((horde.isDemonHorde()) && (!((horde.members[_local2] is mDemon))))){
horde.members.splice(_local2, 1);
continue;
};
};
horde.members[_local2].clearStatusEffects();
horde.members[_local2].resetSkills();
horde.members[_local2].health = horde.members[_local2].health_max;
horde.members[_local2].power = horde.members[_local2].power_max;
horde.members[_local2].hadCombatTurn = false;
addMonsterPortrait(horde.members[_local2]);
};
_local4 = "Adjust Party Formation";
_local5 = "Click here when ready to begin battle!";
messages.addMessage(_local4, _local5);
messages.addEventListener(MouseEvent.MOUSE_DOWN, battleReady);
selected_skill_text.text = "";
removeChild(actionsbar);
removeChild(skillbar);
removeChild(active_info_panel);
removeChild(target_info_panel);
CalculateInitiative();
initDisplay.turnOf(speedlist[0], false);
}
private function setBlur(_arg1:int):void{
var _local2:BlurFilter;
_local2 = new BlurFilter();
_local2.blurX = _arg1;
_local2.blurY = _arg1;
_local2.quality = BitmapFilterQuality.LOW;
this.filters = [_local2];
currentBlur = _arg1;
}
function clickAttack(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:Character;
var _local5:*;
_local4 = Character(CharacterPortrait(_arg1.currentTarget).char_ref);
_local5 = skillbar.getSelectedSkill();
RemoveTargetInfo();
useSkill(speedlist[turn], _local5, _local4);
}
private function CalculateInitiative(_arg1:Boolean=true):Boolean{
var _local2:*;
var _local3:*;
var _local4:Array;
var _local5:int;
var _local6:int;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:Array;
var _local11:*;
var _local12:*;
var _local13:*;
_local4 = pc_party.members.concat(horde.members);
_local7 = 0;
_local8 = speedlist[turn];
_local9 = -1;
_local10 = speedlist;
speedlist = new Array(_local4.length);
_local2 = 0;
while (_local2 < speedlist.length) {
_local5 = 0;
_local6 = 0;
_local3 = 0;
while (_local3 < speedlist.length) {
if (_local4[_local3] == null){
} else {
_local12 = 0;
_local12 = _local4[_local3].getQuickness();
if (_local12 >= _local6){
_local6 = _local12;
_local5 = _local3;
};
};
_local3++;
};
speedlist[_local2] = _local4[_local5];
if (speedlist[_local2] == _local8){
_local9 = _local2;
};
_local4.splice(_local5, 1);
_local7++;
_local2++;
};
speedlist.length = _local7;
if (!_arg1){
if (_local9 != -1){
turn = _local9;
};
};
initDisplay.setData(speedlist);
_local11 = false;
if (_local10.length != speedlist.length){
_local11 = true;
} else {
_local13 = 0;
while (_local13 < _local10.length) {
if (_local10[_local13] != speedlist[_local13]){
_local11 = true;
break;
};
_local13++;
};
};
return (_local11);
}
private function entryBlur():void{
setBlur(max_blur);
blurTimer = new Timer(50, blur_steps);
blurTimer.addEventListener(TimerEvent.TIMER, unBlurStep);
blurTimer.addEventListener(TimerEvent.TIMER_COMPLETE, unBlurDone);
blurTimer.start();
}
function startDragging(_arg1:MouseEvent):void{
stage.addChild(CharacterPortrait(_arg1.currentTarget));
CharacterPortrait(_arg1.currentTarget).startDrag();
}
public static function DistanceBetween(_arg1:int, _arg2:int, _arg3:int, _arg4:int):int{
var _local5:*;
var _local6:*;
_local5 = Math.abs((_arg1 - _arg3));
_local6 = Math.abs((_arg2 - _arg4));
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
}
}//package
Section 30
//BattleInfoPanel (BattleInfoPanel)
package {
import flash.text.*;
import flash.display.*;
public class BattleInfoPanel extends MovieClip {
const color_green:uint = 52275;
const color_white:uint = 0xFFFFFF;
const color_red:uint = 0xE90000;
public var large_portrait:CharGraphic;
public var poison_resist_number:TextField;
public var name_label:TextField;
public var accuracy_number:TextField;
public var damage_resist_number:TextField;
public var stun_resist_number:TextField;
public var health_bar:NumericIndicatorHealth;
public var level_label:TextField;
var portrait_w;// = 20
public var power_bar:NumericIndicatorPower;
var portrait_h;// = 20
public var description_label:TextField;
public function BattleInfoPanel(){
portrait_w = 20;
portrait_h = 20;
super();
portrait_w = large_portrait.width;
portrait_h = large_portrait.height;
}
public function setChar(_arg1:Character):void{
var _local2:*;
var _local3:*;
var _local4:*;
name_label.text = _arg1.charname;
level_label.text = ((("Level " + String(_arg1.level)) + " ") + _arg1.classname);
UpdateDescription(description_label, _arg1);
large_portrait.setFrame(_arg1.portrait);
health_bar.bar.width = ((60 / 100) * _arg1.getHealthPercent());
health_bar.numbers.text = ((String(_arg1.health) + "/") + String(_arg1.health_max));
power_bar.bar.width = ((60 / 100) * _arg1.getPowerPercent());
power_bar.numbers.text = ((String(_arg1.power) + "/") + String(_arg1.power_max));
if (getChildByName("health_bar") == null){
addChild(health_bar);
};
if (getChildByName("power_bar") == null){
addChild(power_bar);
};
accuracy_number.text = (String(_arg1.getAccuracy()) + "%");
damage_resist_number.text = (String(_arg1.getDamageResist()) + "%");
poison_resist_number.text = (String(_arg1.getPoisonResist()) + "%");
stun_resist_number.text = (String(_arg1.getStunResist()) + "%");
_local2 = 0;
if ((_arg1 is MonsterCharacter)){
_local2 = MonsterCharacter(_arg1).damage_resistance;
} else {
if ((_arg1 is PlayerCharacter)){
_local2 = PlayerCharacter(_arg1).getDamageReductionFromArmor();
};
};
_local3 = (_arg1.getPoisonResist() - _arg1.buff_resistPoison);
_local4 = (_arg1.getStunResist() - _arg1.buff_resistStun);
accuracy_number.textColor = getColorForText(_arg1.accuracy, _arg1.getAccuracy());
damage_resist_number.textColor = getColorForText(_local2, _arg1.getDamageResist());
poison_resist_number.textColor = getColorForText(_local3, _arg1.getPoisonResist());
stun_resist_number.textColor = getColorForText(_local4, _arg1.getStunResist());
}
private function getColorForText(_arg1, _arg2):uint{
if (_arg2 > _arg1){
return (color_green);
};
if (_arg2 < _arg1){
return (color_red);
};
return (color_white);
}
private function UpdateDescription(_arg1:TextField, _arg2:Character){
var _local3:String;
if ((_arg2 is PlayerCharacter)){
_local3 = "";
} else {
_local3 = (_arg2.description + "\n ");
};
if (_arg2.lethalityImmune){
_local3 = (_local3 + "'Instant Kill' Immunity, ");
};
if (((parent) && ((parent is Battlefield)))){
if (((((!((Battlefield(parent).damageSpongePlayer == null))) && ((_arg2 is PlayerCharacter)))) && ((Battlefield(parent).damageSpongePlayer == _arg2)))){
_local3 = (_local3 + "Shielding Allies! ");
} else {
if (((((!((Battlefield(parent).damageSpongeMonster == null))) && ((_arg2 is MonsterCharacter)))) && ((Battlefield(parent).damageSpongeMonster == _arg2)))){
_local3 = (_local3 + "Shielding Allies! ");
};
};
};
if (_arg2.cancelPowerRegen){
_local3 = (_local3 + "No Power Regeneration, ");
};
if (_arg2.damageMod != 1){
_local3 = (_local3 + (("Next Attack(" + Math.round((_arg2.damageMod * 100))) + "%), "));
};
if (_arg2.powerRegenMod != 1){
_local3 = (_local3 + (("Temp Power Regen(" + Math.round((_arg2.powerRegenMod * 100))) + "%), "));
};
if (_arg2.cursed){
_local3 = (_local3 + (("Cursed(" + (_arg2.cursed * 100)) + "%), "));
};
if (_arg2.temp_damage_resistance){
_local3 = (_local3 + (("Temp Damage Resist(" + _arg2.temp_damage_resistance) + "), "));
};
if (_arg2.buff_resistPoison){
_local3 = (_local3 + (("Buff Resist Poison(" + _arg2.buff_resistPoison) + "), "));
};
if (_arg2.buff_resistStun){
_local3 = (_local3 + (("Buff Resist Stun(" + _arg2.buff_resistStun) + "), "));
};
if (_arg2.buff_damageResist){
_local3 = (_local3 + (("Buff Damage Resist(" + _arg2.buff_damageResist) + "), "));
};
if (_arg2.buff_damageReflect){
_local3 = (_local3 + (("Buff Damage Reflect(" + _arg2.buff_damageReflect) + "), "));
};
if (_arg2.buff_healthRegen){
_local3 = (_local3 + (("Buff Health Regen(" + _arg2.buff_healthRegen) + "), "));
};
if (_arg2.buff_powerRegen){
_local3 = (_local3 + (("Buff Power Regen(" + _arg2.buff_powerRegen) + "), "));
};
if (_arg2.buff_vampiric){
_local3 = (_local3 + (("Buff Health Drain(" + _arg2.buff_vampiric) + "), "));
};
if (_arg2.buff_stun){
_local3 = (_local3 + (("Buff Stun Chance(" + _arg2.buff_stun) + "), "));
};
if (_arg2.buff_quickness){
_local3 = (_local3 + (("Buff Quickness(" + _arg2.buff_quickness) + "), "));
};
if (_arg2.buff_damage != 1){
_local3 = (_local3 + (("Buff Damage(+" + (Math.round((_arg2.buff_damage * 100)) - 100)) + "%), "));
};
if (_arg2.buff_accuracy){
_local3 = (_local3 + (("Buff Accuracy(" + _arg2.buff_accuracy) + "), "));
};
if (_arg2.potion_damage_resist){
_local3 = (_local3 + (("Potion Armor(+" + _arg2.potion_damage_resist) + "%), "));
};
if (_arg2.potion_damage_bonus){
_local3 = (_local3 + (("Potion Damage(+" + _arg2.potion_damage_bonus) + "%), "));
};
if (_arg2.potion_poison_resist){
_local3 = (_local3 + (("Potion Poison Resist(+" + _arg2.potion_poison_resist) + "%), "));
};
if (_arg2.potion_stun_resist){
_local3 = (_local3 + (("Potion Stun Resist(+" + _arg2.potion_stun_resist) + "%), "));
};
if (_arg2.potion_quickness_bonus){
_local3 = (_local3 + (("Potion Quickness(+" + _arg2.potion_quickness_bonus) + "), "));
};
if (_arg2.poisoned){
_local3 = (_local3 + (("Poisoned(" + _arg2.poisoned) + "), "));
};
if (_arg2.accuracy_penalty){
_local3 = (_local3 + (("Blinded(" + _arg2.accuracy_penalty) + "), "));
};
if (_arg2.crippled){
_local3 = (_local3 + (("Slowed(" + _arg2.crippled) + "), "));
};
if (_arg2.stunned_duration){
_local3 = (_local3 + (("Stunned(" + _arg2.stunned_duration) + "), "));
};
if (_arg2.cannotDie){
_local3 = (_local3 + (("Defiant(" + _arg2.cannotDie) + "), "));
};
if (_arg2.invulnerable){
_local3 = (_local3 + (("Invulnerable(" + _arg2.invulnerable) + "), "));
};
if ((((_arg2 is PlayerCharacter)) && (PlayerCharacter(_arg2).retreating))){
_local3 = (_local3 + "Retreating, ");
};
if ((((_arg2 is PlayerCharacter)) && (PlayerCharacter(_arg2).retreated))){
_local3 = (_local3 + "Retreated, ");
};
if (_arg2.hiding){
_local3 = (_local3 + "Hidden, ");
};
if (_local3.length > 1){
_local3 = _local3.slice(0, (_local3.length - 2));
};
_arg1.text = _local3;
}
}
}//package
Section 31
//BattleMessageBox (BattleMessageBox)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class BattleMessageBox extends MovieClip {
public var next_btn:BattleMessageScroller;
public var previous_btn:BattleMessageScroller;
var messages2:Array;
var messages1:Array;
var current:int;// = -1
public var line1:TextField;
public var line2:TextField;
public function BattleMessageBox():void{
current = -1;
super();
messages1 = new Array();
messages2 = new Array();
previous_btn.addEventListener(MouseEvent.MOUSE_DOWN, goPrevious);
next_btn.addEventListener(MouseEvent.MOUSE_DOWN, goNext);
previous_btn.doubleClickEnabled = true;
next_btn.doubleClickEnabled = true;
previous_btn.addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickArrow);
next_btn.addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickArrow);
previous_btn.useHandCursor = false;
next_btn.useHandCursor = false;
previousEnabled(false);
nextEnabled(false);
}
function doubleClickArrow(_arg1:MouseEvent):void{
}
public function clearAll():void{
current = 0;
messages1.length = 0;
messages2.length = 0;
line1.text = "";
line2.text = "";
previousEnabled(false);
nextEnabled(false);
}
public function addMessage(_arg1:String, _arg2:String):void{
current = messages1.length;
messages1.push(_arg1);
messages2.push(_arg2);
displayCurrent();
}
private function displayCurrent():void{
if ((((current < 0)) || (!(messages1.length)))){
return;
};
display(current);
}
public function updateMostRecent(_arg1:String, _arg2:String):void{
var _local3:*;
_local3 = (messages1.length - 1);
if (_arg1.length){
messages1[_local3] = (messages1[_local3] + _arg1);
};
if (_arg2.length){
messages2[_local3] = (messages2[_local3] + _arg2);
};
display(_local3);
}
private function previousEnabled(_arg1:Boolean):void{
if (((_arg1) && (!(this.contains(previous_btn))))){
addChild(previous_btn);
} else {
if (((!(_arg1)) && (this.contains(previous_btn)))){
removeChild(previous_btn);
};
};
}
function goNext(_arg1:MouseEvent):void{
current = Math.min((current + 1), (messages1.length - 1));
displayCurrent();
}
public function cleanup():void{
previous_btn.removeEventListener(MouseEvent.MOUSE_DOWN, goPrevious);
next_btn.removeEventListener(MouseEvent.MOUSE_DOWN, goNext);
previous_btn.removeEventListener(MouseEvent.DOUBLE_CLICK, doubleClickArrow);
next_btn.removeEventListener(MouseEvent.DOUBLE_CLICK, doubleClickArrow);
}
private function display(_arg1:int):void{
line1.text = String(messages1[_arg1]);
line2.text = String(messages2[_arg1]);
dm.embolden(line1);
dm.embolden(line2);
if (_arg1 < (messages1.length - 1)){
nextEnabled(true);
} else {
nextEnabled(false);
};
if (_arg1 > 0){
previousEnabled(true);
} else {
previousEnabled(false);
};
}
private function nextEnabled(_arg1:Boolean):void{
if (((_arg1) && (!(this.contains(next_btn))))){
addChild(next_btn);
} else {
if (((!(_arg1)) && (this.contains(next_btn)))){
removeChild(next_btn);
};
};
}
function goPrevious(_arg1:MouseEvent):void{
current = Math.max((current - 1), 0);
displayCurrent();
}
}
}//package
Section 32
//BattleMessageScroller (BattleMessageScroller)
package {
import flash.display.*;
public dynamic class BattleMessageScroller extends SimpleButton {
}
}//package
Section 33
//BattleMusic (BattleMusic)
package {
public class BattleMusic extends Music {
public function BattleMusic(_arg1:Boolean=true):void{
var _local2:*;
super();
active = true;
_local2 = new rollingthunder_c();
channel = _local2.play(0, 99999);
if (_arg1){
this.fadeIn(750);
} else {
this.setVolume(volumeSetting);
};
}
}
}//package
Section 34
//BiclopsLogo (BiclopsLogo)
package {
import flash.display.*;
public dynamic class BiclopsLogo extends SimpleButton {
}
}//package
Section 35
//BiclopsPreloaderLink (BiclopsPreloaderLink)
package {
import flash.display.*;
public dynamic class BiclopsPreloaderLink extends SimpleButton {
}
}//package
Section 36
//blind_effect (blind_effect)
package {
import flash.display.*;
public dynamic class blind_effect extends MovieClip {
public function blind_effect(){
addFrameScript(0, frame1, 19, frame20);
}
function frame1(){
dm.sound.play(SoundControl.blind);
}
function frame20(){
this.gotoAndStop(20);
}
}
}//package
Section 37
//blind_sound (blind_sound)
package {
import flash.media.*;
public dynamic class blind_sound extends Sound {
}
}//package
Section 38
//BloodRandom (BloodRandom)
package {
import flash.display.*;
public dynamic class BloodRandom extends MovieClip {
public var f;
public function BloodRandom(){
addFrameScript(0, frame1);
}
function frame1(){
f = DungeonMain.RandomNum(1, this.totalFrames);
this.gotoAndStop(f);
}
}
}//package
Section 39
//BlueBarHorz (BlueBarHorz)
package {
import flash.display.*;
public dynamic class BlueBarHorz extends Sprite {
}
}//package
Section 40
//blueburst (blueburst)
package {
import flash.display.*;
public dynamic class blueburst extends MovieClip {
}
}//package
Section 41
//buff_chant_sound (buff_chant_sound)
package {
import flash.media.*;
public dynamic class buff_chant_sound extends Sound {
}
}//package
Section 42
//buff_effect (buff_effect)
package {
import flash.display.*;
public dynamic class buff_effect extends MovieClip {
public function buff_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.buff);
}
function frame45(){
this.stop();
}
}
}//package
Section 43
//buff_quickness_effect (buff_quickness_effect)
package {
import flash.display.*;
public dynamic class buff_quickness_effect extends MovieClip {
}
}//package
Section 44
//BuySkillPanel (BuySkillPanel)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class BuySkillPanel extends Sprite {
public var sk_icon:SkillIcon;
public var bg:MovieClip;
var skill:Skill;
public var sk_description:TextField;
var isSelected:Boolean;// = false
public function BuySkillPanel(){
isSelected = false;
super();
bg.addEventListener(MouseEvent.MOUSE_DOWN, clicked);
sk_icon.addEventListener(MouseEvent.MOUSE_DOWN, clicked);
bg.gotoAndStop("normal");
}
public function setBlank():void{
if (this.contains(sk_description)){
removeChild(sk_description);
};
if (this.contains(sk_icon)){
removeChild(sk_icon);
};
cleanup();
}
public function setSkill(_arg1:Skill):void{
if (_arg1 == null){
return;
};
this.skill = _arg1;
sk_icon.gotoAndStop(_arg1.iconFrame);
sk_icon.setSkill(_arg1);
sk_icon.setOwner(PlayerCharacter(_arg1.char_ref));
sk_icon.setUsable(_arg1.usable(true));
sk_description.mouseEnabled = false;
sk_description.text = _arg1.skillname;
dm.embolden(sk_description);
}
function clicked(_arg1:MouseEvent):void{
if (isSelected){
isSelected = false;
bg.gotoAndStop("normal");
if (parent != null){
BuySkills(parent).skillDeselected();
};
} else {
if ((((parent == null)) || (!((parent is BuySkills))))){
return;
};
if (BuySkills(parent).pointsFree > 0){
isSelected = true;
bg.gotoAndStop("selected");
BuySkills(parent).skillSelected();
};
};
}
public function cleanup():void{
sk_icon.cleanup();
bg.removeEventListener(MouseEvent.MOUSE_DOWN, clicked);
sk_icon.removeEventListener(MouseEvent.MOUSE_DOWN, clicked);
}
}
}//package
Section 45
//BuySkillPanelR (BuySkillPanelR)
package {
public dynamic class BuySkillPanelR extends BuySkillPanel {
}
}//package
Section 46
//BuySkills (BuySkills)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class BuySkills extends MovieClip {
public var sk4:BuySkillPanel;
public var cancel_btn:CancelButton;
public var points_txt:TextField;
var char_ref:PlayerCharacter;
var info_panel:CharInfoPanel;
public var continue_btn:ContinueButton;
public var sk1:BuySkillPanel;
public var sk2:BuySkillPanel;
public var sk3:BuySkillPanel;
public var sk5:BuySkillPanelR;
public var sk8:BuySkillPanelR;
public var sk6:BuySkillPanelR;
public var sk7:BuySkillPanelR;
var pointsFree:int;// = 0
public function BuySkills(_arg1:CharInfoPanel=null){
pointsFree = 0;
super();
if (_arg1 != null){
this.info_panel = _arg1;
};
continue_btn.addEventListener(MouseEvent.MOUSE_DOWN, continueClick);
cancel_btn.addEventListener(MouseEvent.MOUSE_DOWN, cancelClick);
}
public function setChar(_arg1:PlayerCharacter):void{
var _local2:*;
var _local3:*;
var _local4:*;
if (_arg1 == null){
return;
};
char_ref = _arg1;
_local3 = 1;
pointsFree = _arg1.skill_points;
updateSkillPoints();
_local4 = 0;
while (_local4 < _arg1.skills.length) {
if (_arg1.skills[_local4].unlocked){
} else {
_local2 = getChildByName(("sk" + _local3));
if (_local2 == null){
} else {
_local2.setSkill(_arg1.skills[_local4]);
_local3++;
};
};
_local4++;
};
_local4 = _local3;
while (_local4 <= 8) {
_local2 = getChildByName(("sk" + _local4));
if (_local2 != null){
_local2.setBlank();
};
_local4++;
};
}
private function updateSkillPoints():void{
points_txt.text = String(pointsFree);
dm.embolden(points_txt);
}
function continueClick(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
_local2 = 1;
while (_local2 <= 8) {
_local3 = getChildByName(("sk" + _local2));
if (_local3 == null){
} else {
if (((_local3.isSelected) && (!((_local3.skill == null))))){
_local3.skill.unlocked = true;
};
};
_local2++;
};
char_ref.skill_points = pointsFree;
this.cleanup();
if (info_panel != null){
info_panel.updateValues();
};
if (stage != null){
stage.removeChild(this);
};
}
function cancelClick(_arg1:MouseEvent):void{
this.cleanup();
if (parent != null){
stage.removeChild(this);
};
}
public function skillSelected():void{
pointsFree--;
updateSkillPoints();
}
public function skillDeselected():void{
pointsFree++;
updateSkillPoints();
}
public function cleanup():void{
var _local1:*;
var _local2:*;
continue_btn.removeEventListener(MouseEvent.MOUSE_DOWN, continueClick);
cancel_btn.removeEventListener(MouseEvent.MOUSE_DOWN, cancelClick);
_local1 = 1;
while (_local1 <= 8) {
_local2 = getChildByName(("sk" + _local1));
if (_local2 != null){
_local2.cleanup();
};
_local1++;
};
}
}
}//package
Section 47
//CancelButton (CancelButton)
package {
import flash.display.*;
public dynamic class CancelButton extends MovieClip {
}
}//package
Section 48
//Character (Character)
package {
public class Character {
const power_max = 100;
private var _power:int;// = 100
var damageMod;// = 1
private var _type:int;// = 0
private var _potion_stun_resist:int;// = 0
var buff_resistPoison;// = 0
var cursed;// = 0
private var _intellect:int;// = 1
var invulnerable:int;// = 0
var buff_resistStun;// = 0
var buff_stun;// = 0
var lethalityImmune:Boolean;// = false
private var _potion_poison_resist:int;// = 0
private var _description:String;// = ""
var skills:Array;
var accuracy_penalty:int;// = 0
private var _dexterity:int;// = 1
private var _charname:String;
private var _quickness:int;// = 50
var cancelPowerRegen:Boolean;// = false
var buff_healthRegen;// = 0
private var _accuracy:int;// = 95
var power_per_turn;// = 10
var temp_damage_resistance:int;// = 0
var buff_damageReflect;// = 0
var buff_accuracy;// = 0
private var _potion_quickness_bonus:int;// = 0
var crippled:int;// = 0
private var _health:int;// = 50
var hadCombatTurn:Boolean;// = false
var cannotDie:int;// = 0
var hiding;// = false
private var _level;// = 1
private var _classname:String;
private var _damage:int;// = 0
private var _endurance:int;// = 1
private var _pos:int;// = 0
var cannotDieMin:int;// = 1
private var _health_max:int;// = 50
var buff_damageResist;// = 0
private var _strength:int;// = 1
var powerRegenMod;// = 1
var buff_powerRegen;// = 0
var poisoned:int;// = 0
var stunned_duration:int;// = 0
private var _potion_damage_bonus:int;// = 0
var buff_quickness;// = 0
var buff_damage;// = 1
private var _stunResist:int;// = 0
private var _potion_damage_resist:int;// = 0
private var _poisonResist:int;// = 0
private var _portrait:int;// = 1
var buff_vampiric;// = 0
static const ACCURACY_MINIMUM = 10;
public function Character(){
_level = 1;
_health_max = 50;
_health = 50;
power_per_turn = 10;
_power = 100;
_damage = 0;
_type = 0;
_description = "";
_strength = 1;
_endurance = 1;
_dexterity = 1;
_intellect = 1;
_quickness = 50;
_accuracy = 95;
_portrait = 1;
_pos = 0;
_poisonResist = 0;
_stunResist = 0;
skills = new Array();
stunned_duration = 0;
accuracy_penalty = 0;
poisoned = 0;
powerRegenMod = 1;
hiding = false;
cannotDie = 0;
cannotDieMin = 1;
cursed = 0;
lethalityImmune = false;
invulnerable = 0;
temp_damage_resistance = 0;
damageMod = 1;
crippled = 0;
cancelPowerRegen = false;
buff_resistPoison = 0;
buff_resistStun = 0;
buff_damageResist = 0;
buff_damageReflect = 0;
buff_healthRegen = 0;
buff_powerRegen = 0;
buff_vampiric = 0;
buff_stun = 0;
buff_quickness = 0;
buff_damage = 1;
buff_accuracy = 0;
_potion_damage_resist = 0;
_potion_damage_bonus = 0;
_potion_poison_resist = 0;
_potion_stun_resist = 0;
_potion_quickness_bonus = 0;
hadCombatTurn = false;
super();
}
public function set intellect(_arg1:int):void{
this._intellect = _arg1;
}
public function get health_max():int{
return (this._health_max);
}
public function set health_max(_arg1:int):void{
this._health_max = _arg1;
}
public function get classname():String{
return (this._classname);
}
public function get power():int{
return (this._power);
}
public function set level(_arg1:int):void{
this._level = _arg1;
}
public function set classname(_arg1:String):void{
this._classname = _arg1;
}
public function set endurance(_arg1:int):void{
this._endurance = _arg1;
}
public function set power(_arg1:int):void{
this._power = _arg1;
}
public function get poisonResist():int{
return (this._poisonResist);
}
public function getPoisonDamage(_arg1:Boolean=true):int{
return (0);
}
public function get potion_damage_resist():int{
return (this._potion_damage_resist);
}
public function get endurance():int{
return (this._endurance);
}
public function set potion_damage_bonus(_arg1:int):void{
this._potion_damage_bonus = _arg1;
}
public function getDexterity(_arg1:Boolean=true):int{
return (this.dexterity);
}
public function getVampiric(_arg1:Boolean=true):int{
if (_arg1){
return (buff_vampiric);
};
return (0);
}
public function set poisonResist(_arg1:int):void{
this._poisonResist = _arg1;
}
public function getPowerRegen(_arg1:Boolean=true):int{
if (_arg1){
return (Math.round(((power_per_turn + buff_powerRegen) * powerRegenMod)));
};
return (power_per_turn);
}
public function getPowerPercent():int{
return (Math.round((100 / (power_max / power))));
}
public function set potion_damage_resist(_arg1:int):void{
this._potion_damage_resist = _arg1;
}
public function set portrait(_arg1:int):void{
this._portrait = _arg1;
}
public function get potion_quickness_bonus():int{
return (this._potion_quickness_bonus);
}
public function get type():int{
return (this._type);
}
public function increaseHealth(_arg1:int, _arg2:Boolean=false):int{
var _local3:*;
_local3 = health;
if ((((_local3 == 0)) && (!(_arg2)))){
return (0);
};
health = (health + _arg1);
if (health > health_max){
health = health_max;
};
if (health < 0){
health = 0;
clearStatusEffects();
};
return ((health - _local3));
}
public function reducePower(_arg1:int):int{
var _local2:*;
_local2 = power;
power = (power - _arg1);
if (power < 0){
power = 0;
};
if (power > 100){
power = 100;
};
return ((_local2 - power));
}
public function get strength():int{
return (this._strength);
}
public function get stunResist():int{
return (this._stunResist);
}
public function genderPronoun(_arg1:Boolean=false):String{
if (_arg1){
return ("They");
};
return ("they");
}
public function getStunResist(_arg1:Boolean=true):int{
if (_arg1){
return (((stunResist + buff_resistStun) + potion_stun_resist));
};
return (stunResist);
}
public function getHealthRegen(_arg1:Boolean=true):int{
if (_arg1){
return (buff_healthRegen);
};
return (0);
}
public function get pos():int{
return (this._pos);
}
public function get health():int{
return (this._health);
}
public function get potion_poison_resist():int{
return (this._potion_poison_resist);
}
public function getLethality(_arg1:Boolean=true):int{
return (0);
}
public function getEndurance(_arg1:Boolean=true):int{
return (this.endurance);
}
public function get potion_stun_resist():int{
return (this._potion_stun_resist);
}
public function poison(_arg1:int):Boolean{
var _local2:*;
var _local3:*;
if (invulnerable){
return (false);
};
_local2 = getPoisonResist();
if (_local2 >= 100){
return (false);
};
_local3 = Math.round((_arg1 * (1 - (_local2 / 100))));
if (_local3 > 0){
poisoned = (poisoned + _local3);
return (true);
};
return (false);
}
public function genderPossessive(_arg1:Boolean=false):String{
if (_arg1){
return ("Their");
};
return ("their");
}
public function get damage():int{
return (this._damage);
}
public function set potion_quickness_bonus(_arg1:int):void{
this._potion_quickness_bonus = _arg1;
}
public function set type(_arg1:int):void{
this._type = _arg1;
}
public function getAccuracy(_arg1:Boolean=true):int{
var _local2:int;
if (_arg1){
_local2 = ((accuracy + buff_accuracy) - accuracy_penalty);
} else {
_local2 = accuracy;
};
_local2 = Math.max(ACCURACY_MINIMUM, _local2);
return (_local2);
}
public function getDamageReflection(_arg1:Boolean=true):int{
if (_arg1){
return (buff_damageReflect);
};
return (0);
}
public function set strength(_arg1:int):void{
this._strength = _arg1;
}
public function get level():int{
return (this._level);
}
public function get intellect():int{
return (this._intellect);
}
public function set stunResist(_arg1:int):void{
this._stunResist = _arg1;
}
public function clearStatusEffects():void{
cannotDie = 0;
invulnerable = 0;
stunned_duration = 0;
accuracy_penalty = 0;
poisoned = 0;
damageMod = 1;
powerRegenMod = 1;
temp_damage_resistance = 0;
crippled = 0;
cursed = 0;
hiding = false;
cancelPowerRegen = false;
buff_resistPoison = 0;
buff_resistStun = 0;
buff_damageResist = 0;
buff_damageReflect = 0;
buff_healthRegen = 0;
buff_powerRegen = 0;
buff_vampiric = 0;
buff_stun = 0;
buff_quickness = 0;
buff_damage = 1;
buff_accuracy = 0;
buff_quickness = 0;
potion_damage_resist = 0;
potion_damage_bonus = 0;
potion_poison_resist = 0;
potion_stun_resist = 0;
potion_quickness_bonus = 0;
}
public function getQuickness(_arg1:Boolean=true):int{
var _local2:*;
_local2 = this.quickness;
if (_arg1){
_local2 = (_local2 + ((buff_quickness + potion_quickness_bonus) - crippled));
};
_local2 = Math.max(_local2, 0);
return (_local2);
}
public function set dexterity(_arg1:int):void{
this._dexterity = _arg1;
}
public function damageAfterArmor(_arg1:int):int{
return (_arg1);
}
public function getHealthPercent():int{
return (Math.round((100 / (health_max / health))));
}
public function get portrait():int{
return (this._portrait);
}
public function get potion_damage_bonus():int{
return (this._potion_damage_bonus);
}
public function getStunChance(_arg1:Boolean=true):int{
return (0);
}
public function set pos(_arg1:int):void{
this._pos = _arg1;
}
public function getEffectiveHealth():int{
return (health);
}
public function getDamageResist(_arg1:Boolean=true):int{
if (_arg1){
return (((buff_damageResist + temp_damage_resistance) + potion_damage_resist));
};
return (0);
}
public function hasPowerForSkill(_arg1:Skill):Boolean{
if (_arg1.power_cost > power){
return (false);
};
return (true);
}
public function genderSelf(_arg1:Boolean=false):String{
if (_arg1){
return ("Itself");
};
return ("itself");
}
public function set quickness(_arg1:int):void{
this._quickness = _arg1;
}
public function set health(_arg1:int):void{
this._health = _arg1;
}
public function set potion_poison_resist(_arg1:int):void{
this._potion_poison_resist = _arg1;
}
public function stun(_arg1:int):Boolean{
var _local2:*;
_local2 = getStunResist();
if (invulnerable){
return (false);
};
if (DungeonMain.RandomNum(0, 100) >= _local2){
stunned_duration = _arg1;
return (true);
};
return (false);
}
public function getHealingBonus(_arg1:Boolean=true):int{
return (0);
}
public function getAccuracyDamage(_arg1:Boolean=true):int{
return (0);
}
public function getPoisonResist(_arg1:Boolean=true):int{
if (_arg1){
return (((poisonResist + buff_resistPoison) + potion_poison_resist));
};
return (poisonResist);
}
public function set charname(_arg1:String):void{
this._charname = _arg1;
}
public function get dexterity():int{
return (this._dexterity);
}
public function reduceHealth(_arg1:int):int{
var _local2:*;
if (invulnerable){
return (0);
};
_local2 = health;
health = (health - _arg1);
if ((((health < cannotDieMin)) && ((cannotDie > 0)))){
health = Math.min(_local2, cannotDieMin);
};
if (health < 0){
health = 0;
clearStatusEffects();
};
if (health > health_max){
health = health_max;
};
return ((_local2 - health));
}
public function increaseHealthByPercentage(_arg1:int, _arg2:Boolean=false):int{
var _local3:*;
_local3 = Math.round((health_max * (_arg1 / 100)));
return (increaseHealth(_local3, _arg2));
}
public function get quickness():int{
return (this._quickness);
}
public function set potion_stun_resist(_arg1:int):void{
this._potion_stun_resist = _arg1;
}
public function getStrength(_arg1:Boolean=true):int{
return (this.strength);
}
public function getIntellect(_arg1:Boolean=true):int{
return (this.intellect);
}
public function canMissWith(_arg1:Skill):Boolean{
if (_arg1.alwaysHits){
return (false);
};
if (_arg1.targetsFriendlies){
return (false);
};
if (_arg1.targetsSelf){
return (false);
};
if (_arg1.targetsEmpty){
return (false);
};
return (true);
}
public function increasePowerByPercentage(_arg1:int):int{
return (increasePower(_arg1));
}
public function set damage(_arg1:int):void{
this._damage = _arg1;
}
public function get charname():String{
return (this._charname);
}
public function increasePower(_arg1:int):int{
var _local2:*;
_local2 = power;
power = (power + _arg1);
if (power > power_max){
power = power_max;
};
return ((power - _local2));
}
public function reduceHealthByPercentage(_arg1:int):int{
var _local2:*;
_local2 = ((health_max / 100) * _arg1);
return (reduceHealth(_local2));
}
public function set accuracy(_arg1:int):void{
this._accuracy = _arg1;
}
public function set description(_arg1:String):void{
this._description = _arg1;
}
public function get accuracy():int{
return (this._accuracy);
}
public function get description():String{
return (this._description);
}
}
}//package
Section 49
//CharacterPortrait (CharacterPortrait)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
import flash.utils.*;
public class CharacterPortrait extends MovieClip {
var hasLethalAnim:Boolean;// = false
var char_ref:Character;
public var nametag:TextField;
public var healthbar:HealthBar;
var isHiding:Boolean;// = false
var dead:Boolean;
var level_glow:LevelUpGlow;
var hasGainPowerAnim:Boolean;// = false
var animations:Array;
var hasPoisonAnim:Boolean;// = false
var hasGainHealthAnim:Boolean;// = false
var poisoned:Boolean;// = false
var animationFrame:PortraitAnimationFrame;
var hasCurseAnim:Boolean;// = false
var timers:Array;
public var graphic:CharGraphic;
var animationDurationTimer:Timer;
public var powerbar:PowerBar;
static const HEALTHBAR_HEIGHT = 58;
public function CharacterPortrait(){
poisoned = false;
level_glow = new LevelUpGlow();
isHiding = false;
animations = new Array();
timers = new Array();
hasCurseAnim = false;
hasPoisonAnim = false;
hasLethalAnim = false;
hasGainHealthAnim = false;
hasGainPowerAnim = false;
super();
dead = false;
this.gotoAndStop(1);
}
public function setChar(_arg1:Character, _arg2:Boolean=false){
char_ref = _arg1;
if (!_arg2){
update();
};
}
public function stunAnim():void{
if (!char_ref.stunned_duration){
if (((((!((parent == null))) && (!((parent.parent == null))))) && ((parent.parent is EmptyPortrait)))){
EmptyPortrait(parent.parent).gotoAndPlay(2);
};
};
}
public function setClone():void{
var _local1:*;
_local1 = new ClonePortrait();
this.addChild(_local1);
this.addSpecialAnimation(new clone_create_effect(), 1500);
}
public function setGlow():void{
if (!(char_ref is PlayerCharacter)){
return;
};
if (((PlayerCharacter(char_ref).stat_points) || (PlayerCharacter(char_ref).skill_points))){
if (!this.contains(level_glow)){
addChild(level_glow);
};
} else {
if (this.contains(level_glow)){
removeChild(level_glow);
};
};
}
public function updateBars(){
if (((dead) && ((char_ref.health > 0)))){
setAlive();
};
setHealth(char_ref.getHealthPercent());
setPower(char_ref.getPowerPercent());
checkStun();
}
public function setPoisoned(_arg1:Boolean):void{
var _local2:*;
var _local3:*;
var _local4:*;
if (((_arg1) && (!(poisoned)))){
poisoned = true;
_local2 = new LightGreenBar();
_local2.x = healthbar.lightbar.x;
_local2.y = healthbar.lightbar.y;
_local2.height = healthbar.lightbar.height;
_local2.width = healthbar.lightbar.width;
_local2.name = healthbar.lightbar.name;
healthbar.removeChild(healthbar.lightbar);
healthbar.addChild(_local2);
_local2 = new GreenBar();
_local2.x = healthbar.bar.x;
_local2.y = healthbar.bar.y;
_local2.height = healthbar.bar.height;
_local2.width = healthbar.bar.width;
_local2.name = healthbar.bar.name;
healthbar.removeChild(healthbar.bar);
healthbar.addChild(_local2);
} else {
if (((poisoned) && (!(_arg1)))){
poisoned = false;
_local3 = healthbar.getChildByName("bar");
_local4 = healthbar.getChildByName("lightbar");
healthbar.bar.height = _local3.height;
healthbar.lightbar.height = _local4.height;
healthbar.removeChild(_local3);
healthbar.removeChild(_local4);
healthbar.addChild(healthbar.lightbar);
healthbar.addChild(healthbar.bar);
};
};
}
function specialAnimationDurationTimerComplete(_arg1:TimerEvent):void{
var _local2:*;
var _local3:MovieClip;
_local2 = getTimerIndex(Timer(_arg1.target));
if (_local2 < 0){
return;
};
_local3 = animations[_local2];
if (_local3 != null){
if (this.contains(_local3)){
this.removeChild(_local3);
};
if ((_local3 is curse_effect)){
hasCurseAnim = false;
};
if ((_local3 is poisoneffect)){
hasPoisonAnim = false;
};
if ((_local3 is lethal_effect)){
hasLethalAnim = false;
};
if ((_local3 is gain_health_effect)){
hasGainHealthAnim = false;
};
if ((_local3 is gain_power_effect)){
hasGainPowerAnim = false;
};
_local3.stop();
animations.splice(_local2, 1);
_local3 = null;
timers.splice(_local2, 1);
};
}
public function setHealth(_arg1:Number){
var _local2:*;
var _local3:*;
_local2 = healthbar.getChildByName("bar");
_local2.height = Math.round(((58 / 100) * _arg1));
_local3 = healthbar.getChildByName("lightbar");
_local3.height = Math.round(((58 / 100) * _arg1));
if ((((char_ref.health <= 0)) && (!(dead)))){
this.setDead();
};
}
public function setRetreated(){
var _local1:RetreatedEffect;
_local1 = new RetreatedEffect();
_local1.x = 0;
_local1.y = 0;
_local1.alpha = 0.5;
_local1.name = "r_effect";
addChild(_local1);
}
public function startPowerCostPreview(_arg1:int){
var _local2:*;
_local2 = (char_ref.power - _arg1);
if (_local2 < 0){
return;
};
this.powerbar.bar.height = ((HEALTHBAR_HEIGHT / 100) * _local2);
}
public function addAnimationFrame(_arg1:int, _arg2:int=1500){
if (animationFrame != null){
return;
};
animationFrame = new PortraitAnimationFrame(_arg1);
animationFrame.name = "anim";
animationFrame.x = graphic.x;
animationFrame.y = graphic.y;
this.addChild(animationFrame);
animationDurationTimer = new Timer(_arg2, 1);
animationDurationTimer.addEventListener(TimerEvent.TIMER_COMPLETE, animationDurationTimerComplete);
animationDurationTimer.start();
}
public function setHealthPreview(_arg1:int){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local2 = (char_ref.health - _arg1);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 > char_ref.health_max){
_local2 = char_ref.health_max;
};
_local3 = ((100 / char_ref.health_max) * _local2);
_local4 = healthbar.getChildByName("bar");
_local5 = healthbar.getChildByName("lightbar");
if (_arg1 >= 0){
_local4.height = ((HEALTHBAR_HEIGHT / 100) * _local3);
} else {
_local5.height = Math.round(((HEALTHBAR_HEIGHT / 100) * _local3));
};
}
public function setHiding(_arg1:Boolean){
var _local2:*;
if (_arg1){
if (!isHiding){
_local2 = new HidingEffect();
_local2.x = 0;
_local2.y = 0;
_local2.alpha = 0.5;
_local2.name = "hiding_effect";
addChild(_local2);
};
isHiding = true;
} else {
isHiding = false;
_local2 = getChildByName("hiding_effect");
if (_local2 != null){
removeChild(_local2);
};
};
}
public function addPortraitAnimation(_arg1:int):void{
var _local2:MovieClip;
if (!_arg1){
return;
};
_local2 = PortraitAnimation.getAnimation(_arg1);
if (_local2 != null){
_local2.gotoAndStop(1);
addSpecialAnimation(_local2);
};
_local2 = null;
}
public function setAlive(){
var _local1:*;
dead = false;
_local1 = getChildByName("dead_effect");
if (_local1 != null){
removeChild(_local1);
};
}
public function setPowerPreview(_arg1:int){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local2 = (char_ref.power - _arg1);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 > char_ref.power_max){
_local2 = char_ref.power_max;
};
_local3 = ((100 / char_ref.power_max) * _local2);
_local4 = powerbar.getChildByName("bar");
_local5 = powerbar.getChildByName("lightbar");
if (_arg1 >= 0){
_local4.height = ((HEALTHBAR_HEIGHT / 100) * _local3);
} else {
_local5.height = Math.round(((HEALTHBAR_HEIGHT / 100) * _local3));
};
}
public function setNameTag(_arg1:String){
this.nametag.text = _arg1;
}
function animationDurationTimerComplete(_arg1:TimerEvent):void{
animationDurationTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, animationDurationTimerComplete);
if (this.getChildByName("anim") != null){
this.removeChild(animationFrame);
};
animationFrame = null;
}
private function getTimerIndex(_arg1:Timer):int{
var _local2:*;
_local2 = 0;
while (_local2 < timers.length) {
if (timers[_local2] == _arg1){
return (_local2);
};
_local2++;
};
return (-1);
}
private function addSpecialAnimation(_arg1:MovieClip, _arg2:int=1500){
var _local3:Timer;
var _local4:int;
var _local5:*;
_arg1.x = graphic.x;
_arg1.y = graphic.y;
if ((_arg1 is curse_effect)){
if (!hasCurseAnim){
hasCurseAnim = true;
} else {
return;
};
} else {
if ((_arg1 is poisoneffect)){
if (!hasPoisonAnim){
hasPoisonAnim = true;
} else {
return;
};
} else {
if ((_arg1 is lethal_effect)){
if (!hasLethalAnim){
hasLethalAnim = true;
} else {
return;
};
} else {
if ((_arg1 is gain_health_effect)){
if (!hasGainHealthAnim){
hasGainHealthAnim = true;
} else {
return;
};
} else {
if ((_arg1 is gain_power_effect)){
if (!hasGainPowerAnim){
hasGainPowerAnim = true;
} else {
return;
};
} else {
if ((_arg1 is player_multi_slash)){
_local4 = DungeonMain.RandomNum(-20, 20);
_arg1.rotation = _local4;
} else {
if ((_arg1 is revive_effect)){
_local5 = this.graphic.currentFrame;
revive_effect(_arg1).gfx.gotoAndStop(_local5);
} else {
if ((((_arg1 is player_arrow)) && ((_arg2 == 750)))){
player_arrow(_arg1).spark.x = dm.randomNum(15, 43);
player_arrow(_arg1).spark.y = dm.randomNum(15, 43);
};
};
};
};
};
};
};
};
_arg1.gotoAndPlay(1);
this.addChild(_arg1);
_local3 = new Timer(_arg2, 1);
_local3.addEventListener(TimerEvent.TIMER_COMPLETE, specialAnimationDurationTimerComplete, false, 0, true);
_local3.start();
animations.push(_arg1);
timers.push(_local3);
}
public function setPower(_arg1:Number){
this.powerbar.bar.height = ((HEALTHBAR_HEIGHT / 100) * _arg1);
this.powerbar.lightbar.height = ((HEALTHBAR_HEIGHT / 100) * _arg1);
}
public function update():void{
this.graphic.setFrame(char_ref.portrait);
this.setPoisoned((char_ref.poisoned > 0));
this.setNameTag(char_ref.charname);
this.setHealth(((char_ref.health / char_ref.health_max) * 100));
this.setPower(((char_ref.power / char_ref.power_max) * 100));
}
public function setDead(){
var _local1:DeadEffect;
dead = true;
setHealth(0);
_local1 = new DeadEffect();
_local1.x = 0;
_local1.y = 0;
_local1.alpha = 0.5;
_local1.name = "dead_effect";
addChild(_local1);
}
public function checkStun():void{
if (!char_ref.stunned_duration){
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
};
}
public function endPowerCostPreview(){
this.powerbar.bar.height = this.powerbar.lightbar.height;
}
}
}//package
Section 50
//CharCreationEmpty (CharCreationEmpty)
package {
import flash.display.*;
public dynamic class CharCreationEmpty extends MovieClip {
}
}//package
Section 51
//CharCreationPanel (CharCreationPanel)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class CharCreationPanel extends MovieClip {
const animate_frames = 10;
var slot:int;// = 1
var start_y;// = 0
var end_y;// = 0
public var portrait_left:SelectArrow;
var portraits:Array;
var lastRandomName:String;
public var gender_icon:GenderIcon;
var char:PlayerCharacter;
var lowered_y;// = 0
var animating;// = false
public var portrait_right:SelectArrow;
public var description_text:TextField;
public var name_text:TextField;
public var delete_button:SimpleButton;
public var random_name_btn:MovieClip;
public var class2:ClassIcon;
public var portrait:CharGraphic;
public var class_text:TextField;
public var class4:ClassIcon;
public var class3:ClassIcon;
public var class5:ClassIcon;
var selected_portrait:int;// = 0
public var class1:ClassIcon;
var selected_class:int;// = 1
var frame_count;// = 0
public var skill_preview:TextField;
public function CharCreationPanel():void{
var _local1:*;
var _local2:*;
portraits = new Array();
selected_portrait = 0;
selected_class = 1;
slot = 1;
animating = false;
frame_count = 0;
start_y = 0;
end_y = 0;
lowered_y = 0;
super();
random_name_btn.addEventListener(MouseEvent.MOUSE_DOWN, randomName);
portrait_left.addEventListener(MouseEvent.MOUSE_DOWN, cyclePortrait);
portrait_right.addEventListener(MouseEvent.MOUSE_DOWN, cyclePortrait);
gender_icon.addEventListener(MouseEvent.MOUSE_DOWN, toggleGender);
skill_preview.addEventListener(MouseEvent.MOUSE_DOWN, previewSkills);
_local1 = 1;
while (_local1 <= 5) {
_local2 = getChildByName(("class" + _local1));
_local2.addEventListener(MouseEvent.MOUSE_DOWN, setClass);
_local2.gotoAndStop(_local1);
_local2.bg.gotoAndStop(1);
_local1++;
};
delete_button.addEventListener(MouseEvent.MOUSE_DOWN, deleteChar);
lowered_y = this.y;
this.y = (0 - (this.height + 10));
}
public function updateFromChar():void{
name_text.text = char.charname;
}
function animateFrame(_arg1:Event):void{
var _local2:*;
var _local3:*;
animating = true;
frame_count++;
if ((((frame_count > animate_frames)) || ((this.y == end_y)))){
removeEventListener(Event.ENTER_FRAME, animateFrame);
animating = false;
return;
};
_local2 = (end_y - start_y);
_local3 = (_local2 / animate_frames);
this.y = (start_y + (frame_count * _local3));
}
public function finalize():void{
if (name_text.text != null){
char.charname = name_text.text;
};
char.portrait = portraits[selected_portrait];
}
function previewSkills(_arg1:MouseEvent):void{
var _local2:PlayerCharacter;
var _local3:SkillsPreview;
if (selected_class == PlayerCharacter.warrior){
_local2 = new PC_Warrior();
} else {
if (selected_class == PlayerCharacter.rogue){
_local2 = new PC_Rogue();
} else {
if (selected_class == PlayerCharacter.ranger){
_local2 = new PC_Ranger();
} else {
if (selected_class == PlayerCharacter.mage){
_local2 = new PC_Mage();
} else {
if (selected_class == PlayerCharacter.cleric){
_local2 = new PC_Cleric();
};
};
};
};
};
_local3 = new SkillsPreview(_local2);
stage.addChild(_local3);
}
function cycleClass(_arg1:MouseEvent):void{
var _local2:SelectArrow;
if ((_arg1.currentTarget is SelectArrow)){
_local2 = SelectArrow(_arg1.currentTarget);
} else {
return;
};
_local2.clicked();
if (_local2.name == "class_left"){
selected_class--;
if (selected_class < 1){
selected_class = 5;
};
} else {
if (_local2.name == "class_right"){
selected_class++;
if (selected_class > 5){
selected_class = 1;
};
};
};
updateClass();
}
function toggleGender(_arg1:MouseEvent):void{
if (char.male){
char.male = false;
gender_icon.gotoAndStop("female");
} else {
char.male = true;
gender_icon.gotoAndStop("male");
};
selected_portrait = (selected_class - 1);
updatePortraitsArray();
updatePortrait();
if (name_text.text == lastRandomName){
randomName();
};
}
function setClass(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
_local2 = 1;
while (_local2 <= 5) {
_local3 = getChildByName(("class" + _local2));
if (_local3 == null){
} else {
if (_arg1.currentTarget == _local3){
selected_class = _local2;
};
};
_local2++;
};
updateClass();
}
private function updatePortraitsArray():void{
portraits.length = 0;
if (char.male){
portraits.push(CharGraphic.ranger1);
portraits.push(CharGraphic.cleric1);
portraits.push(CharGraphic.mage1);
portraits.push(CharGraphic.warrior1);
portraits.push(CharGraphic.rogue1);
portraits.push(6);
portraits.push(7);
portraits.push(8);
portraits.push(9);
portraits.push(10);
} else {
portraits.push(15);
portraits.push(16);
portraits.push(17);
portraits.push(18);
portraits.push(19);
};
}
private function updatePortrait():void{
if (!portraits.length){
return;
};
portrait.setFrame(portraits[selected_portrait]);
char.portrait = portraits[selected_portrait];
}
public function createChar(_arg1:MouseEvent=null):void{
animating = true;
end_y = lowered_y;
start_y = (0 - this.height);
this.y = start_y;
frame_count = 0;
addEventListener(Event.ENTER_FRAME, animateFrame);
char = new PlayerCharacter();
gender_icon.gotoAndStop("male");
randomName();
if (this.slot == 4){
selected_class = dm.randomNum(4, 5);
} else {
selected_class = this.slot;
};
selected_portrait = (selected_class - 1);
updatePortraitsArray();
updatePortrait();
updateClass();
}
function deleteChar(_arg1:MouseEvent):void{
char = null;
animating = true;
start_y = this.y;
end_y = (0 - this.height);
frame_count = 0;
addEventListener(Event.ENTER_FRAME, animateFrame);
}
function cyclePortrait(_arg1:MouseEvent):void{
var _local2:SelectArrow;
if ((_arg1.currentTarget is SelectArrow)){
_local2 = SelectArrow(_arg1.currentTarget);
} else {
return;
};
if (_local2.name == "portrait_left"){
selected_portrait--;
if (selected_portrait < 0){
selected_portrait = (portraits.length - 1);
};
} else {
if (_local2.name == "portrait_right"){
selected_portrait++;
if (selected_portrait > (portraits.length - 1)){
selected_portrait = 0;
};
};
};
updatePortrait();
}
private function updateClass():void{
var _local1:*;
var _local2:*;
if (selected_class == PlayerCharacter.warrior){
class_text.text = "Warrior";
description_text.text = "Warriors can wear the heaviest armor and excel at combat with melee weapons. They are difficult to kill and good at protecting more vulnerable members of the party.";
} else {
if (selected_class == PlayerCharacter.rogue){
class_text.text = "Rogue";
description_text.text = "Rogues inflict high damage in melee combat, but can also do well with a bow. They have many abilities which debilitate their foes. They may wear medium armor.";
} else {
if (selected_class == PlayerCharacter.ranger){
class_text.text = "Ranger";
description_text.text = "Rangers are masters of ranged weapons and the lore of the wild. They prefer to fight from afar, where they can heal and support their allies. They may wear medium armor.";
} else {
if (selected_class == PlayerCharacter.mage){
class_text.text = "Mage";
description_text.text = "Mages use their arcane knowledge to destroy foes from afar and augment their allies. They can inflict a lot of damage, but may wear only the lightest armor.";
} else {
if (selected_class == PlayerCharacter.cleric){
class_text.text = "Cleric";
description_text.text = "Clerics are holy warriors who call upon divine powers to heal and support their allies or smite their enemies. They wear heavy armor but their weapon selection is limited.";
};
};
};
};
};
dm.embolden(class_text);
_local1 = 1;
while (_local1 <= 5) {
_local2 = ClassIcon(getChildByName(("class" + _local1)));
if (_local1 == selected_class){
_local2.bg.gotoAndStop(2);
} else {
_local2.bg.gotoAndStop(1);
};
_local1++;
};
selected_portrait = (selected_class - 1);
updatePortrait();
}
public function cleanup():void{
var _local1:*;
var _local2:*;
_local1 = 1;
while (_local1 <= 5) {
_local2 = getChildByName(("char" + _local1));
if (_local2 == null){
} else {
_local2.removeEventListener(MouseEvent.MOUSE_DOWN, setClass);
};
_local1++;
};
random_name_btn.removeEventListener(MouseEvent.MOUSE_DOWN, randomName);
portrait_left.removeEventListener(MouseEvent.MOUSE_DOWN, cyclePortrait);
portrait_right.removeEventListener(MouseEvent.MOUSE_DOWN, cyclePortrait);
delete_button.removeEventListener(MouseEvent.MOUSE_DOWN, deleteChar);
skill_preview.removeEventListener(MouseEvent.MOUSE_DOWN, previewSkills);
gender_icon.removeEventListener(MouseEvent.MOUSE_DOWN, toggleGender);
}
function randomName(_arg1:MouseEvent=null):void{
var _local2:Array;
var _local3:*;
var _local4:String;
var _local5:*;
var _local6:*;
if (char.male){
_local2 = new Array("Nigel", "Neil", "Niles", "Charles", "Boris", "Jethro", "Gerald", "Horace", "Stan", "Alan", "Hank", "Marty", "Trevor", "Trent", "Bruce", "Eugene", "Wally", "Harold", "Hamish", "Carlos", "Jeremy", "Jerome", "Jermaine", "Tito", "George", "Hans", "Chad", "Rupert", "Ruprecht", "Albert", "Alfred", "Phineas", "Brent", "Colin", "Travis", "Jarvis", "Elton", "Ernest", "Mitch");
} else {
_local2 = new Array("Tiffany", "Matilda", "Jemima", "Morag", "Mildred", "Martha", "Suzanne", "Sharon", "Chantel", "Miriam", "Muriel", "Susan", "Pam", "Desiree", "Bertha", "Olga", "Peggy", "Freda", "Charlene", "Bessy", "Priscilla", "Aubrey", "Mariah", "Nancy", "Barbara", "Kathleen", "Cynthia", "Maureen", "Judith", "Tammy", "Sheila", "Joyce", "Regina", "Wanda");
};
_local3 = 0;
_local4 = "";
_local5 = name_text.text;
while ((((char.charname == null)) || ((((char.charname == _local5)) && ((_local3 < 100)))))) {
_local6 = DungeonMain.RandomNum(0, (_local2.length - 1));
_local4 = _local2[_local6];
if (!PartyCreation(parent).isNameTaken(_local4)){
char.charname = _local4;
};
_local3++;
};
if (_local5 != _local4){
lastRandomName = _local4;
};
name_text.text = char.charname;
}
}
}//package
Section 52
//CharGraphic (CharGraphic)
package {
import flash.display.*;
public class CharGraphic extends MovieClip {
var frame:int;
static const troll = 32;
static const ranger1 = 1;
static const bone_horror = 29;
static const lightning_drake = 49;
static const orc_warlord = 35;
static const vampire = 25;
static const ghost = 22;
static const voidstalker = 59;
static const dragon = 44;
static const rogue1 = 5;
static const aetherguard = 54;
static const demon = 60;
static const zombie = 21;
static const cult_engine = 57;
static const orc_juggernaut = 36;
static const warrior1 = 4;
static const lich = 28;
static const skeleton_archer = 24;
static const beholder = 45;
static const death_knight = 26;
static const necromancer = 27;
static const cleric1 = 2;
static const greebler = 47;
static const poison_drake = 48;
static const skeleton = 23;
static const arachnoid = 43;
static const goblin = 33;
static const ascendant = 55;
static const orc = 31;
static const cult_neophyte = 58;
static const orc_woman = 39;
static const cult_chosen = 56;
static const orc_champion = 38;
static const basilisk = 42;
static const goblin_archer = 34;
static const orc_shaman = 37;
static const cult_archer = 52;
static const gargoyle = 46;
static const cult_priest = 53;
static const cult_warrior = 51;
static const mage1 = 3;
public function CharGraphic(_arg1:int=1){
addFrameScript(0, frame1);
setFrame(_arg1);
}
public function setFrame(_arg1:int){
this.frame = _arg1;
this.gotoAndStop(_arg1);
}
function frame1(){
this.stop();
}
}
}//package
Section 53
//CharInfoPanel (CharInfoPanel)
package {
import flash.events.*;
import flash.display.*;
public class CharInfoPanel extends MovieClip {
public var stats_tab:InventoryTab;
public var skills_tab:InventoryTab;
var char_ref:PlayerCharacter;
public var stats_panel:CharStatsPanel;
public var skills_panel:CharSkillsPanel;
public function CharInfoPanel(_arg1:PlayerCharacter=null){
var _local2:uint;
super();
char_ref = _arg1;
if (_arg1 != null){
setChar(_arg1);
};
stats_tab.tab_text.text = "Statistics";
stats_tab.gotoAndStop(1);
stats_tab.addEventListener(MouseEvent.MOUSE_DOWN, clickStatsTab);
_local2 = (numChildren - 1);
setChildIndex(stats_tab, _local2);
skills_tab.tab_text.text = "Skills";
skills_tab.gotoAndStop(2);
skills_tab.addEventListener(MouseEvent.MOUSE_DOWN, clickSkillsTab);
removeChild(skills_panel);
}
public function setChar(_arg1:PlayerCharacter){
var _local2:uint;
if (_arg1 == null){
return;
};
char_ref = _arg1;
stats_panel.char_ref = _arg1;
skills_panel.char_ref = _arg1;
updateValues();
if (parent){
_local2 = (parent.numChildren - 1);
parent.setChildIndex(this, _local2);
};
}
function clickStatsTab(_arg1:MouseEvent):void{
dm.childToTop(stats_tab);
stats_tab.gotoAndStop(1);
if (!this.contains(stats_panel)){
addChild(stats_panel);
};
if (this.contains(skills_panel)){
removeChild(skills_panel);
};
dm.childToTop(stats_panel);
skills_tab.gotoAndStop(2);
updateTabFlashes();
}
public function updateValues():void{
stats_panel.updateValues();
skills_panel.updateValues();
updateTabFlashes();
if (((!((parent == null))) && ((parent is Inventory)))){
Inventory(parent).updateStats();
};
}
function clickSkillsTab(_arg1:MouseEvent):void{
dm.childToTop(skills_tab);
skills_tab.gotoAndStop(1);
if (this.contains(stats_panel)){
removeChild(stats_panel);
};
if (!this.contains(skills_panel)){
addChild(skills_panel);
};
dm.childToTop(skills_panel);
stats_tab.gotoAndStop(2);
updateTabFlashes();
}
public function cleanup():void{
stats_tab.removeEventListener(MouseEvent.MOUSE_DOWN, clickStatsTab);
skills_tab.removeEventListener(MouseEvent.MOUSE_DOWN, clickSkillsTab);
stats_panel.cleanup();
skills_panel.cleanup();
}
private function updateTabFlashes():void{
stats_tab.setFlasher((char_ref.stat_points > 0));
skills_tab.setFlasher((char_ref.skill_points > 0));
}
}
}//package
Section 54
//CharsButton (CharsButton)
package {
import flash.display.*;
public dynamic class CharsButton extends MovieClip {
}
}//package
Section 55
//CharSkillsPanel (CharSkillsPanel)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class CharSkillsPanel extends Sprite {
public var idle3:SkillIconEmpty;
public var active2:SkillIconEmpty;
public var active3:SkillIconEmpty;
var dragged_icon:SkillIcon;
public var idle10:SkillIconEmpty;
public var idle4:SkillIconEmpty;
public var idle7:SkillIconEmpty;
var char_ref:PlayerCharacter;
public var newskills_button:TextField;
public var idle8:SkillIconEmpty;
var dragging:Boolean;// = false
public var skillpoints_number:TextField;
var start_drag_x;// = 0
var start_drag_y;// = 0
public var idle1:SkillIconEmpty;
public var idle2:SkillIconEmpty;
var num_active:int;// = 0
public var idle6:SkillIconEmpty;
public var active1:SkillIconEmpty;
var num_idle:int;// = 0
public var active4:SkillIconEmpty;
public var active5:SkillIconEmpty;
public var active6:SkillIconEmpty;
public var idle5:SkillIconEmpty;
public var idle9:SkillIconEmpty;
public function CharSkillsPanel(_arg1:PlayerCharacter=null){
start_drag_x = 0;
start_drag_y = 0;
dragging = false;
num_idle = 0;
num_active = 0;
super();
char_ref = _arg1;
newskills_button.addEventListener(MouseEvent.MOUSE_DOWN, buySkillsClick);
if (_arg1 != null){
updateValues();
};
}
function buySkillsClick(_arg1:MouseEvent):void{
var _local2:*;
_local2 = new BuySkills(CharInfoPanel(parent));
_local2.setChar(char_ref);
stage.addChild(_local2);
}
private function getActiveSkillInPosition(_arg1:int):Skill{
var _local2:*;
_local2 = 0;
while (_local2 < char_ref.skills.length) {
if (((char_ref.skills[_local2].active) && ((char_ref.skills[_local2].position == _arg1)))){
return (char_ref.skills[_local2]);
};
_local2++;
};
return (null);
}
private function removeSkillIcons():void{
var _local1:*;
var _local2:*;
_local1 = 0;
num_active = 0;
num_idle = 0;
_local1 = 0;
while (_local1 < 6) {
_local2 = getChildByName(("icon_active" + (_local1 + 1)));
removeIcon(_local2);
_local1++;
};
_local1 = 0;
while (_local1 < 10) {
_local2 = getChildByName(("icon_idle" + (_local1 + 1)));
removeIcon(_local2);
_local1++;
};
}
function startItemDragging(_arg1:MouseEvent):void{
var _local2:SkillIcon;
var _local3:uint;
var _local4:*;
if (((!((_arg1.currentTarget.parent == null))) && ((_arg1.currentTarget.parent is SkillIcon)))){
_local2 = _arg1.currentTarget.parent;
} else {
return;
};
_local3 = (numChildren - 1);
setChildIndex(_local2, _local3);
start_drag_x = _local2.x;
start_drag_y = _local2.y;
_local2.startDrag();
dragging = true;
dragged_icon = _local2;
_local4 = _local2.tooltip;
if (_local4 != null){
_local2.mouseOutTarget(null);
};
}
private function removeIcon(_arg1:SkillIcon):void{
if (_arg1 == null){
return;
};
if (this.contains(_arg1)){
removeChild(_arg1);
};
_arg1.bg.removeEventListener(MouseEvent.MOUSE_DOWN, startItemDragging);
_arg1.bg.removeEventListener(MouseEvent.MOUSE_UP, stopItemDragging);
_arg1.bg.removeEventListener(MouseEvent.DOUBLE_CLICK, mouseDblClickSkill);
_arg1.cleanup();
}
public function updateValues(){
var _local1:*;
var _local2:Skill;
var _local3:SkillIcon;
var _local4:*;
var _local5:*;
if (char_ref == null){
return;
};
skillpoints_number.text = String(char_ref.skill_points);
removeSkillIcons();
setDefaultAttack();
_local4 = 0;
for (;_local4 < char_ref.skills.length;_local4++) {
_local2 = char_ref.skills[_local4];
if (_local2 == null){
} else {
if (!_local2.unlocked){
} else {
if (num_active >= 6){
_local2.active = false;
};
if (_local2.active){
_local1 = getChildByName(("active" + _local2.position));
if (_local1 == null){
continue;
};
_local3 = new SkillIcon();
_local3.setSkill(_local2);
_local3.setOwner(char_ref);
_local3.x = _local1.x;
_local3.y = _local1.y;
_local3.name = ("icon_active" + _local2.position);
addChild(_local3);
_local3.bg.addEventListener(MouseEvent.MOUSE_DOWN, startItemDragging);
_local3.bg.addEventListener(MouseEvent.MOUSE_UP, stopItemDragging);
_local3.bg.doubleClickEnabled = true;
_local3.bg.addEventListener(MouseEvent.DOUBLE_CLICK, mouseDblClickSkill);
_local3.setUsable(_local3.skill_ref.usable());
num_active++;
} else {
_local1 = getChildByName(("idle" + (num_idle + 1)));
if (_local1 == null){
} else {
_local3 = new SkillIcon();
_local3.setSkill(_local2);
_local3.setOwner(char_ref);
_local3.x = _local1.x;
_local3.y = _local1.y;
addChild(_local3);
_local3.name = ("icon_idle" + (num_idle + 1));
_local3.bg.addEventListener(MouseEvent.MOUSE_DOWN, startItemDragging);
_local3.bg.addEventListener(MouseEvent.MOUSE_UP, stopItemDragging);
_local3.bg.doubleClickEnabled = true;
_local3.bg.addEventListener(MouseEvent.DOUBLE_CLICK, mouseDblClickSkill);
_local3.setUsable(_local3.skill_ref.usable());
num_idle++;
};
};
};
};
};
if (root != null){
dm.main.saveParty();
dm.main.saveChars();
dm.main.saveInventory();
};
}
function mouseDblClickSkill(_arg1:MouseEvent):void{
var _local2:SkillIcon;
if (_arg1.currentTarget.parent == null){
return;
};
if (!(_arg1.currentTarget.parent is SkillIcon)){
return;
};
_local2 = SkillIcon(_arg1.currentTarget.parent);
if (_local2.skill_ref.active){
_local2.skill_ref.active = false;
updateValues();
} else {
if (num_active < 6){
_local2.skill_ref.active = true;
_local2.skill_ref.position = lowestAvailablePosition();
updateValues();
};
};
}
private function lowestAvailablePosition():int{
var _local1:*;
var _local2:*;
_local2 = 1;
while (_local2 <= 6) {
if (getChildByName(("icon_active" + _local2)) == null){
return (_local2);
};
_local2++;
};
return (-1);
}
public function cleanup():void{
newskills_button.removeEventListener(MouseEvent.MOUSE_DOWN, buySkillsClick);
removeSkillIcons();
}
private function setDefaultAttack():void{
var _local1:*;
var _local2:*;
_local1 = char_ref.gear[Equipment.weapon];
_local2 = 1;
if (char_ref.skills[0] != null){
_local2 = char_ref.skills[0].position;
};
if (_local1 != null){
if ((_local1 is MeleeWeapon)){
char_ref.skills[0] = new sWeaponAttack(char_ref);
} else {
if ((_local1 is RangedWeapon)){
char_ref.skills[0] = new sRangedAttack(char_ref);
} else {
if ((_local1 is MageWeapon)){
char_ref.skills[0] = new sMageAttack(char_ref);
};
};
};
} else {
char_ref.skills[0] = new sUnarmedAttack(char_ref);
};
char_ref.skills[0].active = true;
char_ref.skills[0].position = _local2;
}
function stopItemDragging(_arg1:MouseEvent):void{
var _local2:*;
var _local3:SkillIcon;
var _local4:*;
_local2 = 0;
_local3 = _arg1.currentTarget.parent;
if (_local3 == null){
return;
};
if (!(_local3 is SkillIcon)){
return;
};
_arg1.currentTarget.stopDrag();
if (!dragging){
return;
};
dragging = false;
if ((((_local3.x == start_drag_x)) && ((_local3.y == start_drag_y)))){
return;
};
_local4 = _local3.dropTarget.parent;
if (_local4 == null){
return;
};
if (_local4.name == "bg"){
_local4 = _local4.parent;
if (_local4 == null){
return;
};
};
if ((_local4 is SkillIcon)){
if (_local4.name.search("idle") > -1){
if (_local3.skill_ref.active){
if (_local3.skill_ref == char_ref.skills[0]){
updateValues();
return;
};
_local3.skill_ref.active = false;
SkillIcon(_local4).skill_ref.position = _local3.skill_ref.position;
SkillIcon(_local4).skill_ref.active = true;
};
updateValues();
} else {
if (_local4.name.search("active") > -1){
if (_local3.skill_ref.active){
_local2 = _local3.skill_ref.position;
_local3.skill_ref.position = SkillIcon(_local4).skill_ref.position;
SkillIcon(_local4).skill_ref.position = _local2;
updateValues();
} else {
if (SkillIcon(_local4).skill_ref == char_ref.skills[0]){
updateValues();
return;
};
_local3.skill_ref.position = SkillIcon(_local4).skill_ref.position;
_local3.skill_ref.active = true;
SkillIcon(_local4).skill_ref.active = false;
updateValues();
};
};
};
} else {
if ((_local4 is SkillIconEmpty)){
_local3.x = _local4.x;
_local3.y = _local4.y;
if (_local4.name.search("idle") > -1){
if (_local3.skill_ref == char_ref.skills[0]){
updateValues();
return;
};
if (_local3.skill_ref.active){
_local3.skill_ref.active = false;
updateValues();
};
} else {
if (_local4.name.search("active") > -1){
_local3.skill_ref.active = true;
_local3.skill_ref.position = _local4.name.charAt((_local4.name.length - 1)).valueOf();
updateValues();
};
};
} else {
updateValues();
};
};
}
}
}//package
Section 56
//CharStatsPanel (CharStatsPanel)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class CharStatsPanel extends Sprite {
const color_green:uint = 52275;
const color_white:uint = 0xFFFFFF;
const color_red:uint = 0xE90000;
public var dexterity_inc:StatIncreaseButton;
public var healthRegen_number:StatNumber;
public var str_number:StatNumber;
public var damage_number:StatNumber;
public var poisonResist_number:StatNumber;
public var quickness_number:StatNumber;
public var end_number:StatNumber;
var char_ref:PlayerCharacter;
public var powerRegen_number:StatNumber;
public var lethality_number:StatNumber;
public var armor_number:StatNumber;
public var accuracy_number:StatNumber;
public var dex_number:StatNumber;
public var statpoints_number:StatNumber;
public var undo_btn:UndoChangesButton;
public var reduction_number:StatNumber;
public var int_number:StatNumber;
public var intellect_inc:StatIncreaseButton;
public var stunResist_number:StatNumber;
public var endurance_inc:StatIncreaseButton;
public var stun_number:StatNumber;
public var blind_number:StatNumber;
public var vampiric_number:StatNumber;
public var poison_number:StatNumber;
public var reflection_number:StatNumber;
public var strength_inc:StatIncreaseButton;
public function CharStatsPanel(_arg1:PlayerCharacter=null){
char_ref = _arg1;
strength_inc.addEventListener(MouseEvent.MOUSE_DOWN, statClick);
endurance_inc.addEventListener(MouseEvent.MOUSE_DOWN, statClick);
dexterity_inc.addEventListener(MouseEvent.MOUSE_DOWN, statClick);
intellect_inc.addEventListener(MouseEvent.MOUSE_DOWN, statClick);
undo_btn.addEventListener(MouseEvent.MOUSE_DOWN, undoClick);
undo_btn.useHandCursor = false;
if (this.contains(undo_btn)){
this.removeChild(undo_btn);
};
if (_arg1 != null){
updateValues();
};
}
function undoClick(_arg1:MouseEvent):void{
char_ref.stat_points = char_ref.old_stat_points;
char_ref.strength = char_ref.old_strength;
char_ref.endurance = char_ref.old_endurance;
char_ref.dexterity = char_ref.old_dexterity;
char_ref.intellect = char_ref.old_intellect;
if (((!((parent == null))) && ((parent is CharInfoPanel)))){
CharInfoPanel(parent).updateValues();
} else {
updateValues();
};
if (this.contains(undo_btn)){
this.removeChild(undo_btn);
};
}
public function updateValues(){
var _local1:*;
var _local2:*;
if (char_ref == null){
return;
};
if (char_ref.stat_points){
enableButtons();
} else {
disableButtons();
};
if (char_ref.stat_points == char_ref.old_stat_points){
if (this.contains(undo_btn)){
this.removeChild(undo_btn);
};
} else {
if (!this.contains(undo_btn)){
this.addChild(undo_btn);
};
};
str_number.nlabel.text = String(char_ref.getStrength());
end_number.nlabel.text = String(char_ref.getEndurance());
dex_number.nlabel.text = String(char_ref.getDexterity());
int_number.nlabel.text = String(char_ref.getIntellect());
statpoints_number.nlabel.text = String(char_ref.stat_points);
accuracy_number.nlabel.text = (String(char_ref.getAccuracy()) + "%");
quickness_number.nlabel.text = String(char_ref.getQuickness());
damage_number.nlabel.text = String(char_ref.getWeaponDamage());
armor_number.nlabel.text = String(char_ref.getArmorRating());
reduction_number.nlabel.text = (String(char_ref.getDamageResist()) + "%");
poisonResist_number.nlabel.text = (String(char_ref.getPoisonResist()) + "%");
stunResist_number.nlabel.text = (String(char_ref.getStunResist()) + "%");
healthRegen_number.nlabel.text = String(char_ref.getHealthRegen());
powerRegen_number.nlabel.text = String(char_ref.getPowerRegen());
vampiric_number.nlabel.text = (String(char_ref.getVampiric()) + "%");
stun_number.nlabel.text = (String(char_ref.getStunChance()) + "%");
poison_number.nlabel.text = String(char_ref.getPoisonDamage());
blind_number.nlabel.text = String(char_ref.getAccuracyDamage());
lethality_number.nlabel.text = (String(char_ref.getLethality()) + "%");
reflection_number.nlabel.text = (String(char_ref.getDamageReflection()) + "%");
reduction_number.nlabel.textColor = color_white;
damage_number.nlabel.textColor = color_white;
poisonResist_number.nlabel.textColor = color_white;
stunResist_number.nlabel.textColor = color_white;
quickness_number.nlabel.textColor = color_white;
if (char_ref.potion_damage_resist){
reduction_number.nlabel.textColor = color_green;
};
if (char_ref.potion_damage_bonus){
damage_number.nlabel.textColor = color_green;
};
if (char_ref.potion_poison_resist){
poisonResist_number.nlabel.textColor = color_green;
};
if (char_ref.potion_stun_resist){
stunResist_number.nlabel.textColor = color_green;
};
if (char_ref.potion_quickness_bonus){
quickness_number.nlabel.textColor = color_green;
};
str_number.tt_title = "Strength";
end_number.tt_title = "Endurance";
dex_number.tt_title = "Dexterity";
int_number.tt_title = "Intellect";
statpoints_number.tt_title = "Stat Points";
accuracy_number.tt_title = "Accuracy";
quickness_number.tt_title = "Quickness";
damage_number.tt_title = "Weapon Damage";
armor_number.tt_title = "Armor Rating";
reduction_number.tt_title = "Damage Reduction";
poisonResist_number.tt_title = "Poison Resistance";
stunResist_number.tt_title = "Stun Resistance";
healthRegen_number.tt_title = "Health Regeneration";
powerRegen_number.tt_title = "Power Regeneration";
vampiric_number.tt_title = "Health Drain on Hit";
stun_number.tt_title = "Cause Stun on Hit";
poison_number.tt_title = "Poison Damage on Hit";
blind_number.tt_title = "Accuracy Damage on Hit";
lethality_number.tt_title = "Instant Kill on Hit";
reflection_number.tt_title = "Damage Reflection";
str_number.tt_text = "Increases damage done with melee weapons.";
end_number.tt_text = "Increases total health points.";
dex_number.tt_text = "Increases damage done with ranged weapons.";
int_number.tt_text = "Increases the effectiveness of magic.";
statpoints_number.tt_text = "You may spend Stat Points to increase one of the character's four main statistics: Strength, Endurance, Dexterity or Intellect. A character gains an extra Stat Point each time they level up.";
accuracy_number.tt_text = "Chance to hit with attacks in combat. Higher accuracy is always better, as it helps counteract Blind effects.";
quickness_number.tt_text = "Determines turn order in combat. Characters with higher Quickness act sooner.";
armor_number.tt_text = "The total of the Armor Rating on all the character's equipment. A higher armor rating grants a greater level of incoming damage reduction.";
reduction_number.tt_text = "Damage the character receives is reduced by this amount.";
poisonResist_number.tt_text = "Percentage reduction in the damage received from poison effects.";
stunResist_number.tt_text = "Percentage chance of resisting stun effects.";
healthRegen_number.tt_text = "Health regenerated during combat at the start of the character's turn.";
powerRegen_number.tt_text = "Power regenerated during combat at the start of the character's turn.";
vampiric_number.tt_text = "Damaging hits will return this percentage of damage caused back to the character as restored health. Vampiric effects cannot return more than half your total health in one turn.";
stun_number.tt_text = "Percentage chance that damaging hits will stun the target. If attacking multiple targets or multiple times, the chance is divided amongst all targets.";
poison_number.tt_text = "Damaging hits will add this amount of ongoing poison damage to the target. If attacking multiple targets or multiple times, the effect is divided amongst all targets.";
blind_number.tt_text = "On a damaging hit, the target's accuracy is reduced by up to this amount. If attacking multiple targets or multiple times, the effect is divided amongst all targets.";
lethality_number.tt_text = "Percentage chance that damaging hits will instantly kill the target. If attacking multiple targets or multiple times, the chance is divided amongst all targets.";
reflection_number.tt_text = "This percentage of damage received is inflicted on the attacker.";
damage_number.tt_text = "Damage for basic weapon attacks.";
if (char_ref.gear[Equipment.weapon]){
_local1 = 0;
_local2 = "stat";
damage_number.tt_text = (damage_number.tt_text + (("\n\n" + char_ref.gear[Equipment.weapon].damage) + " (weapon)"));
if ((char_ref.gear[Equipment.weapon] is iDagger)){
_local1 = (char_ref.getStrengthDamageBonus() + char_ref.getDexterityDamageBonus());
_local2 = "strength+dexterity";
} else {
if ((char_ref.gear[Equipment.weapon] is MeleeWeapon)){
_local1 = char_ref.getStrengthDamageBonus();
_local2 = "strength";
} else {
if ((char_ref.gear[Equipment.weapon] is RangedWeapon)){
_local1 = char_ref.getDexterityDamageBonus();
_local2 = "dexterity";
} else {
if ((char_ref.gear[Equipment.weapon] is MageWeapon)){
_local1 = char_ref.getIntellectDamageBonus();
_local2 = "intellect";
};
};
};
};
damage_number.tt_text = (damage_number.tt_text + ((((" + " + _local1) + " (") + _local2) + " bonus)\n"));
} else {
damage_number.tt_text = (("Base damage for attacks.\n\n " + char_ref.getUnarmedDamage()) + " (strength bonus)");
};
}
private function disableButtons():void{
strength_inc.gotoAndStop(2);
endurance_inc.gotoAndStop(2);
dexterity_inc.gotoAndStop(2);
intellect_inc.gotoAndStop(2);
}
private function enableButtons():void{
strength_inc.gotoAndStop(1);
endurance_inc.gotoAndStop(1);
dexterity_inc.gotoAndStop(1);
intellect_inc.gotoAndStop(1);
}
public function cleanup():void{
strength_inc.removeEventListener(MouseEvent.MOUSE_DOWN, statClick);
endurance_inc.removeEventListener(MouseEvent.MOUSE_DOWN, statClick);
dexterity_inc.removeEventListener(MouseEvent.MOUSE_DOWN, statClick);
intellect_inc.removeEventListener(MouseEvent.MOUSE_DOWN, statClick);
undo_btn.removeEventListener(MouseEvent.MOUSE_DOWN, undoClick);
strength_inc.cleanup();
endurance_inc.cleanup();
dexterity_inc.cleanup();
intellect_inc.cleanup();
str_number.cleanup();
end_number.cleanup();
dex_number.cleanup();
int_number.cleanup();
statpoints_number.cleanup();
accuracy_number.cleanup();
quickness_number.cleanup();
armor_number.cleanup();
reduction_number.cleanup();
reflection_number.cleanup();
poisonResist_number.cleanup();
stunResist_number.cleanup();
healthRegen_number.cleanup();
powerRegen_number.cleanup();
vampiric_number.cleanup();
poison_number.cleanup();
blind_number.cleanup();
lethality_number.cleanup();
damage_number.cleanup();
}
function statClick(_arg1:MouseEvent):void{
var _local2:*;
var _local3:int;
_local2 = false;
if (!char_ref.stat_points){
disableButtons();
return;
};
_local3 = 1;
if (_arg1.shiftKey){
_local3 = char_ref.stat_points;
} else {
if (_arg1.ctrlKey){
_local3 = Math.floor(((char_ref.stat_points / 3) * 2));
};
};
if (_arg1.currentTarget.contains(strength_inc)){
char_ref.strength = (char_ref.strength + _local3);
_local2 = true;
} else {
if (_arg1.currentTarget.contains(endurance_inc)){
char_ref.endurance = (char_ref.endurance + _local3);
_local2 = true;
} else {
if (_arg1.currentTarget.contains(dexterity_inc)){
char_ref.dexterity = (char_ref.dexterity + _local3);
_local2 = true;
} else {
if (_arg1.currentTarget.contains(intellect_inc)){
char_ref.intellect = (char_ref.intellect + _local3);
_local2 = true;
};
};
};
};
if (_local2){
char_ref.stat_points = (char_ref.stat_points - _local3);
if (!char_ref.stat_points){
disableButtons();
};
if (((!((parent == null))) && ((parent is CharInfoPanel)))){
CharInfoPanel(parent).updateValues();
} else {
updateValues();
};
if (!this.contains(undo_btn)){
this.addChild(undo_btn);
};
};
}
}
}//package
Section 57
//ClassIcon (ClassIcon)
package {
import flash.display.*;
public dynamic class ClassIcon extends MovieClip {
public var bg:ClassIconBG;
}
}//package
Section 58
//ClassIconBG (ClassIconBG)
package {
import flash.display.*;
public dynamic class ClassIconBG extends MovieClip {
}
}//package
Section 59
//CleanSlate (CleanSlate)
package {
public class CleanSlate extends Consumable {
public function CleanSlate(_arg1:int=1){
item_name = "Clean Slate";
lore = "It's not often you get a chance to start over.";
reset_stats = true;
item_rarity = Item.orange;
icon_frame = 84;
}
}
}//package
Section 60
//clone_create_effect (clone_create_effect)
package {
import flash.display.*;
public dynamic class clone_create_effect extends MovieClip {
public function clone_create_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.clone);
}
function frame45(){
this.stop();
}
}
}//package
Section 61
//clone_effect (clone_effect)
package {
import flash.display.*;
public dynamic class clone_effect extends MovieClip {
public function clone_effect(){
addFrameScript(44, frame45);
}
function frame45(){
this.stop();
}
}
}//package
Section 62
//ClonePortrait (ClonePortrait)
package {
import flash.display.*;
public dynamic class ClonePortrait extends MovieClip {
}
}//package
Section 63
//coins_sound (coins_sound)
package {
import flash.media.*;
public dynamic class coins_sound extends Sound {
}
}//package
Section 64
//Consumable (Consumable)
package {
public class Consumable extends Item {
private var _stack:int;// = 1
var restore_power:int;// = 0
var damage_bonus:int;// = 0
var poison_resist:int;// = 0
var resurrect:Boolean;// = false
var quickness_bonus:int;// = 0
var sneaky:Boolean;// = false
var restore_health:int;// = 0
var reset_stats:Boolean;// = false
var stun_resist:int;// = 0
var damage_resist:int;// = 0
public function Consumable(){
_stack = 1;
restore_health = 0;
restore_power = 0;
resurrect = false;
sneaky = false;
reset_stats = false;
damage_resist = 0;
damage_bonus = 0;
poison_resist = 0;
stun_resist = 0;
quickness_bonus = 0;
super();
item_name = "Consumable";
item_level = 0;
item_rarity = Item.grey;
icon_frame = 1;
}
public function get stack():int{
return (this._stack);
}
public function set stack(_arg1:int):void{
this._stack = _arg1;
}
override public function getItemTypeString(){
return ("Consumable");
}
public function basicPowerPotion(){
item_name = "Weak Power Potion";
restore_power = 20;
item_rarity = Item.green;
item_level = 1;
icon_frame = 5;
}
public function basicRejuvePotion(){
item_name = "Weak Rejuvenation Potion";
restore_health = 20;
restore_power = 20;
item_rarity = Item.blue;
item_level = 1;
icon_frame = 7;
}
public function basicRevivePotion(){
item_name = "Weak Revival Potion";
restore_health = 1;
resurrect = true;
item_rarity = Item.green;
item_level = 1;
icon_frame = 6;
}
public function consume(_arg1:PlayerCharacter, _arg2:Party):Boolean{
var _local3:Boolean;
var _local4:*;
var _local5:*;
var _local6:*;
_local3 = false;
if (reset_stats){
_arg1.stat_points = ((_arg1.level - 1) * PlayerCharacter.STATS_PER_LEVEL);
_local6 = (1 + ((_arg1.level - 1) * PlayerCharacter.STATS_PER_LEVEL));
_arg1.strength = _local6;
_arg1.endurance = _local6;
_arg1.dexterity = _local6;
_arg1.intellect = _local6;
_arg1.old_strength = _arg1.strength;
_arg1.old_endurance = _arg1.endurance;
_arg1.old_dexterity = _arg1.dexterity;
_arg1.old_intellect = _arg1.intellect;
_arg1.old_stat_points = _arg1.stat_points;
_local3 = true;
};
if (((resurrect) && ((_arg1.health > 0)))){
return (false);
};
if (((sneaky) && ((_arg2.sneaking < 2)))){
_arg2.sneaking = 2;
_local3 = true;
};
if (((restore_health) && (_arg1.increaseHealthByPercentage(restore_health, resurrect)))){
_local3 = true;
};
if (_arg1.health > 0){
if (restore_power){
if (_arg1.increasePower(restore_power)){
_local3 = true;
};
};
if (damage_resist){
_arg1.potion_damage_resist = Math.max(_arg1.potion_damage_resist, damage_resist);
_local3 = true;
};
if (poison_resist){
_arg1.potion_poison_resist = Math.max(_arg1.potion_poison_resist, poison_resist);
_local3 = true;
};
if (stun_resist){
_arg1.potion_stun_resist = Math.max(_arg1.potion_stun_resist, stun_resist);
_local3 = true;
};
if (quickness_bonus){
_arg1.potion_quickness_bonus = Math.max(_arg1.potion_quickness_bonus, quickness_bonus);
_local3 = true;
};
};
if (_local3){
this.stack--;
if (this.stack <= 0){
_local4 = 0;
while (_local4 < Party.MAX_INVENTORY) {
if (_arg2.inventory[_local4] == this){
_arg2.inventory.splice(_local4, 1);
};
_local4++;
};
_local4 = 0;
while (_local4 < Party.MAX_OVERFLOW) {
if (_arg2.overflow[_local4] == this){
_arg2.overflow.splice(_local4, 1);
};
_local4++;
};
};
};
return (_local3);
}
override public function itemStatsString(_arg1:String):String{
_arg1 = "";
_arg1 = (_arg1 + "Use: ");
if (reset_stats){
_arg1 = (_arg1 + "Reset a character's strength, endurance, dexterity and intellect to base amounts for level, recover all spent Stat points.\n\n(Tip: Shift-click on increase button to spend all remaining stat points, ctrl-click to spend 2/3)\n");
};
if (resurrect){
_arg1 = (_arg1 + "Revives a character\n");
};
if (sneaky){
_arg1 = (_arg1 + "Allows the party to pass by one enemy horde without being attacked\n");
};
if (restore_health){
_arg1 = (_arg1 + (("Restores " + restore_health) + "% maximum health\n"));
};
if (restore_power){
_arg1 = (_arg1 + (("Restores " + restore_power) + "% maximum power\n"));
};
if (damage_resist){
_arg1 = (_arg1 + (("Grants +" + damage_resist) + "% damage resistance for next battle\n"));
};
if (damage_bonus){
_arg1 = (_arg1 + (("Grants +" + damage_bonus) + "% bonus damage for next battle\n"));
};
if (stun_resist){
_arg1 = (_arg1 + (("Grants +" + stun_resist) + "% stun resistance for next battle\n"));
};
if (poison_resist){
_arg1 = (_arg1 + (("Grants +" + poison_resist) + "% poison resistance for next battle\n"));
};
if (quickness_bonus){
_arg1 = (_arg1 + (("Grants +" + quickness_bonus) + " quickness for next battle\n"));
};
_arg1 = (_arg1 + "\n(Cannot be used in combat)\n");
return (_arg1);
}
public function basicHealthPotion(){
item_name = "Weak Healing Potion";
restore_health = 20;
item_rarity = Item.green;
item_level = 1;
icon_frame = 4;
}
}
}//package
Section 65
//ContinueButton (ContinueButton)
package {
import flash.display.*;
public dynamic class ContinueButton extends MovieClip {
}
}//package
Section 66
//CorridorConnectorH (CorridorConnectorH)
package {
import flash.display.*;
public class CorridorConnectorH extends DoorIcon {
public var gfx:MovieClip;
public function CorridorConnectorH(){
this.gotoAndStop(1);
}
override public function setAlpha(_arg1:Number):void{
gfx.alpha = _arg1;
}
override public function getAlpha():Number{
return (gfx.alpha);
}
}
}//package
Section 67
//CorridorConnectorV (CorridorConnectorV)
package {
import flash.display.*;
public class CorridorConnectorV extends DoorIcon {
public var gfx:MovieClip;
public function CorridorConnectorV(){
this.gotoAndStop(1);
}
override public function setAlpha(_arg1:Number):void{
gfx.alpha = _arg1;
}
override public function getAlpha():Number{
return (gfx.alpha);
}
}
}//package
Section 68
//cosmic_prison (cosmic_prison)
package {
import flash.display.*;
public dynamic class cosmic_prison extends MovieClip {
public function cosmic_prison(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.cosmicPrison);
}
function frame45(){
this.stop();
}
}
}//package
Section 69
//cosmic_prison_sound (cosmic_prison_sound)
package {
import flash.media.*;
public dynamic class cosmic_prison_sound extends Sound {
}
}//package
Section 70
//creature_slash (creature_slash)
package {
import flash.display.*;
public dynamic class creature_slash extends MovieClip {
public var blood:BloodRandom;
public function creature_slash(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.monsterClaws);
}
function frame45(){
this.stop();
}
}
}//package
Section 71
//creature_slash_sound (creature_slash_sound)
package {
import flash.media.*;
public dynamic class creature_slash_sound extends Sound {
}
}//package
Section 72
//creature_spear (creature_spear)
package {
import flash.display.*;
public dynamic class creature_spear extends MovieClip {
public var blood:BloodRandom;
public var slash:MovieClip;
public function creature_spear(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.monsterSlash);
}
function frame45(){
this.stop();
}
}
}//package
Section 73
//creature_weapon (creature_weapon)
package {
import flash.display.*;
public dynamic class creature_weapon extends MovieClip {
public var blood:BloodRandom;
public var slash:horz_slash;
public function creature_weapon(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.monsterSlash);
slash.rotation = DungeonMain.RandomNum(-15, 15);
}
function frame45(){
this.stop();
}
}
}//package
Section 74
//CreditsButton (CreditsButton)
package {
import flash.display.*;
public dynamic class CreditsButton extends SimpleButton {
}
}//package
Section 75
//CreditsScreen (CreditsScreen)
package {
import flash.events.*;
import flash.display.*;
public class CreditsScreen extends MovieClip {
public var yes_btn:ContinueButton;
public var cerberus_link:SimpleButton;
public var biclops_link:SimpleButton;
public function CreditsScreen():void{
biclops_link.addEventListener(MouseEvent.MOUSE_DOWN, biclopsClick);
cerberus_link.addEventListener(MouseEvent.MOUSE_DOWN, cerberusClick);
yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, exitClick);
}
function exitClick(_arg1:MouseEvent):void{
if (this.parent != null){
cleanup();
parent.removeChild(this);
};
}
public function cerberusClick(_arg1:MouseEvent):void{
dm.link("http://www.cerberusart.com");
}
private function cleanup():void{
biclops_link.removeEventListener(MouseEvent.MOUSE_DOWN, biclopsClick);
cerberus_link.removeEventListener(MouseEvent.MOUSE_DOWN, cerberusClick);
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, exitClick);
}
public function biclopsClick(_arg1:MouseEvent):void{
dm.link("http://www.biclopsgames.com");
}
}
}//package
Section 76
//CurrentPortraitHighlight (CurrentPortraitHighlight)
package {
import flash.display.*;
public dynamic class CurrentPortraitHighlight extends MovieClip {
}
}//package
Section 77
//CurrentRoomIcon (CurrentRoomIcon)
package {
import flash.display.*;
public dynamic class CurrentRoomIcon extends MovieClip {
}
}//package
Section 78
//curse_effect (curse_effect)
package {
import flash.display.*;
public dynamic class curse_effect extends MovieClip {
public function curse_effect(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
dm.sound.play(SoundControl.curse, 0.5);
}
function frame50(){
this.stop();
}
}
}//package
Section 79
//curse_sound (curse_sound)
package {
import flash.media.*;
public dynamic class curse_sound extends Sound {
}
}//package
Section 80
//dCheckBox (dCheckBox)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class dCheckBox extends MovieClip {
public var description:TextField;
var hover:Boolean;// = false
var checked:Boolean;// = false
public function dCheckBox(_arg1:Boolean=false, _arg2:String=""){
checked = false;
hover = false;
super();
checked = _arg1;
addEventListener(MouseEvent.MOUSE_DOWN, mouseClick);
addEventListener(MouseEvent.MOUSE_OVER, mouseOn);
addEventListener(MouseEvent.MOUSE_OUT, mouseOff);
setDescription(_arg2);
update();
}
function mouseClick(_arg1:MouseEvent):void{
checked = !(checked);
update();
}
public function clicked(_arg1:MouseEvent=null){
this.gotoAndPlay(2);
}
function mouseOn(_arg1:MouseEvent):void{
hover = true;
update();
}
function mouseOff(_arg1:MouseEvent):void{
hover = false;
update();
}
public function setDescription(_arg1:String):void{
description.text = _arg1;
dm.embolden(description);
description.autoSize = TextFieldAutoSize.LEFT;
}
public function cleanup():void{
removeEventListener(MouseEvent.MOUSE_DOWN, mouseClick);
removeEventListener(MouseEvent.MOUSE_OVER, mouseOn);
removeEventListener(MouseEvent.MOUSE_OUT, mouseOff);
}
private function update():void{
if (!checked){
if (hover){
this.gotoAndStop(3);
} else {
this.gotoAndStop(1);
};
} else {
if (hover){
this.gotoAndStop(4);
} else {
this.gotoAndStop(2);
};
};
}
public function setChecked(_arg1:Boolean):void{
this.checked = _arg1;
update();
}
}
}//package
Section 81
//DeadEffect (DeadEffect)
package {
import flash.display.*;
public dynamic class DeadEffect extends MovieClip {
}
}//package
Section 82
//debuff_effect (debuff_effect)
package {
import flash.display.*;
public dynamic class debuff_effect extends MovieClip {
public function debuff_effect(){
addFrameScript(4, frame5, 44, frame45);
}
function frame5(){
dm.sound.play(SoundControl.debuff);
}
function frame45(){
this.stop();
}
}
}//package
Section 83
//debuff_sound (debuff_sound)
package {
import flash.media.*;
public dynamic class debuff_sound extends Sound {
}
}//package
Section 84
//DeleteButton (DeleteButton)
package {
import flash.display.*;
public dynamic class DeleteButton extends MovieClip {
}
}//package
Section 85
//destroy_item_sound (destroy_item_sound)
package {
import flash.media.*;
public dynamic class destroy_item_sound extends Sound {
}
}//package
Section 86
//DifficultySelect (DifficultySelect)
package {
import flash.events.*;
import flash.display.*;
public class DifficultySelect extends MovieClip {
public var hardcore:MovieClip;
public var beginner:MovieClip;
public var extreme:MovieClip;
public var standard:MovieClip;
private var party:Party;
public function DifficultySelect(_arg1:Party=null):void{
party = _arg1;
standard.addEventListener(MouseEvent.CLICK, standardClicked);
beginner.addEventListener(MouseEvent.CLICK, beginnerClicked);
hardcore.addEventListener(MouseEvent.CLICK, hardcoreClicked);
extreme.addEventListener(MouseEvent.CLICK, extremeClicked);
standard.useHandCursor = true;
beginner.useHandCursor = true;
hardcore.useHandCursor = true;
}
private function exit():void{
if (parent != null){
if (parent.contains(this)){
parent.removeChild(this);
};
cleanup();
};
dm.main.difficultySelected();
}
function beginnerClicked(_arg1:MouseEvent):void{
if (party != null){
party.beginner = true;
party.hardcore = false;
party.extreme = false;
};
exit();
}
function standardClicked(_arg1:MouseEvent):void{
if (party != null){
party.beginner = false;
party.hardcore = false;
party.extreme = false;
};
exit();
}
public function cleanup():void{
standard.removeEventListener(MouseEvent.CLICK, standardClicked);
beginner.removeEventListener(MouseEvent.CLICK, beginnerClicked);
hardcore.removeEventListener(MouseEvent.CLICK, hardcoreClicked);
extreme.removeEventListener(MouseEvent.CLICK, extremeClicked);
}
function hardcoreClicked(_arg1:MouseEvent):void{
if (party != null){
party.beginner = false;
party.hardcore = true;
party.extreme = false;
};
exit();
}
function extremeClicked(_arg1:MouseEvent):void{
if (party != null){
party.beginner = false;
party.hardcore = false;
party.extreme = true;
};
exit();
}
}
}//package
Section 87
//DiscardButton (DiscardButton)
package {
import flash.display.*;
public dynamic class DiscardButton extends MovieClip {
}
}//package
Section 88
//disintegrate_effect (disintegrate_effect)
package {
import flash.display.*;
public dynamic class disintegrate_effect extends MovieClip {
public function disintegrate_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.disintegrate);
}
function frame45(){
this.stop();
}
}
}//package
Section 89
//disintegrate_sound (disintegrate_sound)
package {
import flash.media.*;
public dynamic class disintegrate_sound extends Sound {
}
}//package
Section 90
//dm (dm)
package {
import flash.text.*;
import flash.display.*;
import flash.net.*;
import flash.external.*;
public class dm {
static var stage:Stage;
static var party:Party;
static var sound:SoundControl;
static var MeezGPF;
static var main:DungeonMain;
static var kongregate;
public static function randomNum(_arg1:int, _arg2:int):int{
var _local3:*;
_local3 = (Math.round((Math.random() * (_arg2 - _arg1))) + _arg1);
return (_local3);
}
public static function copyArray(_arg1:Array):Array{
var _local2:Array;
var _local3:*;
_local2 = new Array(_arg1.length);
_local3 = 0;
while (_local3 < _local2.length) {
_local2[_local3] = _arg1[_local3];
_local3++;
};
return (_local2);
}
public static function shuffleArray(_arg1:Array):Array{
var _local2:Array;
var _local3:Array;
var _local4:*;
var _local5:Array;
_local2 = new Array();
_local3 = new Array(_arg1.length);
_local4 = 0;
while (_local4 < _local3.length) {
_local3[_local4] = _arg1[_local4];
_local4++;
};
while (_local3.length) {
_local4 = dm.randomNum(0, (_local3.length - 1));
_local5 = _local3.splice(_local4, 1);
_local2.push(_local5[0]);
};
return (_local2);
}
static function vector_length(_arg1:Number, _arg2:Number):Number{
return (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))));
}
public static function joinArrays(_arg1:Array, _arg2:Array):Array{
var _local3:Array;
var _local4:*;
_local3 = new Array();
_local4 = 0;
while (_local4 < _arg1.length) {
_local3.push(_arg1[_local4]);
_local4++;
};
_local4 = 0;
while (_local4 < _arg2.length) {
_local3.push(_arg2[_local4]);
_local4++;
};
return (_local3);
}
public static function childToTop(_arg1:DisplayObjectContainer):void{
var _local2:*;
if ((((_arg1 == null)) || ((_arg1.parent == null)))){
return;
};
_local2 = (_arg1.parent.numChildren - 1);
_arg1.parent.setChildIndex(_arg1, _local2);
}
static function vectors2angle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
_local5 = vector_length(_arg1, _arg2);
_local6 = vector_length(_arg3, _arg4);
if (_local5 != 0){
_arg1 = (_arg1 / _local5);
_arg2 = (_arg2 / _local5);
};
if (_local6 != 0){
_arg3 = (_arg3 / _local6);
_arg4 = (_arg4 / _local6);
};
_local7 = dot(_arg1, _arg2, _arg3, _arg4);
_local8 = (_local7 / (Math.sqrt(vector_length(_arg1, _arg2)) * Math.sqrt(vector_length(_arg3, _arg4))));
_local9 = Math.acos(_local8);
_local10 = dm.radians_to_degrees(_local9);
return (_local10);
}
static function radians_to_degrees(_arg1:Number):Number{
return ((_arg1 * (180 / Math.PI)));
}
static function dot(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1 * _arg3) + (_arg2 * _arg4)));
}
public static function link(_arg1:String):void{
var url = _arg1;
try {
ExternalInterface.call("window.open", url, "_blank", "");
} catch(error) {
navigateToURL(new URLRequest(url), "_blank");
};
}
public static function embolden(_arg1:TextField){
var _local2:TextFormat;
_local2 = _arg1.getTextFormat();
_local2.bold = true;
_arg1.setTextFormat(_local2);
}
}
}//package
Section 91
//dmf (dmf)
package {
import flash.text.*;
import flash.display.*;
import flash.net.*;
import flash.external.*;
public class dmf {
public static function shuffleArray(_arg1:Array):Array{
var _local2:Array;
var _local3:Array;
var _local4:*;
var _local5:Array;
_local2 = new Array();
_local3 = new Array(_arg1.length);
_local4 = 0;
while (_local4 < _local3.length) {
_local3[_local4] = _arg1[_local4];
_local4++;
};
while (_local3.length) {
_local4 = randomNum(0, (_local3.length - 1));
_local5 = _local3.splice(_local4, 1);
_local2.push(_local5[0]);
};
return (_local2);
}
public static function randomNum(_arg1:int, _arg2:int):int{
var _local3:*;
_local3 = (Math.round((Math.random() * (_arg2 - _arg1))) + _arg1);
return (_local3);
}
public static function copyArray(_arg1:Array):Array{
var _local2:Array;
var _local3:*;
_local2 = new Array(_arg1.length);
_local3 = 0;
while (_local3 < _local2.length) {
_local2[_local3] = _arg1[_local3];
_local3++;
};
return (_local2);
}
static function vector_length(_arg1:Number, _arg2:Number):Number{
return (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))));
}
public static function joinArrays(_arg1:Array, _arg2:Array):Array{
var _local3:Array;
var _local4:*;
_local3 = new Array();
_local4 = 0;
while (_local4 < _arg1.length) {
_local3.push(_arg1[_local4]);
_local4++;
};
_local4 = 0;
while (_local4 < _arg2.length) {
_local3.push(_arg2[_local4]);
_local4++;
};
return (_local3);
}
static function dot(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1 * _arg3) + (_arg2 * _arg4)));
}
public static function numberToText(_arg1:int, _arg2:Boolean=false):String{
var _local3:String;
_local3 = "number";
if (_arg1 == 0){
_local3 = "zero";
} else {
if (_arg1 == 1){
_local3 = "one";
} else {
if (_arg1 == 2){
_local3 = "two";
} else {
if (_arg1 == 3){
_local3 = "three";
} else {
if (_arg1 == 4){
_local3 = "four";
} else {
if (_arg1 == 5){
_local3 = "five";
} else {
if (_arg1 == 6){
_local3 = "six";
} else {
if (_arg1 == 7){
_local3 = "seven";
} else {
if (_arg1 == 8){
_local3 = "eight";
} else {
if (_arg1 == 9){
_local3 = "nine";
} else {
if (_arg1 == 10){
_local3 = "ten";
};
};
};
};
};
};
};
};
};
};
};
if (_arg2){
_local3 = _local3.toUpperCase();
};
return (_local3);
}
public static function boldText(_arg1:TextField){
var _local2:TextFormat;
_local2 = _arg1.getTextFormat();
_local2.bold = true;
_arg1.setTextFormat(_local2);
}
static function vectors2angle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
_local5 = vector_length(_arg1, _arg2);
_local6 = vector_length(_arg3, _arg4);
if (_local5 != 0){
_arg1 = (_arg1 / _local5);
_arg2 = (_arg2 / _local5);
};
if (_local6 != 0){
_arg3 = (_arg3 / _local6);
_arg4 = (_arg4 / _local6);
};
_local7 = dot(_arg1, _arg2, _arg3, _arg4);
_local8 = (_local7 / (Math.sqrt(vector_length(_arg1, _arg2)) * Math.sqrt(vector_length(_arg3, _arg4))));
_local9 = Math.acos(_local8);
_local10 = radians_to_degrees(_local9);
return (_local10);
}
public static function randomString(_arg1:Array):String{
return (_arg1[randomNum(0, (_arg1.length - 1))]);
}
public static function embolden(_arg1:TextField){
boldText(_arg1);
}
static function radians_to_degrees(_arg1:Number):Number{
return ((_arg1 * (180 / Math.PI)));
}
public static function arrayContains(_arg1:Array, _arg2:Object):Boolean{
var _local3:*;
if ((((_arg1 == null)) || (!(_arg1.length)))){
return (false);
};
_local3 = 0;
while (_local3 < _arg1.length) {
if (_arg1[_local3] == _arg2){
return (true);
};
_local3++;
};
return (false);
}
public static function link(_arg1:String):void{
var url = _arg1;
try {
ExternalInterface.call("window.open", url, "_blank", "");
} catch(error) {
navigateToURL(new URLRequest(url), "_blank");
};
}
public static function italicText(_arg1:TextField){
var _local2:TextFormat;
_local2 = _arg1.getTextFormat();
_local2.italic = true;
_arg1.setTextFormat(_local2);
}
public static function childToTop(_arg1:DisplayObjectContainer):void{
var _local2:*;
if ((((_arg1 == null)) || ((_arg1.parent == null)))){
return;
};
_local2 = (_arg1.parent.numChildren - 1);
_arg1.parent.setChildIndex(_arg1, _local2);
}
}
}//package
Section 92
//DoorIcon (DoorIcon)
package {
import flash.display.*;
public class DoorIcon extends MovieClip {
public var door_gfx:MovieClip;
var room2:DungeonRoom;
var room1:DungeonRoom;
public function DoorIcon(){
this.gotoAndStop(1);
}
public function setAlpha(_arg1:Number):void{
this.door_gfx.alpha = _arg1;
}
public function getAlpha():Number{
return (this.door_gfx.alpha);
}
public function setVert():void{
this.rotation = 90;
}
}
}//package
Section 93
//DownLevelButton (DownLevelButton)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
import flash.geom.*;
public class DownLevelButton extends MovieClip {
var tooltip:Tooltip;
var tt_text:String;
var tt_title:String;
public function DownLevelButton(){
tt_title = "Descend";
tt_text = "You have found the exit from this level. When you are ready, click here to proceed.";
}
function mouseOverTarget(_arg1:MouseEvent):void{
var _local2:uint;
var _local3:*;
var _local4:*;
var _local5:Point;
_local2 = (parent.numChildren - 1);
parent.setChildIndex(this, _local2);
if (_arg1.buttonDown){
return;
};
if (tooltip == null){
if (!newTooltip()){
return;
};
};
_local3 = _arg1.target.mouseX;
_local4 = _arg1.target.mouseY;
_local5 = _arg1.target.localToGlobal(new Point(_arg1.target.mouseX, _arg1.target.mouseY));
if ((_local5.x + tooltip.width) > DungeonMain.APP_WIDTH){
_local3 = (_local3 + (DungeonMain.APP_WIDTH - (_local5.x + tooltip.width)));
};
if ((_local5.y + tooltip.height) > DungeonMain.APP_HEIGHT){
_local4 = (_local4 + (DungeonMain.APP_HEIGHT - (_local5.y + tooltip.height)));
};
tooltip.x = _local3;
tooltip.y = _local4;
_arg1.updateAfterEvent();
}
private function newTooltip():Boolean{
tooltip = new Tooltip(tt_title, tt_text);
tooltip.mouseEnabled = false;
tooltip.mouseChildren = false;
tooltip.name = "tooltip_skill";
addChild(tooltip);
return (true);
}
function mouseMoveTarget(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:Point;
if (_arg1.buttonDown){
return;
};
if (tooltip == null){
if (!newTooltip()){
return;
};
};
_local2 = _arg1.target.mouseX;
_local3 = _arg1.target.mouseY;
_local4 = _arg1.target.localToGlobal(new Point(_arg1.target.mouseX, _arg1.target.mouseY));
if ((_local4.x + tooltip.width) > DungeonMain.APP_WIDTH){
_local2 = (_local2 + (DungeonMain.APP_WIDTH - (_local4.x + tooltip.width)));
};
if ((_local4.y + tooltip.height) > DungeonMain.APP_HEIGHT){
_local3 = (_local3 + (DungeonMain.APP_HEIGHT - (_local4.y + tooltip.height)));
};
tooltip.x = _local2;
tooltip.y = _local3;
_arg1.updateAfterEvent();
}
function mouseOutTarget(_arg1:MouseEvent):void{
if (tooltip != null){
removeChild(tooltip);
tooltip = null;
};
}
}
}//package
Section 94
//DownLevelDialog (DownLevelDialog)
package {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public class DownLevelDialog extends MovieClip {
public var yes_btn:YesButton;
public var no_btn:NotYetButton;
public function DownLevelDialog(){
this.yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickYes);
this.no_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickNo);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function clickYes(_arg1:MouseEvent):void{
Dungeon(parent).descend();
cleanup();
}
function clickNo(_arg1:MouseEvent):void{
if (parent != null){
cleanup();
parent.removeChild(this);
};
}
private function cleanup():void{
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickYes);
no_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickNo);
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
clickYes(null);
} else {
if (_arg1.keyCode == Keyboard.ESCAPE){
clickNo(null);
};
};
}
}
}//package
Section 95
//Dungeon (Dungeon)
package {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public class Dungeon extends Sprite {
const hintStart = 32;
const tile_dungeon = 1;
const hintBattle = 8;
const tile_cave = 2;
const hintInventory = 2;
const hintDefeat = 4;
const hintSave = 128;
const hintLevel = 1;
const hintTurn = 64;
const hintHorde = 16;
const bar_max_width = 147;
var bossRoom:DungeonRoom;
var a_tallrooms:Array;
var previousLevelCleared;// = false
var entryRoom:DungeonRoom;
var hint:HintDialog;
var door_array:Array;
var currentRoomIcon:CurrentRoomIcon;
var a_chambers:Array;
var moveArrow:Sprite;
var shrines:Array;
var race:int;// = 0
var tileset:int;
var a_galleries:Array;
var exitRoom:DungeonRoom;
var exit_found;// = false
var a_largerooms:Array;
var grid:Array;
var dinterface:DungeonInterface;
var a_corridors:Array;
var chests:Array;
var pc_party:Party;
var a_widerooms:Array;
var dungeon_level:int;// = 1
var hordes:Array;
var a_cells:Array;
var currentRoom:DungeonRoom;
var room_array:Array;
static const grid_height = 15;
static const GRID_SIZE = 20;
static const SCREEN_Y_OFFSET = 10;
static const grid_width = 27;
static const SCREEN_X_OFFSET = 5;
public function Dungeon(_arg1:Party=null, _arg2:int=1, _arg3:int=0, _arg4:Boolean=false){
dungeon_level = 1;
race = 0;
tileset = tile_dungeon;
room_array = new Array();
door_array = new Array();
hordes = new Array();
shrines = new Array();
chests = new Array();
exit_found = false;
previousLevelCleared = false;
super();
if (_arg1 == null){
return;
};
this.previousLevelCleared = _arg4;
dungeon_level = _arg2;
pc_party = _arg1;
dinterface = new DungeonInterface();
if (!_arg3){
race = Dungeon.getMonsterRace(_arg2, 0);
} else {
race = _arg3;
};
drawInterface();
if (DungeonMain.showHints){
if ((((_arg2 == 2)) && (!(hintShown(hintLevel))))){
hint = new HintDialog("Level Up!", "You have descended to the next level of the dungeon, and your characters have grown in power. \n\nEach level they will gain points to increase their statistics and buy new skills.\n\nClick on a portrait to enter the Inventory screen and spend these points.");
DungeonMain.hints = (DungeonMain.hints + hintLevel);
};
if ((((_arg2 == 1)) && (!(hintShown(hintStart))))){
hint = new HintDialog("The Dungeon Map", "This is the Dungeon Map. From here, you move your party from room to room, encountering monsters and finding treasure while searching for the entrance to the next level of the dungeon.\n\nThe brightest room shows the current position of your party, while slightly dimmer rooms are those you can move to from your current position. Simply click on a room to move there.\n\nIf you can't figure out where to explore next, try clicking the 'Map Hint' button.");
DungeonMain.hints = (DungeonMain.hints + hintStart);
};
};
}
private function saveClick(_arg1:MouseEvent):void{
if (parent != null){
DungeonMain(parent).saveClick(_arg1);
};
}
public function exploreAll(_arg1:MouseEvent):void{
var _local2:*;
foundExit();
_local2 = 0;
while (_local2 < room_array.length) {
if (room_array[_local2] == null){
} else {
room_array[_local2].explored = true;
room_array[_local2].seen = true;
};
_local2++;
};
roomHighlights();
}
private function generateDoors():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:DoorIcon;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
_local10 = -1;
_local11 = -1;
_local1 = 0;
while (_local1 < room_array.length) {
_local2 = 0;
for (;_local2 < room_array[_local1].adjacent.length;_local2++) {
if (room_array[_local1] == null){
} else {
if (room_array[_local1].adjacent[_local2] == room_array[_local1]){
} else {
_local8 = room_array[_local1];
_local7 = room_array[_local1].adjacent[_local2];
if ((((_local7 is DungeonCorridor)) && ((room_array[_local1] is DungeonCorridor)))){
addCorridorConnection(_local7, room_array[_local1]);
} else {
_local6 = new DoorIcon();
_local6.x = 0;
_local6.y = 0;
_local6.room1 = _local8;
_local6.room2 = _local7;
_local12 = 0;
_local13 = 0;
if (_local7.grid_x >= (_local8.grid_x + _local8.getGridWidth())){
_local6.setVert();
_local12 = (_local8.grid_x + _local8.getGridWidth());
_local13 = _local8.grid_y;
if ((((_local12 >= grid_width)) || ((_local13 >= grid_height)))){
continue;
};
_local6.x = (SCREEN_X_OFFSET + (GRID_SIZE * (_local8.grid_x + _local8.getGridWidth())));
_local10 = -1;
_local11 = -1;
_local3 = 0;
while (_local3 < _local8.getGridHeight()) {
_local9 = grid[_local12][(_local13 + _local3)];
if (_local9 == null){
} else {
if (_local9 == _local7){
if (_local10 == -1){
_local10 = _local3;
};
_local11 = _local3;
};
};
_local3++;
};
_local5 = ((_local10 + _local11) / 2);
_local6.y = (SCREEN_Y_OFFSET + (GRID_SIZE * (_local8.grid_y + _local5)));
} else {
if (_local7.grid_y >= (_local8.grid_y + _local8.getGridHeight())){
_local12 = _local8.grid_x;
_local13 = (_local8.grid_y + _local8.getGridHeight());
if ((((_local12 >= grid_width)) || ((_local13 >= grid_height)))){
continue;
};
_local6.y = Math.round((SCREEN_Y_OFFSET + (GRID_SIZE * (_local8.grid_y + _local8.getGridHeight()))));
_local10 = -1;
_local11 = -1;
_local3 = 0;
while (_local3 < _local8.getGridWidth()) {
_local9 = grid[(_local12 + _local3)][_local13];
if (_local9 == null){
} else {
if (_local9 == _local7){
if (_local10 == -1){
_local10 = _local3;
};
_local11 = _local3;
};
};
_local3++;
};
_local5 = ((_local10 + _local11) / 2);
_local6.x = (SCREEN_X_OFFSET + (GRID_SIZE * (_local8.grid_x + _local5)));
};
};
if ((((_local6.x > 0)) && ((_local6.y > 0)))){
door_array.push(_local6);
DungeonRoom(_local6.room1).addDoor(_local6);
DungeonRoom(_local6.room2).addDoor(_local6);
};
};
};
};
};
_local1++;
};
}
private function drawRooms():void{
var _local1:*;
_local1 = 0;
while (_local1 < room_array.length) {
if (room_array[_local1] == null){
} else {
room_array[_local1].index = _local1;
this.addChild(room_array[_local1]);
};
_local1++;
};
}
private function newCorridorConnection(_arg1:Boolean, _arg2:int, _arg3:int, _arg4:DungeonRoom, _arg5:DungeonRoom):void{
var _local6:*;
if (_arg1){
_local6 = new CorridorConnectorV();
} else {
_local6 = new CorridorConnectorH();
};
_local6.room1 = _arg4;
_local6.room2 = _arg5;
_local6.y = _arg3;
_local6.x = _arg2;
_arg4.addDoor(_local6);
_arg5.addDoor(_local6);
door_array.push(_local6);
}
private function updateInventoryCount():void{
dinterface.items_label.text = ((String((pc_party.inventory.length + pc_party.overflow.length)) + "/") + String(Party.MAX_INVENTORY));
if (pc_party.overflow.length){
dinterface.items_label.textColor = 0xFF0000;
} else {
dinterface.items_label.textColor = 0xFFFFFF;
};
dm.embolden(dinterface.items_label);
}
private function addRoomToTypeArray(_arg1:DungeonRoom):void{
if ((((_arg1 is rCorridorV)) || ((_arg1 is rCorridorH)))){
a_corridors.push(_arg1);
} else {
if ((_arg1 is rCell)){
a_cells.push(_arg1);
} else {
if ((_arg1 is rChamber)){
a_chambers.push(_arg1);
} else {
if ((_arg1 is rLargeRoom)){
a_largerooms.push(_arg1);
} else {
if ((_arg1 is rGallery)){
a_galleries.push(_arg1);
} else {
if ((_arg1 is rTallRoom)){
a_tallrooms.push(_arg1);
} else {
if ((_arg1 is rWideRoom)){
a_widerooms.push(_arg1);
};
};
};
};
};
};
};
}
private function isExistingRoomConnection(_arg1:DungeonRoom, _arg2:DungeonRoom):Boolean{
var _local3:*;
_local3 = 0;
while (_local3 < _arg1.doors.length) {
if ((((_arg1.doors[_local3].room1 == _arg2)) || ((_arg1.doors[_local3].room2 == _arg2)))){
return (true);
};
_local3++;
};
return (false);
}
private function getRoomCount():int{
return ((room_array.length - a_corridors.length));
}
private function PlaceRoom(_arg1:DungeonRoom):Boolean{
var _local2:*;
var _local3:*;
var _local4:*;
_local4 = checkFootprintEmpty(_arg1);
if (!_local4){
return (false);
};
_arg1.x = (SCREEN_X_OFFSET + (_arg1.grid_x * GRID_SIZE));
_arg1.y = (SCREEN_Y_OFFSET + (_arg1.grid_y * GRID_SIZE));
fillGridForRoom(_arg1);
room_array.push(_arg1);
_arg1.setFloor();
_arg1.addFurniture();
addRoomToTypeArray(_arg1);
return (true);
}
private function isDungeonTooSmall():Boolean{
if (room_array.length < 40){
return (true);
};
if (getRoomCount() < 10){
return (true);
};
return (false);
}
private function ConnectRooms(_arg1:DungeonRoom, _arg2:DungeonRoom, _arg3:int){
var _local4:*;
var _local5:*;
if ((((_arg2 == null)) || ((_arg1 == null)))){
return;
};
if (_arg2.num_adjacent == DungeonRoom.max_adjacent){
return;
};
if (_arg1.num_adjacent == DungeonRoom.max_adjacent){
return;
};
if ((_arg1 is DungeonCorridor)){
if ((_arg2 is DungeonCorridor)){
_arg1.setAdjacentTo(_arg2);
return;
};
};
if (_arg2.num_adjacent == 0){
_arg1.setAdjacentTo(_arg2);
return;
};
if ((_arg1 is DungeonCorridor)){
if (_arg1.num_adjacent < 2){
_arg1.setAdjacentTo(_arg2);
return;
};
};
if ((_arg2 is DungeonCorridor)){
if (_arg2.num_adjacent < 2){
_arg1.setAdjacentTo(_arg2);
return;
};
};
_local4 = ((((_arg3 * room_array.length) + _arg2.floor_frame_number) + (_arg1.grid_x * _arg2.grid_y)) + (_arg2.grid_x * _arg1.grid_y));
_local5 = (_local4 % 10);
if (_arg1.num_adjacent == 0){
_arg1.setAdjacentTo(_arg2);
} else {
if (_arg1.num_adjacent == 1){
if (_local5 >= 4){
_arg1.setAdjacentTo(_arg2);
};
} else {
if (_arg1.num_adjacent == 2){
if (_local5 >= 8){
_arg1.setAdjacentTo(_arg2);
};
} else {
if (_local5 >= 9){
_arg1.setAdjacentTo(_arg2);
};
};
};
};
}
private function ClearAllRoomEdges(){
var _local1:*;
_local1 = 0;
while (_local1 < room_array.length) {
if (room_array[_local1] == null){
} else {
room_array[_local1].clearAdjacent();
};
_local1++;
};
}
public function useShrine():void{
var _local1:*;
var _local2:*;
var _local3:*;
if ((((currentRoom.shrine == null)) || (currentRoom.shrine.used))){
return;
};
_local1 = getChildByName("shrine_dlg");
if (_local1 != null){
removeChild(_local1);
};
pc_party.fullRecovery();
_local2 = 0;
while (_local2 < pc_party.members.length) {
_local3 = dinterface.getChildByName(("char" + (_local2 + 1)));
if (_local3 == null){
} else {
CharacterPortrait(_local3).addPortraitAnimation(PortraitAnimation.heal);
};
_local2++;
};
currentRoom.shrine.used = true;
currentRoom.shrine.fade();
pc_party.stat_shrines_used++;
if (parent != null){
DungeonMain(parent).saveParty();
DungeonMain(parent).saveDungeon();
};
updateChars();
}
function removed(_arg1:Event):void{
stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
public function removeMovementArrow():void{
var _local1:*;
_local1 = this;
if (((!((moveArrow == null))) && (_local1.contains(moveArrow)))){
_local1.removeChild(moveArrow);
moveArrow = null;
};
}
private function drawInterface(){
var _local1:CharacterPortrait;
var _local2:*;
var _local3:*;
dinterface.x = 0;
dinterface.y = 0;
this.addChild(dinterface);
dinterface.level_label.mouseEnabled = false;
dinterface.level_label.text = ("Dungeon Level " + dungeon_level);
dm.embolden(dinterface.level_label);
if (DungeonMain.debug){
dinterface.explore_btn.addEventListener(MouseEvent.MOUSE_DOWN, exploreAll);
dinterface.newdungeon_btn.addEventListener(MouseEvent.MOUSE_DOWN, newDungeonClick);
dinterface.clear_btn.addEventListener(MouseEvent.MOUSE_DOWN, clearHordes);
dinterface.gear_btn.addEventListener(MouseEvent.MOUSE_DOWN, addDebugGear);
dinterface.heal_btn.addEventListener(MouseEvent.MOUSE_DOWN, debugHeal);
dinterface.level_debug.text = ((("Health: " + MonsterCharacter.getHealthMax(dungeon_level)) + " | Damage: ") + MonsterCharacter.getBaseDamage(dungeon_level));
} else {
if (dinterface.contains(dinterface.explore_btn)){
dinterface.removeChild(dinterface.explore_btn);
};
if (dinterface.contains(dinterface.newdungeon_btn)){
dinterface.removeChild(dinterface.newdungeon_btn);
};
if (dinterface.contains(dinterface.clear_btn)){
dinterface.removeChild(dinterface.clear_btn);
};
if (dinterface.contains(dinterface.gear_btn)){
dinterface.removeChild(dinterface.gear_btn);
};
if (dinterface.contains(dinterface.heal_btn)){
dinterface.removeChild(dinterface.heal_btn);
};
if (dinterface.contains(dinterface.level_debug)){
dinterface.removeChild(dinterface.level_debug);
};
};
dinterface.rest_button.addEventListener(MouseEvent.MOUSE_DOWN, restButtonClick);
dinterface.inventory_btn.addEventListener(MouseEvent.MOUSE_DOWN, inventoryClick);
dinterface.menu_btn.addEventListener(MouseEvent.MOUSE_DOWN, menuClick);
dinterface.hint_btn.addEventListener(MouseEvent.MOUSE_DOWN, hintClick);
dinterface.rating_btn.addEventListener(MouseEvent.MOUSE_DOWN, ratingClick);
dinterface.maxgames_btn.addEventListener(MouseEvent.MOUSE_DOWN, linkClick);
this.addEventListener(Event.ADDED_TO_STAGE, added);
this.addEventListener(Event.REMOVED_FROM_STAGE, removed);
updateInventoryCount();
_local2 = 0;
while (_local2 < pc_party.members.length) {
_local3 = dinterface.getChildByName(("slot" + (_local2 + 1)));
if (_local3 == null){
} else {
_local1 = new CharacterPortrait();
_local1.x = _local3.x;
_local1.y = _local3.y;
_local1.setChar(pc_party.members[_local2]);
_local1.name = ("char" + (_local2 + 1));
_local1.setGlow();
dinterface.addChild(_local1);
dinterface.removeChild(_local3);
_local1.addEventListener(MouseEvent.MOUSE_DOWN, portraitClick);
};
_local2++;
};
if (!exit_found){
if (dinterface.getChildByName("descend_button") != null){
dinterface.removeChild(dinterface.descend_button);
};
};
if (((!(previousLevelCleared)) && (!((dungeon_level == 10))))){
removeRestButton();
};
}
public function fullyCleared():Boolean{
var _local1:*;
if (getHordesDefeated() == hordes.length){
_local1 = 0;
while (_local1 < room_array.length) {
if (room_array[_local1].explored == false){
return (false);
};
_local1++;
};
return (true);
};
return (false);
}
private function addTreasureToRoom(_arg1:DungeonRoom):void{
var _local2:*;
_local2 = new TreasureChest(pc_party, dungeon_level);
_local2.x = _arg1.getCenterHorz();
_local2.y = _arg1.getCenterVert();
_arg1.treasure = _local2;
chests.push(_local2);
_arg1.setChild(_local2);
_local2.mask = null;
}
public function getIntroduction(_arg1:int):String{
var _local2:*;
var _local3:String;
var _local4:*;
var _local5:*;
var _local6:*;
_local2 = false;
_local3 = "The party descend to the next level.\n\n";
if (pc_party.members.length == 1){
return ("");
};
if ((((dungeon_level > DungeonMain.MAX_LEVEL)) && ((_arg1 == Horde.special)))){
return ((_local3 + "An uneasy peace holds in this area, as the dungeon's denizens come together to plot and scheme."));
};
_local4 = DungeonMain.RandomNum(0, (pc_party.members.length - 1));
if (dm.randomNum(0, 100) < 8){
_local2 = true;
} else {
_local2 = false;
};
if ((pc_party.members[_local4] is PC_Cleric)){
if (_local2){
_local3 = (_local3 + (((pc_party.members[_local4].charname + " performs a rite of battle.\n'") + Horde.nameForRace(_arg1, true)) + ", then? It makes little difference. Nothing may hinder the righteous.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (pc_party.members[_local4].charname + " scowls.\n'This place bears the taint of the undead.'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (("'There is heresy here. The greenskins and their false gods hold\nsway,' spits " + pc_party.members[_local4].charname) + ", growing incensed."));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (("'The creatures here are base, soulless things: the work of no higher\npower,' mutters " + pc_party.members[_local4].charname) + "."));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (pc_party.members[_local4].charname + " appears distressed.\n'This place.. it is utterly corrupted by the heresies of the cultists.\nWe should not linger here.'"));
};
};
};
};
};
} else {
if ((pc_party.members[_local4] is PC_Warrior)){
if (_local2){
_local3 = (_local3 + (((pc_party.members[_local4].charname + " says 'An opportunity to test my prowess against ") + Horde.nameForRace(_arg1)) + " is welcome. To arms!'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (((("'It is plain that this is the domain of the undead. Be on your\nguard,' says " + pc_party.members[_local4].charname) + ", adjusting ") + pc_party.members[_local4].genderPossessive()) + " armor."));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (pc_party.members[_local4].charname + " points.\n'Look, there: the trappings of the orc. Stupid beasts, but\ndangerous. Stay close.'"));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (pc_party.members[_local4].charname + " inhales, then spits.\n'The stench of carrion. Whatever monsters lurk here, they shall not\nfind us so easy a meal.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'Ho, there- that emblem. The mark of the Cult of the Outward\nPath,' notes " + pc_party.members[_local4].charname) + ".\n'Our foes will not hail from this world alone.'"));
};
};
};
};
};
} else {
if ((pc_party.members[_local4] is PC_Rogue)){
if (_local2){
_local3 = (_local3 + (((((((((pc_party.members[_local4].charname + " checks ") + pc_party.members[_local4].genderPossessive()) + " pack for provisions.\n'I just hope we're not fighting any more ") + Horde.nameForRace(_arg1)) + ".'\n") + pc_party.members[_local4].genderPronoun(true)) + " turns ") + pc_party.members[_local4].genderPossessive()) + " head sharply as a distinctive sound echoes down the corridor.\n'Well. I suppose I should have seen that coming.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (("'Did you hear that?' asks " + pc_party.members[_local4].charname) + ", peering nervously into the gloom.\n'I have a bad feeling we're dealing with walking corpses, here.'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (((pc_party.members[_local4].charname + " sniffs the air.\n'Did we take a wrong turn into a sewer? Oh, right.. orcs.'\n") + pc_party.members[_local4].genderPronoun(true)) + " sighs."));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (pc_party.members[_local4].charname + " sits down heavily, taking a moment to rest.\n'Ugh, I think I may be sitting in monster droppings.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'This place doesn't feel right,' mutters " + pc_party.members[_local4].charname) + ".\n'It's those twisted cultists.'"));
};
};
};
};
};
} else {
if ((pc_party.members[_local4] is PC_Mage)){
if (_local2){
_local3 = (_local3 + (((("At a gesture from " + pc_party.members[_local4].charname) + ", a glyph appears fleetingly in the air.\n'") + Horde.nameForRace(_arg1, true)) + ". There can be no doubt: my mastery of detection spells\nis complete.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (("Warning glyphs flash in the air about " + pc_party.members[_local4].charname) + ".\n'The dark arts are at work in this place. The dead walk.'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (pc_party.members[_local4].charname + " concentrates for a moment.\n'The mystic arts are being practiced here, but weakly. This place\nmust be home to the vile orcs and their kin.'"));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (((pc_party.members[_local4].charname + " falters in ") + pc_party.members[_local4].genderPossessive()) + " preparation.\n'There is ancient power here. The creatures of the deep are drawn to\nit.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'The fabric of the aether has been rent,' states " + pc_party.members[_local4].charname) + ".\n'No doubt the work of those reckless amateurs, the Cult of the\nOutward Path.'"));
};
};
};
};
};
} else {
if ((pc_party.members[_local4] is PC_Ranger)){
if (_local2){
_local3 = (_local3 + (((("Examining the entrance, " + pc_party.members[_local4].charname) + " slowly nods.\n'There were ") + Horde.nameForRace(_arg1)) + " here, and recently. The signs of their passage\n are unmistakable.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (pc_party.members[_local4].charname + " crouches, noting debris strewn on the dank stone floor.\n'Nothing but bonemeal and crypt-dust. Undead.'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (("'I've found something! Look here: the spoor of greenskins,' calls " + pc_party.members[_local4].charname) + ", after examining the area."));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (((pc_party.members[_local4].charname + " grows excited as ") + pc_party.members[_local4].genderPronoun()) + " scouts the immediate area.\n'There are tracks here.. creatures of many types. We have found\nourselves a hunt.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'Human footprints,' remarks " + pc_party.members[_local4].charname) + ".\n'Cultists?'"));
};
};
};
};
};
} else {
_local3 = (_local3 + (((pc_party.members[_local4].charname + " says 'There are ") + Horde.nameForRace(_arg1)) + " here.'"));
};
};
};
};
};
_local3 = (_local3 + "\n\n");
_local5 = _local4;
while (_local5 == _local4) {
_local5 = DungeonMain.RandomNum(0, (pc_party.members.length - 1));
};
if (dm.randomNum(0, 100) < 8){
_local2 = true;
} else {
_local2 = false;
};
if ((pc_party.members[_local5] is PC_Cleric)){
if (_local2){
_local3 = (_local3 + (pc_party.members[_local5].charname + " intones a sonorous prayer.\n'Let our faith be our shield!'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (((("'Those lost souls will find peace this day,' promises " + pc_party.members[_local5].charname) + ",\n") + pc_party.members[_local5].genderPossessive()) + " countenance grim."));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (((((pc_party.members[_local5].charname + " grimaces.\n'The beasts will not defile this place much longer. We shall make\ncertain of it,' ") + pc_party.members[_local4].genderPronoun()) + " growls, hefting ") + pc_party.members[_local5].genderPossessive()) + " weapon."));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (((pc_party.members[_local5].charname + " readies ") + pc_party.members[_local5].genderSelf()) + ".\n'Let us cleanse this foul menagerie.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'Heretics!' snarls " + pc_party.members[_local5].charname) + ".\n'Their work here is an affront: we must make an end of it.'"));
};
};
};
};
};
} else {
if ((pc_party.members[_local5] is PC_Warrior)){
if (_local2){
_local3 = (_local3 + (((pc_party.members[_local5].charname + " draws ") + pc_party.members[_local5].genderPossessive()) + " weapon.\n'Stay behind me. We will cut a path, no matter how many may come.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (pc_party.members[_local5].charname + " nods slightly.\n'Then let us lay them to rest.'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (((pc_party.members[_local5].charname + " sharpens ") + pc_party.members[_local5].genderPossessive()) + " blade.\n'The clumsy brawn of those ragged brutes is little match for the\nfighting arm of a seasoned warrior. Let them come.'"));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (((pc_party.members[_local5].charname + " shifts ") + pc_party.members[_local5].genderPossessive()) + " weight.\n'It will take more than a monstrous rabble to slow us.\nCome, this way.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'The Cult of the Outward Path,' muses " + pc_party.members[_local5].charname) + ".\n'Let us see if the fiends they worship can protect them.'"));
};
};
};
};
};
} else {
if ((pc_party.members[_local5] is PC_Rogue)){
if (_local2){
_local3 = (_local3 + (pc_party.members[_local5].charname + " glances around.\n'Is it too late to go back?'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (("'Great. My favorite,' snorts " + pc_party.members[_local5].charname) + "."));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (((pc_party.members[_local5].charname + " holds ") + pc_party.members[_local5].genderPossessive()) + " nose.\n'I suppose they won't smell any better after we kill them..'"));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (pc_party.members[_local5].charname + " sighs.\n'More things that want to eat me.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (((("'Religious types,' mutters " + pc_party.members[_local5].charname) + ", rolling ") + pc_party.members[_local5].genderPossessive()) + " eyes."));
_local6 = 0;
while (_local6 < pc_party.members.length) {
if ((pc_party.members[_local6] is PC_Cleric)){
_local3 = (_local3 + (((("\n\n" + pc_party.members[_local6].charname) + " glares at ") + pc_party.members[_local5].charname) + "."));
break;
};
_local6++;
};
};
};
};
};
};
} else {
if ((pc_party.members[_local5] is PC_Mage)){
if (_local2){
_local3 = (_local3 + (pc_party.members[_local5].charname + " finishes an incantation.\n'I am prepared.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (pc_party.members[_local5].charname + " frowns.\n'The spawn of the dark arts. Despicable.'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (pc_party.members[_local5].charname + " nods.\n'Communers with spirits and petty dabblers in the art. Precious\nlittle here to challenge me.'"));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (((pc_party.members[_local5].charname + " snaps shut ") + pc_party.members[_local5].genderPossessive()) + " spellbook.\n'Monsters and aberrations. I have some experience with their ilk.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'Meddlers! Fools!' rages " + pc_party.members[_local5].charname) + ".\n'They cannot begin to comprehend the forces they toy with.'"));
};
};
};
};
};
} else {
if ((pc_party.members[_local5] is PC_Ranger)){
if (_local2){
_local3 = (_local3 + (pc_party.members[_local5].charname + " smiles.\n'Easy prey.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (pc_party.members[_local5].charname + " nocks an arrow.\n'Unnatural foes, but they shall fall all the same.'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (pc_party.members[_local5].charname + " appears disappointed.\n'Savages. They lack all finesse.'"));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (((pc_party.members[_local5].charname + " tests ") + pc_party.members[_local5].genderPossessive()) + " bowstring.\n'At last, worthy prey.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'Perhaps here I can find a fresh challenge,' remarks " + pc_party.members[_local5].charname) + "."));
};
};
};
};
};
} else {
_local3 = (_local3 + (((pc_party.members[_local5].charname + " says 'We will defeat the ") + Horde.nameForRace(_arg1)) + ".'"));
};
};
};
};
};
return (_local3);
}
function TestForAdjacentCorridorV(_arg1:DungeonRoom):Boolean{
if (_arg1 == null){
return (false);
};
if ((_arg1 is rCorridorV)){
return (true);
};
return (false);
}
private function initGrid():void{
var _local1:*;
var _local2:*;
grid = new Array(grid_width);
_local1 = 0;
while (_local1 < grid_width) {
grid[_local1] = new Array(grid_height);
_local2 = 0;
while (_local2 < grid_height) {
grid[_local1][_local2] = null;
_local2++;
};
_local1++;
};
}
public function updateChars():void{
var _local1:*;
var _local2:*;
updateCleared();
updateInventoryCount();
_local2 = 0;
while (_local2 < pc_party.members.length) {
_local1 = dinterface.getChildByName(("char" + (_local2 + 1)));
if ((((_local1 == null)) || (!((_local1 is CharacterPortrait))))){
} else {
CharacterPortrait(_local1).updateBars();
CharacterPortrait(_local1).setGlow();
CharacterPortrait(_local1).setHiding((pc_party.sneaking > 0));
};
_local2++;
};
if (parent != null){
DungeonMain(parent).saveParty();
DungeonMain(parent).saveChars();
};
}
function TestForAdjacentCorridorH(_arg1:DungeonRoom):Boolean{
if (_arg1 == null){
return (false);
};
if ((_arg1 is rCorridorH)){
return (true);
};
return (false);
}
private function updateCleared():void{
var _local1:int;
var _local2:*;
_local1 = getClearedPercent();
dinterface.cleared_bar.label.text = ((" " + String(_local1)) + "% CLEARED");
dinterface.cleared_bar.bar_mask.width = Math.ceil(((_local1 / 100) * bar_max_width));
_local2 = "normal";
if (_local1 == 100){
_local2 = "complete";
};
dinterface.cleared_bar.holder.gotoAndStop(_local2);
}
private function GenerateMonsters():void{
var _local1:DungeonRoom;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:Array;
var _local6:*;
var _local7:*;
_local2 = 0;
if (DungeonMain.nobaddies){
return;
};
_local3 = 10;
_local4 = 0;
if (dungeon_level != DungeonMain.MAX_LEVEL){
_local7 = getLargestEmptyRoom();
addHordeToRoom(_local7, true);
bossRoom = _local7;
_local4++;
} else {
_local3--;
};
_local5 = getRandomRoomList(true);
_local6 = 0;
for (;_local6 < _local5.length;_local6++) {
if (roomValidForMonster(_local5[_local6])){
addHordeToRoom(_local5[_local6]);
_local4++;
} else {
continue;
};
if (_local4 >= _local3){
break;
};
};
}
public function createFromDataArray(_arg1:Array, _arg2:int, _arg3:Array, _arg4:Boolean=false):Boolean{
var _local5:*;
var _local6:DungeonRoom;
var _local7:*;
var _local8:Horde;
this.race = race;
this.tileset = tileset;
this.previousLevelCleared = _arg4;
initGrid();
initRoomArrays();
_local5 = 0;
while (_local5 < _arg1.length) {
_local6 = DungeonRoomData(_arg1[_local5]).toRoom(_arg4);
PlaceRoom(_local6);
if ((_local6 is rDemonRoom)){
bossRoom = _local6;
};
if (_arg1[_local5].treasure){
addTreasureToRoom(_local6);
} else {
if (_arg1[_local5].shrine){
addShrineToRoom(_local6);
} else {
_local7 = 0;
while (_local7 < _arg3.length) {
if (HordeData(_arg3[_local7]).roomIndex == _local5){
_local8 = HordeData(_arg3[_local7]).toHorde();
room_array[_local5].setHorde(_local8);
hordes.push(_local8);
_local8.mask = null;
if (_local8.boss){
bossRoom = _local6;
};
break;
};
_local7++;
};
};
};
_local5++;
};
TestAllRoomEdges();
generateDoors();
_local5 = 0;
while (_local5 < room_array.length) {
if (_arg1[_local5].isEntrance){
room_array[_local5].addEntrance(_arg4);
entryRoom = room_array[_local5];
} else {
if (_arg1[_local5].isExit){
room_array[_local5].addExit();
exitRoom = room_array[_local5];
};
};
_local5++;
};
drawRooms();
drawDoors();
currentRoom = room_array[_arg2];
currentRoom.travelTo(true);
roomHighlights();
updateDemonRoom();
if (((previousLevelCleared) || ((dungeon_level == 10)))){
addRestButton();
} else {
removeRestButton();
};
return (true);
}
public function cleanup():void{
var _local1:*;
var _local2:*;
dinterface.explore_btn.removeEventListener(MouseEvent.MOUSE_DOWN, exploreAll);
dinterface.newdungeon_btn.removeEventListener(MouseEvent.MOUSE_DOWN, newDungeonClick);
dinterface.clear_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clearHordes);
dinterface.gear_btn.removeEventListener(MouseEvent.MOUSE_DOWN, addDebugGear);
dinterface.heal_btn.removeEventListener(MouseEvent.MOUSE_DOWN, debugHeal);
dinterface.rating_btn.removeEventListener(MouseEvent.MOUSE_DOWN, ratingClick);
dinterface.maxgames_btn.addEventListener(MouseEvent.MOUSE_DOWN, linkClick);
dinterface.inventory_btn.removeEventListener(MouseEvent.MOUSE_DOWN, inventoryClick);
dinterface.menu_btn.removeEventListener(MouseEvent.MOUSE_DOWN, menuClick);
dinterface.hint_btn.removeEventListener(MouseEvent.MOUSE_DOWN, hintClick);
dinterface.descend_button.removeEventListener(MouseEvent.MOUSE_DOWN, descendClick);
dinterface.rest_button.removeEventListener(MouseEvent.MOUSE_DOWN, restButtonClick);
this.removeEventListener(Event.ADDED_TO_STAGE, added);
this.removeEventListener(Event.REMOVED_FROM_STAGE, removed);
dinterface.help_btn.cleanup();
dinterface.sound_btn.cleanup();
_local1 = 0;
while (_local1 < pc_party.members.length) {
_local2 = dinterface.getChildByName(("char" + (_local1 + 1)));
if (_local2 != null){
_local2.removeEventListener(MouseEvent.MOUSE_DOWN, portraitClick);
};
_local1++;
};
_local1 = 0;
while (_local1 < hordes.length) {
hordes[_local1].cleanup();
_local1++;
};
if (currentRoom != null){
currentRoom.travelFrom();
};
}
private function clearHordes(_arg1:MouseEvent=null):void{
var _local2:*;
if (!DungeonMain.debug){
return;
};
_local2 = 0;
while (_local2 < hordes.length) {
hordes[_local2].fade();
_local2++;
};
hordeDefeated(null);
}
private function showDescendDialog():void{
var _local1:*;
if (getChildByName("downlevel_dlg") == null){
_local1 = new DownLevelDialog();
_local1.name = "downlevel_dlg";
addChild(_local1);
};
}
private function newDungeonClick(_arg1:MouseEvent):void{
DungeonMain(parent).NewDungeonClick(_arg1);
}
public function descend():void{
if (parent != null){
DungeonMain(parent).descendClick(null);
};
}
function CloseTreasureReport(){
var _local1:*;
_local1 = getChildByName("treasure_report");
if (_local1 != null){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, treasureReportKeyDown);
if (_local1.chest != null){
if (!_local1.chest.looted){
_local1.chest.fade();
};
};
_local1.take_btn.removeEventListener(MouseEvent.MOUSE_DOWN, treasureTakeClick);
_local1.discard_btn.removeEventListener(MouseEvent.MOUSE_DOWN, treasureDiscardClick);
_local1.cleanup();
removeChild(_local1);
_local1 = null;
};
if (parent != null){
DungeonMain(parent).saveInventory();
DungeonMain(parent).saveDungeon();
};
updateInventoryCount();
}
private function checkFootprintEmpty(_arg1:DungeonRoom):Boolean{
var _local2:*;
var _local3:*;
_local2 = 0;
while (_local2 < _arg1.getGridWidth()) {
_local3 = 0;
while (_local3 < _arg1.getGridHeight()) {
if (((((_arg1.grid_x + _local2) >= grid_width)) || (((_arg1.grid_y + _local3) >= grid_height)))){
return (false);
};
if (grid[(_arg1.grid_x + _local2)][(_arg1.grid_y + _local3)] != null){
return (false);
};
_local3++;
};
_local2++;
};
return (true);
}
private function getRandomRoomListIncreasingSize(_arg1:Boolean=false):Array{
var _local2:Array;
_local2 = new Array();
if (_arg1){
_local2 = dm.joinArrays(_local2, dm.shuffleArray(a_corridors));
};
_local2 = dm.joinArrays(_local2, dm.shuffleArray(a_cells));
_local2 = dm.joinArrays(_local2, dm.shuffleArray(a_chambers));
_local2 = dm.joinArrays(_local2, dm.shuffleArray(a_widerooms));
_local2 = dm.joinArrays(_local2, dm.shuffleArray(a_tallrooms));
_local2 = dm.joinArrays(_local2, dm.shuffleArray(a_galleries));
_local2 = dm.joinArrays(_local2, dm.shuffleArray(a_largerooms));
return (_local2);
}
function portraitClick(_arg1:MouseEvent):void{
var _local2:*;
if (_arg1.currentTarget == null){
return;
};
if (!(_arg1.currentTarget is CharacterPortrait)){
return;
};
_local2 = PlayerCharacter(CharacterPortrait(_arg1.currentTarget).char_ref);
dm.main.goToInventory(_local2);
}
private function RemoveUselessCorridors():Boolean{
var _local1:*;
var _local2:*;
_local1 = false;
_local2 = 0;
while (_local2 < room_array.length) {
if ((((room_array[_local2] is DungeonCorridor)) && ((room_array[_local2].num_adjacent == 1)))){
if (room_array[_local2].getChildByName("entrance") != null){
} else {
if (room_array[_local2].getChildByName("exit") != null){
} else {
DeleteRoom(_local2);
_local1 = true;
};
};
};
_local2++;
};
return (_local1);
}
private function isValidEntryPoint(_arg1:DungeonRoom):Boolean{
if (_arg1 == null){
return (false);
};
if ((((_arg1 is DungeonCorridor)) && ((_arg1.num_adjacent > 1)))){
return (false);
};
return (true);
}
function debugHeal(_arg1:MouseEvent):void{
pc_party.fullRecovery();
updateChars();
}
private function findEntryPoint():DungeonRoom{
var _local1:*;
_local1 = 0;
_local1 = 0;
while (_local1 < a_corridors.length) {
if (!isValidEntryPoint(a_corridors[_local1])){
} else {
if (a_corridors[_local1].num_adjacent == 1){
return (a_corridors[_local1]);
};
};
_local1++;
};
return (null);
}
function addDebugGear(_arg1:MouseEvent):void{
var _local2:Item;
if (DungeonMain.debug == false){
return;
};
while (pc_party.inventory.length < Party.MAX_INVENTORY) {
_local2 = TreasureChest.getItem(dungeon_level, dm.randomNum(0, 4));
if (TreasureChest.testItemSuitable(_local2, pc_party)){
pc_party.addToInventory(_local2);
};
};
updateInventoryCount();
}
private function addCorridorConnection(_arg1:DungeonRoom, _arg2:DungeonRoom):void{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local5 = 0;
_local6 = 0;
_local7 = false;
if (isExistingRoomConnection(_arg1, _arg2)){
return;
};
if ((_arg1 is rCorridorV)){
if ((_arg2 is rCorridorV)){
_local7 = true;
_local5 = _arg1.x;
_local6 = Math.max(_arg1.y, _arg2.y);
newCorridorConnection(_local7, _local5, _local6, _arg1, _arg2);
} else {
if ((_arg2 is rCorridorH)){
if (_arg2.y < _arg1.y){
_local7 = true;
} else {
if (Math.abs((_arg1.y - _arg2.y)) >= 40){
_local7 = true;
} else {
_local7 = false;
};
};
_local5 = Math.max(_arg1.x, _arg2.x);
_local6 = Math.max(_arg1.y, _arg2.y);
newCorridorConnection(_local7, _local5, _local6, _arg1, _arg2);
};
};
} else {
if ((_arg2 is rCorridorH)){
_local7 = false;
_local5 = Math.max(_arg1.x, _arg2.x);
_local6 = _arg1.y;
newCorridorConnection(_local7, _local5, _local6, _arg1, _arg2);
};
};
}
private function ValidateDungeonLayout(_arg1:Boolean=false):Boolean{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:Array;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
_local2 = 0;
_local3 = 0;
_local4 = false;
_local5 = 0;
_local6 = new Array();
_local7 = 0;
_local8 = 0;
_local3 = 0;
while (_local3 < room_array.length) {
room_array[_local3].validate_id = -1;
_local3++;
};
while ((((_local5 < room_array.length)) && ((_local2 < room_array.length)))) {
if (room_array[_local2].validate_id > -1){
_local2++;
} else {
_local6[_local8] = room_array[_local2].validate(_local8);
_local5 = (_local5 + _local6[_local8]);
if (_local6[_local8] > _local6[_local7]){
_local7 = _local8;
};
_local8++;
_local2++;
};
};
_local3 = 0;
for (;_local3 < room_array.length;_local3++) {
if (room_array[_local3].validate_id != _local7){
if ((((dungeon_level == DungeonMain.MAX_LEVEL)) && ((room_array[_local3] == bossRoom)))){
room_array.length = 0;
return (true);
};
DeleteRoom(_local3);
_local3--;
_local4 = true;
continue;
} else {
if (_arg1){
if ((((room_array[_local3] is DungeonCorridor)) && ((room_array[_local3].num_adjacent == 1)))){
DeleteRoom(_local3);
_local3--;
_local4 = true;
continue;
};
} else {
if ((((((room_array[_local3] is DungeonCorridor)) && ((room_array[_local3].num_adjacent == 1)))) && (!((room_array[_local3].adjacent[0] is DungeonCorridor))))){
_local9 = room_array[_local3].adjacent[0];
_local10 = room_array[_local3].grid_x;
_local11 = room_array[_local3].grid_y;
if ((room_array[_local3] is rCorridorH)){
if ((((getRoomAtGridPos(_local10, (_local11 - 1)) == _local9)) || ((getRoomAtGridPos((_local10 + 1), (_local11 - 1)) == _local9)))){
DeleteRoom(_local3);
_local3--;
_local4 = true;
continue;
};
if ((((getRoomAtGridPos(_local10, (_local11 + 1)) == _local9)) || ((getRoomAtGridPos((_local10 + 1), (_local11 + 1)) == _local9)))){
DeleteRoom(_local3);
_local3--;
_local4 = true;
continue;
};
} else {
if ((room_array[_local3] is rCorridorV)){
if ((((getRoomAtGridPos((_local10 - 1), _local11) == _local9)) && ((getRoomAtGridPos((_local10 - 1), (_local11 + 1)) == _local9)))){
DeleteRoom(_local3);
_local3--;
_local4 = true;
} else {
if ((((getRoomAtGridPos((_local10 + 1), _local11) == _local9)) && ((getRoomAtGridPos((_local10 + 1), (_local11 + 1)) == _local9)))){
DeleteRoom(_local3);
_local3--;
_local4 = true;
continue;
};
};
};
};
};
};
};
};
return (_local4);
}
private function pointlessBusyWork():void{
}
function GoToInventory():void{
CloseTreasureReport();
dm.main.InventoryClick(null);
}
private function descendClick(_arg1:MouseEvent):void{
showDescendDialog();
}
function added(_arg1:Event):void{
stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
if (hint != null){
stage.addChild(hint);
hint = null;
};
}
private function getRandomRoomList(_arg1:Boolean=false):Array{
var _local2:Array;
_local2 = new Array();
_local2 = dm.joinArrays(_local2, a_largerooms);
_local2 = dm.joinArrays(_local2, a_galleries);
_local2 = dm.joinArrays(_local2, a_widerooms);
_local2 = dm.joinArrays(_local2, a_tallrooms);
_local2 = dm.joinArrays(_local2, a_chambers);
_local2 = dm.joinArrays(_local2, a_cells);
if (_arg1){
_local2 = dm.joinArrays(_local2, a_corridors);
};
return (dm.shuffleArray(_local2));
}
function restButtonClick(_arg1:MouseEvent):void{
showRestDialog();
}
public function retreatFromMonsters(_arg1:Horde):void{
var _local2:*;
if (_arg1 != null){
_arg1.gotoAndStop("normal");
};
_local2 = 0;
while (_local2 < DungeonRoom.max_adjacent) {
if (currentRoom.adjacent[_local2] == currentRoom){
} else {
if (currentRoom.adjacent[_local2] == null){
} else {
if (currentRoom.adjacent[_local2].explored){
currentRoom.travelFrom();
currentRoom.adjacent[_local2].travelTo();
currentRoom = currentRoom.adjacent[_local2];
roomHighlights();
return;
};
};
};
_local2++;
};
}
private function getHordesDefeated():int{
var _local1:*;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < hordes.length) {
if (hordes[_local2].defeated){
_local1++;
};
_local2++;
};
return (_local1);
}
private function showRestDialog():void{
var _local1:*;
if (!previousLevelCleared){
return;
};
if (this.getChildByName("rest_dlg") == null){
_local1 = new RestDialog();
_local1.name = "rest_dlg";
this.addChild(_local1);
};
}
private function initRoomArrays():void{
a_corridors = new Array();
a_cells = new Array();
a_chambers = new Array();
a_largerooms = new Array();
a_galleries = new Array();
a_tallrooms = new Array();
a_widerooms = new Array();
}
private function addShrineToRoom(_arg1:DungeonRoom):void{
var _local2:*;
_local2 = new RecoveryShrine();
_local2.x = _arg1.getCenterHorz();
_local2.y = _arg1.getCenterVert();
_arg1.shrine = _local2;
_local2.room = _arg1;
_arg1.setChild(_local2);
shrines.push(_local2);
_local2.mask = null;
}
private function getRoomAtGridPos(_arg1:int, _arg2:int):DungeonRoom{
if (_arg1 >= grid_width){
return (null);
};
if (_arg2 >= grid_height){
return (null);
};
if (_arg1 < 0){
return (null);
};
if (_arg2 < 0){
return (null);
};
return (DungeonRoom(grid[_arg1][_arg2]));
}
private function encounter(_arg1:DungeonRoom):void{
var _local2:*;
var _local3:*;
var _local4:*;
if (_arg1.isEntrance){
_local2 = _arg1.getEntrance();
if (_local2 == null){
return;
};
if (_local2.enableRest){
showRestDialog();
};
} else {
if (_arg1.isExit){
foundExit();
showDescendDialog();
} else {
if (_arg1.horde != null){
if (_arg1.horde.defeated){
return;
};
if (pc_party.sneaking){
pc_party.sneaking = 1;
return;
};
_local3 = stage.getChildByName("tooltip_horde");
if (_local3 != null){
stage.removeChild(_local3);
};
enterBattle(_arg1.horde);
} else {
if (_arg1.treasure != null){
addTreasureReport(_arg1.treasure);
} else {
if (_arg1.shrine != null){
if (_arg1.shrine.used){
return;
};
if (getChildByName("shrine_dlg") == null){
_local4 = new ShrineUseDialog();
_local4.name = "shrine_dlg";
addChild(_local4);
};
};
};
};
};
};
}
private function refreshRoomArrays():void{
var _local1:*;
initRoomArrays();
_local1 = 0;
while (_local1 < room_array.length) {
addRoomToTypeArray(DungeonRoom(room_array[_local1]));
_local1++;
};
}
public function hordeDefeated(_arg1:Horde):void{
updateCleared();
updateDemonRoom();
}
function hintClick(_arg1:Event):void{
var _local2:*;
_local2 = 0;
while (_local2 < room_array.length) {
if (room_array[_local2].explored){
} else {
if (room_array[_local2].seen){
room_array[_local2].hintFlash();
};
};
_local2++;
};
}
function treasureTakeClick(_arg1:MouseEvent){
var _local2:TreasureReport;
var _local3:*;
_local2 = TreasureReport(getChildByName("treasure_report"));
if (_local2 == null){
return;
};
_local3 = 0;
while (_local3 < _local2.icons.length) {
if (_local2.icons[_local3].taking){
pc_party.addToInventory(_local2.icons[_local3].item_ref);
};
_local3++;
};
CloseTreasureReport();
dm.sound.play(SoundControl.lootItem);
if (DungeonMain.MEEZ){
dm.MeezGPF.emote(7);
};
if (pc_party.overflow.length){
GoToInventory();
};
}
private function findExitPoint(_arg1:DungeonRoom):DungeonRoom{
var _local2:Array;
var _local3:*;
_local2 = getRandomRoomListIncreasingSize(true);
_local3 = 0;
while (_local3 < _local2.length) {
if (!isRoomValidExit(_local2[_local3], _arg1)){
} else {
if (_local2[_local3].num_adjacent == 1){
return (_local2[_local3]);
};
};
_local3++;
};
return (null);
}
private function roomValidForShrine(_arg1:DungeonRoom):Boolean{
var _local2 = ??pushnamespace
;
var _local3:*;
var _local4:*;
if (_arg1 == null){
return (false);
};
if (_arg1.horde != null){
return (false);
};
if (_arg1.treasure != null){
return (false);
};
if (_arg1.shrine != null){
return (false);
};
if (_arg1.isExit){
return (false);
};
if (_arg1.isEntrance){
return (false);
};
if ((_arg1 is DungeonCorridor)){
return (false);
};
if ((_arg1 is rCell)){
return (false);
};
_local2 = 5;
_local3 = 0;
for (;_local3 < shrines.length;_local3++) {
if (shrines[_local3].room == null){
continue;
} else {
_local4 = shrines[_local3].room;
};
if (Math.abs((_arg1.grid_x - _local4.grid_x)) < _local2){
return (false);
};
if (Math.abs((_arg1.grid_y - _local4.grid_y)) < _local2){
return (false);
};
};
return (true);
}
private function GenerateTreasure():void{
var _local1 = ??pushnamespace
;
var _local2:*;
var _local3:Array;
var _local4:*;
var _local5:*;
var _local6:DungeonRoom;
_local1 = 30;
_local2 = Math.max(8, Math.round((getRoomCount() * (_local1 / 100))));
_local3 = getRandomRoomList(false);
_local4 = 0;
_local5 = 0;
while (_local5 < _local3.length) {
_local6 = _local3[_local5];
if (((_local6.isExit) || (_local6.isEntrance))){
} else {
if (_local6.horde != null){
} else {
if (_local6.shrine != null){
} else {
if (_local6.treasure != null){
} else {
addTreasureToRoom(_local6);
++_local4;
if (_local4 >= _local2){
break;
};
};
};
};
};
_local5++;
};
}
function treasureReportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
treasureTakeClick(null);
} else {
if (_arg1.keyCode == Keyboard.ESCAPE){
treasureDiscardClick(null);
};
};
}
private function debugReport(_arg1:MouseEvent):void{
var _local2:DungeonRoom;
_local2 = currentRoom;
if (_local2 == null){
return;
};
if ((((((_local2 is DungeonCorridor)) && ((_local2.num_adjacent == 1)))) && (!((_local2.adjacent[0] is DungeonCorridor))))){
};
}
private function menuClick(_arg1:MouseEvent):void{
if (parent != null){
DungeonMain(parent).dungeonMenuClick(_arg1);
};
}
function roomClick(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
if (pc_party.overflow.length){
_local2 = new WarningDialog("You are carrying too many items. You must enter the Inventory screen and discard some.");
this.addChild(_local2);
return;
};
currentRoom.travelFrom();
if (pc_party.sneaking == 1){
pc_party.sneaking = 0;
_local3 = 0;
while (_local3 < pc_party.members.length) {
_local4 = dinterface.getChildByName(("char" + (_local3 + 1)));
if ((((_local4 == null)) || (!((_local4 is CharacterPortrait))))){
} else {
_local4.setHiding((pc_party.sneaking > 0));
};
_local3++;
};
};
currentRoom = DungeonRoom(_arg1.currentTarget);
if (currentRoom.travelTo()){
roomHighlights();
encounter(currentRoom);
} else {
roomHighlights();
};
if (((DungeonMain.showHints) && ((hintShown(hintHorde) == false)))){
_local5 = false;
_local6 = 0;
while (_local6 < currentRoom.num_adjacent) {
if (((!((currentRoom.adjacent[_local6].horde == null))) && (!(currentRoom.adjacent[_local6].horde.defeated)))){
_local5 = true;
break;
};
_local6++;
};
if (_local5){
_local7 = new HintDialog("Lurking Monsters", "There are enemies nearby, as indicated by the crossed swords icon. Move the mouse over the icon to see their type and number. Entering that room will trigger a battle.\n\nYou do not need to kill every monster in the dungeon, but doing so earns rewards. Defeated monsters will always drop treasure items.\n\nBeware of 'Leader' monsters, indicated by golden swords. They are significantly stronger than regular monsters, but defeating them yields a powerful item.\n\nUse a 'Scroll of Deception' (check Inventory) to sneak past monsters you cannot defeat yet.");
DungeonMain.hints = (DungeonMain.hints + hintHorde);
stage.addChild(_local7);
DungeonMain(parent).saveInterface();
};
};
}
private function TestAllRoomEdges(){
var _local1:*;
ClearAllRoomEdges();
_local1 = 0;
while (_local1 < room_array.length) {
if (room_array[_local1] == null){
} else {
if (room_array[_local1].num_adjacent == DungeonRoom.max_adjacent){
} else {
TestRoomEdges(_local1);
};
};
_local1++;
};
specialEdgeTests();
}
public function roomHighlights(){
var _local1:int;
var _local2:int;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
_local1 = 0;
_local2 = 0;
_local3 = 0;
while (_local3 < room_array.length) {
if (room_array[_local3] == null){
} else {
if (room_array[_local3].explored){
room_array[_local3].setAlpha(0.3);
_local2++;
} else {
if (room_array[_local3].seen){
room_array[_local3].setAlpha(0.2);
} else {
room_array[_local3].setAlpha(0);
};
};
};
_local3++;
};
currentRoom.setAlpha(1);
if (currentRoomIcon == null){
currentRoomIcon = new CurrentRoomIcon();
};
if (currentRoomIcon.parent != null){
currentRoomIcon.parent.removeChild(currentRoomIcon);
};
currentRoomIcon.x = currentRoom.getCenterHorz();
currentRoomIcon.y = currentRoom.getCenterVert();
currentRoomIcon.width = ((currentRoom.getGridWidth() * GRID_SIZE) - 4);
currentRoomIcon.height = ((currentRoom.getGridHeight() * GRID_SIZE) - 4);
if (currentRoom.hasSpecial()){
currentRoom.addChildAt(currentRoomIcon, (currentRoom.numChildren - 2));
} else {
currentRoom.addChild(currentRoomIcon);
};
_local4 = 0;
while (_local4 < currentRoom.num_adjacent) {
currentRoom.adjacent[_local4].setAlpha(0.6);
_local4++;
};
_local5 = 0;
while (_local5 < door_array.length) {
if (((DungeonRoom(door_array[_local5].room1).seen) && (DungeonRoom(door_array[_local5].room2).seen))){
_local7 = door_array[_local5].room1.getAlpha();
_local8 = door_array[_local5].room2.getAlpha();
if ((((door_array[_local5] is CorridorConnectorH)) || ((door_array[_local5] is CorridorConnectorV)))){
door_array[_local5].setAlpha(Math.min(_local7, _local8));
} else {
door_array[_local5].setAlpha(((_local7 + _local8) / 2));
};
} else {
door_array[_local5].setAlpha(0);
};
_local5++;
};
_local1 = Math.round(((_local2 / room_array.length) * 100));
dinterface.explored_bar.label.text = (("EXPLORED " + String(_local1)) + "% ");
dinterface.explored_bar.bar_mask.width = Math.ceil(((_local1 / 100) * bar_max_width));
_local6 = "normal";
if (_local1 == 100){
_local6 = "complete";
};
dinterface.explored_bar.holder.gotoAndStop(_local6);
updateCleared();
updateDemonRoom();
if (parent != null){
dm.main.saveParty();
dm.main.saveDungeon();
};
}
private function GenerateShrines():void{
var _local1:*;
var _local2:Array;
var _local3:*;
var _local4:*;
_local1 = dmf.randomNum(1, 2);
_local2 = getRandomRoomList(false);
_local3 = 0;
_local4 = 0;
for (;_local4 < _local2.length;_local4++) {
if (roomValidForShrine(_local2[_local4])){
addShrineToRoom(_local2[_local4]);
_local3++;
} else {
continue;
};
if (_local3 >= _local1){
break;
};
};
}
private function DeleteRoom(_arg1:int){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
if (_arg1 >= room_array.length){
return;
};
if (_arg1 < 0){
return;
};
if (room_array[_arg1] != null){
_local2 = room_array[_arg1].grid_x;
_local3 = room_array[_arg1].grid_y;
_local4 = 0;
while (_local4 < room_array[_arg1].getGridWidth()) {
_local6 = 0;
while (_local6 < room_array[_arg1].getGridHeight()) {
grid[(_local2 + _local4)][(_local3 + _local6)] = null;
_local6++;
};
_local4++;
};
_local5 = 0;
while (_local5 < room_array[_arg1].num_adjacent) {
DungeonRoom(room_array[_arg1]).setNotAdjacentTo(room_array[_arg1].adjacent[_local5]);
_local5++;
};
};
room_array.splice(_arg1, 1);
}
private function isRoomValidExit(_arg1:DungeonRoom, _arg2:DungeonRoom):Boolean{
var _local3 = ??pushnamespace
;
_local3 = 6;
if (_arg1 == null){
return (false);
};
if (_arg1 == _arg2){
return (false);
};
if (Math.abs((_arg1.grid_x - _arg2.grid_x)) < _local3){
return (false);
};
if (Math.abs((_arg1.grid_y - _arg2.grid_y)) < _local3){
return (false);
};
if ((((_arg1 is DungeonCorridor)) && ((_arg1.num_adjacent > 1)))){
return (false);
};
return (true);
}
private function demonSpawnCheck():Boolean{
if (((!((bossRoom == null))) && (!((bossRoom.horde == null))))){
return (false);
};
if (getHordesDefeated() == hordes.length){
return (true);
};
return (false);
}
private function roomValidForMonster(_arg1:DungeonRoom):Boolean{
var _local2:*;
if (_arg1 == null){
return (false);
};
if (_arg1.horde != null){
return (false);
};
if (_arg1.shrine != null){
return (false);
};
if (_arg1.treasure != null){
return (false);
};
if (_arg1.isExit){
return (false);
};
if (_arg1.isEntrance){
return (false);
};
if ((_arg1 is DungeonCorridor)){
if (DungeonMain.RandomNum(0, 1000) < 700){
return (false);
};
};
_local2 = 0;
while (_local2 < DungeonRoom.max_adjacent) {
if (_arg1.adjacent[_local2] == null){
} else {
if (_arg1.adjacent[_local2] == _arg1){
} else {
if (_arg1.adjacent[_local2].horde != null){
return (false);
};
if (_arg1.adjacent[_local2].isEntrance){
return (false);
};
};
};
_local2++;
};
return (true);
}
private function fillGridForRoom(_arg1:DungeonRoom):void{
var _local2:*;
var _local3:*;
_local2 = 0;
while (_local2 < _arg1.getGridWidth()) {
_local3 = 0;
while (_local3 < _arg1.getGridHeight()) {
grid[(_arg1.grid_x + _local2)][(_arg1.grid_y + _local3)] = _arg1;
_local3++;
};
_local2++;
};
}
public function generateDungeon():Boolean{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:DungeonRoom;
var _local13:*;
var _local14:*;
var _local15:*;
var _local16:*;
var _local17:*;
var _local18:*;
room_array = new Array();
door_array = new Array();
bossRoom = null;
currentRoom = null;
entryRoom = null;
exitRoom = null;
initGrid();
initRoomArrays();
_local8 = false;
_local9 = 0;
_local10 = 0;
if (dungeon_level == DungeonMain.MAX_LEVEL){
_local12 = new rDemonRoom();
_local14 = ((grid_width - _local12.getGridWidth()) / 2);
_local15 = ((grid_height - _local12.getGridHeight()) / 2);
_local12.grid_x = dm.randomNum((_local14 - 2), (_local14 + 2));
_local12.grid_y = dm.randomNum((_local15 - 2), (_local15 + 2));
PlaceRoom(_local12);
bossRoom = _local12;
};
_local1 = 0;
while (_local1 < grid_width) {
_local2 = 0;
while (_local2 < grid_height) {
if (grid[_local1][_local2] != null){
} else {
if (dm.randomNum(1, 100) > 50){
_local16 = dm.randomNum(0, 100);
_local17 = (a_corridors.length > Math.round((room_array.length / 2)));
if ((((_local17 == false)) && ((_local16 > 70)))){
if (dm.randomNum(1, 100) > 50){
_local8 = false;
} else {
_local8 = true;
};
if (_local8){
_local12 = new rCorridorV();
} else {
_local12 = new rCorridorH();
};
_local12.grid_x = _local1;
_local12.grid_y = _local2;
PlaceCorridor(DungeonCorridor(_local12), true);
} else {
if (_local16 > 65){
_local12 = new rCell();
} else {
if (_local16 > 50){
_local12 = new rChamber();
} else {
if (_local16 > 35){
_local12 = new rTallRoom();
} else {
if (_local16 > 20){
_local12 = new rWideRoom();
} else {
if (_local16 > 10){
_local12 = new rLargeRoom();
} else {
_local12 = new rGallery();
};
};
};
};
};
_local12.grid_x = _local1;
_local12.grid_y = _local2;
PlaceRoom(_local12);
};
};
};
_local2++;
};
_local1++;
};
if (isDungeonTooSmall()){
return (false);
};
TestAllRoomEdges();
_local13 = false;
while (!(_local13)) {
_local18 = ValidateDungeonLayout(false);
if (isDungeonTooSmall()){
return (false);
};
if (_local18){
TestAllRoomEdges();
} else {
_local13 = true;
};
};
refreshRoomArrays();
generateDoors();
entryRoom = findEntryPoint();
if ((((entryRoom == null)) || (!(entryRoom.num_adjacent)))){
return (false);
};
entryRoom.addEntrance(previousLevelCleared);
currentRoom = entryRoom;
if (dungeon_level != DungeonMain.MAX_LEVEL){
exit_found = false;
exitRoom = findExitPoint(entryRoom);
if (exitRoom == null){
return (false);
};
exitRoom.addExit();
};
GenerateShrines();
GenerateTreasure();
GenerateMonsters();
drawRooms();
drawDoors();
pc_party.stat_rooms_total = (pc_party.stat_rooms_total + room_array.length);
currentRoom.travelTo(true);
roomHighlights();
updateDemonRoom();
return (true);
}
private function drawDoors():void{
var _local1:*;
_local1 = 0;
while (_local1 < door_array.length) {
addChild(door_array[_local1]);
_local1++;
};
}
public function addRestButton():void{
if (!dinterface.contains(dinterface.rest_button)){
dinterface.addChild(dinterface.rest_button);
};
}
private function TestRoomEdges(_arg1:int){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
_local2 = 0;
_local3 = 0;
_local5 = room_array[_arg1].getGridWidth();
_local6 = room_array[_arg1].getGridHeight();
_local7 = (room_array[_arg1].grid_x - 1);
_local8 = room_array[_arg1].grid_y;
if ((((_local7 >= 0)) && ((_local8 >= 0)))){
_local2 = 0;
while (_local2 < _local6) {
if (grid[_local7][(_local8 + _local2)] != null){
_local4 = grid[_local7][(_local8 + _local2)];
ConnectRooms(room_array[_arg1], _local4, _arg1);
};
_local2++;
};
};
_local7 = room_array[_arg1].grid_x;
_local8 = (room_array[_arg1].grid_y - 1);
if ((((_local8 >= 0)) && ((_local7 >= 0)))){
_local2 = 0;
while (_local2 < _local5) {
if (grid[(_local7 + _local2)][_local8] != null){
_local4 = grid[(_local7 + _local2)][_local8];
ConnectRooms(room_array[_arg1], _local4, _arg1);
};
_local2++;
};
};
}
private function updateDemonRoom():void{
var _local1:*;
var _local2:*;
if (dungeon_level != DungeonMain.MAX_LEVEL){
return;
};
if (bossRoom == null){
return;
};
if ((bossRoom is rDemonRoom)){
_local1 = (getHordesDefeated() + 1);
_local2 = Math.min((getHordesDefeated() + 1), bossRoom.totalFrames);
if (bossRoom.currentFrame != _local2){
rDemonRoom(bossRoom).toFrame(_local2);
};
if (demonSpawnCheck()){
addHordeToRoom(bossRoom, true);
};
};
}
private function enterBattle(_arg1:Horde):void{
if (dm.main != null){
dm.main.beginBattle(_arg1);
} else {
if (parent != null){
DungeonMain(parent).beginBattle(_arg1);
};
};
}
private function specialEdgeTests():void{
var _local1:*;
var _local2:DungeonCorridor;
var _local3:DungeonRoom;
var _local4:*;
_local1 = 0;
while (_local1 < room_array.length) {
if ((((room_array[_local1] is DungeonCorridor)) && ((room_array[_local1].num_adjacent == 2)))){
_local4 = 0;
while (_local4 < room_array[_local1].num_adjacent) {
if ((room_array[_local1].adjacent[_local4] is DungeonCorridor)){
_local2 = room_array[_local1].adjacent[_local4];
} else {
_local3 = room_array[_local1].adjacent[_local4];
};
_local4++;
};
if (((((!((_local2 == null))) && (!((_local3 == null))))) && (_local2.isAdjacentTo(_local3)))){
room_array[_local1].setNotAdjacentTo(_local3, true);
};
};
_local1++;
};
}
function linkClick(_arg1:MouseEvent):void{
dm.link("http://www.maxgames.com");
}
public function drawMovementArrow(_arg1:DungeonRoom):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:DoorIcon;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
_local2 = 0xFFFFFF;
_local3 = new MovementArrowHead();
if (((((!((_arg1.horde == null))) && (!(_arg1.horde.defeated)))) && (!(pc_party.sneaking)))){
_local2 = 0xFF0000;
_local3.gotoAndStop("red");
} else {
if (!_arg1.explored){
_local2 = 39423;
_local3.gotoAndStop("blue");
} else {
_local2 = 26367;
_local3.gotoAndStop("blue");
};
};
moveArrow = new Sprite();
moveArrow.name = "arrow";
moveArrow.mouseEnabled = false;
moveArrow.mouseChildren = false;
_local4 = (currentRoom.x + Math.round(((currentRoom.getGridWidth() * GRID_SIZE) / 2)));
_local5 = (currentRoom.y + Math.round(((currentRoom.getGridHeight() * GRID_SIZE) / 2)));
_local6 = _local4;
_local7 = _local5;
_local8 = _arg1.findDoorTo(currentRoom);
if (_local8 != null){
if ((((_local8 is CorridorConnectorH)) || ((((_local8 is DoorIcon)) && (!((_local8.rotation == 0))))))){
_local6 = _local8.x;
_local7 = (_local8.y + 10);
} else {
if ((((_local8 is CorridorConnectorV)) || ((((_local8 is DoorIcon)) && ((_local8.rotation == 0)))))){
_local6 = (_local8.x + 10);
_local7 = _local8.y;
} else {
_local6 = (_local8.x + Math.round((_local8.width / 2)));
_local7 = (_local8.y + Math.round((_local8.height / 2)));
};
};
};
_local9 = (_arg1.x + Math.round(((_arg1.getGridWidth() * GRID_SIZE) / 2)));
_local10 = (_arg1.y + Math.round(((_arg1.getGridHeight() * GRID_SIZE) / 2)));
moveArrow.graphics.lineStyle(4, _local2, 0.9);
moveArrow.graphics.moveTo(_local4, _local5);
moveArrow.graphics.lineTo(_local6, _local7);
moveArrow.graphics.lineTo(_local9, _local10);
_local3.x = _local9;
_local3.y = _local10;
_local11 = Math.round(dm.vectors2angle((_local9 - _local6), (_local10 - _local7), 1, 0));
if (_local10 < _local5){
_local11 = -(_local11);
};
_local3.rotation = _local11;
_local12 = this;
moveArrow.addChild(_local3);
_local12.addChild(moveArrow);
dm.childToTop(moveArrow);
}
private function inventoryClick(_arg1:MouseEvent):void{
DungeonMain(parent).InventoryClick(_arg1);
}
public function foundExit():void{
exit_found = true;
dinterface.addChild(dinterface.descend_button);
dinterface.descend_button.addEventListener(MouseEvent.MOUSE_DOWN, descendClick);
}
private function addHordeToRoom(_arg1:DungeonRoom, _arg2:Boolean=false):void{
var _local3:Horde;
_local3 = new Horde(this.race, this.dungeon_level, _arg2, _arg1);
_arg1.setHorde(_local3);
hordes.push(_local3);
_local3.mask = null;
}
private function getLargestEmptyRoom():DungeonRoom{
var _local1:Array;
var _local2:DungeonRoom;
var _local3:int;
var _local4:Array;
var _local5:*;
_local3 = 0;
_local4 = new Array();
_local4 = dm.joinArrays(_local4, dm.shuffleArray(a_largerooms));
_local4 = dm.joinArrays(_local4, dm.shuffleArray(a_galleries));
_local4 = dm.joinArrays(_local4, dm.shuffleArray(a_widerooms));
_local4 = dm.joinArrays(_local4, dm.shuffleArray(a_tallrooms));
_local4 = dm.joinArrays(_local4, dm.shuffleArray(a_chambers));
_local4 = dm.joinArrays(_local4, dm.shuffleArray(a_cells));
_local4 = dm.joinArrays(_local4, dm.shuffleArray(a_corridors));
_local5 = 0;
for (;_local5 < _local4.length;_local5++) {
if (!roomValidForMonster(_local4[_local5])){
continue;
} else {
return (_local4[_local5]);
};
};
return (room_array[0]);
}
public function removeRestButton():void{
if (dinterface.contains(dinterface.rest_button)){
dinterface.removeChild(dinterface.rest_button);
};
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.SPACE){
hintClick(_arg1);
};
}
public function addTreasureReport(_arg1:TreasureChest, _arg2:Boolean=false):void{
var _local3:String;
var _local4:*;
var _local5:*;
if (_arg1.looted){
return;
};
if (_arg2){
_local3 = "drop";
} else {
_local3 = "chest";
};
_local4 = new TreasureReport(_local3);
_local4.name = "treasure_report";
_local4.chest = _arg1;
_local5 = 0;
while (_local5 < _arg1.loot.length) {
_local4.addItemRef(_arg1.loot[_local5]);
_local5++;
};
_local4.take_btn.addEventListener(MouseEvent.MOUSE_DOWN, treasureTakeClick);
_local4.discard_btn.addEventListener(MouseEvent.MOUSE_DOWN, treasureDiscardClick);
stage.addEventListener(KeyboardEvent.KEY_DOWN, treasureReportKeyDown);
addChild(_local4);
_local4.drawIcons();
}
function treasureDiscardClick(_arg1:MouseEvent):void{
CloseTreasureReport();
dm.sound.play(SoundControl.destroyItem);
}
function ratingClick(_arg1:Event):void{
var _local2:*;
_local2 = new RatingDialog(pc_party);
addChild(_local2);
}
private function getClearedPercent():int{
var _local1:*;
var _local2:*;
_local1 = hordes.length;
if (_local1 <= 0){
return (0);
};
_local2 = getHordesDefeated();
return (Math.round(((_local2 / _local1) * 100)));
}
private function PlaceCorridor(_arg1:DungeonCorridor, _arg2:Boolean=false):int{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:DungeonRoom;
var _local7:*;
var _local8:*;
var _local9:Boolean;
var _local10:*;
_local3 = 0;
_local4 = _arg1.grid_x;
_local5 = _arg1.grid_y;
_local7 = (_arg1 is rCorridorV);
_local8 = checkFootprintEmpty(_arg1);
if (!_local8){
return (0);
};
_local9 = false;
if (_local7){
_local3 = 0;
while (_local3 < 2) {
if (((((_local4 - 1) < 0)) || (((_local5 + _local3) >= grid_height)))){
return (0);
};
_local6 = grid[(_local4 - 1)][(_local5 + _local3)];
_local9 = ((_local9) || (TestForAdjacentCorridorV(_local6)));
if (((((_local4 + 1) >= grid_width)) || (((_local5 + _local3) >= grid_height)))){
return (0);
};
_local6 = grid[(_local4 + 1)][(_local5 + _local3)];
_local9 = ((_local9) || (TestForAdjacentCorridorV(_local6)));
_local3++;
};
} else {
_local3 = 0;
while (_local3 < 2) {
if (((((_local4 + _local3) >= grid_width)) || (((_local5 - 1) < 0)))){
return (0);
};
_local6 = grid[(_local4 + _local3)][(_local5 - 1)];
_local9 = ((_local9) || (TestForAdjacentCorridorH(_local6)));
if (((((_local4 + _local3) >= grid_width)) || (((_local5 + 1) >= grid_height)))){
return (0);
};
_local6 = grid[(_local4 + _local3)][(_local5 + 1)];
_local9 = ((_local9) || (TestForAdjacentCorridorH(_local6)));
_local3++;
};
};
if (_local9){
return (0);
};
_arg1.x = (SCREEN_X_OFFSET + (_local4 * GRID_SIZE));
_arg1.y = (SCREEN_Y_OFFSET + (_local5 * GRID_SIZE));
fillGridForRoom(_arg1);
room_array.push(_arg1);
addRoomToTypeArray(_arg1);
_local10 = 1;
if (((_arg2) || ((dm.randomNum(1, 100) > 20)))){
if (_local7){
_local5 = (_local5 + rCorridorV.grid_height);
} else {
_local4 = (_local4 + rCorridorH.grid_width);
};
if (dm.randomNum(1, 100) > 70){
_local7 = !(_local7);
if (!_local7){
_local5 = (_local5 + (rCorridorV.grid_height - 1));
};
};
if (_local7){
_arg1 = new rCorridorV();
} else {
_arg1 = new rCorridorH();
};
_arg1.grid_x = _local4;
_arg1.grid_y = _local5;
_local10 = (_local10 + PlaceCorridor(_arg1, false));
};
return (_local10);
}
public function useRest():void{
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = getChildByName("rest_dlg");
if (_local1 != null){
removeChild(_local1);
};
if (entryRoom == null){
return;
};
_local2 = entryRoom.getEntrance();
if (_local2 == null){
return;
};
_local3 = new RestScreen();
addChild(_local3);
pc_party.fullRecovery();
_local2.enableRest = false;
_local2.removeGlow();
if (DungeonMain.MEEZ){
dm.MeezGPF.emote("asleep01");
};
previousLevelCleared = false;
if (parent != null){
DungeonMain(parent).saveParty();
DungeonMain(parent).saveDungeon();
};
}
public static function hintShown(_arg1:int):Boolean{
return (((DungeonMain.hints & _arg1) == _arg1));
}
public static function getMonsterRace(_arg1:int, _arg2:int):int{
var _local3:Array;
var _local4:*;
if ((_arg1 % DungeonMain.MAX_LEVEL) == 0){
return (Horde.special);
};
if (_arg1 == 1){
return (Horde.undead);
};
_local3 = new Array();
_local4 = 1;
while (_local4 <= 8) {
if ((_arg2 & _local4) != _local4){
_local3.push(_local4);
};
_local4 = (_local4 * 2);
};
if (!_local3.length){
return (Horde.undead);
};
return (_local3[dm.randomNum(0, (_local3.length - 1))]);
}
}
}//package
Section 96
//DungeonCorridor (DungeonCorridor)
package {
public class DungeonCorridor extends DungeonRoom {
public function DungeonCorridor(){
isCorridor = true;
}
}
}//package
Section 97
//DungeonInterface (DungeonInterface)
package {
import flash.text.*;
import flash.display.*;
public dynamic class DungeonInterface extends MovieClip {
public var cleared_bar:ProgressCleared;
public var slot3:EmptyPortrait;
public var level_debug:TextField;
public var slot1:EmptyPortrait;
public var slot4:EmptyPortrait;
public var maxgames_btn:MaxGamesHudButton;
public var sound_btn:SoundButton;
public var slot2:EmptyPortrait;
public var explored_bar:ProgressExplored;
public var help_btn:HelpButton;
public var clear_btn:TextField;
public var descend_button:DownLevelButton;
public var menu_btn:MenuButton;
public var level_label:TextField;
public var heal_btn:TextField;
public var gear_btn:TextField;
public var hint_btn:HintButton;
public var items_label:TextField;
public var explore_btn:TextField;
public var rating_btn:MovieClip;
public var newdungeon_btn:TextField;
public var inventory_btn:CharsButton;
public var rest_button:MovieClip;
}
}//package
Section 98
//DungeonLoading (DungeonLoading)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
import flash.media.*;
public class DungeonLoading extends Sprite {
private var text_contents:String;
var channel:SoundChannel;
public var proceed_btn:ProceedButton;
public var prose:TextField;
var anim_frame:int;// = 0
private var proceed_fn:Function;
public function DungeonLoading(){
anim_frame = 0;
super();
this.addEventListener(Event.REMOVED_FROM_STAGE, removed);
}
function frameAnim(_arg1:Event):void{
var _local2 = ??pushnamespace
;
var _local3:*;
if (anim_frame == 1){
startWriteSound();
};
_local2 = 4;
_local3 = Math.min((_local2 * anim_frame), text_contents.length);
prose.text = text_contents.substr(0, _local3);
if (_local3 >= text_contents.length){
this.removeEventListener(Event.ENTER_FRAME, frameAnim);
endWriteSound();
};
anim_frame++;
}
public function allowProceed():void{
if (!this.contains(proceed_btn)){
addChild(proceed_btn);
};
if (proceed_fn != null){
proceed_btn.addEventListener(MouseEvent.MOUSE_DOWN, proceed_fn);
};
}
function removed(_arg1:Event):void{
this.removeEventListener(Event.REMOVED_FROM_STAGE, removed);
if (proceed_fn != null){
proceed_btn.removeEventListener(MouseEvent.MOUSE_DOWN, proceed_fn);
};
this.removeEventListener(Event.ENTER_FRAME, frameAnim);
endWriteSound();
}
private function startWriteSound():void{
channel = new writing_sound().play(0, 999);
channel.soundTransform = new SoundTransform(SoundControl.volumeSetting);
}
public function setText(_arg1:String):int{
var _local2:*;
text_contents = _arg1;
prose.text = _arg1;
_local2 = prose.textHeight;
prose.text = "";
this.addEventListener(Event.ENTER_FRAME, frameAnim);
return (_local2);
}
private function endWriteSound():void{
if (channel != null){
channel.stop();
};
}
public function setCallback(_arg1:Function):void{
proceed_fn = _arg1;
}
}
}//package
Section 99
//DungeonMain (DungeonMain)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
import meez.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class DungeonMain extends MovieClip {
var dungeon_theme:DungeonMusic;
public var debug_label:TextField;
var so:SharedObject;
var suspendSaving:Boolean;// = false
var infiniteTransition:Boolean;// = false
var dungeonTimer:Timer;
var battle:Battlefield;
var dungeon:Dungeon;
public var constructed:Boolean;// = false
private var initialized:Boolean;// = false
var creation:PartyCreation;
var title_theme:TitleMusic;
var loading:DungeonLoading;
var recent_monsters:uint;// = 0
var inventory:Inventory;
private var battleTimer:Timer;
var battle_theme:BattleMusic;
var level:int;// = 1
var pc_party:Party;
static const skillsUnlocked = false;
static const debugitems = false;
static const debug = false;
static const MEEZ = false;
static const nobaddies = false;
static const KONGREGATE = false;
static const instantKill = false;
static const startAtLevel = 1;
static const APP_WIDTH = 550;
static const MAX_LEVEL = 9;
static const GAME_VERSION = 1.25;
static const APP_HEIGHT = 450;
static const nosaving = false;
static var hints:uint = 0;
static var showHints:Boolean = true;
public function DungeonMain():void{
level = 1;
recent_monsters = 0;
constructed = false;
initialized = false;
infiniteTransition = false;
suspendSaving = false;
super();
addFrameScript(0, frame1);
addEventListener(Event.ADDED, added);
debug_label.text = "Constructing..";
doConstruct();
}
function saveClick(_arg1:MouseEvent):void{
saveAll(false);
}
private function startDungeonTimer():void{
dungeonTimer = new Timer(50, 1);
dungeonTimer.addEventListener(TimerEvent.TIMER_COMPLETE, generateDungeon);
dungeonTimer.start();
}
public function saveInterface():void{
var _local1:SharedObject;
if (nosaving){
return;
};
_local1 = SharedObject.getLocal("interface");
_local1.data.globalVolumeSetting = GlobalVolume.volumeSetting;
_local1.data.sfxVolumeSetting = SoundControl.volumeSetting;
_local1.data.musicVolumeSetting = Music.volumeSetting;
_local1.data.showHints = showHints;
_local1.data.hints = hints;
}
function kLoadComplete(_arg1:Event):void{
dm.kongregate = _arg1.target.content;
dm.kongregate.services.connect();
}
private function endIntro():void{
var _local1:*;
_local1 = getChildByName("intro");
if (_local1 != null){
this.removeChild(_local1);
MaxGamesIntro(_local1).link_btn.removeEventListener(MouseEvent.CLICK, maxGamesClick);
};
}
private function musicTitleTheme():void{
stopMusic();
title_theme = new TitleMusic();
}
public function saveInventory():void{
var _local1:*;
if (((nosaving) || (suspendSaving))){
return;
};
if (so == null){
setSaveSlot();
};
so.data.inventory = new Array(pc_party.inventory.length);
_local1 = 0;
while (_local1 < pc_party.inventory.length) {
so.data.inventory[_local1] = pc_party.inventory[_local1];
_local1++;
};
so.data.overflow = new Array(pc_party.overflow.length);
_local1 = 0;
while (_local1 < pc_party.overflow.length) {
so.data.overflow[_local1] = pc_party.overflow[_local1];
_local1++;
};
}
public function saveChars():void{
var _local1:*;
if (((nosaving) || (suspendSaving))){
return;
};
if (so == null){
setSaveSlot();
};
so.data.char1 = pc_party.members[0];
so.data.char2 = pc_party.members[1];
so.data.char3 = pc_party.members[2];
so.data.char4 = pc_party.members[3];
if (pc_party.members[0] != null){
so.data.char1_skills_active = new Array(10);
so.data.char1_skills_position = new Array(10);
so.data.char1_skills_unlocked = new Array(10);
_local1 = 0;
while (_local1 < pc_party.members[0].skills.length) {
so.data.char1_skills_active[_local1] = pc_party.members[0].skills[_local1].active;
so.data.char1_skills_position[_local1] = pc_party.members[0].skills[_local1].position;
so.data.char1_skills_unlocked[_local1] = pc_party.members[0].skills[_local1].unlocked;
_local1++;
};
so.data.char1_equipment = new Array(Equipment.gearSlots);
_local1 = 0;
while (_local1 < Equipment.gearSlots) {
so.data.char1_equipment[_local1] = pc_party.members[0].gear[_local1];
_local1++;
};
};
if (pc_party.members[1] != null){
so.data.char2_skills_active = new Array(10);
so.data.char2_skills_position = new Array(10);
so.data.char2_skills_unlocked = new Array(10);
_local1 = 0;
while (_local1 < pc_party.members[1].skills.length) {
so.data.char2_skills_active[_local1] = pc_party.members[1].skills[_local1].active;
so.data.char2_skills_position[_local1] = pc_party.members[1].skills[_local1].position;
so.data.char2_skills_unlocked[_local1] = pc_party.members[1].skills[_local1].unlocked;
_local1++;
};
so.data.char2_equipment = new Array(Equipment.gearSlots);
_local1 = 0;
while (_local1 < Equipment.gearSlots) {
so.data.char2_equipment[_local1] = pc_party.members[1].gear[_local1];
_local1++;
};
};
if (pc_party.members[2] != null){
so.data.char3_skills_active = new Array(10);
so.data.char3_skills_position = new Array(10);
so.data.char3_skills_unlocked = new Array(10);
_local1 = 0;
while (_local1 < pc_party.members[2].skills.length) {
so.data.char3_skills_active[_local1] = pc_party.members[2].skills[_local1].active;
so.data.char3_skills_position[_local1] = pc_party.members[2].skills[_local1].position;
so.data.char3_skills_unlocked[_local1] = pc_party.members[2].skills[_local1].unlocked;
_local1++;
};
so.data.char3_equipment = new Array(Equipment.gearSlots);
_local1 = 0;
while (_local1 < Equipment.gearSlots) {
so.data.char3_equipment[_local1] = pc_party.members[2].gear[_local1];
_local1++;
};
};
if (pc_party.members[3] != null){
so.data.char4_skills_active = new Array(10);
so.data.char4_skills_position = new Array(10);
so.data.char4_skills_unlocked = new Array(10);
_local1 = 0;
while (_local1 < pc_party.members[3].skills.length) {
so.data.char4_skills_active[_local1] = pc_party.members[3].skills[_local1].active;
so.data.char4_skills_position[_local1] = pc_party.members[3].skills[_local1].position;
so.data.char4_skills_unlocked[_local1] = pc_party.members[3].skills[_local1].unlocked;
_local1++;
};
so.data.char4_equipment = new Array(Equipment.gearSlots);
_local1 = 0;
while (_local1 < Equipment.gearSlots) {
so.data.char4_equipment[_local1] = pc_party.members[3].gear[_local1];
_local1++;
};
};
}
public function closeInventory(){
inventory.cleanup();
removeChild(inventory);
addChild(dungeon);
dungeon.updateChars();
}
function frame1(){
debug_label.text = "Constructing from script..";
if (((!((parent == null))) && ((MovieClip(parent).currentFrame == 3)))){
this.doConstruct();
};
}
public function creationFinished(_arg1:Party):void{
var _local2:*;
var _local3:Item;
_arg1.version12 = true;
pc_party = _arg1;
dm.party = _arg1;
if (this.contains(creation)){
removeChild(creation);
};
if (DungeonMain.debugitems){
while (_arg1.inventory.length < Party.MAX_INVENTORY) {
_local3 = new iShieldBuckler(1, Item.purple);
_arg1.addToInventory(_local3);
};
};
_local2 = new DifficultySelect(pc_party);
this.addChild(_local2);
}
function closeDefeatDialog(_arg1:MouseEvent):void{
var _local2 = ??pushnamespace
;
var _local3:*;
if (((!((loading == null))) && (stage.contains(loading)))){
stage.removeChild(loading);
};
musicDungeonTheme();
_local2 = 4;
if (((((!(pc_party.beginner)) && (DungeonMain.showHints))) && ((Dungeon.hintShown(_local2) == false)))){
_local3 = new HintDialog("Defeat!", "You suffer a penalty for the defeat of the entire party.\n\nEach character loses an item of equipment, and up to two items are lost from party inventory.");
DungeonMain.hints = (DungeonMain.hints + _local2);
stage.addChild(_local3);
saveInterface();
};
}
private function checkRecentMonsters():void{
if (recent_monsters == (((Horde.greenskins + Horde.undead) + Horde.cultists) + Horde.creatures)){
recent_monsters = 0;
};
}
public function saveDungeon():void{
var _local1:*;
if (((nosaving) || (suspendSaving))){
return;
};
if (so == null){
setSaveSlot();
};
so.data.recent_monsters = recent_monsters;
so.data.race = dungeon.race;
so.data.tileset = dungeon.tileset;
so.data.exit_found = dungeon.exit_found;
so.data.previous_cleared = dungeon.previousLevelCleared;
so.data.currentRoomIndex = dungeon.currentRoom.index;
so.data.rooms = new Array();
_local1 = 0;
while (_local1 < dungeon.room_array.length) {
so.data.rooms.push(dungeon.room_array[_local1].roomData());
_local1++;
};
so.data.hordes = new Array(dungeon.hordes.length);
_local1 = 0;
while (_local1 < dungeon.hordes.length) {
so.data.hordes[_local1] = dungeon.hordes[_local1].hordeData();
_local1++;
};
if (dungeon.hordes.length >= 1){
so.data.h0_members = dungeon.hordes[0].members;
};
if (dungeon.hordes.length >= 2){
so.data.h1_members = dungeon.hordes[1].members;
};
if (dungeon.hordes.length >= 3){
so.data.h2_members = dungeon.hordes[2].members;
};
if (dungeon.hordes.length >= 4){
so.data.h3_members = dungeon.hordes[3].members;
};
if (dungeon.hordes.length >= 5){
so.data.h4_members = dungeon.hordes[4].members;
};
if (dungeon.hordes.length >= 6){
so.data.h5_members = dungeon.hordes[5].members;
};
if (dungeon.hordes.length >= 7){
so.data.h6_members = dungeon.hordes[6].members;
};
if (dungeon.hordes.length >= 8){
so.data.h7_members = dungeon.hordes[7].members;
};
if (dungeon.hordes.length >= 9){
so.data.h8_members = dungeon.hordes[8].members;
};
if (dungeon.hordes.length >= 10){
so.data.h9_members = dungeon.hordes[9].members;
};
}
private function musicBattleTheme():void{
stopMusic();
battle_theme = new BattleMusic(true);
}
public function NewDungeonClick(_arg1:MouseEvent){
var _local2:*;
var _local3:*;
removeChild(dungeon);
dungeon.cleanup();
_local2 = dungeon.race;
dungeon = null;
dungeon = new Dungeon(pc_party, level);
_local3 = false;
while (!(_local3)) {
_local3 = dungeon.generateDungeon();
};
addChild(dungeon);
}
function closeHardcoreDefeatDialog(_arg1:MouseEvent):void{
if (((!((loading == null))) && (stage.contains(loading)))){
stage.removeChild(loading);
};
mainMenu();
}
public function beginBattle(_arg1:Horde, _arg2:Boolean=false){
dungeon.mouseEnabled = false;
dungeon.mouseChildren = false;
battle = new Battlefield();
battle.pc_party = pc_party;
battle.horde = _arg1;
battle.layoutBoard();
if (!_arg2){
saveAll(true);
};
clearSave();
suspendSaving = true;
battleTimer = new Timer(1000, 1);
battleTimer.addEventListener(TimerEvent.TIMER_COMPLETE, battleTimerFinished);
battleTimer.start();
if (_arg1.room != null){
dm.childToTop(_arg1.room);
};
_arg1.battleAnim();
}
private function getMeezScoreDetail():Object{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local1 = pc_party.level;
_local2 = pc_party.stat_leaders_defeated;
_local3 = pc_party.stat_shrines_used;
_local4 = pc_party.stat_member_deaths;
_local5 = pc_party.stat_party_defeats;
return (Games.O2S({l:_local1, b:_local2, s:_local3, d:_local4, f:_local5}));
}
public function mainMenu(_arg1:Boolean=false):void{
var _local2:*;
var _local3:*;
var _local4:*;
debug_label.text = "Accessing main menu..";
if (battle_theme != null){
battle_theme.fadeOut(500);
};
if (dungeon_theme != null){
dungeon_theme.fadeOut(500);
};
if (title_theme == null){
musicTitleTheme();
};
_local2 = new TitleScreen();
_local2.name = "title";
addChild(_local2);
if (_arg1){
_local3 = "The quest has been completed, but the adventure is not over. \n\nYou may continue with your party, gaining power and items, as long as you wish.\n\nCheck the party inventory for bonus rewards!";
_local4 = new HintDialog("Infinite Mode Unlocked", _local3, false, true);
stage.addChild(_local4);
};
}
public function saveAll(_arg1:Boolean):void{
var _local2:*;
var _local3:*;
if (((nosaving) || (suspendSaving))){
return;
};
saveInterface();
setSaveSlot();
saveParty();
saveChars();
saveInventory();
saveDungeon();
so.data.battle = _arg1;
if (DungeonMain.debug){
};
so.flush();
if (DungeonMain.debug){
};
}
public function loadInterface():void{
var _local1:SharedObject;
debug_label.text = "Loading interface settings..";
_local1 = SharedObject.getLocal("interface");
if (_local1.size > 0){
GlobalVolume.setVolume(_local1.data.globalVolumeSetting);
SoundControl.volumeSetting = _local1.data.sfxVolumeSetting;
setMusicVolume(_local1.data.musicVolumeSetting);
showHints = _local1.data.showHints;
hints = _local1.data.hints;
};
}
public function descendClick(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
saveAll(false);
clearSave();
suspendSaving = true;
levelUp();
if (MEEZ){
_local5 = pc_party.getScore();
_local6 = getMeezScoreDetail();
dm.MeezGPF.postScore(_local5, _local6, Games.Event.CHECKPOINT);
};
dungeon.cleanup();
removeChild(dungeon);
_local2 = dungeon.race;
_local3 = dungeon.fullyCleared();
dungeon = null;
checkRecentMonsters();
_local4 = Dungeon.getMonsterRace(level, recent_monsters);
addToRecentMonsters(_local4);
dungeon = new Dungeon(pc_party, level, _local4, _local3);
if (level == MAX_LEVEL){
addLoadingScreen("The party descend to the next level.\n\nIn their quest they have battled many and experienced much, but\nthey find themselves unprepared for what awaits them here. Never\nyet have they encountered so palpable a sense of evil. It pervades\nthese halls, and lesser men would flee in terror at its touch.\n\nThese few, though, have not come so far only to falter at the last. They sense that they have reached their destination and victory\nnow lies within their grasp.\n\nWithout exchanging a word, the heroes know what they must do. Nothing in this place may be suffered to live.", this.proceedClick, true);
} else {
addLoadingScreen(dungeon.getIntroduction(_local4), this.proceedClick);
};
startDungeonTimer();
}
function battleTimerFinished(_arg1:TimerEvent):void{
battleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, battleTimerFinished);
if (this.contains(dungeon)){
removeChild(dungeon);
};
addChild(battle);
dungeon.mouseEnabled = true;
dungeon.mouseChildren = true;
musicBattleTheme();
}
private function added(_arg1:Event):void{
removeEventListener(Event.ADDED, added);
if (stage != null){
dm.stage = stage;
};
}
public function init():void{
if (initialized){
return;
};
initialized = true;
debug_label.text = "Initializing game..";
endIntro();
if (root != null){
dm.stage = stage;
};
if (MEEZ){
initMeezAPI();
} else {
if (KONGREGATE){
initKongregateAPI();
};
};
debug_label.text = "Registering aliases..";
registerAliases();
loadInterface();
mainMenu();
}
public function goToInventory(_arg1:PlayerCharacter=null){
inventory = null;
inventory = new Inventory();
removeChild(dungeon);
addChild(inventory);
inventory.init(pc_party);
if (_arg1 != null){
inventory.selectChar(_arg1);
};
}
private function initKongregateAPI():void{
var _local1:Object;
var _local2:String;
var _local3:URLRequest;
var _local4:Loader;
debug_label.text = "Init Kongregate API..";
Security.allowDomain("kongregate.com");
Security.allowDomain("http://www.kongregate.com/flash/API_AS3_Local.swf");
_local1 = LoaderInfo(root.loaderInfo).parameters;
_local2 = ((_local1.api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
_local3 = new URLRequest(_local2);
_local4 = new Loader();
_local4.contentLoaderInfo.addEventListener(Event.COMPLETE, kLoadComplete);
_local4.load(_local3);
this.addChild(_local4);
}
private function demonDefeated():void{
var _local1:*;
var _local2:*;
dungeon.cleanup();
removeChild(dungeon);
dungeon = null;
infiniteTransition = true;
pc_party.fullRecovery();
levelUp();
pc_party.addDemonLoot();
checkRecentMonsters();
_local1 = Dungeon.getMonsterRace(level, recent_monsters);
addToRecentMonsters(_local1);
dungeon = new Dungeon(pc_party, level, _local1, true);
_local2 = "The demonic presence begins to fade, drawn back to whichever\nhellish realm spawned it. Not willingly, as its final scream of rage\nand pain shakes the dungeon to its very foundations.\n\nDebris begins to rain from the ceiling, and jagged chasms open in\nthe stone floor, revealing still deeper levels of the dungeon. That,\nhowever, must remain a mystery for another time. The heroes,\nvictorious in their quest, realize they must leave now lest their\nretreat be forever barred by the mounting piles of fallen rubble.\nBounding up the stairs, they find themselves passing back through\nall the levels in which they have fought, and bled, and which may\nyet become their tomb.\n\nFinally, desperately, they surge forth from the ruin's entrance, as\nthe dungeon collapses behind them in a final exhalation of dust and debris. Jubilance and disbelief.\n\nThey have succeeded, and they have survived.";
addLoadingScreen(_local2, this.proceedClick, true);
if (((!((dm.kongregate == null))) && (KONGREGATE))){
if (pc_party.beginner){
dm.kongregate.stats.submit("max_quest_complete_beginner", 1);
} else {
if (pc_party.hardcore){
dm.kongregate.stats.submit("max_quest_complete_hc", 1);
} else {
if (pc_party.extreme){
dm.kongregate.stats.submit("max_quest_complete_extreme", 1);
} else {
dm.kongregate.stats.submit("max_quest_complete", 1);
};
};
};
dm.kongregate.stats.submit("max_quest_any", 1);
};
startDungeonTimer();
}
private function levelUp():void{
var _local1:*;
level++;
pc_party.level++;
_local1 = 0;
while (_local1 < pc_party.members.length) {
if (level > pc_party.members[_local1].level){
pc_party.members[_local1].levelUp();
};
_local1++;
};
pc_party.fullRecovery();
}
private function beginIntro():void{
var _local1:MaxGamesIntro;
_local1 = new MaxGamesIntro();
_local1.name = "intro";
_local1.x = 275;
_local1.y = 225;
addChild(_local1);
_local1.link_btn.addEventListener(MouseEvent.CLICK, maxGamesClick);
}
private function stopMusic(_arg1:int=0):void{
if (_arg1){
if (title_theme != null){
title_theme.fadeOut(_arg1);
};
if (battle_theme != null){
battle_theme.fadeOut(_arg1);
};
if (dungeon_theme != null){
dungeon_theme.fadeOut(_arg1);
};
} else {
if (title_theme != null){
title_theme.stop();
title_theme = null;
};
if (battle_theme != null){
battle_theme.stop();
battle_theme = null;
};
if (dungeon_theme != null){
dungeon_theme.stop();
dungeon_theme = null;
};
};
}
private function initMeezAPI():void{
var _local1:*;
_local1 = FlashUtil.loadFlashVars(this.root);
dm.MeezGPF = new Games(_local1);
dm.MeezGPF.broadcastEvent("LOADED");
}
public function saveParty():void{
var _local1:String;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:String;
if (((nosaving) || (suspendSaving))){
return;
};
if (so == null){
setSaveSlot();
};
so.data.pc_party = pc_party;
if (((!((dm.kongregate == null))) && (KONGREGATE))){
_local1 = "";
_local2 = 0;
if (pc_party.beginner){
_local2 = 1;
};
_local3 = 0;
if (pc_party.hardcore){
_local3 = 1;
};
_local4 = 0;
if (pc_party.extreme){
_local4 = 1;
};
_local5 = 0;
if (level > DungeonMain.MAX_LEVEL){
_local5 = 1;
};
_local6 = pc_party.getScore();
dm.kongregate.stats.submit((_local1 + "level"), level);
dm.kongregate.stats.submit((_local1 + "beginner"), _local2);
dm.kongregate.stats.submit((_local1 + "hardcore"), _local3);
dm.kongregate.stats.submit((_local1 + "extreme"), _local4);
dm.kongregate.stats.submit((_local1 + "quest_complete"), _local5);
dm.kongregate.stats.submit((_local1 + "hordes_defeated"), pc_party.stat_hordes_defeated);
dm.kongregate.stats.submit((_local1 + "leaders_defeated"), pc_party.stat_leaders_defeated);
dm.kongregate.stats.submit((_local1 + "party_defeats"), pc_party.stat_party_defeats);
dm.kongregate.stats.submit((_local1 + "member_deaths"), pc_party.stat_member_deaths);
dm.kongregate.stats.submit((_local1 + "shrines_used"), pc_party.stat_shrines_used);
dm.kongregate.stats.submit((_local1 + "clear_percent"), pc_party.getTotalClearPercent());
dm.kongregate.stats.submit((_local1 + "explore_percent"), pc_party.getTotalExplorePercent());
dm.kongregate.stats.submit((_local1 + "rating"), _local6);
if (pc_party.beginner){
dm.kongregate.stats.submit("HighestLevelBeginner", level);
dm.kongregate.stats.submit("max_rating_beginner", _local6);
dm.kongregate.stats.submit("max_quest_complete_beginner", _local5);
} else {
if (pc_party.hardcore){
dm.kongregate.stats.submit("HighestLevelHardcore", level);
dm.kongregate.stats.submit("max_rating_hc", _local6);
dm.kongregate.stats.submit("max_quest_complete_hc", _local5);
} else {
if (pc_party.extreme){
dm.kongregate.stats.submit("HighestLevelExtreme", level);
dm.kongregate.stats.submit("max_rating_extreme", _local6);
dm.kongregate.stats.submit("max_quest_complete_extreme", _local5);
} else {
dm.kongregate.stats.submit("HighestLevel", level);
dm.kongregate.stats.submit("max_rating", _local6);
dm.kongregate.stats.submit("max_quest_complete", _local5);
};
};
};
dm.kongregate.stats.submit("max_quest_complete_any", _local5);
dm.kongregate.stats.submit("max_highest_level_any", level);
_local7 = "normal";
if (pc_party.hardcore){
_local7 = "hardcore";
} else {
if (pc_party.beginner){
_local7 = "beginner";
} else {
if (pc_party.extreme){
_local7 = "extreme";
};
};
};
dm.kongregate.scores.submit(_local6, _local7);
};
}
private function clearSave():void{
if (so == null){
return;
};
}
public function difficultySelected():void{
var _local1:*;
var _local2:*;
recent_monsters = 0;
_local1 = Dungeon.getMonsterRace(1, recent_monsters);
addToRecentMonsters(_local1);
level = 1;
if (DungeonMain.debug){
level = startAtLevel;
pc_party.level = level;
_local2 = 1;
while (_local2 < level) {
pc_party.levelUp();
_local2++;
};
};
dungeon = new Dungeon(pc_party, level, _local1, false);
addLoadingScreen("The party of adventurers make their way to the ancient ruin,\nequipped only with what meagre provisions the locals could spare.\n\nThe words of the village headman had filled them with a quiet\ndread, yet steeled their resolve. If the world is to be saved, they\nmust assault the dungeon and destroy the corruption lurking in its\ndepths.\n\nThey must enter the monsters' den.", this.proceedClick);
startDungeonTimer();
}
private function addToRecentMonsters(_arg1:int):void{
if ((recent_monsters & _arg1) == _arg1){
recent_monsters = 0;
} else {
recent_monsters = (recent_monsters + _arg1);
};
}
public function proceedClick(_arg1:MouseEvent):void{
if (((!((loading == null))) && (stage.contains(loading)))){
stage.removeChild(loading);
};
if (infiniteTransition){
infiniteTransition = false;
mainMenu(true);
} else {
addChild(dungeon);
musicDungeonTheme(true);
if (((MEEZ) && ((level > 1)))){
dm.MeezGPF.emote(8);
};
};
}
public function startGame(_arg1:int=1){
loadInterface();
level = 1;
creation = new PartyCreation();
creation.pc_party.save_slot = _arg1;
addChild(creation);
if (MEEZ){
dm.MeezGPF.broadcastEvent("NEWGAME");
};
}
public function generateDungeon(_arg1:TimerEvent=null):void{
var _local2:*;
var _local3:*;
if (dungeonTimer != null){
dungeonTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, generateDungeon);
};
_local2 = false;
_local3 = 0;
while (((!(_local2)) && ((_local3 < 5)))) {
_local2 = dungeon.generateDungeon();
_local3++;
};
if (_local2){
dungeonLoadingFinished();
} else {
startDungeonTimer();
};
}
public function loadGameMenu(){
var _local1:*;
_local1 = new LoadParty();
_local1.name = "LoadParty";
addChild(_local1);
}
public function PostBattle(_arg1:Horde){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:String;
var _local9:*;
_local2 = false;
battle.cleanup();
removeChild(battle);
battle = null;
suspendSaving = false;
_local3 = 0;
while (_local3 < pc_party.members.length) {
pc_party.members[_local3].clearStatusEffects();
_local3++;
};
_local3 = (_arg1.members.length - 1);
while (_local3 >= 0) {
if (_arg1.members[_local3].isSummoned()){
_arg1.members.splice(_local3, 1);
} else {
if ((((((level == MAX_LEVEL)) && (_arg1.boss))) && (!((_arg1.members[_local3] is mDemon))))){
_arg1.members.splice(_local3, 1);
} else {
_arg1.members[_local3].clearStatusEffects();
_arg1.members[_local3].resetSkills();
_arg1.members[_local3].health = _arg1.members[_local3].health_max;
_arg1.members[_local3].power = _arg1.members[_local3].power_max;
};
};
_local3--;
};
_arg1.tooltip = null;
if (pc_party.isPartyDead()){
if (MEEZ){
dm.MeezGPF.emote("die01");
};
pc_party.stat_party_defeats++;
if (((pc_party.hardcore) || (pc_party.extreme))){
if (MEEZ){
_local5 = pc_party.getScore();
_local6 = getMeezScoreDetail();
dm.MeezGPF.postScore(_local5, _local6, Games.Event.GAMEOVER);
};
DeleteSave();
pc_party = null;
_local4 = "The heroes have fallen. Jubilant shouts ring through the ancient\nhalls as the enemy celebrate their victory.\n\nThough the adventurers fought bravely and endured much, in the\nend it was not enough-- the forces of darkness proving too strong.\n\nThe only hope that remains is that another group of brave souls\nmay be found, to attempt once more to enter the monsters' den\nand penetrate its dark heart.";
addLoadingScreen(_local4, this.closeHardcoreDefeatDialog, false, true);
return;
} else {
_local7 = pc_party.deathPenalty();
dungeon.retreatFromMonsters(_arg1);
if (pc_party.beginner){
_local8 = "The party has been defeated in battle. The enemy cheer over\nthe fallen bodies, exultant in their victory.\n\nTime passes.\n\nEventually, the bodies begin to stir. Were the enemy less successful\nthan they hoped, or is this a miracle-- an act of divine provenance?\n\nWhatever the explanation may be, our heroes have survived to\ncontinue their quest. There is hope yet.";
} else {
_local8 = "The party has been defeated in battle. The enemy pick over the\nfallen bodies, claiming a few choice items as trophies of their\nvictory.\n\nTime passes.\n\nEventually, the bodies begin to stir. Were the enemy less successful\nthan they hoped, or is this a miracle-- an act of divine provenance?\n\nWhatever the explanation may be, our heroes have survived to\ncontinue their quest. There is hope yet.";
};
addLoadingScreen(_local8, this.closeDefeatDialog, false, true);
if (_local7){
};
_local2 = true;
};
} else {
if (!_arg1.defeated){
dungeon.retreatFromMonsters(_arg1);
if (MEEZ){
dm.MeezGPF.emote("goodbye01");
};
};
};
addChild(dungeon);
dungeon.updateChars();
if (_arg1.defeated){
_arg1.fade();
pc_party.stat_hordes_defeated++;
if (_arg1.boss){
pc_party.stat_leaders_defeated++;
};
if ((((((level == MAX_LEVEL)) && (_arg1.boss))) || (_arg1.isDemonHorde()))){
if (MEEZ){
dm.MeezGPF.emote(10);
};
demonDefeated();
return;
};
if (MEEZ){
dm.MeezGPF.emote(7);
};
dungeon.hordeDefeated(_arg1);
_local9 = new TreasureChest(pc_party, level, Math.round((_arg1.members.length * 1.5)), _arg1.boss, true);
if (_local9.loot.length){
dungeon.addTreasureReport(_local9, true);
};
};
if (!_local2){
musicDungeonTheme();
};
saveAll(false);
}
public function doConstruct():void{
if (constructed){
return;
};
constructed = true;
debug_label.text = "Initializing sound..";
dm.sound = new SoundControl();
dm.main = this;
initialized = false;
debug_label.text = "Starting intro..";
beginIntro();
}
public function setSaveSlot():void{
var _local1:*;
if (((nosaving) || (suspendSaving))){
return;
};
_local1 = pc_party.save_slot;
if (_local1 == 1){
so = SharedObject.getLocal("party1");
} else {
if (_local1 == 2){
so = SharedObject.getLocal("party2");
} else {
if (_local1 == 3){
so = SharedObject.getLocal("party3");
} else {
return;
};
};
};
}
private function addLoadingScreen(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:Boolean=false):void{
var _local5:*;
var _local6:*;
stopMusic(200);
loading = new DungeonLoading();
loading.name = "dungeonloading";
loading.setCallback(_arg2);
_local5 = loading.setText(_arg1);
loading.prose.y = ((APP_HEIGHT - _local5) / 2);
if (_arg3){
_local6 = (((loading.prose.y + loading.prose.textHeight) + 15) - loading.proceed_btn.y);
if (_local6 > 0){
loading.prose.y = Math.max(0, (loading.prose.y - _local6));
};
};
if (_arg4){
loading.allowProceed();
} else {
loading.removeChild(loading.proceed_btn);
};
stage.addChild(loading);
}
public function InventoryClick(_arg1:MouseEvent){
goToInventory();
}
private function dungeonLoadingFinished():void{
suspendSaving = false;
saveAll(false);
loading.allowProceed();
}
public function dungeonMenuClick(_arg1:MouseEvent):void{
saveAll(false);
if (dungeon != null){
if (this.contains(dungeon)){
removeChild(dungeon);
};
dungeon.cleanup();
dungeon = null;
};
mainMenu();
}
function maxGamesClick(_arg1:MouseEvent):void{
dm.link("http://www.maxgames.com");
}
public function setMusicVolume(_arg1:Number):void{
Music.volumeSetting = _arg1;
if (((!((dungeon_theme == null))) && (dungeon_theme.active))){
dungeon_theme.setVolume(_arg1);
};
if (((!((battle_theme == null))) && (battle_theme.active))){
battle_theme.setVolume(_arg1);
};
if (((!((title_theme == null))) && (title_theme.active))){
title_theme.setVolume(_arg1);
};
}
private function DeleteSave():void{
setSaveSlot();
if (((!((so == null))) && ((so.size > 0)))){
so.clear();
so.flush();
so = null;
};
}
private function musicDungeonTheme(_arg1:Boolean=false):void{
stopMusic();
dungeon_theme = new DungeonMusic(_arg1);
}
public function loadGame(_arg1:int):void{
var _local2:*;
var _local3:*;
var _local4:Boolean;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
loadInterface();
if ((((_arg1 > 0)) && ((_arg1 < 4)))){
so = SharedObject.getLocal(("party" + _arg1));
if (DungeonMain.debug){
};
};
if (((!((so == null))) && ((so.size > 0)))){
pc_party = Party(so.data.pc_party);
dm.party = pc_party;
pc_party.save_slot = _arg1;
if (so.data.char1 != null){
pc_party.members[0] = so.data.char1;
_local2 = 0;
while (_local2 < so.data.char1_skills_active.length) {
pc_party.members[0].skills[_local2].active = so.data.char1_skills_active[_local2];
pc_party.members[0].skills[_local2].position = so.data.char1_skills_position[_local2];
pc_party.members[0].skills[_local2].unlocked = so.data.char1_skills_unlocked[_local2];
_local2++;
};
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
pc_party.members[0].gear[_local2] = so.data.char1_equipment[_local2];
_local2++;
};
pc_party.members[0].party = pc_party;
};
if (so.data.char2 != null){
pc_party.members[1] = so.data.char2;
_local2 = 0;
while (_local2 < so.data.char2_skills_active.length) {
pc_party.members[1].skills[_local2].active = so.data.char2_skills_active[_local2];
pc_party.members[1].skills[_local2].position = so.data.char2_skills_position[_local2];
pc_party.members[1].skills[_local2].unlocked = so.data.char2_skills_unlocked[_local2];
_local2++;
};
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
pc_party.members[1].gear[_local2] = so.data.char2_equipment[_local2];
_local2++;
};
pc_party.members[1].party = pc_party;
};
if (so.data.char3 != null){
pc_party.members[2] = so.data.char3;
_local2 = 0;
while (_local2 < so.data.char3_skills_active.length) {
pc_party.members[2].skills[_local2].active = so.data.char3_skills_active[_local2];
pc_party.members[2].skills[_local2].position = so.data.char3_skills_position[_local2];
pc_party.members[2].skills[_local2].unlocked = so.data.char3_skills_unlocked[_local2];
_local2++;
};
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
pc_party.members[2].gear[_local2] = so.data.char3_equipment[_local2];
_local2++;
};
pc_party.members[2].party = pc_party;
};
if (so.data.char4 != null){
pc_party.members[3] = so.data.char4;
_local2 = 0;
while (_local2 < so.data.char4_skills_active.length) {
pc_party.members[3].skills[_local2].active = so.data.char4_skills_active[_local2];
pc_party.members[3].skills[_local2].position = so.data.char4_skills_position[_local2];
pc_party.members[3].skills[_local2].unlocked = so.data.char4_skills_unlocked[_local2];
_local2++;
};
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
pc_party.members[3].gear[_local2] = so.data.char4_equipment[_local2];
_local2++;
};
pc_party.members[3].party = pc_party;
};
pc_party.inventory = so.data.inventory;
pc_party.overflow = so.data.overflow;
_local4 = pc_party.scanForItemUpdates();
recent_monsters = so.data.recent_monsters;
if (so.data.hordes.length >= 1){
so.data.hordes[0].members = so.data.h0_members;
};
if (so.data.hordes.length >= 2){
so.data.hordes[1].members = so.data.h1_members;
};
if (so.data.hordes.length >= 3){
so.data.hordes[2].members = so.data.h2_members;
};
if (so.data.hordes.length >= 4){
so.data.hordes[3].members = so.data.h3_members;
};
if (so.data.hordes.length >= 5){
so.data.hordes[4].members = so.data.h4_members;
};
if (so.data.hordes.length >= 6){
so.data.hordes[5].members = so.data.h5_members;
};
if (so.data.hordes.length >= 7){
so.data.hordes[6].members = so.data.h6_members;
};
if (so.data.hordes.length >= 8){
so.data.hordes[7].members = so.data.h7_members;
};
if (so.data.hordes.length >= 9){
so.data.hordes[8].members = so.data.h8_members;
};
if (so.data.hordes.length >= 10){
so.data.hordes[9].members = so.data.h9_members;
};
this.level = pc_party.level;
dungeon = new Dungeon(pc_party, pc_party.level, so.data.race);
_local5 = dungeon.createFromDataArray(so.data.rooms, so.data.currentRoomIndex, so.data.hordes, so.data.previous_cleared);
if (((_local4) && ((level > 9)))){
_local6 = new WarningDialog("The game has been updated: high level monsters will once again pose a threat. Make sure your equipment is up to date. Check your Inventory for special items.");
stage.addChild(_local6);
_local7 = 0;
while (_local7 < dungeon.hordes.length) {
dungeon.hordes[_local7].convertHealthTo12();
_local7++;
};
};
if (_local4){
saveAll(false);
};
if (!_local5){
} else {
if (so.data.exit_found){
dungeon.foundExit();
};
if (getChildByName("LoadParty") != null){
removeChild(getChildByName("LoadParty"));
};
if (MEEZ){
dm.MeezGPF.emote("hello01");
};
if (((so.data.battle) && (!((dungeon.currentRoom.horde == null))))){
addChild(dungeon);
_local8 = dungeon.currentRoom.horde;
_local8.fullRecovery();
beginBattle(_local8, true);
} else {
addChild(dungeon);
musicDungeonTheme(true);
};
};
if (((nosaving) || (suspendSaving))){
so = null;
};
};
}
public static function RandomNum(_arg1:int, _arg2:int):int{
var _local3:*;
_local3 = (Math.round((Math.random() * (_arg2 - _arg1))) + _arg1);
return (_local3);
}
public static function registerAliases():void{
registerClassAlias("PartyAlias", Party);
registerClassAlias("PlayerCharacterAlias", PlayerCharacter);
registerClassAlias("PC_ClericAlias", PC_Cleric);
registerClassAlias("PC_RogueAlias", PC_Rogue);
registerClassAlias("PC_MageAlias", PC_Mage);
registerClassAlias("PC_WarriorAlias", PC_Warrior);
registerClassAlias("PC_RangerAlias", PC_Ranger);
registerClassAlias("DungeonRoomDataAlias", DungeonRoomData);
registerClassAlias("HordeDataAlias", HordeData);
registerClassAlias("MonsterCharacterAlias", MonsterCharacter);
registerClassAlias("mDemonAlias", mDemon);
registerClassAlias("mDeathKnightAlias", mDeathKnight);
registerClassAlias("mNecromancerAlias", mNecromancer);
registerClassAlias("mOrcJuggernaut", mOrcJuggernaut);
registerClassAlias("mOrcWarlordAlias", mOrcWarlord);
registerClassAlias("mDragonAlias", mDragon);
registerClassAlias("mBeholderAlias", mBeholder);
registerClassAlias("mCultEngineAlias", mCultEngine);
registerClassAlias("mAscendantAlias", mAscendant);
registerClassAlias("mZombieAlias", mZombie);
registerClassAlias("mBoneHorrorAlias", mBoneHorror);
registerClassAlias("mGhostAlias", mGhost);
registerClassAlias("mSkeletonAlias", mSkeleton);
registerClassAlias("mLichAlias", mLich);
registerClassAlias("mVampireAlias", mVampire);
registerClassAlias("mSkeletonArcherAlias", mSkeletonArcher);
registerClassAlias("mTrollAlias", mTroll);
registerClassAlias("mOrcBerserkerAlias", mOrcBerserker);
registerClassAlias("mOrcChampionAlias", mOrcChampion);
registerClassAlias("mOrcSavageAlias", mOrcSavage);
registerClassAlias("mOrcShamanAlias", mOrcShaman);
registerClassAlias("mGoblinArtificerAlias", mGoblinArtificer);
registerClassAlias("mBasiliskAlias", mBasilisk);
registerClassAlias("mArachnoidAlias", mArachnoid);
registerClassAlias("mGreeblerAlias", mGreebler);
registerClassAlias("mGargoyleAlias", mGargoyle);
registerClassAlias("mPoisonDrakeAlias", mPoisonDrake);
registerClassAlias("mLightningDrakeAlias", mLightningDrake);
registerClassAlias("mCultWarriorAlias", mCultWarrior);
registerClassAlias("mCultArcherAlias", mCultArcher);
registerClassAlias("mCultChosenAlias", mCultChosen);
registerClassAlias("mCultPriestAlias", mCultPriest);
registerClassAlias("mCultNeophyteAlias", mCultNeophyte);
registerClassAlias("mVoidstalkerAlias", mVoidstalker);
registerClassAlias("mAetherguardAlias", mAetherguard);
registerClassAlias("iDaggerAlias", iDagger);
registerClassAlias("iSwordAlias", iSword);
registerClassAlias("iAxeAlias", iAxe);
registerClassAlias("iMaceAlias", iMace);
registerClassAlias("iSpearAlias", iSpear);
registerClassAlias("iBowAlias", iBow);
registerClassAlias("iCrossbowAlias", iCrossbow);
registerClassAlias("iStaffAlias", iStaff);
registerClassAlias("iPlateHelmetAlias", iPlateHelmet);
registerClassAlias("iPlateGlovesAlias", iPlateGloves);
registerClassAlias("iPlateGreavesAlias", iPlateGreaves);
registerClassAlias("iPlateBootsAlias", iPlateBoots);
registerClassAlias("iPlateBreastplateAlias", iPlateBreastplate);
registerClassAlias("iLeatherHatAlias", iLeatherHat);
registerClassAlias("iLeatherGlovesAlias", iLeatherGloves);
registerClassAlias("iLeatherLegsAlias", iLeatherLegs);
registerClassAlias("iLeatherBootsAlias", iLeatherBoots);
registerClassAlias("iLeatherChestAlias", iLeatherChest);
registerClassAlias("iCLothHat", iClothHat);
registerClassAlias("iClothGloves", iClothGloves);
registerClassAlias("iClothlegs", iClothLegs);
registerClassAlias("iClothShows", iClothShoes);
registerClassAlias("iClothRobe", iClothRobe);
registerClassAlias("iRingAlias", iRing);
registerClassAlias("iCloakAlias", iCloak);
registerClassAlias("iQuiverAlias", iQuiver);
registerClassAlias("iParryingDaggerAlias", iParryingDagger);
registerClassAlias("iShieldBucklerAlias", iShieldBuckler);
registerClassAlias("iShieldTowerAlias", iShieldTower);
registerClassAlias("iCenserAlias", iCenser);
registerClassAlias("pothealthsmall", PotionHealthSmall);
registerClassAlias("potpowersmall", PotionPowerSmall);
registerClassAlias("potrejuvesmall", PotionRejuveSmall);
registerClassAlias("potreviveweak", PotionReviveWeak);
registerClassAlias("pothealth", PotionHealth);
registerClassAlias("potpower", PotionPower);
registerClassAlias("potrejuve", PotionRejuve);
registerClassAlias("potrevive", PotionRevive);
registerClassAlias("potresist", PotionPoisonResist);
registerClassAlias("potshield", PotionShield);
registerClassAlias("potquickness", PotionQuickness);
registerClassAlias("sneakscroll", SneakyScroll);
registerClassAlias("tabula", CleanSlate);
}
}
}//package
Section 100
//DungeonMusic (DungeonMusic)
package {
import flash.events.*;
import flash.media.*;
public class DungeonMusic extends Music {
var segment2:Sound;
var segment1:Sound;
var playingSegment:int;// = 0
public function DungeonMusic(_arg1:Boolean=true):void{
playingSegment = 0;
super();
segment1 = new return_of_the_knights_b();
active = true;
channel = segment1.play(0, 99999);
if (_arg1){
this.fadeIn();
} else {
this.setVolume(volumeSetting);
};
}
private function playSegment2():void{
var _local1:*;
if (channel != null){
channel.removeEventListener(Event.SOUND_COMPLETE, finishedSegment);
};
playingSegment = 2;
_local1 = dm.randomNum(1, 1);
channel = segment2.play(0, _local1);
channel.addEventListener(Event.SOUND_COMPLETE, finishedSegment);
}
function finishedSegment(_arg1:Event):void{
if (this.active){
if (playingSegment == 2){
playSegment1();
} else {
if (playingSegment == 1){
playSegment2();
};
};
};
}
private function playSegment1():void{
var _local1:*;
if (channel != null){
channel.removeEventListener(Event.SOUND_COMPLETE, finishedSegment);
};
playingSegment = 1;
_local1 = dm.randomNum(1, 1);
channel = segment1.play(0, _local1);
channel.addEventListener(Event.SOUND_COMPLETE, finishedSegment);
}
}
}//package
Section 101
//DungeonRoom (DungeonRoom)
package {
import flash.events.*;
import flash.display.*;
public class DungeonRoom extends MovieClip {
var shrine:RecoveryShrine;
public var floor:MovieClip;
var horde:Horde;
private var _floor_frame_number:int;// = 0
private var _isExit:Boolean;// = false
var doors:Array;
private var _furniture_frame_number:int;// = 0
var treasure:TreasureChest;
private var _grid_x:int;// = 0
private var _grid_y:int;// = 0
var validate_id:int;// = -1
var isCorridor:Boolean;
var adjacent:Array;
private var _seen:Boolean;// = false
private var _explored:Boolean;// = false
var isCorridorH:Boolean;
private var _isEntrance:Boolean;// = false
private var _index:int;// = 0
static const max_adjacent = 6;
public function DungeonRoom(){
adjacent = new Array();
doors = new Array(max_adjacent);
_grid_x = 0;
_grid_y = 0;
_furniture_frame_number = 0;
_floor_frame_number = 0;
_seen = false;
_explored = false;
_isExit = false;
_isEntrance = false;
_index = 0;
validate_id = -1;
super();
isCorridor = false;
isCorridorH = false;
}
public function get isEntrance():Boolean{
return (this._isEntrance);
}
public function set isEntrance(_arg1:Boolean):void{
this._isEntrance = _arg1;
}
public function getGridHeight():int{
return (0);
}
public function setAlpha(_arg1:Number):void{
this.alpha = _arg1;
}
public function isAdjacentTo(_arg1:DungeonRoom):Boolean{
var _local2:*;
_local2 = 0;
while (_local2 < num_adjacent) {
if (adjacent[_local2] == _arg1){
return (true);
};
_local2++;
};
return (false);
}
public function getEntrance():EntryStairs{
var _local1:*;
if (!this.isEntrance){
return (null);
};
_local1 = getChildByName("entrance");
return (_local1);
}
public function get explored():Boolean{
return (this._explored);
}
protected function setAlphaChildren(_arg1:Number):void{
if (treasure != null){
treasure.alpha = _arg1;
};
if (horde != null){
horde.alpha = _arg1;
};
if (shrine != null){
shrine.alpha = _arg1;
};
if (isEntrance){
getChildByName("entrance").alpha = _arg1;
};
if (isExit){
getChildByName("exit").alpha = _arg1;
};
}
public function hasValidTreasure():Boolean{
if (((!((this.treasure == null))) && (!(this.treasure.looted)))){
return (true);
};
return (false);
}
public function addFurniture():void{
if (furniture_frame_number == 0){
furniture_frame_number = DungeonMain.RandomNum(1, this.totalFrames);
};
this.gotoAndStop(furniture_frame_number);
}
public function set explored(_arg1:Boolean):void{
this._explored = _arg1;
}
public function realHeight():int{
return ((getGridHeight() * Dungeon.GRID_SIZE));
}
private function resetDoors():void{
var _local1:*;
_local1 = 0;
while (_local1 < doors.length) {
if (doors[_local1] == null){
} else {
doors[_local1].gotoAndStop(1);
};
_local1++;
};
}
public function addEntrance(_arg1:Boolean):void{
var _local2:*;
var _local3:EntryStairs;
var _local4:*;
var _local5:*;
var _local6:*;
_local2 = 0;
this.isEntrance = true;
this.furniture_frame_number = 1;
_local3 = new EntryStairs(_arg1);
_local3.name = "entrance";
_local4 = (this.x + (this.realWidth() / 2));
_local5 = (this.y + (this.realHeight() / 2));
_local6 = false;
if (isCorridor){
if (isCorridorH){
_local6 = false;
_local2 = 0;
while (_local2 < doors.length) {
if (doors[_local2].x >= _local4){
_local6 = true;
};
_local2++;
};
if (_local6){
_local3.rotation = 180;
};
} else {
_local3.rotation = 90;
_local6 = false;
_local2 = 0;
while (_local2 < doors.length) {
if (doors[_local2].y >= _local5){
_local6 = true;
};
_local2++;
};
if (_local6){
_local3.rotation = 270;
};
};
};
_local3.x = getCenterHorz();
_local3.y = getCenterVert();
this.setChild(_local3);
}
public function get seen():Boolean{
return (this._seen);
}
private function highlightDoor():void{
var _local1:DungeonRoom;
var _local2:*;
if (((!((parent == null))) && ((parent is Dungeon)))){
_local1 = Dungeon(parent).currentRoom;
} else {
return;
};
_local2 = 0;
while (_local2 < doors.length) {
if (doors[_local2] == null){
} else {
if ((((doors[_local2].room1 == _local1)) || ((doors[_local2].room2 == _local1)))){
doors[_local2].gotoAndStop(2);
};
};
_local2++;
};
}
function room_mouseover(_arg1:MouseEvent):void{
drawArrow();
}
public function cleanup():void{
this.removeEventListener(MouseEvent.MOUSE_DOWN, Dungeon(parent).roomClick);
this.removeEventListener(MouseEvent.MOUSE_OVER, room_mouseover);
this.removeEventListener(MouseEvent.MOUSE_OUT, room_mouseout);
}
public function hasPathTo(_arg1:DungeonRoom):Boolean{
var _local2:Array;
var _local3:Array;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local2 = new Array();
_local3 = new Array();
_local4 = false;
_local2.push(this);
while ((_local5 = _local2.pop())) {
_local3.push(_local5);
_local6 = 0;
while (_local6 < num_adjacent) {
if (_local5.adjacent[_local6] != _local5){
_local4 = false;
_local7 = 0;
while (_local7 < _local3.length) {
if (_local3[_local7] == _local5.adjacent[_local6]){
_local4 = true;
};
_local7++;
};
if (!_local4){
_local2.push(_local5.adjacent[_local6]);
};
};
_local6++;
};
if (_local5 == _arg1){
return (true);
};
};
return (false);
}
public function clearAdjacent():void{
adjacent.length = 0;
doors.length = 0;
}
public function hasSpecial():Boolean{
if (((!((this.horde == null))) && (!(horde.defeated)))){
return (true);
};
if (((!((this.shrine == null))) && (!(shrine.used)))){
return (true);
};
if (((!((this.treasure == null))) && (!(treasure.looted)))){
return (true);
};
if (this.isExit){
return (true);
};
if (this.isEntrance){
return (true);
};
return (false);
}
public function setHorde(_arg1:Horde):void{
this.horde = _arg1;
_arg1.room = this;
_arg1.x = getCenterHorz();
_arg1.y = getCenterVert();
_arg1.name = "horde";
if (_arg1.defeated == false){
this.setChild(_arg1);
};
}
public function realWidth():int{
return ((getGridWidth() * Dungeon.GRID_SIZE));
}
public function set isExit(_arg1:Boolean):void{
this._isExit = _arg1;
}
public function setFloor():void{
var _local1:MovieClip;
_local1 = MovieClip(this.getChildByName("floor"));
if (_local1 == null){
return;
};
if (floor_frame_number == 0){
floor_frame_number = DungeonMain.RandomNum(1, _local1.totalFrames);
};
_local1.gotoAndStop(floor_frame_number);
}
public function get index():int{
return (this._index);
}
public function toTop():void{
var _local1:*;
if (parent == null){
return;
};
_local1 = (parent.numChildren - 1);
if (parent.getChildByName("arrow") != null){
_local1--;
};
parent.setChildIndex(this, _local1);
}
public function set seen(_arg1:Boolean):void{
this._seen = _arg1;
}
public function set furniture_frame_number(_arg1:int):void{
this._furniture_frame_number = _arg1;
}
public function getCenterVert():int{
return (((this.getGridHeight() * Dungeon.GRID_SIZE) / 2));
}
public function roomData():DungeonRoomData{
var _local1:*;
_local1 = new DungeonRoomData();
this.copyValuesTo(_local1);
return (_local1);
}
private function drawArrow():void{
if (((!((parent == null))) && ((parent is Dungeon)))){
Dungeon(parent).drawMovementArrow(this);
};
}
public function validate(_arg1:int):int{
var _local2:*;
var _local3:*;
_local2 = 0;
if (this.validate_id != -1){
return (_local2);
};
this.validate_id = _arg1;
_local2++;
_local3 = 0;
while (_local3 < adjacent.length) {
_local2 = (_local2 + adjacent[_local3].validate(_arg1));
_local3++;
};
return (_local2);
}
public function travelTo(_arg1:Boolean=false):Boolean{
var _local2:*;
removeArrow();
if (!explored){
dm.party.stat_rooms_explored++;
dm.party.roomMovedRegen();
if (((!((parent == null))) && ((parent is Dungeon)))){
Dungeon(parent).updateChars();
};
};
seen = true;
explored = true;
if ((((parent == null)) && (!((parent is Dungeon))))){
return (false);
};
_local2 = 0;
while (_local2 < adjacent.length) {
if (((!((adjacent[_local2] == this))) && (!((adjacent[_local2] == null))))){
adjacent[_local2].addEventListener(MouseEvent.MOUSE_DOWN, Dungeon(parent).roomClick);
adjacent[_local2].seen = true;
adjacent[_local2].addEventListener(MouseEvent.MOUSE_OVER, adjacent[_local2].room_mouseover);
adjacent[_local2].addEventListener(MouseEvent.MOUSE_OUT, adjacent[_local2].room_mouseout);
};
_local2++;
};
if (!_arg1){
if (treasure != null){
return (true);
};
if (isExit){
return (true);
};
if (isEntrance){
return (true);
};
if (shrine != null){
return (true);
};
};
if (horde != null){
return (true);
};
return (false);
}
public function setNotAdjacentTo(_arg1:DungeonRoom, _arg2:Boolean=true){
var _local3:*;
_local3 = 0;
while (_local3 < adjacent.length) {
if (adjacent[_local3] == _arg1){
adjacent.splice(_local3, 1);
_local3--;
if (_arg2){
_arg1.setNotAdjacentTo(this, false);
};
return;
};
_local3++;
};
}
public function setAdjacentTo(_arg1:DungeonRoom, _arg2:Boolean=true){
var _local3:*;
_local3 = 0;
while (_local3 < adjacent.length) {
if (adjacent[_local3] == _arg1){
return;
};
_local3++;
};
adjacent.push(_arg1);
if (_arg2){
_arg1.setAdjacentTo(this, false);
};
}
public function set floor_frame_number(_arg1:int):void{
this._floor_frame_number = _arg1;
}
public function addExit():void{
var _local1:*;
var _local2:ExitStairs;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = 0;
this.isExit = true;
this.furniture_frame_number = 1;
_local2 = new ExitStairs();
_local2.name = "exit";
_local3 = (this.x + (this.realWidth() / 2));
_local4 = (this.y + (this.realHeight() / 2));
_local5 = false;
if (isCorridor){
_local2.gotoAndStop(1);
if (isCorridorH){
_local5 = false;
_local1 = 0;
while (_local1 < doors.length) {
if (doors[_local1].x > _local3){
_local5 = true;
};
_local1++;
};
if (_local5){
_local2.rotation = 180;
};
} else {
_local2.rotation = 90;
_local5 = false;
_local1 = 0;
while (_local1 < doors.length) {
if (doors[_local1].y >= _local4){
_local5 = true;
};
_local1++;
};
if (_local5){
_local2.rotation = 270;
};
};
} else {
_local2.gotoAndStop(2);
};
_local2.x = getCenterHorz();
_local2.y = getCenterVert();
this.setChild(_local2);
}
public function getGridWidth():int{
return (0);
}
function room_mouseout(_arg1:MouseEvent):void{
removeArrow();
}
public function get isExit():Boolean{
return (this._isExit);
}
public function getCenterHorz():int{
return (((this.getGridWidth() * Dungeon.GRID_SIZE) / 2));
}
public function set grid_x(_arg1:int):void{
this._grid_x = _arg1;
}
public function set grid_y(_arg1:int):void{
this._grid_y = _arg1;
}
public function get furniture_frame_number():int{
return (this._furniture_frame_number);
}
public function set index(_arg1:int):void{
this._index = _arg1;
}
public function getAlpha():Number{
return (this.alpha);
}
public function hintFlash():void{
var _local1:*;
_local1 = new RoomFlash();
_local1.x = this.x;
_local1.y = this.y;
_local1.width = (this.getGridWidth() * Dungeon.GRID_SIZE);
_local1.height = (this.getGridHeight() * Dungeon.GRID_SIZE);
if (isCorridor){
_local1.x = (_local1.x + 1);
_local1.y = (_local1.y + 1);
_local1.width = (_local1.width - 2);
_local1.height = (_local1.height - 2);
} else {
_local1.x = (_local1.x + 2);
_local1.y = (_local1.y + 2);
_local1.width = (_local1.width - 4);
_local1.height = (_local1.height - 4);
};
_local1.alpha = 0.8;
parent.addChild(_local1);
}
public function get floor_frame_number():int{
return (this._floor_frame_number);
}
public function get grid_y():int{
return (this._grid_y);
}
public function get grid_x():int{
return (this._grid_x);
}
protected function copyValuesTo(_arg1:DungeonRoomData):void{
_arg1.roomType = DungeonRoomData.getRoomTypeOf(this);
_arg1.grid_x = this.grid_x;
_arg1.grid_y = this.grid_y;
_arg1.furniture_frame_number = this.furniture_frame_number;
_arg1.floor_frame_number = this.floor_frame_number;
_arg1.seen = this.seen;
_arg1.explored = this.explored;
_arg1.isEntrance = this.isEntrance;
_arg1.isExit = this.isExit;
_arg1.treasure = ((!((this.treasure == null))) && (!((this.treasure.looted == true))));
_arg1.shrine = ((!((this.shrine == null))) && (!((this.shrine.used == true))));
}
public function setChild(_arg1:DisplayObject):void{
this.addChild(_arg1);
}
public function get num_adjacent():int{
return (this.adjacent.length);
}
public function findDoorTo(_arg1:DungeonRoom):DoorIcon{
var _local2:*;
_local2 = 0;
while (_local2 < doors.length) {
if ((((doors[_local2].room1 == _arg1)) || ((doors[_local2].room2 == _arg1)))){
return (doors[_local2]);
};
_local2++;
};
return (null);
}
public function travelFrom():void{
var _local1:*;
resetDoors();
removeArrow();
_local1 = 0;
while (_local1 < num_adjacent) {
if (adjacent[_local1] == null){
} else {
adjacent[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, Dungeon(parent).roomClick);
adjacent[_local1].removeEventListener(MouseEvent.MOUSE_OVER, adjacent[_local1].room_mouseover);
adjacent[_local1].removeEventListener(MouseEvent.MOUSE_OUT, adjacent[_local1].room_mouseout);
};
_local1++;
};
}
private function removeArrow():void{
if (((!((parent == null))) && ((parent is Dungeon)))){
Dungeon(parent).removeMovementArrow();
};
}
public function addDoor(_arg1:DoorIcon):Boolean{
var _local2:*;
_local2 = 0;
while (_local2 < doors.length) {
if (doors[_local2] == _arg1){
return (false);
};
_local2++;
};
doors.push(_arg1);
return (true);
}
}
}//package
Section 102
//DungeonRoomData (DungeonRoomData)
package {
public class DungeonRoomData {
private var _floor_frame_number:int;// = 0
private var _roomType:int;// = 1
private var _isExit:Boolean;// = false
private var _explored:Boolean;// = false
private var _seen:Boolean;// = false
private var _grid_x:int;// = 0
private var _grid_y:int;// = 0
private var _isEntrance:Boolean;// = false
private var _furniture_frame_number:int;// = 0
private var _shrine:Boolean;// = false
private var _treasure:Boolean;// = false
static const chamber = 5;
static const demonRoom = 9;
static const tallRoom = 8;
static const cell = 4;
static const corridorV = 2;
static const wideRoom = 3;
static const gallery = 6;
static const largeRoom = 7;
static const corridorH = 1;
public function DungeonRoomData(){
_grid_x = 0;
_grid_y = 0;
_furniture_frame_number = 0;
_floor_frame_number = 0;
_seen = false;
_explored = false;
_isExit = false;
_isEntrance = false;
_roomType = 1;
_treasure = false;
_shrine = false;
super();
}
public function get grid_y():int{
return (this._grid_y);
}
public function get shrine():Boolean{
return (this._shrine);
}
public function set grid_x(_arg1:int):void{
this._grid_x = _arg1;
}
public function set shrine(_arg1:Boolean):void{
this._shrine = _arg1;
}
public function set grid_y(_arg1:int):void{
this._grid_y = _arg1;
}
public function get furniture_frame_number():int{
return (this._furniture_frame_number);
}
public function set furniture_frame_number(_arg1:int):void{
this._furniture_frame_number = _arg1;
}
public function get treasure():Boolean{
return (this._treasure);
}
public function get isEntrance():Boolean{
return (this._isEntrance);
}
public function set floor_frame_number(_arg1:int):void{
this._floor_frame_number = _arg1;
}
public function set explored(_arg1:Boolean):void{
this._explored = _arg1;
}
public function set treasure(_arg1:Boolean):void{
this._treasure = _arg1;
}
public function get isExit():Boolean{
return (this._isExit);
}
public function set roomType(_arg1:int):void{
this._roomType = _arg1;
}
public function set isEntrance(_arg1:Boolean):void{
this._isEntrance = _arg1;
}
public function get floor_frame_number():int{
return (this._floor_frame_number);
}
public function get explored():Boolean{
return (this._explored);
}
public function set isExit(_arg1:Boolean):void{
this._isExit = _arg1;
}
public function get roomType():int{
return (this._roomType);
}
public function set seen(_arg1:Boolean):void{
this._seen = _arg1;
}
public function get seen():Boolean{
return (this._seen);
}
public function toRoom(_arg1:Boolean):DungeonRoom{
var _local2:DungeonRoom;
if (roomType == corridorH){
_local2 = new rCorridorH();
} else {
if (roomType == corridorV){
_local2 = new rCorridorV();
} else {
if (roomType == wideRoom){
_local2 = new rWideRoom();
} else {
if (roomType == cell){
_local2 = new rCell();
} else {
if (roomType == chamber){
_local2 = new rChamber();
} else {
if (roomType == gallery){
_local2 = new rGallery();
} else {
if (roomType == largeRoom){
_local2 = new rLargeRoom();
} else {
if (roomType == tallRoom){
_local2 = new rTallRoom();
} else {
if (roomType == demonRoom){
_local2 = new rDemonRoom();
} else {
_local2 = new rCorridorH();
};
};
};
};
};
};
};
};
};
_local2.grid_x = this.grid_x;
_local2.grid_y = this.grid_y;
_local2.furniture_frame_number = this.furniture_frame_number;
_local2.floor_frame_number = this.floor_frame_number;
_local2.seen = this.seen;
_local2.explored = this.explored;
return (_local2);
}
public function get grid_x():int{
return (this._grid_x);
}
public static function getRoomTypeOf(_arg1:DungeonRoom):int{
if ((_arg1 is rCorridorH)){
return (corridorH);
};
if ((_arg1 is rCorridorV)){
return (corridorV);
};
if ((_arg1 is rWideRoom)){
return (wideRoom);
};
if ((_arg1 is rCell)){
return (cell);
};
if ((_arg1 is rChamber)){
return (chamber);
};
if ((_arg1 is rGallery)){
return (gallery);
};
if ((_arg1 is rLargeRoom)){
return (largeRoom);
};
if ((_arg1 is rTallRoom)){
return (tallRoom);
};
if ((_arg1 is rDemonRoom)){
return (demonRoom);
};
return (0);
}
}
}//package
Section 103
//EmptyPortrait (EmptyPortrait)
package {
import flash.display.*;
public class EmptyPortrait extends MovieClip {
public var empty:MovieClip;
public function EmptyPortrait(){
addFrameScript(0, frame1, 12, frame13);
this.gotoAndStop(1);
}
function frame1(){
this.stop();
}
function frame13(){
this.gotoAndStop(1);
}
}
}//package
Section 104
//EntryStairs (EntryStairs)
package {
import flash.display.*;
public class EntryStairs extends Sprite {
public var glow:StairsGlow;
var enableRest:Boolean;// = false
public function EntryStairs(_arg1:Boolean=false){
enableRest = false;
super();
this.enableRest = _arg1;
if (!_arg1){
removeGlow();
};
}
public function removeGlow():void{
if (this.contains(glow)){
removeChild(glow);
};
}
}
}//package
Section 105
//equip_bow_sound (equip_bow_sound)
package {
import flash.media.*;
public dynamic class equip_bow_sound extends Sound {
}
}//package
Section 106
//equip_shield_sound (equip_shield_sound)
package {
import flash.media.*;
public dynamic class equip_shield_sound extends Sound {
}
}//package
Section 107
//equip_sound (equip_sound)
package {
import flash.media.*;
public dynamic class equip_sound extends Sound {
}
}//package
Section 108
//equip_staff_sound (equip_staff_sound)
package {
import flash.media.*;
public dynamic class equip_staff_sound extends Sound {
}
}//package
Section 109
//equip_sword_sound (equip_sword_sound)
package {
import flash.media.*;
public dynamic class equip_sword_sound extends Sound {
}
}//package
Section 110
//Equipment (Equipment)
package {
public class Equipment extends Item {
const base_accuracy_bonus = 10;
const base_item_stat_bonus = 1;
const purple_armor_multiplier = 1.5;
private var _causes_stun_percent:int;// = 0
var white_chance;// = 15
private var _mod_endurance:int;// = 0
var purple_chance;// = 1
var base_armor_mod:int;// = 0
private var _damageBonusVsCreatureType:int;// = 0
private var _whoEquips:uint;// = 0
var material:int;// = -1
protected var materials:Array;
private var _damageBonusVsCreatureModifier:Number;// = 1
var base_armor_rating:int;// = 0
var suffix:int;// = -1
private var _mod_healing:int;// = 0
private var _blind:int;// = 0
private var _damageReflection:int;// = 0
private var _resistStun:int;// = 0
private var _resistPoison:int;// = 0
private var _poisonDamage:int;// = 0
private var _armor_rating:int;// = 0
private var _healthRegen:int;// = 0
private var _mod_intellect:int;// = 0
var prefix:int;// = -1
var grey_chance;// = 5
private var _accuracyBonus:int;// = 0
private var _lethality:int;// = 0
var blue_chance;// = 24
protected var suffixes:Array;
protected var prefixes:Array;
private var _mod_strength:int;// = 0
private var _mod_dexterity:int;// = 0
private var _powerRegen:int;// = 0
private var _replenishing:int;// = 0
private var _slot:int;// = 0
private var _mod_quickness:int;// = 0
protected var grey_name:String;// = "Damaged"
var green_chance;// = 55
private var _quickRetreat:Boolean;// = false
private var _vampiric_percent:int;// = 0
static const boots = 4;
static const weapon = 0;
static const legs = 5;
static const gearSlots = 9;
static const back = 3;
static const max_stat_for_purple = 4;
static const head = 8;
static const ring = 2;
static const offhand = 1;
static const armor_scale_constant = 0.2;
static const gloves = 7;
static const armor = 6;
static var clericEquip:uint = 2;
static var allEquip:uint = 4095;
static var warriorEquip:uint = 8;
static var rangerEquip:uint = 1;
static var mageEquip:uint = 16;
static var rogueEquip:uint = 4;
public function Equipment(){
_slot = 0;
grey_name = "Damaged";
grey_chance = 5;
white_chance = 15;
green_chance = 55;
blue_chance = 24;
purple_chance = 1;
material = -1;
prefix = -1;
suffix = -1;
materials = new Array();
_whoEquips = 0;
_vampiric_percent = 0;
_causes_stun_percent = 0;
_poisonDamage = 0;
_powerRegen = 0;
_healthRegen = 0;
_quickRetreat = false;
_accuracyBonus = 0;
_resistPoison = 0;
_resistStun = 0;
_damageReflection = 0;
_blind = 0;
_lethality = 0;
_damageBonusVsCreatureType = 0;
_damageBonusVsCreatureModifier = 1;
_armor_rating = 0;
base_armor_rating = 0;
base_armor_mod = 0;
_replenishing = 0;
_mod_strength = 0;
_mod_endurance = 0;
_mod_dexterity = 0;
_mod_intellect = 0;
_mod_quickness = 0;
_mod_healing = 0;
super();
item_name = "Equipment";
slot = Equipment.gearSlots;
item_level = 1;
icon_frame = 1;
}
public function getItemModifiers():void{
prefixes = new Array();
prefixes.push(["Runed", 2]);
suffixes = new Array();
suffixes.push(["Resilience", base_item_stat_bonus]);
suffixes.push(["Insight", base_item_stat_bonus]);
suffixes.push(["Speed", 5]);
}
public function get replenishing():int{
return (this._replenishing);
}
public function set damageBonusVsCreatureType(_arg1:int):void{
this._damageBonusVsCreatureType = _arg1;
}
public function set mod_intellect(_arg1:int):void{
this._mod_intellect = _arg1;
}
public function get mod_endurance():int{
return (this._mod_endurance);
}
protected function setVampiric(_arg1:int=5, _arg2:int=7):void{
this.vampiric_percent = (this.vampiric_percent + adjustStat(_arg1, _arg2));
}
public function get lethality():int{
return (this._lethality);
}
public function get quickRetreat():Boolean{
return (this._quickRetreat);
}
protected function setPoisonDamage(_arg1:int=5):void{
this.poisonDamage = (this.poisonDamage + Math.round((MonsterCharacter.getHealthMax(item_level) * (_arg1 / 100))));
}
public function get damageBonusVsCreatureModifier():Number{
return (this._damageBonusVsCreatureModifier);
}
public function usableString():String{
var _local1:String;
if (whoEquips == allEquip){
return ("Usable: All");
};
_local1 = "";
if ((warriorEquip & whoEquips) == warriorEquip){
_local1 = (_local1 + "Warrior, ");
};
if ((rogueEquip & whoEquips) == rogueEquip){
_local1 = (_local1 + "Rogue, ");
};
if ((clericEquip & whoEquips) == clericEquip){
_local1 = (_local1 + "Cleric, ");
};
if ((rangerEquip & whoEquips) == rangerEquip){
_local1 = (_local1 + "Ranger, ");
};
if ((mageEquip & whoEquips) == mageEquip){
_local1 = (_local1 + "Mage, ");
};
if (_local1 == ""){
return ("Usable: None");
};
_local1 = _local1.substr(0, (_local1.length - 2));
return (("Usable: " + _local1));
}
public function set resistPoison(_arg1:int):void{
this._resistPoison = _arg1;
}
public function set lethality(_arg1:int):void{
this._lethality = _arg1;
}
public function set quickRetreat(_arg1:Boolean):void{
this._quickRetreat = _arg1;
}
public function set vampiric_percent(_arg1:int):void{
this._vampiric_percent = _arg1;
}
public function get powerRegen():int{
return (this._powerRegen);
}
public function set armor_rating(_arg1:int):void{
this._armor_rating = _arg1;
}
public function set poisonDamage(_arg1:int):void{
this._poisonDamage = _arg1;
}
public function setIntellect(_arg1:int=1, _arg2:int=3):void{
this.mod_intellect = (this.mod_intellect + adjustStat(_arg1, _arg2, true));
}
protected function setBlind(_arg1:int=10, _arg2:int=20):void{
this.blind = (this.blind + adjustStat(_arg1, _arg2));
}
public function get healthRegen():int{
return (this._healthRegen);
}
public function set whoEquips(_arg1:uint):void{
this._whoEquips = _arg1;
}
protected function setPowerRegen(_arg1:int=1, _arg2:int=4):void{
this.powerRegen = (this.powerRegen + adjustStat(_arg1, _arg2));
}
public function generateItem(_arg1:int):void{
}
public function set accuracyBonus(_arg1:int):void{
this._accuracyBonus = _arg1;
}
public function set damageBonusVsCreatureModifier(_arg1:Number):void{
this._damageBonusVsCreatureModifier = _arg1;
}
public function rollForMaterial(_arg1:int, _arg2:Array):int{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
if (_arg1 == Item.grey){
return (-1);
};
if (_arg1 == Item.purple){
return (-1);
};
_local3 = Math.ceil((100 / _arg2.length));
_local4 = DungeonMain.RandomNum(0, 100);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = ((_local5 + 1) * _local3);
if (_local4 <= _local6){
return (_local5);
};
_local5++;
};
return (1);
}
override public function getItemTypeString(){
return ("Equipment");
}
protected function setResistPoison(_arg1:int=20, _arg2:int=40):void{
this.resistPoison = (this.resistPoison + adjustStat(_arg1, _arg2));
}
public function get blind():int{
return (this._blind);
}
override public function itemData():ItemData{
var _local1:ItemData;
_local1 = new ItemData();
_local1.item_level = this.item_level;
_local1.item_rarity = this.item_rarity;
_local1.purple_num = this.purple_num;
_local1.material = this.material;
_local1.prefix = this.prefix;
_local1.suffix = this.suffix;
return (_local1);
}
public function set mod_endurance(_arg1:int):void{
this._mod_endurance = _arg1;
}
public function set causes_stun_percent(_arg1:int):void{
this._causes_stun_percent = _arg1;
}
public function set powerRegen(_arg1:int):void{
this._powerRegen = _arg1;
}
public function scaleArmorForLevel(_arg1:int):int{
return ((_arg1 * (1 + ((item_level - 1) * armor_scale_constant))));
}
protected function setAccuracy(_arg1:int=5, _arg2:int=15):void{
this.accuracyBonus = (this.accuracyBonus + adjustStat(_arg1, _arg2));
}
override public function itemStatsString(_arg1:String):String{
if (replenishing){
_arg1 = (_arg1 + (("Replenishes " + replenishing) + "% health and power at the end of every battle\n"));
};
if (damageBonusVsCreatureType == MonsterCharacter.undead){
_arg1 = (_arg1 + ((damageBonusVsCreatureModifier * 100) + "% damage to undead\n"));
};
if (damageBonusVsCreatureType == MonsterCharacter.greenskin){
_arg1 = (_arg1 + ((damageBonusVsCreatureModifier * 100) + "% damage to greenskins\n"));
};
if (damageBonusVsCreatureType == MonsterCharacter.creature){
_arg1 = (_arg1 + ((damageBonusVsCreatureModifier * 100) + "% damage to creatures\n"));
};
if (damageBonusVsCreatureType == MonsterCharacter.human){
_arg1 = (_arg1 + ((damageBonusVsCreatureModifier * 100) + "% damage to humans\n"));
};
if (mod_strength > 0){
_arg1 = (_arg1 + (("+" + mod_strength) + " Strength\n"));
};
if (mod_endurance > 0){
_arg1 = (_arg1 + (("+" + mod_endurance) + " Endurance\n"));
};
if (mod_dexterity > 0){
_arg1 = (_arg1 + (("+" + mod_dexterity) + " Dexterity\n"));
};
if (mod_intellect > 0){
_arg1 = (_arg1 + (("+" + mod_intellect) + " Intellect\n"));
};
if (causes_stun_percent > 0){
_arg1 = (_arg1 + (String(causes_stun_percent) + "% chance to stun target\n"));
};
if (blind > 0){
_arg1 = (_arg1 + (("Reduces target's accuracy by " + blind) + "%\n"));
};
if (lethality > 0){
_arg1 = (_arg1 + (lethality + "% chance to kill target\n"));
};
if (powerRegen > 0){
_arg1 = (_arg1 + (("+" + powerRegen) + " power regeneration\n"));
};
if (healthRegen > 0){
_arg1 = (_arg1 + (("+" + healthRegen) + " health regeneration\n"));
};
if (damageReflection > 0){
_arg1 = (_arg1 + (damageReflection + "% damage reflection\n"));
};
if (resistPoison > 0){
_arg1 = (_arg1 + (resistPoison + "% reduced damage from poison\n"));
};
if (resistStun > 0){
_arg1 = (_arg1 + (resistStun + "% chance to resist stun\n"));
};
if (vampiric_percent > 0){
_arg1 = (_arg1 + (("Drain health (" + vampiric_percent) + "% of damage)\n"));
};
if (poisonDamage > 0){
_arg1 = (_arg1 + (("Apply " + poisonDamage) + " poison damage on hit\n"));
};
if (accuracyBonus){
_arg1 = (_arg1 + (("+" + accuracyBonus) + " chance to hit\n"));
};
if (mod_quickness > 0){
_arg1 = (_arg1 + (("+" + mod_quickness) + " Quickness\n"));
};
if (mod_quickness < 0){
_arg1 = (_arg1 + (mod_quickness + " Quickness\n"));
};
if (quickRetreat){
_arg1 = (_arg1 + "Wearer may retreat instantly\n");
};
return (_arg1);
}
protected function setHealthRegen(_arg1:int=7):void{
this.healthRegen = (this.healthRegen + Math.round((_arg1 * (PlayerCharacter.baseHealthForLevel(item_level) / 100))));
}
public function get damageBonusVsCreatureType():int{
return (this._damageBonusVsCreatureType);
}
public function set resistStun(_arg1:int):void{
this._resistStun = _arg1;
}
public function set healthRegen(_arg1:int):void{
this._healthRegen = _arg1;
}
protected function adjustStat(_arg1:int, _arg2:int, _arg3:Boolean=false):int{
var _local4:Number;
var _local5:*;
_local4 = 0;
if (_arg3){
_local4 = ((item_level - 1) / DungeonMain.MAX_LEVEL);
} else {
_local4 = Math.min(1, ((item_level - 1) / DungeonMain.MAX_LEVEL));
};
_local5 = Math.round((_arg1 + (_local4 * Math.abs((_arg2 - _arg1)))));
return (_local5);
}
protected function setDamageReflection(_arg1:int=25, _arg2:int=45):void{
this.damageReflection = (this.damageReflection + adjustStat(_arg1, _arg2));
}
public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
if (suffixes[_local1][0] == "Reflection"){
setDamageReflection();
return;
};
if (suffixes[_local1][0] == "Tenacity"){
setResistStun();
return;
};
if (suffixes[_local1][0] == "Accuracy"){
setAccuracy();
return;
};
if (suffixes[_local1][0] == "Might"){
setStrength();
return;
};
if (suffixes[_local1][0] == "Resilience"){
setEndurance();
return;
};
if (suffixes[_local1][0] == "Insight"){
setIntellect();
return;
};
if (suffixes[_local1][0] == "Deftness"){
setDexterity();
return;
};
if (suffixes[_local1][0] == "Speed"){
setQuickness();
return;
};
if (suffixes[_local1][0] == "Lethality"){
setLethality();
return;
};
if (suffixes[_local1][0] == "Discretion"){
quickRetreat = true;
return;
};
}
protected function SetRarity(_arg1:int){
var _local2:int;
if (_arg1 >= 0){
this.item_rarity = _arg1;
return;
};
_local2 = DungeonMain.RandomNum(1, 100);
if (_local2 <= grey_chance){
item_rarity = Item.grey;
} else {
if (_local2 <= (white_chance + grey_chance)){
item_rarity = Item.white;
} else {
if (_local2 <= ((green_chance + grey_chance) + white_chance)){
item_rarity = Item.green;
} else {
if (_local2 <= (((blue_chance + green_chance) + grey_chance) + white_chance)){
item_rarity = Item.blue;
} else {
item_rarity = Item.purple;
};
};
};
};
}
public function set mod_dexterity(_arg1:int):void{
this._mod_dexterity = _arg1;
}
protected function setStunChance(_arg1:int=5, _arg2:int=10):void{
this.causes_stun_percent = (this.causes_stun_percent + adjustStat(_arg1, _arg2));
}
protected function setQuickness(_arg1:int=3, _arg2:int=10):void{
this.mod_quickness = (this.mod_quickness + adjustStat(_arg1, _arg2));
}
public function set mod_quickness(_arg1:int):void{
this._mod_quickness = _arg1;
}
public function get vampiric_percent():int{
return (this._vampiric_percent);
}
public function get resistPoison():int{
return (this._resistPoison);
}
public function setDexterity(_arg1:int=1, _arg2:int=3):void{
this.mod_dexterity = (this.mod_dexterity + adjustStat(_arg1, _arg2, true));
}
public function get mod_intellect():int{
return (this._mod_intellect);
}
public function set mod_healing(_arg1:int):void{
this._mod_healing = _arg1;
}
public function get armor_rating():int{
return (this._armor_rating);
}
public function get poisonDamage():int{
return (this._poisonDamage);
}
public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
if (prefixes[_local1][0] == "Runed"){
setPowerRegen();
return;
};
if (prefixes[_local1][0] == "Vampiric"){
setVampiric();
return;
};
if (prefixes[_local1][0] == "Staggering"){
setStunChance();
return;
};
if (prefixes[_local1][0] == "Unerring"){
setAccuracy();
return;
};
if (prefixes[_local1][0] == "Venomous"){
setPoisonDamage();
return;
};
if (prefixes[_local1][0] == "Blinding"){
setBlind();
return;
};
if (prefixes[_local1][0] == "Soothing"){
setHealthRegen();
return;
};
if (prefixes[_local1][0] == "Purifying"){
setResistPoison();
return;
};
}
public function get whoEquips():uint{
return (this._whoEquips);
}
public function get accuracyBonus():int{
return (this._accuracyBonus);
}
public function set blind(_arg1:int):void{
this._blind = _arg1;
}
public function get causes_stun_percent():int{
return (this._causes_stun_percent);
}
public function set mod_strength(_arg1:int):void{
this._mod_strength = _arg1;
}
public function rollForPrefix(_arg1:int):int{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
if ((((_arg1 == Item.grey)) || ((_arg1 == Item.white)))){
return (-1);
};
_local2 = Math.ceil((100 / prefixes.length));
_local3 = DungeonMain.RandomNum(0, 100);
_local4 = 0;
while (_local4 < prefixes.length) {
_local5 = ((_local4 + 1) * _local2);
if (_local3 <= _local5){
return (_local4);
};
_local4++;
};
return (-1);
}
public function setStrength(_arg1:int=1, _arg2:int=3):void{
this.mod_strength = (this.mod_strength + adjustStat(_arg1, _arg2, true));
}
public function get resistStun():int{
return (this._resistStun);
}
public function setEndurance(_arg1:int=1, _arg2:int=3):void{
this.mod_endurance = (this.mod_endurance + adjustStat(_arg1, _arg2, true));
}
public function get mod_dexterity():int{
return (this._mod_dexterity);
}
protected function setResistStun(_arg1:int=20, _arg2:int=40):void{
this.resistStun = (this.resistStun + adjustStat(_arg1, _arg2));
}
public function get mod_quickness():int{
return (this._mod_quickness);
}
public function rollForSuffix(_arg1:int):int{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
if ((((_arg1 == Item.grey)) || ((_arg1 == Item.white)))){
return (-1);
};
_local2 = Math.ceil((100 / suffixes.length));
_local3 = DungeonMain.RandomNum(0, 100);
_local4 = 0;
while (_local4 < suffixes.length) {
_local5 = ((_local4 + 1) * _local2);
if (_local3 <= _local5){
return (_local4);
};
_local4++;
};
return (-1);
}
protected function setLethality(_arg1:int=5, _arg2:int=10):void{
this.lethality = (this.lethality + adjustStat(_arg1, _arg2));
}
public function get mod_healing():int{
return (this._mod_healing);
}
public function get mod_strength():int{
return (this._mod_strength);
}
public function set damageReflection(_arg1:int):void{
this._damageReflection = _arg1;
}
public function get damageReflection():int{
return (this._damageReflection);
}
public function set slot(_arg1:int):void{
this._slot = _arg1;
}
public function get slot():int{
return (this._slot);
}
public function set replenishing(_arg1:int):void{
this._replenishing = _arg1;
}
}
}//package
Section 111
//ErrorDialog (ErrorDialog)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
import flash.ui.*;
public class ErrorDialog extends MovieClip {
public var yes_btn:ContinueButton;
public var bg:MovieClip;
public var dlg_text:TextField;
public var dlg_title:TextField;
public function ErrorDialog(_arg1:String="", _arg2:String=""){
var _local3:*;
var _local4:*;
super();
if (_arg1.length){
setTitle(_arg1);
};
if (_arg2.length){
setText(_arg2);
};
yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
dlg_title.y = (bg.y + 5);
dlg_text.y = (dlg_title.y + 40);
yes_btn.y = ((dlg_text.y + dlg_text.textHeight) + 18);
bg.height = ((yes_btn.y - bg.y) + 26);
_local3 = bg.y;
bg.y = ((DungeonMain.APP_HEIGHT - bg.height) / 2);
_local4 = (_local3 - bg.y);
dlg_title.y = (dlg_title.y - _local4);
dlg_text.y = (dlg_text.y - _local4);
yes_btn.y = (yes_btn.y - _local4);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
public function setTitle(_arg1:String):void{
dlg_title.text = _arg1;
dm.embolden(dlg_title);
}
private function cleanup():void{
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
}
public function setText(_arg1:String):void{
dlg_text.text = _arg1;
}
function clickOkay(_arg1:MouseEvent):void{
if (stage != null){
stage.removeChild(this);
cleanup();
};
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == Keyboard.ENTER)) || ((_arg1.keyCode == Keyboard.ESCAPE)))){
clickOkay(null);
};
}
}
}//package
Section 112
//ExitStairs (ExitStairs)
package {
import flash.display.*;
public dynamic class ExitStairs extends MovieClip {
}
}//package
Section 113
//FadeScreen (FadeScreen)
package {
import flash.display.*;
public dynamic class FadeScreen extends MovieClip {
public function FadeScreen(){
addFrameScript(5, frame6);
}
function frame6(){
this.gotoAndStop(6);
}
}
}//package
Section 114
//feardeath_effect (feardeath_effect)
package {
import flash.display.*;
public dynamic class feardeath_effect extends MovieClip {
public function feardeath_effect(){
addFrameScript(0, frame1, 34, frame35, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.curse, 0.75);
}
function frame35(){
this.stop();
}
function frame45(){
this.stop();
}
}
}//package
Section 115
//fire_effect (fire_effect)
package {
import flash.display.*;
public dynamic class fire_effect extends MovieClip {
public var flames:fire_scroll;
public function fire_effect(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
dm.sound.play(SoundControl.flames);
this.flames.x = DungeonMain.RandomNum(0, 240);
}
function frame50(){
this.stop();
}
}
}//package
Section 116
//fire_scroll (fire_scroll)
package {
import flash.display.*;
public dynamic class fire_scroll extends MovieClip {
public function fire_scroll(){
addFrameScript(44, frame45);
}
function frame45(){
this.gotoAndStop(45);
}
}
}//package
Section 117
//flames_sound (flames_sound)
package {
import flash.media.*;
public dynamic class flames_sound extends Sound {
}
}//package
Section 118
//freeze_sound (freeze_sound)
package {
import flash.media.*;
public dynamic class freeze_sound extends Sound {
}
}//package
Section 119
//frozen_effect (frozen_effect)
package {
import flash.display.*;
public dynamic class frozen_effect extends MovieClip {
public function frozen_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.freeze);
}
function frame45(){
this.stop();
}
}
}//package
Section 120
//gain_both_effect (gain_both_effect)
package {
import flash.display.*;
public dynamic class gain_both_effect extends MovieClip {
public function gain_both_effect(){
addFrameScript(44, frame45);
}
function frame45(){
this.stop();
}
}
}//package
Section 121
//gain_health_effect (gain_health_effect)
package {
import flash.display.*;
public dynamic class gain_health_effect extends MovieClip {
public function gain_health_effect(){
addFrameScript(20, frame21, 44, frame45);
}
function frame21(){
this.stop();
}
function frame45(){
this.stop();
}
}
}//package
Section 122
//gain_power_effect (gain_power_effect)
package {
import flash.display.*;
public dynamic class gain_power_effect extends MovieClip {
public function gain_power_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.powerUp);
}
function frame45(){
this.stop();
}
}
}//package
Section 123
//GenderIcon (GenderIcon)
package {
import flash.display.*;
public dynamic class GenderIcon extends MovieClip {
}
}//package
Section 124
//GlobalVolume (GlobalVolume)
package {
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class GlobalVolume {
static const fade_out_time = 500;
static const volumeFull = 1;
static const volumeMid = 0.5;
static const volumeLow = 0.15;
static const sound_fade_steps = 20;
static const fade_in_time = 1000;
static const volumeOff = 0;
static var volumeSetting:Number = 1;
static var fadeTimer:Timer;
static var fadeFromSetting:Number = 0;
public static function beginFade():void{
var _local1:*;
if (volumeSetting == fadeFromSetting){
return;
};
if (volumeSetting > fadeFromSetting){
_local1 = fade_in_time;
} else {
_local1 = fade_out_time;
};
SoundMixer.soundTransform = new SoundTransform(fadeFromSetting);
fadeTimer = new Timer(Math.round((_local1 / sound_fade_steps)), sound_fade_steps);
fadeTimer.addEventListener(TimerEvent.TIMER, fadeStep);
fadeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, fadeDone);
fadeTimer.start();
}
public static function mute():void{
setVolume(volumeOff);
}
public static function setVolume(_arg1:Number, _arg2:Boolean=false):void{
fadeFromSetting = volumeSetting;
volumeSetting = _arg1;
if (_arg2){
beginFade();
} else {
SoundMixer.soundTransform = new SoundTransform(_arg1);
};
}
static function fadeDone(_arg1:TimerEvent):void{
fadeTimer.removeEventListener(TimerEvent.TIMER, fadeStep);
fadeTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, fadeDone);
SoundMixer.soundTransform = new SoundTransform(volumeSetting);
}
static function fadeStep(_arg1:TimerEvent):void{
var _local2:*;
var _local3:*;
_local2 = ((volumeSetting - fadeFromSetting) / sound_fade_steps);
_local3 = (SoundMixer.soundTransform.volume + _local2);
SoundMixer.soundTransform = new SoundTransform(_local3);
}
}
}//package
Section 125
//GreenBar (GreenBar)
package {
import flash.display.*;
public dynamic class GreenBar extends Sprite {
}
}//package
Section 126
//grid_marker (grid_marker)
package {
import flash.text.*;
import flash.display.*;
public dynamic class grid_marker extends MovieClip {
public var owner_label:TextField;
}
}//package
Section 127
//heal1_sound (heal1_sound)
package {
import flash.media.*;
public dynamic class heal1_sound extends Sound {
}
}//package
Section 128
//healeffect (healeffect)
package {
import flash.display.*;
public dynamic class healeffect extends MovieClip {
public function healeffect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.heal);
}
function frame45(){
this.stop();
}
}
}//package
Section 129
//healeffect_green (healeffect_green)
package {
import flash.display.*;
public dynamic class healeffect_green extends MovieClip {
}
}//package
Section 130
//HealthBar (HealthBar)
package {
import flash.display.*;
public dynamic class HealthBar extends MovieClip {
public var bar:RedBar;
public var lightbar:RedBar;
}
}//package
Section 131
//HeavyArmor (HeavyArmor)
package {
public class HeavyArmor extends Armor {
public function HeavyArmor(){
type = Armor.heavy;
mod_quickness = (mod_quickness - 5);
whoEquips = (Equipment.warriorEquip + Equipment.clericEquip);
base_armor_rating = 27;
grey_name = "Battered";
materials.push("Iron", "Steel", "Damascene", "Mithril", "Magesteel", "Planeforged");
}
override public function getItemTypeString(){
return ("Heavy Armor");
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function itemStatsString(_arg1:String):String{
return (super.itemStatsString(_arg1));
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
if (prefixes[_local1][0] == "Lightweight"){
mod_quickness = (mod_quickness + prefixes[_local1][1]);
if (mod_quickness > 0){
mod_quickness = 0;
};
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Lightweight", 2]);
}
}
}//package
Section 132
//HelpButton (HelpButton)
package {
import flash.events.*;
import flash.display.*;
public class HelpButton extends MovieClip {
var target:DisplayObjectContainer;
var helpscreen:MovieClip;
public function HelpButton(){
addEventListener(MouseEvent.MOUSE_DOWN, clicked);
}
public function clicked(_arg1:MouseEvent){
if (parent == null){
return;
};
target = parent;
if ((parent is DungeonInterface)){
helpscreen = new HelpScreenDungeon();
target = parent.parent;
} else {
if ((parent is Inventory)){
helpscreen = new HelpScreenInventory();
} else {
if ((parent is Battlefield)){
helpscreen = new HelpScreenBattlefield();
};
};
};
if (helpscreen == null){
return;
};
helpscreen.addEventListener(MouseEvent.MOUSE_DOWN, closeHelp);
target.addChild(helpscreen);
}
function closeHelp(_arg1:MouseEvent):void{
if (helpscreen == null){
return;
};
if (target == null){
target = parent;
};
helpscreen.removeEventListener(MouseEvent.MOUSE_DOWN, closeHelp);
if (target.contains(helpscreen)){
target.removeChild(helpscreen);
};
helpscreen = null;
}
public function cleanup():void{
removeEventListener(MouseEvent.MOUSE_DOWN, clicked);
}
}
}//package
Section 133
//HelpScreenBattlefield (HelpScreenBattlefield)
package {
import flash.display.*;
public dynamic class HelpScreenBattlefield extends MovieClip {
}
}//package
Section 134
//HelpScreenDungeon (HelpScreenDungeon)
package {
import flash.display.*;
public dynamic class HelpScreenDungeon extends MovieClip {
}
}//package
Section 135
//HelpScreenInventory (HelpScreenInventory)
package {
import flash.display.*;
public dynamic class HelpScreenInventory extends MovieClip {
}
}//package
Section 136
//hide3_sound (hide3_sound)
package {
import flash.media.*;
public dynamic class hide3_sound extends Sound {
}
}//package
Section 137
//HidingEffect (HidingEffect)
package {
import flash.display.*;
public dynamic class HidingEffect extends MovieClip {
}
}//package
Section 138
//HintButton (HintButton)
package {
import flash.display.*;
public dynamic class HintButton extends MovieClip {
}
}//package
Section 139
//HintDialog (HintDialog)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
import flash.ui.*;
public class HintDialog extends MovieClip {
public var yes_btn:ContinueButton;
var checkboxEnabled:Boolean;// = true
public var showCheck:dCheckBox;
public var bg:MovieClip;
public var dlg_text:TextField;
public var dlg_title:TextField;
public function HintDialog(_arg1:String="", _arg2:String="", _arg3:Boolean=true, _arg4:Boolean=false){
var _local5:*;
var _local6:*;
checkboxEnabled = true;
super();
if (_arg1.length){
setTitle(_arg1);
};
if (_arg2.length){
setText(_arg2);
};
yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
if (_arg3){
showCheck.setChecked(DungeonMain.showHints);
showCheck.setDescription("Show hints and tips");
} else {
removeChild(showCheck);
checkboxEnabled = false;
};
dlg_text.mouseEnabled = false;
dlg_title.y = (bg.y + 5);
dlg_text.y = (dlg_title.y + 40);
yes_btn.y = ((dlg_text.y + dlg_text.textHeight) + 18);
showCheck.y = yes_btn.y;
bg.height = ((yes_btn.y - bg.y) + 26);
_local5 = bg.y;
if (!_arg4){
bg.y = (((DungeonMain.APP_HEIGHT - bg.height) - 130) / 2);
} else {
bg.y = ((DungeonMain.APP_HEIGHT - bg.height) / 2);
};
_local6 = (_local5 - bg.y);
dlg_title.y = (dlg_title.y - _local6);
dlg_text.y = (dlg_text.y - _local6);
yes_btn.y = (yes_btn.y - _local6);
showCheck.y = (showCheck.y - _local6);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
public function setTitle(_arg1:String):void{
dlg_title.text = _arg1;
dm.embolden(dlg_title);
}
private function cleanup():void{
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
showCheck.cleanup();
}
public function setText(_arg1:String):void{
dlg_text.text = _arg1;
}
function clickOkay(_arg1:MouseEvent):void{
if (stage != null){
DungeonMain.showHints = showCheck.checked;
if (dm.main != null){
dm.main.saveInterface();
};
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
stage.removeChild(this);
cleanup();
};
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == Keyboard.ENTER)) || ((_arg1.keyCode == Keyboard.ESCAPE)))){
clickOkay(null);
};
}
}
}//package
Section 140
//Horde (Horde)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class Horde extends MovieClip {
var tooltip:HordeTooltip;
var members:Array;
var defeated:Boolean;// = false
public var bg:MovieClip;
var boss:Boolean;// = false
var level:int;// = 1
public var icon:HordeIcon;
var race:int;// = 1
var room:DungeonRoom;
static const cultists = 8;
static const greenskins = 2;
static const creatures = 4;
static const special = 16;
static const max_size = 6;
static const undead = 1;
public function Horde(_arg1:int=1, _arg2:int=1, _arg3=false, _arg4=null, _arg5:Boolean=false){
var _local6:*;
var _local7:MonsterCharacter;
var _local8:*;
var _local9:*;
var _local10:Boolean;
var _local11:Array;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
var _local16:*;
members = new Array();
defeated = false;
race = Horde.undead;
level = 1;
boss = false;
super();
addFrameScript(0, frame1, 14, frame15, 29, frame30);
_local6 = 0;
_local8 = -1;
_local9 = dm.randomNum(1, 4);
this.race = _arg1;
this.level = _arg2;
this.boss = _arg3;
this.room = _arg4;
if (_arg3){
icon.gotoAndStop(2);
if (_arg2 == DungeonMain.MAX_LEVEL){
_local7 = new mDemon(_arg2);
_local7.pos = 2;
} else {
if (_arg2 <= 4){
_local10 = true;
} else {
if (_arg2 <= 8){
_local10 = false;
} else {
_local10 = (DungeonMain.RandomNum(0, 1000) > 500);
};
};
if (_arg1 == Horde.special){
_local8 = dm.randomNum(1, 4);
};
if ((((_arg1 == Horde.undead)) || ((_local8 == 1)))){
if (_local10){
_local7 = new mDeathKnight(_arg2);
} else {
_local7 = new mNecromancer(_arg2);
};
} else {
if ((((_arg1 == Horde.greenskins)) || ((_local8 == 2)))){
if (_local10){
_local7 = new mOrcJuggernaut(_arg2);
} else {
_local7 = new mOrcWarlord(_arg2);
};
} else {
if ((((_arg1 == Horde.creatures)) || ((_local8 == 3)))){
if (_local10){
_local7 = new mDragon(_arg2);
} else {
_local7 = new mBeholder(_arg2);
};
} else {
if ((((_arg1 == Horde.cultists)) || ((_local8 == 4)))){
if (_local10){
_local7 = new mCultEngine(_arg2);
} else {
_local7 = new mAscendant(_arg2);
};
};
};
};
};
};
if (((!((_local7 == null))) && (!(_arg5)))){
if (_local10){
_local7.pos = 5;
} else {
_local7.pos = 2;
};
members.push(_local7);
_local6 = _local7.pos;
_local9 = (_local9 + 2);
};
};
_local9 = (_local9 + getRoomSizeModifier());
if (_arg2 == DungeonMain.MAX_LEVEL){
if (_arg3){
_local9 = 1;
} else {
_local9++;
};
} else {
if (_arg2 == 1){
_local9--;
};
};
_local9 = Math.min(_local9, 6);
_local9 = Math.max(_local9, 1);
while ((((members.length < _local9)) && (!(_arg5)))) {
_local11 = new Array(6);
_local12 = 0;
while (_local12 < 6) {
_local11[_local12] = (_local12 + 1);
_local12++;
};
_local11 = dm.shuffleArray(_local11);
_local13 = 0;
while (_local13 < 6) {
if (_local11[_local13] == _local6){
} else {
if (memberInPos(_local11[_local13]) != null){
} else {
_local14 = (_local9 - members.length);
_local15 = Math.round((75 / _local14));
if (DungeonMain.RandomNum(0, 100) <= _local15){
_local16 = _arg2;
_local7 = GetMonsterForSlot(_arg1, _local16, _local11[_local13]);
members.push(_local7);
if (members.length == _local9){
break;
};
};
};
};
_local13++;
};
};
bg.addEventListener(MouseEvent.MOUSE_MOVE, hordeMouseOnTarget);
bg.addEventListener(MouseEvent.MOUSE_OVER, hordeMouseOnTarget);
bg.addEventListener(MouseEvent.MOUSE_OUT, hordeMouseOutTarget);
}
public function battleAnim():void{
this.gotoAndPlay("battle");
dm.sound.play(SoundControl.battleStart, Music.volumeSetting);
}
protected function GetMonsterForSlot(_arg1:int, _arg2:int, _arg3:int):MonsterCharacter{
var _local4:MonsterCharacter;
var _local5:*;
var _local6:*;
_local5 = (_arg3 > 3);
if ((_arg2 % DungeonMain.MAX_LEVEL) == 0){
_local6 = dm.randomNum(1, 99);
if (_local6 > 75){
_local4 = getUndead(_arg1, _arg2, _local5);
} else {
if (_local6 > 50){
_local4 = getGreenskin(_arg1, _arg2, _local5);
} else {
if (_local6 > 25){
_local4 = getCreature(_arg1, _arg2, _local5);
} else {
_local4 = getCultist(_arg1, _arg2, _local5);
};
};
};
} else {
if (_arg1 == Horde.undead){
_local4 = getUndead(_arg1, _arg2, _local5);
} else {
if (_arg1 == Horde.greenskins){
_local4 = getGreenskin(_arg1, _arg2, _local5);
} else {
if (_arg1 == Horde.creatures){
_local4 = getCreature(_arg1, _arg2, _local5);
} else {
if (_arg1 == Horde.cultists){
_local4 = getCultist(_arg1, _arg2, _local5);
} else {
_local4 = new mGreebler(_arg2);
};
};
};
};
};
_local4.pos = _arg3;
return (_local4);
}
private function newTooltip():Boolean{
var _local1:*;
var _local2:Array;
var _local3:Boolean;
var _local4:*;
var _local5:*;
var _local6:*;
_local1 = 0;
_local2 = new Array();
_local4 = getHordeDescription();
if (!members.length){
return (false);
};
_local5 = 0;
while (_local5 < members.length) {
if (members[_local5].health <= 0){
} else {
_local3 = true;
_local6 = 0;
while (_local6 < _local2.length) {
if (_local2[_local6][0] == members[_local5].charname){
var _local7 = _local2[_local6];
var _local8 = 1;
var _local9 = (_local7[_local8] + 1);
_local7[_local8] = _local9;
_local3 = false;
break;
};
_local6++;
};
if (_local3){
_local2.push([members[_local5].charname, 1, members[_local5].portrait]);
};
};
_local5++;
};
tooltip = new HordeTooltip(_local4, _local2, boss);
tooltip.mouseEnabled = false;
tooltip.mouseChildren = false;
tooltip.name = "tooltip_horde";
stage.addChild(tooltip);
tooltip.mask = null;
return (true);
}
public function fullRecovery():void{
var _local1:*;
_local1 = 0;
while (_local1 < members.length) {
members[_local1].clearStatusEffects();
members[_local1].health = members[_local1].health_max;
members[_local1].power = members[_local1].power_max;
_local1++;
};
}
function onFadeComplete(_arg1:TimerEvent):void{
if (parent != null){
parent.removeChild(this);
};
}
function hordeMouseOnTarget(_arg1:MouseEvent):void{
var _local2:Point;
var _local3:*;
var _local4:*;
var _local5 = ??pushnamespace
;
if (room == null){
return;
};
if (!room.seen){
return;
};
if (_arg1.buttonDown){
return;
};
if (tooltip == null){
if (!newTooltip()){
return;
};
};
_local2 = _arg1.target.localToGlobal(new Point(_arg1.target.mouseX, _arg1.target.mouseY));
_local3 = _local2.x;
_local4 = _local2.y;
_local5 = 5;
if (((_local2.x + tooltip.width) + _local5) > DungeonMain.APP_WIDTH){
_local3 = (_local3 + (DungeonMain.APP_WIDTH - ((_local2.x + tooltip.width) + _local5)));
};
if (((_local2.y + tooltip.height) + _local5) > DungeonMain.APP_HEIGHT){
_local4 = (_local4 + (DungeonMain.APP_HEIGHT - ((_local2.y + tooltip.height) + _local5)));
};
tooltip.x = _local3;
tooltip.y = _local4;
_arg1.updateAfterEvent();
}
public function convertHealthTo12():void{
var _local1:*;
var _local2:*;
var _local3:Number;
var _local4:int;
var _local5:int;
if (level < 65){
return;
};
_local1 = MonsterCharacter.getHealthMaxOld(level);
_local2 = 0;
while (_local2 < members.length) {
_local3 = (members[_local2].health_max / _local1);
_local4 = MonsterCharacter.getHealthMax(level);
_local5 = Math.round((_local3 * _local4));
members[_local2].health_max = _local5;
members[_local2].health = _local5;
_local2++;
};
}
public function memberInPos(_arg1:int):MonsterCharacter{
var _local2:*;
if (_arg1 <= 0){
return (null);
};
if (_arg1 > 6){
return (null);
};
_local2 = 0;
while (_local2 < members.length) {
if (members[_local2].pos == _arg1){
return (members[_local2]);
};
_local2++;
};
return (null);
}
private function getGreenskin(_arg1:int, _arg2:int, _arg3:Boolean):MonsterCharacter{
var _local4:*;
var _local5:MonsterCharacter;
_local4 = DungeonMain.RandomNum(0, 100);
if (_arg3){
if (_local4 <= 20){
_local5 = new mOrcChampion(_arg2);
} else {
if (_local4 <= 50){
_local5 = new mTroll(_arg2);
} else {
_local5 = new mOrcBerserker(_arg2);
};
};
} else {
if (_local4 <= 40){
_local5 = new mOrcShaman(_arg2);
} else {
if (_local4 <= 70){
_local5 = new mGoblinArtificer(_arg2);
} else {
_local5 = new mOrcSavage(_arg2);
};
};
};
return (_local5);
}
public function fade():void{
var _local1:Timer;
defeated = true;
this.gotoAndPlay("fade");
_local1 = new Timer(500, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, onFadeComplete);
_local1.start();
}
private function getUndead(_arg1:int, _arg2:int, _arg3:Boolean):MonsterCharacter{
var _local4:*;
var _local5:MonsterCharacter;
_local4 = DungeonMain.RandomNum(0, 100);
if (_arg3){
if (_local4 <= 20){
_local5 = new mBoneHorror(_arg2);
} else {
if (_local4 <= 50){
_local5 = new mGhost(_arg2);
} else {
_local5 = new mSkeleton(_arg2);
};
};
} else {
if (_local4 <= 30){
_local5 = new mLich(_arg2);
} else {
if (_local4 <= 60){
_local5 = new mVampire(_arg2);
} else {
_local5 = new mSkeletonArcher(_arg2);
};
};
};
return (_local5);
}
function frame15(){
this.gotoAndStop(15);
}
function frame30(){
this.gotoAndStop(30);
}
private function getCultist(_arg1:int, _arg2:int, _arg3:Boolean):MonsterCharacter{
var _local4:*;
var _local5:MonsterCharacter;
_local4 = DungeonMain.RandomNum(0, 100);
if (_arg3){
if (_local4 <= 40){
_local5 = new mCultWarrior(_arg2);
} else {
if (_local4 <= 80){
_local5 = new mCultNeophyte(_arg2);
} else {
_local5 = new mCultChosen(_arg2);
};
};
} else {
if (_local4 <= 60){
_local5 = new mCultArcher(_arg2);
} else {
_local5 = new mCultPriest(_arg2);
};
};
return (_local5);
}
function frame1(){
this.gotoAndStop("normal");
}
function hordeMouseOutTarget(_arg1:MouseEvent):void{
if (tooltip != null){
if (((!((stage == null))) && (stage.contains(tooltip)))){
stage.removeChild(tooltip);
};
tooltip = null;
};
}
public function cleanup():void{
bg.removeEventListener(MouseEvent.MOUSE_MOVE, hordeMouseOnTarget);
bg.removeEventListener(MouseEvent.MOUSE_OVER, hordeMouseOnTarget);
bg.removeEventListener(MouseEvent.MOUSE_OUT, hordeMouseOutTarget);
}
private function getCreature(_arg1:int, _arg2:int, _arg3:Boolean):MonsterCharacter{
var _local4:*;
var _local5:MonsterCharacter;
_local4 = DungeonMain.RandomNum(0, 100);
if (_arg3){
if (_local4 <= 40){
_local5 = new mArachnoid(_arg2);
} else {
if (_local4 <= 60){
_local5 = new mBasilisk(_arg2);
} else {
_local5 = new mGreebler(_arg2);
};
};
} else {
if (_local4 <= 35){
_local5 = new mPoisonDrake(_arg2);
} else {
if (_local4 <= 70){
_local5 = new mLightningDrake(_arg2);
} else {
_local5 = new mGargoyle(_arg2);
};
};
};
return (_local5);
}
public function isDemonHorde():Boolean{
var _local1:*;
if (!boss){
return (false);
};
if (level < 9){
return (false);
};
if (((!((room == null))) && ((room is rDemonRoom)))){
return (true);
};
_local1 = 0;
while (_local1 < members.length) {
if ((members[_local1] is mDemon)){
return (true);
};
_local1++;
};
return (false);
}
protected function getHordeDescription():String{
if (race == Horde.undead){
if (boss){
return ("Death's Champions");
};
if (members.length <= 2){
return ("Wandering Bones");
};
if (members.length <= 4){
return ("Restless Dead");
};
return ("Undying Horde");
//unresolved jump
};
if (race == Horde.greenskins){
if (boss){
return ("Warleader's Band");
};
if (members.length <= 2){
return ("Greenskin Patrol");
};
if (members.length <= 4){
return ("Savage Host");
};
return ("Orcish Legion");
//unresolved jump
};
if (race == Horde.creatures){
if (boss){
return ("Ancient Ones");
};
if (members.length <= 2){
return ("Scavengers");
};
if (members.length <= 4){
return ("Hunting Pack");
};
return ("Beastly Horde");
//unresolved jump
};
if (race == Horde.special){
if (boss){
return ("Hellish Overlord");
};
if (members.length <= 2){
return ("Honor Guard");
};
if (members.length <= 4){
return ("United Forces");
};
return ("Alliance of Evil");
//unresolved jump
};
if (race == Horde.cultists){
if (boss){
return ("The Enlightened");
};
if (members.length <= 2){
return ("Cult Sentries");
};
if (members.length <= 4){
return ("Path Faithful");
};
return ("Planebreakers");
//unresolved jump
};
return (Horde.nameForRace(race, true));
}
public function hordeData():HordeData{
var _local1:HordeData;
_local1 = new HordeData();
_local1.roomIndex = this.room.index;
_local1.defeated = this.defeated;
_local1.race = this.race;
_local1.boss = this.boss;
_local1.level = this.level;
return (_local1);
}
protected function getRoomSizeModifier():int{
if (room == null){
return (0);
};
if ((room is rCorridorV)){
return (-1);
};
if ((room is rCorridorH)){
return (-1);
};
if ((room is rCell)){
return (0);
};
if ((room is rChamber)){
return (0);
};
if ((room is rTallRoom)){
return (1);
};
if ((room is rWideRoom)){
return (1);
};
if ((room is rGallery)){
return (2);
};
if ((room is rLargeRoom)){
return (2);
};
return (0);
}
public static function getEngineName():String{
var _local1:Array;
var _local2:Array;
var _local3:String;
_local1 = new Array("Consecrator", "Retributor", "Assimilator", "Annihilator", "Exemplifier", "Admonisher", "Intensifier", "Augmentor");
_local2 = new Array("1", "2", "3", "4", "5", "6", "7", "8", "9");
_local3 = "";
_local3 = (_local3 + _local1[dm.randomNum(0, (_local1.length - 1))]);
_local3 = (_local3 + "-");
_local3 = (_local3 + _local2[dm.randomNum(0, (_local2.length - 1))]);
return (_local3);
}
public static function getNecromancerName():String{
var _local1:Array;
var _local2:Array;
var _local3:Array;
var _local4:String;
_local1 = new Array("Ner", "Zag", "Jal", "Sel", "Bal", "Dam", "Zel", "Sal", "Nar", "Mal", "Tral");
_local2 = new Array("'", "a", "e", "u", "o");
_local3 = new Array("gar", "zar", "thon", "sal", "tor", "thul", "thal", "bann");
_local4 = "";
_local4 = (_local4 + _local1[dm.randomNum(0, (_local1.length - 1))]);
_local4 = (_local4 + _local2[dm.randomNum(0, (_local2.length - 1))]);
_local4 = (_local4 + _local3[dm.randomNum(0, (_local3.length - 1))]);
return (_local4);
}
public static function getKnightName():String{
var _local1:Array;
var _local2:Array;
var _local3:String;
_local1 = new Array("Ser ", "Sir ", "Lord ", "Black ", "Fell ", "Dread ");
_local2 = new Array("Nigel", "Neil", "Niles", "Charles", "Boris", "Jethro", "Gerald", "Horace", "Stan", "Alan", "Hank", "Marty", "Trevor", "Trent", "Bruce", "Eugene", "Wally", "Harold", "Hamish", "Carlos", "Jeremy", "Jerome", "Jermaine", "Tito", "George", "Hans", "Chad", "Rupert", "Ruprecht", "Albert", "Alfred", "Phineas", "Brent", "Colin", "Travis", "Jarvis", "Elton", "Ernest");
_local3 = "";
_local3 = (_local3 + _local1[dm.randomNum(0, (_local1.length - 1))]);
_local3 = (_local3 + _local2[dm.randomNum(0, (_local2.length - 1))]);
return (_local3);
}
public static function nameForRace(_arg1:int, _arg2:Boolean=false):String{
if (_arg2){
if (_arg1 == Horde.undead){
return ("Undead");
};
if (_arg1 == Horde.greenskins){
return ("Greenskins");
};
if (_arg1 == Horde.creatures){
return ("Creatures");
};
if (_arg1 == Horde.cultists){
return ("Cultists");
};
return ("Monsters");
} else {
if (_arg1 == Horde.undead){
return ("undead");
};
if (_arg1 == Horde.greenskins){
return ("greenskins");
};
if (_arg1 == Horde.creatures){
return ("creatures");
};
if (_arg1 == Horde.cultists){
return ("cultists");
};
};
return (!NULL!);
}
public static function getBeholderName():String{
return (getNecromancerName());
}
public static function getGreenskinName():String{
var _local1:Array;
var _local2:Array;
var _local3:String;
_local1 = new Array("Gral", "Grun", "Grun", "Kil", "Skar", "Krum", "Har", "Zug", "Kaz", "Bom");
_local2 = new Array("gog", "gul", "grul", "guk", "krul", "krag", "zog", "bog", "skag", "zak");
_local3 = "";
_local3 = (_local3 + _local1[dm.randomNum(0, (_local1.length - 1))]);
_local3 = (_local3 + _local2[dm.randomNum(0, (_local2.length - 1))]);
return (_local3);
}
public static function getDragonName():String{
var _local1:Array;
var _local2:Array;
var _local3:Array;
var _local4:String;
_local1 = new Array("Sm", "Br", "N");
_local2 = new Array("au", "auga", "aga", "alga", "aulga");
_local3 = new Array("g", "fen", "l", "n");
_local4 = "";
_local4 = (_local4 + _local1[dm.randomNum(0, (_local1.length - 1))]);
_local4 = (_local4 + _local2[dm.randomNum(0, (_local2.length - 1))]);
_local4 = (_local4 + _local3[dm.randomNum(0, (_local3.length - 1))]);
return (_local4);
}
}
}//package
Section 141
//HordeData (HordeData)
package {
public class HordeData {
private var _level:int;// = 0
private var _boss:Boolean;// = false
var members:Array;
private var _defeated:Boolean;// = false
private var _roomIndex:int;// = 0
private var _race:int;
public function HordeData(){
members = new Array();
_roomIndex = 0;
_defeated = false;
_race = Horde.undead;
_level = 0;
_boss = false;
super();
}
public function get level():int{
return (this._level);
}
public function set level(_arg1:int):void{
this._level = _arg1;
}
public function get race():int{
return (this._race);
}
public function get defeated():Boolean{
return (this._defeated);
}
public function set boss(_arg1:Boolean):void{
this._boss = _arg1;
}
public function set defeated(_arg1:Boolean):void{
this._defeated = _arg1;
}
public function set race(_arg1:int):void{
this._race = _arg1;
}
public function get boss():Boolean{
return (this._boss);
}
public function set roomIndex(_arg1:int):void{
this._roomIndex = _arg1;
}
public function get roomIndex():int{
return (this._roomIndex);
}
public function toHorde():Horde{
var _local1:Horde;
var _local2:*;
_local1 = new Horde(this.race, this.level, this.boss, null, true);
_local1.defeated = this.defeated;
_local1.members = this.members;
_local2 = 0;
while (_local2 < members.length) {
MonsterCharacter(_local1.members[_local2]).initSkills();
_local2++;
};
return (_local1);
}
}
}//package
Section 142
//HordeIcon (HordeIcon)
package {
import flash.display.*;
public dynamic class HordeIcon extends MovieClip {
public function HordeIcon(){
addFrameScript(0, frame1);
}
function frame1(){
this.gotoAndStop(1);
}
}
}//package
Section 143
//HordeTooltip (HordeTooltip)
package {
import flash.text.*;
import flash.display.*;
public class HordeTooltip extends Sprite {
const red_text = 0xCC0000;
const white_text = 0xFFFFFF;
const grey_text = 0xCCCCCC;
const boss_text = 16777164;
const purple_text = 0x9900FF;
const green_text = 0x66FF00;
const blue_text = 26367;
public var tooltip_bg:ItemTooltipBg;
public var t2:TextField;
public var t3:TextField;
public var t5:TextField;
public var t1:TextField;
public var t6:TextField;
public var t4:TextField;
public var title_label:TextField;
public var p1:CharGraphic;
public var p2:CharGraphic;
public var p3:CharGraphic;
public var p5:CharGraphic;
public var p6:CharGraphic;
public var p4:CharGraphic;
public function HordeTooltip(_arg1:String="", _arg2:Array=null, _arg3=false){
var _local4:*;
var _local5:*;
var _local6:TextField;
var _local7:MovieClip;
super();
if (_arg2 == null){
return;
};
_local4 = _arg2.length;
if (_arg1 == ""){
_arg1 = "Blank";
};
title_label.text = _arg1;
dm.embolden(title_label);
_local5 = (_local4 + 1);
while (_local5 <= 6) {
removeChild(getChildByName(("p" + _local5)));
removeChild(getChildByName(("t" + _local5)));
_local5++;
};
_local5 = 1;
while (_local5 <= _local4) {
_local6 = TextField(getChildByName(("t" + _local5)));
if (((_arg3) && ((_local5 == 1)))){
_local6.text = getString(_arg2, (_local5 - 1), true);
_local6.textColor = boss_text;
} else {
_local6.text = getString(_arg2, (_local5 - 1));
};
_local7 = MovieClip(getChildByName(("p" + _local5)));
_local7.setFrame(_arg2[(_local5 - 1)][2]);
_local5++;
};
tooltip_bg.height = ((39 + (_local4 * 30)) + 7);
}
private function getString(_arg1:Array, _arg2:int, _arg3:Boolean=false):String{
if (_arg2 >= _arg1.length){
return ("Blank");
};
if (_arg3){
return ((((("x " + String(_arg1[_arg2][1])) + " '") + _arg1[_arg2][0]) + "'"));
};
return (((("x " + String(_arg1[_arg2][1])) + " ") + _arg1[_arg2][0]));
}
}
}//package
Section 144
//horz_slash (horz_slash)
package {
import flash.display.*;
public dynamic class horz_slash extends MovieClip {
public var slash:MovieClip;
public function horz_slash(){
addFrameScript(11, frame12);
}
function frame12(){
this.gotoAndStop(12);
}
}
}//package
Section 145
//iAxe (iAxe)
package {
public class iAxe extends SteelEdgedWeapon {
public function iAxe(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Greataxe";
slot = weapon;
item_level = _arg1;
whoEquips = (Equipment.warriorEquip + Equipment.rangerEquip);
twoHanded = true;
icon_frame = 10;
base_damage = axe_base_damage;
mod_quickness = (mod_quickness - 15);
grey_name = "Rusty";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Blood Harvester";
base_damage_mod = 50;
setHealthRegen();
setVampiric(7, 12);
icon_frame = 38;
} else {
item_name = "Golden Axe";
base_damage_mod = 50;
setStunChance(15, 25);
setStrength(2, max_stat_for_purple);
icon_frame = 39;
};
}
}
}//package
Section 146
//iBow (iBow)
package {
public class iBow extends RangedWeapon {
public function iBow(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Bow";
slot = weapon;
item_level = _arg1;
whoEquips = ((Equipment.warriorEquip + Equipment.rangerEquip) + Equipment.rogueEquip);
twoHanded = true;
icon_frame = 15;
base_damage = bow_base_damage;
grey_name = "Cracked";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "The Huntsman";
base_damage_mod = 50;
damageBonusVsCreatureType = MonsterCharacter.creature;
damageBonusVsCreatureModifier = 1.2;
setAccuracy();
setLethality();
setPoisonDamage();
icon_frame = 53;
} else {
item_name = "Manhunter Bow";
lore = "No man escapes the Manhunter";
base_damage_mod = 50;
damageBonusVsCreatureType = MonsterCharacter.human;
damageBonusVsCreatureModifier = 1.2;
setStunChance(15, 20);
setAccuracy();
icon_frame = 52;
};
}
}
}//package
Section 147
//iCenser (iCenser)
package {
public class iCenser extends Offhand {
public function iCenser(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Censer";
slot = offhand;
item_level = _arg1;
whoEquips = Equipment.clericEquip;
base_armor_rating = 0;
mod_healing = (item_level * 5);
icon_frame = 63;
grey_name = "Tarnished";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Inquisitor's Censer";
mod_healing = Math.round((mod_healing * 1.2));
setStrength(2, max_stat_for_purple);
damageBonusVsCreatureType = MonsterCharacter.undead;
damageBonusVsCreatureModifier = 1.3;
icon_frame = 75;
} else {
item_name = "Blessed Censer of the Exalted Priest-Lord";
mod_healing = (mod_healing * 2);
setHealthRegen();
setResistPoison(50, 75);
icon_frame = 76;
};
}
override public function itemStatsString(_arg1:String):String{
var _local2:*;
_local2 = super.itemStatsString(_arg1);
if (_local2.length){
_local2 = (_local2 + "\n");
};
_local2 = (_local2 + ("Special(Censer): Increases the effect of Healing abilities by " + mod_healing));
return (_local2);
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Vampiric", 10]);
}
}
}//package
Section 148
//iCloak (iCloak)
package {
public class iCloak extends Armor {
public function iCloak(_arg1:int=1, _arg2:int=-1){
type = Armor.light;
mod_quickness = 0;
whoEquips = Equipment.allEquip;
base_armor_rating = 2;
materials.push("Linen", "Wool", "Velvet", "Silk", "Suncloth", "Aetherweave");
SetRarity(_arg2);
item_level = _arg1;
item_name = "Cloak";
slot = Equipment.back;
icon_frame = 55;
if (item_rarity == Item.orange){
return;
};
modifyBaseArmorForSlot();
grey_name = "Threadbare";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Cloak of Flames";
base_armor_rating = Math.round((base_armor_rating * 3));
setStrength(2, max_stat_for_purple);
setDamageReflection(40, 60);
setQuickness(8, 15);
icon_frame = 57;
} else {
if (_local2 == 2){
item_name = "Manashroud";
base_armor_rating = Math.round((base_armor_rating * 2));
setIntellect(2, max_stat_for_purple);
setPowerRegen(5, 8);
icon_frame = 58;
} else {
item_name = "Shroud of Darkness";
base_armor_rating = Math.round((base_armor_rating * 2));
quickRetreat = true;
setBlind(15, 25);
setDexterity(2, max_stat_for_purple);
icon_frame = 56;
};
};
}
override public function getItemTypeString(){
return ("Cloak");
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Vampiric", 10]);
suffixes.push(["Discretion", 1]);
}
}
}//package
Section 149
//iClothGloves (iClothGloves)
package {
public class iClothGloves extends LightArmor {
public function iClothGloves(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Gloves";
icon_frame = 31;
slot = Equipment.gloves;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Thief's Gloves";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setDexterity(2, max_stat_for_purple);
setBlind();
setQuickness();
icon_frame = 88;
} else {
item_name = "Savant's Gloves";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect(2, max_stat_for_purple);
setEndurance();
setPowerRegen();
icon_frame = 87;
};
}
override public function getItemModifiers():void{
super.getItemModifiers();
suffixes.push(["Accuracy", base_accuracy_bonus]);
}
}
}//package
Section 150
//iClothHat (iClothHat)
package {
public class iClothHat extends LightArmor {
public function iClothHat(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Hood";
icon_frame = 33;
slot = Equipment.head;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Facemask of the Bandit Chieftain";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setStrength(2, max_stat_for_purple);
setDexterity(2, max_stat_for_purple);
setPoisonDamage(2);
icon_frame = 90;
} else {
item_name = "Savant's Hood";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect(2, max_stat_for_purple);
setEndurance();
setPowerRegen();
icon_frame = 89;
};
}
}
}//package
Section 151
//iClothLegs (iClothLegs)
package {
public class iClothLegs extends LightArmor {
public function iClothLegs(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Trousers";
icon_frame = 34;
slot = Equipment.legs;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Swashbuckler's Pantaloons";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setStrength();
setDexterity();
setQuickness();
icon_frame = 85;
} else {
item_name = "Savant's Leggings";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect(2, max_stat_for_purple);
setEndurance();
setPowerRegen();
icon_frame = 86;
};
}
}
}//package
Section 152
//iClothRobe (iClothRobe)
package {
public class iClothRobe extends LightArmor {
public function iClothRobe(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Robe";
icon_frame = 35;
slot = Equipment.armor;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Sacred Vestments";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setStrength();
setResistPoison();
mod_healing = (item_level * 5);
whoEquips = clericEquip;
icon_frame = 92;
} else {
if (_local2 == 2){
item_name = "Savant's Robe";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect(2, max_stat_for_purple);
setEndurance();
setPowerRegen();
icon_frame = 91;
};
};
}
}
}//package
Section 153
//iClothShoes (iClothShoes)
package {
public class iClothShoes extends LightArmor {
public function iClothShoes(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Slippers";
icon_frame = 36;
slot = Equipment.boots;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Lightstep Slippers";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setDexterity(2, max_stat_for_purple);
setQuickness(5, 10);
quickRetreat = true;
icon_frame = 95;
} else {
item_name = "Savant's Slippers";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect(2, max_stat_for_purple);
setEndurance();
setPowerRegen();
icon_frame = 94;
};
}
override public function getItemModifiers():void{
super.getItemModifiers();
suffixes.push(["Discretion", 1]);
}
}
}//package
Section 154
//iCrossbow (iCrossbow)
package {
public class iCrossbow extends RangedWeapon {
public function iCrossbow(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Crossbow";
slot = weapon;
item_level = _arg1;
whoEquips = ((Equipment.warriorEquip + Equipment.rangerEquip) + Equipment.rogueEquip);
twoHanded = true;
mod_quickness = (mod_quickness - 20);
icon_frame = 67;
base_damage = crossbow_base_damage;
grey_name = "Worn";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Mystically Augmented Bolt-Throwing System Mk I";
lore = "This weapon is remarkably easy to handle.";
base_damage_mod = 50;
setAccuracy(15, 30);
mod_quickness = 0;
setDexterity();
icon_frame = 72;
} else {
item_name = "Quarrel-Ender";
lore = "The most efficient way to end any argument.";
base_damage_mod = 50;
setBlind(10, 15);
setPoisonDamage();
setLethality(7, 15);
icon_frame = 71;
};
}
}
}//package
Section 155
//iDagger (iDagger)
package {
public class iDagger extends SteelEdgedWeapon {
public function iDagger(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Dagger";
slot = weapon;
item_level = _arg1;
whoEquips = Equipment.rogueEquip;
icon_frame = 16;
base_damage = dagger_base_damage;
mod_quickness = (mod_quickness + 5);
grey_name = "Worn";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Pestilence Blade";
base_damage_mod = 30;
setPoisonDamage(20);
icon_frame = 41;
resistPoison = -10;
} else {
if (_local2 == 2){
item_name = "Bloodseeker";
base_damage_mod = 35;
setVampiric(10, 20);
setAccuracy();
icon_frame = 40;
} else {
item_name = "The Shudderer";
lore = "It brings a pointy reckoning..";
base_damage_mod = 40;
setStunChance(15, 25);
icon_frame = 42;
};
};
}
override public function itemStatsString(_arg1:String):String{
var _local2:*;
_local2 = super.itemStatsString(_arg1);
_local2 = (_local2 + "\nSpecial(Dagger): Gains bonus damage from both Strength and Dexterity");
return (_local2);
}
}
}//package
Section 156
//iLeatherBoots (iLeatherBoots)
package {
public class iLeatherBoots extends MediumArmor {
public function iLeatherBoots(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Boots";
icon_frame = 24;
slot = Equipment.boots;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Heavy Spineskin Boots";
base_armor_rating = Math.round((base_armor_rating * Math.round((purple_armor_multiplier * 1.5))));
setStrength(2, max_stat_for_purple);
setDamageReflection(40, 60);
quickRetreat = true;
icon_frame = 99;
} else {
item_name = "Stalker's Boots";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setDexterity(2, max_stat_for_purple);
setEndurance();
setHealthRegen();
icon_frame = 98;
};
}
override public function getItemModifiers():void{
super.getItemModifiers();
suffixes.push(["Discretion", 1]);
}
}
}//package
Section 157
//iLeatherChest (iLeatherChest)
package {
public class iLeatherChest extends MediumArmor {
public function iLeatherChest(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Jerkin";
icon_frame = 47;
slot = Equipment.armor;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Bloodsoaked Berserker's Jerkin";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setStrength(2, max_stat_for_purple);
setEndurance();
setResistStun();
icon_frame = 104;
} else {
item_name = "Stalker's Jerkin";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setDexterity(2, max_stat_for_purple);
setEndurance();
setHealthRegen();
icon_frame = 103;
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 158
//iLeatherGloves (iLeatherGloves)
package {
public class iLeatherGloves extends MediumArmor {
public function iLeatherGloves(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Gloves";
icon_frame = 32;
slot = Equipment.gloves;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Assassin's Gloves";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setStrength();
setDexterity();
setLethality();
icon_frame = 101;
} else {
item_name = "Stalker's Gloves";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setDexterity(2, max_stat_for_purple);
setEndurance();
setHealthRegen();
icon_frame = 100;
};
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Staggering", 10]);
suffixes.push(["Accuracy", base_accuracy_bonus]);
}
}
}//package
Section 159
//iLeatherHat (iLeatherHat)
package {
public class iLeatherHat extends MediumArmor {
public function iLeatherHat(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Helmet";
icon_frame = 48;
slot = Equipment.head;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 1;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Assassin's Hood";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
damageBonusVsCreatureType = MonsterCharacter.human;
damageBonusVsCreatureModifier = 1.2;
setResistPoison(60, 80);
setLethality();
whoEquips = (whoEquips - Equipment.clericEquip);
icon_frame = 54;
} else {
item_name = "Stalker's Hood";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setDexterity(2, max_stat_for_purple);
setEndurance();
setHealthRegen();
icon_frame = 102;
};
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 160
//iLeatherLegs (iLeatherLegs)
package {
public class iLeatherLegs extends MediumArmor {
public function iLeatherLegs(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Leggings";
icon_frame = 29;
slot = Equipment.legs;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Bloodsoaked Berserker's Leggings";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setStrength(2, max_stat_for_purple);
setEndurance();
setResistStun();
icon_frame = 97;
} else {
item_name = "Stalker's Leggings";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setDexterity(2, max_stat_for_purple);
setEndurance();
setHealthRegen();
icon_frame = 96;
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 161
//iMace (iMace)
package {
public class iMace extends MeleeWeapon {
public function iMace(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Mace";
slot = weapon;
item_level = _arg1;
whoEquips = ((Equipment.warriorEquip + Equipment.clericEquip) + Equipment.rogueEquip);
icon_frame = 13;
base_damage = mace_base_damage;
grey_name = "Battered";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Scepter of Grace";
base_damage_mod = 50;
setPowerRegen(4, 6);
setResistPoison(20, 30);
setResistStun(20, 30);
setIntellect(2, max_stat_for_purple);
icon_frame = 43;
} else {
item_name = "The Punisher";
base_damage_mod = 60;
setBlind(20, 30);
setStunChance(15, 25);
icon_frame = 44;
};
}
}
}//package
Section 162
//InitiativeIcon (InitiativeIcon)
package {
import flash.text.*;
import flash.display.*;
public class InitiativeIcon extends MovieClip {
var start_y:int;
var dying:Boolean;// = false
protected var char_ref:Character;
var nametext:String;// = "Error"
var pos:int;// = 1
var target_y:int;
var tcolor:uint;// = 0xFFFFFF
public var pos_icon:InitiativePositionIndicator;
public var name_label:TextField;
public function InitiativeIcon(_arg1:Character=null){
tcolor = 0xFFFFFF;
nametext = "Error";
pos = 1;
dying = false;
super();
addFrameScript(8, frame9, 9, frame10, 19, frame20, 20, frame21, 30, frame31, 39, frame40, 40, frame41, 49, frame50);
if (_arg1 != null){
this.char_ref = _arg1;
this.updateNow();
};
}
public function fix():void{
name_label.text = this.nametext;
name_label.textColor = this.tcolor;
pos_icon.gotoAndStop(this.pos);
}
function setColor(_arg1:uint):void{
this.tcolor = _arg1;
fix();
}
function frame10(){
if (dying){
tcolor = 0;
};
this.fix();
}
function frame20(){
this.gotoAndStop(20);
this.fix();
}
function frame9(){
if (!dying){
this.gotoAndStop(9);
};
this.fix();
}
public function fade():void{
this.gotoAndPlay("fade");
}
public function kill():void{
dying = true;
fix();
if (this.currentFrame == 9){
this.gotoAndPlay("death");
};
}
function frame21(){
this.fix();
}
function frame31(){
this.fix();
}
public function updateNow():void{
this.nametext = (((char_ref.charname + " Q") + char_ref.getQuickness()) + " ");
this.pos = char_ref.pos;
name_label.text = this.nametext;
name_label.textColor = this.tcolor;
}
public function res():void{
dying = false;
fix();
this.gotoAndPlay("revive");
}
function frame40(){
this.gotoAndStop(40);
this.fix();
}
function frame41(){
this.fix();
}
public function getChar():Character{
return (char_ref);
}
function frame50(){
this.gotoAndStop(50);
this.fix();
}
}
}//package
Section 163
//InitiativeList (InitiativeList)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
import flash.utils.*;
public class InitiativeList extends MovieClip {
const highlight_color = 0xFFFF00;
const player_color = 0xFFFFFF;
const entry_height = 15;
const monster_color = 0xE90000;
const dead_color = 0;
private var icons:Array;
private var turn_order:Array;
public var bg:MovieClip;
private var entry_data:Array;
private var highlighted:Character;
var turn:int;// = 0
var current:int;
private var last_turn:Character;
var frame_count;// = 0
var animate_frames;// = 10
static const max_entries = 25;
public function InitiativeList(){
icons = new Array();
turn_order = new Array();
turn = 0;
frame_count = 0;
animate_frames = 10;
super();
}
function refillTimerComplete(_arg1:TimerEvent):void{
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = 0;
while (_local2 < icons.length) {
if (bg.contains(icons[_local2])){
bg.removeChild(icons[_local2]);
};
_local2++;
};
icons.length = 0;
_local3 = 0;
while (_local3 < turn_order.length) {
_local4 = new InitiativeIcon(turn_order[_local3]);
_local4.setColor(getColorFor(turn_order[_local3]));
_local4.x = 0;
if (_local3 > 0){
_local4.target_y = (entry_height * (_local3 + 1));
_local4.start_y = bg.height;
_local4.y = bg.height;
} else {
_local4.y = (entry_height * _local3);
_local4.target_y = _local4.y;
_local4.start_y = _local4.y;
_local4.gotoAndStop(1);
_local4.fix();
};
icons.push(_local4);
bg.addChild(_local4);
_local3++;
};
animate_frames = 30;
frame_count = 0;
addEventListener(Event.ENTER_FRAME, animateFrame);
}
private function getColorFor(_arg1:Character):uint{
var _local2:uint;
if (((!((highlighted == null))) && ((highlighted == _arg1)))){
_local2 = highlight_color;
} else {
if (!shouldAdd(_arg1)){
_local2 = dead_color;
} else {
if ((_arg1 is MonsterCharacter)){
_local2 = monster_color;
} else {
_local2 = player_color;
};
};
};
return (_local2);
}
private function buildTurnOrder(_arg1:Character, _arg2:Boolean=false):Boolean{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
_local5 = 0;
_local6 = false;
_local7 = false;
turn_order.length = 0;
_local3 = 0;
while (_local3 < entry_data.length) {
if (entry_data[_local3] == _arg1){
_local5 = _local3;
if (_arg2){
if (shouldAdd(last_turn)){
turn_order.push(last_turn);
} else {
_local7 = true;
};
};
_local4 = _local5;
while (_local4 < entry_data.length) {
if (shouldAdd(entry_data[_local4])){
if (Character(entry_data[_local4]).hadCombatTurn == false){
turn_order.push(entry_data[_local4]);
};
};
_local4++;
};
break;
};
_local3++;
};
last_turn = _arg1;
_local8 = turn_order.length;
_local9 = max_entries;
if (_arg2){
_local9 = (_local9 + 2);
};
while (_local8 < _local9) {
_local3 = 0;
while (_local3 < entry_data.length) {
if (shouldAdd(entry_data[_local3])){
turn_order.push(entry_data[_local3]);
++_local8;
if (_local8 >= max_entries){
break;
};
};
_local3++;
};
};
return (_local7);
}
public function removeDead():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
_local3 = 0;
_local4 = false;
_local1 = 0;
while (_local1 < turn_order.length) {
icons[_local1].start_y = icons[_local1].y;
icons[_local1].target_y = icons[_local1].y;
if ((((Character(turn_order[_local1]).health <= 0)) || ((((turn_order[_local1] is PlayerCharacter)) && (turn_order[_local1].retreated))))){
if (_local1 > 1){
_local3 = (_local3 + entry_height);
};
icons[_local1].kill();
_local4 = true;
} else {
icons[_local1].target_y = (icons[_local1].target_y - _local3);
};
_local1++;
};
if (_local4){
animate_frames = 10;
frame_count = -30;
addEventListener(Event.ENTER_FRAME, animateFrame);
};
}
public function setData(_arg1:Array=null){
if (_arg1 == null){
return;
};
entry_data = _arg1;
}
public function highlightChar(_arg1:Character):Boolean{
var _local2:*;
var _local3:*;
_local2 = false;
_local3 = 0;
while (_local3 < icons.length) {
if (icons[_local3].getChar() != _arg1){
} else {
if (icons[_local3].getChar().health <= 0){
} else {
highlighted = _arg1;
icons[_local3].setColor(highlight_color);
_local2 = true;
};
};
_local3++;
};
if (_local2){
return (true);
};
return (false);
}
public function refill(_arg1:Character):void{
var _local2:Boolean;
var _local3:*;
var _local4:Timer;
_local2 = false;
buildTurnOrder(_arg1);
_local3 = 0;
while (_local3 < icons.length) {
if (!_local2){
if (icons[_local3].getChar() == _arg1){
_local2 = true;
};
} else {
icons[_local3].fade();
};
_local3++;
};
_local4 = new Timer(350, 1);
_local4.addEventListener(TimerEvent.TIMER_COMPLETE, refillTimerComplete);
_local4.start();
}
public function turnOf(_arg1:Character, _arg2:Boolean):void{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local5 = false;
_local3 = 0;
while (_local3 < icons.length) {
if (icons[_local3] == null){
} else {
if (bg.contains(icons[_local3])){
bg.removeChild(icons[_local3]);
};
};
_local3++;
};
icons.length = 0;
_local5 = buildTurnOrder(_arg1, _arg2);
_local3 = 0;
while (_local3 < turn_order.length) {
_local6 = new InitiativeIcon(turn_order[_local3]);
_local6.setColor(getColorFor(turn_order[_local3]));
_local6.x = 0;
_local7 = 0;
if (_local5){
_local7 = (_local3 + 1);
} else {
_local7 = _local3;
};
_local6.y = (entry_height * _local7);
if (_arg2){
} else {
_local6.gotoAndStop(1);
_local6.fix();
};
icons.push(_local6);
bg.addChild(_local6);
_local3++;
};
}
function animateFrame(_arg1:Event):void{
var _local2:*;
var _local3:*;
var _local4:*;
frame_count++;
if (frame_count < 1){
return;
};
if (frame_count > animate_frames){
removeEventListener(Event.ENTER_FRAME, animateFrame);
return;
};
_local2 = 0;
while (_local2 < icons.length) {
if (icons[_local2].start_y == icons[_local2].target_y){
} else {
if (icons[_local2].y == icons[_local2].target_y){
} else {
_local3 = (icons[_local2].target_y - icons[_local2].start_y);
_local4 = (_local3 / animate_frames);
icons[_local2].y = (icons[_local2].start_y + (frame_count * _local4));
};
};
_local2++;
};
}
public function insertChar(_arg1:Character, _arg2:Character):void{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
buildTurnOrder(_arg2);
_local3 = 0;
_local4 = -1;
_local5 = false;
_local6 = 0;
_local7 = 0;
while (_local7 < turn_order.length) {
_local4 = (_local7 + 1);
icons[_local4].start_y = icons[_local4].y;
icons[_local4].target_y = icons[_local4].y;
if (turn_order[_local7] == _arg1){
insertIconAt(_local4, _arg1, _local3);
_local3 = (_local3 + entry_height);
_local5 = true;
} else {
icons[_local4].target_y = (icons[_local4].target_y + _local3);
};
_local7++;
};
if (_local5){
animate_frames = 10;
frame_count = 0;
addEventListener(Event.ENTER_FRAME, animateFrame);
};
}
public function cleanup():void{
removeEventListener(Event.ENTER_FRAME, animateFrame);
}
public function setNormalColors():void{
var _local1:uint;
var _local2:*;
highlighted = null;
_local2 = 0;
while (_local2 < icons.length) {
if (!shouldAdd(icons[_local2].getChar())){
_local1 = dead_color;
} else {
if ((icons[_local2].getChar() is MonsterCharacter)){
_local1 = monster_color;
} else {
_local1 = player_color;
};
};
icons[_local2].setColor(_local1);
_local2++;
};
}
private function insertIconAt(_arg1:int, _arg2:Character, _arg3:int):void{
var _local4:*;
var _local5:*;
var _local6:InitiativeIcon;
_local6 = new InitiativeIcon(_arg2);
_local6.setColor(getColorFor(_arg2));
icons.splice(_arg1, 0, _local6);
_local6.x = 0;
_local6.y = ((entry_height * _arg1) + _arg3);
bg.addChild(_local6);
_local6.res();
}
public function setDead(_arg1:Character):void{
var _local2:*;
var _local3:*;
_local2 = 0;
while (_local2 < icons.length) {
if (icons[_local2].getChar() == _arg1){
icons[_local2].setColor(dead_color);
};
_local2++;
};
}
public function updateIcon(_arg1:Character):void{
var _local2:*;
_local2 = 0;
while (_local2 < icons.length) {
if (icons[_local2].getChar() == _arg1){
icons[_local2].updateNow();
};
_local2++;
};
}
private function shouldAdd(_arg1:Character):Boolean{
if (_arg1 == null){
return (false);
};
if (_arg1.health <= 0){
return (false);
};
if ((((_arg1 is PlayerCharacter)) && (PlayerCharacter(_arg1).retreated))){
return (false);
};
return (true);
}
private function numOf(_arg1:Character):int{
var _local2:*;
var _local3:*;
_local2 = 0;
_local3 = 0;
while (_local3 < turn_order.length) {
if (turn_order[_local3] == _arg1){
_local2++;
};
_local3++;
};
return (_local2);
}
}
}//package
Section 164
//InitiativePositionIndicator (InitiativePositionIndicator)
package {
import flash.display.*;
public dynamic class InitiativePositionIndicator extends MovieClip {
}
}//package
Section 165
//Inventory (Inventory)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
import flash.ui.*;
public class Inventory extends Sprite {
const argsForNumeral;
var dragged_icon:InventoryIcon;
public var sort_rarity_btn:RarityButton;
public var player_power_bar:NumericIndicatorPower;
public var player_level_label:TextField;
public var large_portrait:CharGraphic;
public var sound_btn:SoundButton;
public var party_items:InventoryPanel;
public var info_panel:CharInfoPanel;
var portraits:Array;
public var sort_type_btn:TypeButton;
var dragging:Boolean;// = false
public var empty1:EmptyPortrait;
var selectedChar:PlayerCharacter;
public var empty3:EmptyPortrait;
public var empty4:EmptyPortrait;
public var help_btn:HelpButton;
var pc_party:Party;
public var empty2:EmptyPortrait;
public var player_name_label:TextField;
var start_drag_x;// = 0
var start_drag_y;// = 0
public var exit_btn:ReturnButton;
public var sort_level_btn:LevelButton;
public var player_health_bar:NumericIndicatorHealth;
public var paperdoll:Paperdoll;
public var statusbar:TextField;
public var destroy:ItemDestroyTarget;
var tooltipController:ItemTooltipController;
public function Inventory():void{
portraits = new Array();
argsForNumeral = (Array.DESCENDING | Array.NUMERIC);
start_drag_x = 0;
start_drag_y = 0;
dragging = false;
super();
exit_btn.addEventListener(MouseEvent.MOUSE_DOWN, exitClick);
sort_level_btn.addEventListener(MouseEvent.MOUSE_DOWN, sortByLevel);
sort_type_btn.addEventListener(MouseEvent.MOUSE_DOWN, sortByType);
sort_rarity_btn.addEventListener(MouseEvent.MOUSE_DOWN, sortByRarity);
destroy.gotoAndStop(1);
destroy.addEventListener(MouseEvent.MOUSE_MOVE, destroyHover);
statusbar.text = "";
tooltipController = new ItemTooltipController();
addEventListener(Event.ADDED_TO_STAGE, added);
}
function added(_arg1:Event):void{
var _local2:*;
var _local3:*;
removeEventListener(Event.ADDED_TO_STAGE, added);
if (stage != null){
tooltipController.stage = stage;
_local2 = 2;
if (((DungeonMain.showHints) && (!(Dungeon.hintShown(_local2))))){
_local3 = new HintDialog("Status and Inventory", "On this screen you can review and upgrade your characters' skills and statistics, as well as manage their equipment.\n\nEquip items you find by double-clicking their icon, or dragging to the paperdoll or character portrait. \n\nDiscard items by dragging them onto the red 'X' or click on them while holding the 'control' key.", true, true);
DungeonMain.hints = (DungeonMain.hints + _local2);
stage.addChild(_local3);
dm.main.saveInterface();
};
};
}
function startItemDragging(_arg1:MouseEvent):void{
var _local2:*;
if (_arg1.ctrlKey){
_local2 = InventoryIcon(_arg1.currentTarget.parent);
_local2.bg.removeEventListener(MouseEvent.MOUSE_UP, stopItemDragging);
destroyItem(_local2.item_ref);
return;
};
if (_arg1.currentTarget.parent == null){
return;
};
dragged_icon = InventoryIcon(_arg1.currentTarget.parent);
dm.childToTop(dragged_icon);
dm.childToTop(dragged_icon.parent);
start_drag_x = dragged_icon.x;
start_drag_y = dragged_icon.y;
InventoryIcon(dragged_icon).startDrag();
dragging = true;
stage.addEventListener(Event.ENTER_FRAME, checkDropTarget);
tooltipController.destroyTooltip();
_arg1.updateAfterEvent();
}
public function consume(_arg1:Consumable, _arg2:PlayerCharacter){
var _local3:*;
var _local4:int;
var _local5:*;
statusbar.text = (((_arg2.charname + " uses the ") + _arg1.item_name) + ".");
_local3 = portraitFromCharacter(_arg2);
_local4 = 0;
if (((!((_local3 == null))) && (!((_arg1 is CleanSlate))))){
if ((_arg1 is SneakyScroll)){
} else {
if (_arg1.resurrect){
_local4 = PortraitAnimation.revive;
} else {
if ((_arg1 is PotionPoisonResist)){
_local4 = PortraitAnimation.buff;
} else {
if (_arg1.restore_health){
_local4 = PortraitAnimation.heal;
} else {
if (_arg1.restore_power){
_local4 = PortraitAnimation.gainPower;
} else {
if (_arg1.damage_resist){
_local4 = PortraitAnimation.armorBuff;
} else {
_local4 = PortraitAnimation.buff;
};
};
};
};
};
};
if ((_arg1 is SneakyScroll)){
_local5 = SoundControl.hideSound;
} else {
_local5 = SoundControl.potionSound;
};
dm.sound.play(_local5, 1, true);
};
if (_arg1.stack <= 0){
_arg1 = null;
};
updateStats();
updatePaperdoll(selectedChar);
updateInventoryPanels();
if (_local4){
_local3.addPortraitAnimation(_local4);
};
}
public function init(_arg1:Party){
var _local2:*;
var _local3:*;
var _local4:*;
this.pc_party = _arg1;
selectChar(pc_party.members[0]);
_local2 = 0;
while (_local2 < pc_party.members.length) {
pc_party.members[_local2].old_strength = pc_party.members[_local2].strength;
pc_party.members[_local2].old_endurance = pc_party.members[_local2].endurance;
pc_party.members[_local2].old_dexterity = pc_party.members[_local2].dexterity;
pc_party.members[_local2].old_intellect = pc_party.members[_local2].intellect;
pc_party.members[_local2].old_stat_points = pc_party.members[_local2].stat_points;
_local3 = getChildByName(("empty" + (_local2 + 1)));
_local4 = new CharacterPortrait();
_local4.x = _local3.x;
_local4.y = _local3.y;
_local4.setChar(pc_party.members[_local2]);
_local4.name = ("portrait" + _local2);
_local4.setGlow();
_local4.setHiding((pc_party.sneaking > 0));
removeChild(_local3);
addChildAt(_local4, 1);
_local4.addEventListener(MouseEvent.MOUSE_DOWN, portraitClick);
portraits.push(_local4);
_local2++;
};
updateInventoryPanels();
stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, reportKeyUp);
}
public function removeItemFrom(_arg1:Item, _arg2:PlayerCharacter){
var _local3:Equipment;
if (!(_arg1 is Equipment)){
return;
};
_local3 = Equipment(_arg1);
if (_arg2.unequip(Equipment(_arg1))){
updateStats();
updatePaperdoll(selectedChar);
updateInventoryPanels();
statusbar.text = (((_arg2.charname + " removes the ") + _local3.item_name) + ".");
} else {
statusbar.text = (((_arg2.charname + " cannot remove the ") + _local3.item_name) + ".");
};
}
public function exitClick(_arg1:MouseEvent){
if (pc_party.overflow.length){
statusbar.text = "Your party is carrying too many items. Discard some.";
} else {
dm.main.closeInventory();
};
}
public function updatePaperdoll(_arg1:PlayerCharacter){
var _local2:*;
var _local3:*;
var _local4:uint;
_local4 = (numChildren - 1);
setChildIndex(paperdoll, _local4);
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
_local2 = paperdoll.getChildByName(("slot" + String(_local3)));
if (_local2 == null){
} else {
paperdoll.removeChild(_local2);
};
_local3++;
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (_arg1.gear[_local3] == null){
} else {
if (_arg1.gear[_local3].slot == Equipment.gearSlots){
} else {
if (_arg1.gear[_local3].slot != _local3){
} else {
_local2 = new InventoryIcon(_arg1.gear[_local3], tooltipController);
_local2.x = getSlotX(_arg1.gear[_local3].slot);
_local2.y = getSlotY(_arg1.gear[_local3].slot);
_local2.name = ("slot" + String(_local3));
paperdoll.addChild(_local2);
setDraggable(_local2);
if (_local3 == Equipment.weapon){
if (Weapon(_arg1.gear[_local3]).twoHanded){
paperdoll.offhand.gotoAndStop(2);
} else {
paperdoll.offhand.gotoAndStop(1);
};
};
};
};
};
_local3++;
};
info_panel.setChar(_arg1);
}
public function destroyItem(_arg1:Item):void{
var _local2:*;
statusbar.text = (_arg1.item_name + " destroyed.");
pc_party.destroyItem(_arg1);
dm.sound.play(SoundControl.destroyItem, 1, true);
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
if (selectedChar.gear[_local2] == _arg1){
selectedChar.gear[_local2] = null;
};
_local2++;
};
_arg1 = null;
updateStats();
updatePaperdoll(selectedChar);
updateInventoryPanels();
}
private function setDraggable(_arg1:InventoryIcon):void{
_arg1.bg.addEventListener(MouseEvent.MOUSE_DOWN, startItemDragging, false, 0, true);
_arg1.bg.addEventListener(MouseEvent.MOUSE_UP, stopItemDragging, false, 0, true);
}
function destroyHover(_arg1:MouseEvent){
if (((dragging) && (_arg1.buttonDown))){
destroy.gotoAndStop(2);
} else {
destroy.gotoAndStop(1);
};
}
public function updateInventoryPanels(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:uint;
var _local5:InventoryIcon;
_local1 = 0;
_local2 = 0;
_local3 = new InventoryPanel();
_local3.x = party_items.x;
_local3.y = party_items.y;
_local3.width = party_items.original_width;
_local3.height = party_items.original_height;
removeChild(party_items);
party_items = null;
party_items = _local3;
_local4 = (this.numChildren - 1);
addChildAt(party_items, _local4);
_local4 = (this.numChildren - 1);
setChildIndex(paperdoll, _local4);
_local1 = 0;
while (_local1 < pc_party.inventory.length) {
_local5 = party_items.addItemRef(pc_party.inventory[_local1], tooltipController);
setDraggable(_local5);
_local1++;
};
_local1 = 0;
while (_local1 < pc_party.overflow.length) {
_local5 = party_items.addItemRef(pc_party.overflow[_local1], tooltipController);
setDraggable(_local5);
_local1++;
};
party_items.updateCount((pc_party.inventory.length + pc_party.overflow.length));
}
public function getSlotX(_arg1:int):int{
var _local2:*;
_local2 = 0;
if (_arg1 == Equipment.head){
_local2 = paperdoll.head.x;
} else {
if (_arg1 == Equipment.armor){
_local2 = paperdoll.armor.x;
} else {
if (_arg1 == Equipment.gloves){
_local2 = paperdoll.gloves.x;
} else {
if (_arg1 == Equipment.boots){
_local2 = paperdoll.boots.x;
} else {
if (_arg1 == Equipment.back){
_local2 = paperdoll.cloak.x;
} else {
if (_arg1 == Equipment.weapon){
_local2 = paperdoll.weapon.x;
} else {
if (_arg1 == Equipment.offhand){
_local2 = paperdoll.offhand.x;
} else {
if (_arg1 == Equipment.ring){
_local2 = paperdoll.ring.x;
} else {
if (_arg1 == Equipment.legs){
_local2 = paperdoll.legs.x;
};
};
};
};
};
};
};
};
};
return (_local2);
}
public function updateStats(){
var _local1:*;
_local1 = 0;
while (_local1 < portraits.length) {
pc_party.members[_local1].recalculateMaxHealth();
if (portraits[_local1] == null){
} else {
portraits[_local1].updateBars();
portraits[_local1].setGlow();
portraits[_local1].setHiding((pc_party.sneaking > 0));
};
_local1++;
};
player_health_bar.bar.width = ((60 / 100) * selectedChar.getHealthPercent());
player_health_bar.numbers.text = ((String(selectedChar.health) + "/") + String(selectedChar.health_max));
player_power_bar.bar.width = ((60 / 100) * selectedChar.getPowerPercent());
player_power_bar.numbers.text = ((String(selectedChar.power) + "/") + String(selectedChar.power_max));
if (parent != null){
DungeonMain(parent).saveChars();
DungeonMain(parent).saveInventory();
};
}
private function sortByType(_arg1:MouseEvent):void{
var _local2:*;
var _local3:Array;
var _local4:Array;
var _local5:Array;
_local2 = 0;
_local3 = new Array();
_local3 = pc_party.getConsumables();
_local4 = new Array();
_local4 = pc_party.getEquipment();
_local3.sortOn(["icon_frame", "item_name", "item_level"], [argsForNumeral, Array.DESCENDING, argsForNumeral]);
_local4.sortOn(["slot", "icon_frame", "item_name", "item_level"], [argsForNumeral, argsForNumeral, Array.DESCENDING, argsForNumeral]);
_local5 = dm.joinArrays(_local4, _local3);
finishSort(_local5);
}
public function getSlotY(_arg1:int):int{
var _local2:*;
_local2 = 0;
if (_arg1 == Equipment.head){
_local2 = paperdoll.head.y;
} else {
if (_arg1 == Equipment.armor){
_local2 = paperdoll.armor.y;
} else {
if (_arg1 == Equipment.gloves){
_local2 = paperdoll.gloves.y;
} else {
if (_arg1 == Equipment.boots){
_local2 = paperdoll.boots.y;
} else {
if (_arg1 == Equipment.back){
_local2 = paperdoll.cloak.y;
} else {
if (_arg1 == Equipment.weapon){
_local2 = paperdoll.weapon.y;
} else {
if (_arg1 == Equipment.offhand){
_local2 = paperdoll.offhand.y;
} else {
if (_arg1 == Equipment.ring){
_local2 = paperdoll.ring.y;
} else {
if (_arg1 == Equipment.legs){
_local2 = paperdoll.legs.y;
};
};
};
};
};
};
};
};
};
return (_local2);
}
public function consumeFailed(_arg1:Item, _arg2:PlayerCharacter){
statusbar.text = (((_arg2.charname + " cannot use the ") + _arg1.item_name) + " at this time.");
updateInventoryPanels();
}
public function selectChar(_arg1:PlayerCharacter){
var _local2:*;
_local2 = 0;
selectedChar = _arg1;
tooltipController.setChar(_arg1);
player_name_label.text = _arg1.charname;
player_level_label.text = ((("Level " + String(_arg1.level)) + " ") + String(_arg1.classname));
dm.embolden(player_name_label);
dm.embolden(player_level_label);
player_health_bar.bar.width = ((60 / 100) * _arg1.getHealthPercent());
player_health_bar.numbers.text = ((String(_arg1.health) + "/") + String(_arg1.health_max));
player_power_bar.bar.width = ((60 / 100) * _arg1.getPowerPercent());
player_power_bar.numbers.text = ((String(_arg1.power) + "/") + String(_arg1.power_max));
info_panel.setChar(_arg1);
large_portrait.setFrame(_arg1.portrait);
updatePaperdoll(_arg1);
}
private function sortByRarity(_arg1:MouseEvent):void{
var _local2:Array;
_local2 = dm.joinArrays(pc_party.inventory, pc_party.overflow);
_local2.sortOn(["item_rarity", "item_level", "icon_frame"], [Array.DESCENDING, argsForNumeral, argsForNumeral]);
finishSort(_local2);
}
private function reportKeyUp(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.CONTROL){
destroy.gotoAndStop(1);
};
}
function portraitClick(_arg1:MouseEvent):void{
selectChar(PlayerCharacter(CharacterPortrait(_arg1.currentTarget).char_ref));
}
public function equipFailed(_arg1:Item, _arg2:PlayerCharacter){
updatePaperdoll(selectedChar);
updateInventoryPanels();
statusbar.text = (((_arg2.charname + " cannot equip the ") + _arg1.item_name) + ".");
}
public function cleanup():void{
var _local1:*;
var _local2:*;
help_btn.cleanup();
sound_btn.cleanup();
exit_btn.removeEventListener(MouseEvent.MOUSE_DOWN, exitClick);
destroy.removeEventListener(MouseEvent.MOUSE_MOVE, destroyHover);
sort_level_btn.removeEventListener(MouseEvent.MOUSE_DOWN, sortByLevel);
sort_type_btn.removeEventListener(MouseEvent.MOUSE_DOWN, sortByType);
sort_rarity_btn.removeEventListener(MouseEvent.MOUSE_DOWN, sortByRarity);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, reportKeyUp);
_local1 = 0;
while (_local1 < portraits.length) {
portraits[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, portraitClick);
_local1++;
};
_local1 = 0;
while (_local1 < Equipment.gearSlots) {
_local2 = paperdoll.getChildByName(("slot" + String(_local1)));
if (_local2 != null){
_local2.cleanup();
};
_local1++;
};
party_items.cleanup();
info_panel.cleanup();
}
public function useItemOn(_arg1:Item, _arg2:PlayerCharacter){
if ((_arg1 is Equipment)){
if (_arg2.equip(Equipment(_arg1))){
equipped(_arg1, _arg2);
} else {
equipFailed(_arg1, _arg2);
};
} else {
if ((_arg1 is Consumable)){
if (Consumable(_arg1).consume(_arg2, pc_party)){
pc_party.balanceInventory();
consume(Consumable(_arg1), _arg2);
} else {
consumeFailed(_arg1, _arg2);
};
} else {
updateInventoryPanels();
updatePaperdoll(selectedChar);
statusbar.text = (("The " + _arg1.item_name) + " is not usable.");
};
};
}
public function checkDropTarget(_arg1:Event){
if (!dragging){
return;
};
if (dragged_icon == null){
return;
};
if (dragged_icon.dropTarget == null){
return;
};
if (dragged_icon.dropTarget.parent == null){
return;
};
if (dragged_icon.dropTarget.parent == destroy){
destroy.gotoAndStop(2);
} else {
destroy.gotoAndStop(1);
};
}
private function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.CONTROL){
destroy.gotoAndStop(2);
};
}
private function sortByName(_arg1:MouseEvent):void{
var _local2:Array;
_local2 = dm.joinArrays(pc_party.inventory, pc_party.overflow);
_local2.sortOn(["item_name", "item_level", "icon_frame"], [Array.DESCENDING, argsForNumeral, argsForNumeral]);
finishSort(_local2);
}
private function portraitFromCharacter(_arg1:PlayerCharacter):CharacterPortrait{
var _local2:*;
_local2 = 0;
while (_local2 < portraits.length) {
if (portraits[_local2].char_ref == _arg1){
return (portraits[_local2]);
};
_local2++;
};
return (null);
}
private function draggedOnPaperdoll(_arg1:Object):Boolean{
if (_arg1 == null){
return (false);
};
if (_arg1.dropTarget == null){
return (false);
};
if (paperdoll.contains(_arg1.dropTarget)){
return (true);
};
return (false);
}
function stopItemDragging(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_arg1.currentTarget.stopDrag();
if (!dragging){
return;
};
dragging = false;
stage.removeEventListener(Event.ENTER_FRAME, checkDropTarget);
if (!(_arg1.currentTarget.parent is InventoryIcon)){
return;
};
_local2 = _arg1.currentTarget.parent;
_local3 = InventoryIcon(_local2).item_ref;
if ((((_local2.x == start_drag_x)) && ((_local2.y == start_drag_y)))){
return;
};
_local4 = false;
if (_local2.dropTarget.parent != null){
if (_local2.dropTarget.parent == destroy){
_local4 = true;
};
};
if (draggedOnPaperdoll(_local2)){
if (_local2.parent == paperdoll){
updatePaperdoll(selectedChar);
return;
};
useItemOn(_local3, selectedChar);
} else {
if (_local4){
destroy.gotoAndStop(1);
destroyItem(_local3);
} else {
if ((_local2.dropTarget.parent.parent is CharacterPortrait)){
_local5 = PlayerCharacter(CharacterPortrait(_local2.dropTarget.parent.parent).char_ref);
useItemOn(_local3, _local5);
} else {
if ((((party_items == _local2.dropTarget)) || (party_items.contains(_local2.dropTarget)))){
if (paperdoll.contains(_arg1.currentTarget.parent)){
removeItemFrom(_local3, selectedChar);
} else {
updateInventoryPanels();
};
} else {
updatePaperdoll(selectedChar);
updateInventoryPanels();
};
};
};
};
_arg1.updateAfterEvent();
}
private function finishSort(_arg1:Array):void{
var _local2:*;
pc_party.inventory.length = 0;
pc_party.overflow.length = 0;
_local2 = 0;
while (_local2 < Party.MAX_INVENTORY) {
if (_arg1.length){
pc_party.inventory.push(_arg1.pop());
};
_local2++;
};
while (_arg1.length) {
pc_party.overflow.push(_arg1.pop());
};
updateInventoryPanels();
}
public function equipped(_arg1:Item, _arg2:PlayerCharacter){
statusbar.text = (((_arg2.charname + " equips the ") + _arg1.item_name) + ".");
dm.sound.play(getEquipSound(_arg1), 1, true);
_arg1 = null;
updateStats();
updatePaperdoll(selectedChar);
updateInventoryPanels();
}
private function getEquipSound(_arg1:Item):int{
if ((_arg1 is iSword)){
return (SoundControl.equipSword);
};
if ((_arg1 is iAxe)){
return (SoundControl.equipAxe);
};
if ((_arg1 is iDagger)){
return (SoundControl.equipDagger);
};
if ((_arg1 is iMace)){
return (SoundControl.equipMace);
};
if ((_arg1 is iSpear)){
return (SoundControl.equipSpear);
};
if ((_arg1 is iBow)){
return (SoundControl.equipBow);
};
if ((_arg1 is iCrossbow)){
return (SoundControl.equipCrossbow);
};
if ((_arg1 is iStaff)){
return (SoundControl.equipStaff);
};
if ((_arg1 is Shield)){
return (SoundControl.equipShield);
};
if ((_arg1 is iParryingDagger)){
return (SoundControl.equipDagger);
};
return (SoundControl.equipGeneric);
}
private function sortByLevel(_arg1:MouseEvent):void{
var _local2:Array;
_local2 = dm.joinArrays(pc_party.inventory, pc_party.overflow);
_local2.sortOn(["item_level", "icon_frame", "item_name"], [argsForNumeral, argsForNumeral, Array.DESCENDING]);
finishSort(_local2);
}
}
}//package
Section 166
//InventoryIcon (InventoryIcon)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class InventoryIcon extends MovieClip {
public var bg:InventoryIconBg;
public var stack_size:TextField;
public var stack_bg:MovieClip;
var item_ref:Item;
var taking:Boolean;// = true
var draggable:Boolean;// = false
var tooltipController:ItemTooltipController;
public function InventoryIcon(_arg1=null, _arg2:ItemTooltipController=null){
draggable = false;
taking = true;
super();
if (_arg1 == null){
return;
};
if (_arg2 != null){
this.tooltipController = _arg2;
};
item_ref = _arg1;
this.gotoAndStop(_arg1.icon_frame);
stack_size.mouseEnabled = false;
stack_bg.mouseEnabled = false;
if ((((item_ref is Consumable)) && ((Consumable(item_ref).stack > 1)))){
stack_size.text = String(Consumable(item_ref).stack);
} else {
if (this.contains(stack_size)){
removeChild(stack_size);
};
if (this.contains(stack_bg)){
removeChild(stack_bg);
};
};
bg.gotoAndStop((_arg1.item_rarity + 1));
bg.addEventListener(MouseEvent.MOUSE_OVER, mouseOverInventoryIcon);
bg.addEventListener(MouseEvent.MOUSE_MOVE, mouseOverInventoryIcon);
bg.addEventListener(MouseEvent.MOUSE_OUT, mouseOutInventoryIcon);
if ((((_arg1 is Equipment)) || ((_arg1 is Consumable)))){
bg.doubleClickEnabled = true;
bg.addEventListener(MouseEvent.DOUBLE_CLICK, doubleClick);
};
}
function mouseOutInventoryIcon(_arg1:MouseEvent):void{
tooltipController.removeTooltip(_arg1, item_ref);
}
function doubleClick(_arg1:MouseEvent=null):void{
var _local2:*;
if ((parent is InventoryPanel)){
_local2 = Inventory(parent.parent).selectedChar;
Inventory(parent.parent).useItemOn(item_ref, _local2);
} else {
if ((parent is Paperdoll)){
_local2 = Inventory(parent.parent).selectedChar;
Inventory(parent.parent).removeItemFrom(item_ref, _local2);
};
};
}
function mouseOverInventoryIcon(_arg1:MouseEvent):void{
tooltipController.showTooltip(_arg1, item_ref);
if ((((((parent is InventoryPanel)) || ((parent is Paperdoll)))) && ((((item_ref is Equipment)) || ((item_ref is Consumable)))))){
tooltipController.enableDoubleClick(this, doubleClick);
};
}
public function cleanup():void{
bg.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverInventoryIcon);
bg.removeEventListener(MouseEvent.MOUSE_MOVE, mouseOverInventoryIcon);
bg.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutInventoryIcon);
bg.removeEventListener(MouseEvent.DOUBLE_CLICK, doubleClick);
if (draggable){
bg.removeEventListener(MouseEvent.MOUSE_DOWN, Inventory(parent.parent).startItemDragging);
bg.removeEventListener(MouseEvent.MOUSE_UP, Inventory(parent.parent).stopItemDragging);
};
}
}
}//package
Section 167
//InventoryIconBg (InventoryIconBg)
package {
import flash.display.*;
public dynamic class InventoryIconBg extends MovieClip {
}
}//package
Section 168
//InventoryPanel (InventoryPanel)
package {
import flash.text.*;
import flash.display.*;
public class InventoryPanel extends Sprite {
const icon_start_y = 20;
const row_width = 15;
const ICON_WIDTH = 20;
const ICON_HEIGHT = 20;
const ICON_GAP = 4;
var icons:Array;
var original_height;// = 0
public var count_label:TextField;
var original_width;// = 0
public function InventoryPanel(){
icons = new Array();
original_width = 0;
original_height = 0;
super();
original_width = width;
original_height = height;
}
public function addItemRef(_arg1:Item, _arg2:ItemTooltipController):InventoryIcon{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
if (_arg1 == null){
return (null);
};
_local3 = 0;
_local4 = 0;
_local5 = icons.length;
if (_local5 < Party.MAX_INVENTORY){
_local4 = Math.floor((_local5 / row_width));
_local3 = (_local5 % row_width);
_local6 = new InventoryIcon(_arg1, _arg2);
_local6.x = (10 + (_local3 * (ICON_WIDTH + ICON_GAP)));
_local6.y = (icon_start_y + (_local4 * (ICON_HEIGHT + ICON_GAP)));
this.addChild(_local6);
icons.push(_local6);
return (_local6);
};
if (_local5 < (Party.MAX_INVENTORY + Party.MAX_OVERFLOW)){
_local3 = (_local5 % row_width);
_local7 = new InventoryIcon(_arg1, _arg2);
_local7.x = (10 + (_local3 * (ICON_WIDTH + ICON_GAP)));
_local7.y = ((icon_start_y + 7) + ((_local4 + 3) * (ICON_HEIGHT + ICON_GAP)));
this.addChild(_local7);
icons.push(_local7);
return (_local7);
};
return (null);
}
public function cleanup():void{
var _local1:*;
_local1 = 0;
while (_local1 < icons.length) {
icons[_local1].cleanup();
_local1++;
};
}
public function updateCount(_arg1:int){
var _local2 = ??pushnamespace
;
var _local3 = ??pushnamespace
;
_local2 = 0xFF0000;
_local3 = 0xFFFFFF;
if (_arg1 > Party.MAX_INVENTORY){
count_label.textColor = _local2;
} else {
count_label.textColor = _local3;
};
count_label.text = ((_arg1 + "/") + Party.MAX_INVENTORY);
dm.embolden(count_label);
}
}
}//package
Section 169
//InventoryTab (InventoryTab)
package {
import flash.text.*;
import flash.display.*;
public class InventoryTab extends MovieClip {
public var tab_text:TextField;
public var flasher:MovieClip;
var flashing:Boolean;// = false
public function InventoryTab(){
flashing = false;
super();
this.gotoAndStop(1);
flashing = true;
}
public function setFlasher(_arg1:Boolean=true):void{
if (((_arg1) && (!(flashing)))){
flasher.gotoAndPlay(1);
flashing = true;
} else {
if (((!(_arg1)) && (flashing))){
flasher.gotoAndStop(1);
flashing = false;
};
};
}
}
}//package
Section 170
//iParryingDagger (iParryingDagger)
package {
public class iParryingDagger extends Offhand {
public function iParryingDagger(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Parrying Dagger";
slot = offhand;
item_level = _arg1;
whoEquips = ((Equipment.rogueEquip + Equipment.warriorEquip) + Equipment.rangerEquip);
base_armor_rating = 20;
icon_frame = 17;
grey_name = "Worn";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 1;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Bladeturner";
base_armor_rating = Math.round((base_armor_rating * 1.5));
damageReflection = 20;
mod_quickness = 10;
icon_frame = 70;
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function itemStatsString(_arg1:String):String{
var _local2:*;
_local2 = super.itemStatsString(_arg1);
return (_local2);
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 171
//iPlateBoots (iPlateBoots)
package {
public class iPlateBoots extends HeavyArmor {
public function iPlateBoots(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Plate Sabatons";
icon_frame = 12;
slot = Equipment.boots;
modifyBaseArmorForSlot();
grey_name = "Battered";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Stalwart Guardian's Sabatons";
base_armor_rating = Math.round((base_armor_rating * Math.round((purple_armor_multiplier * 1.2))));
setStrength();
setEndurance();
setHealthRegen();
icon_frame = 108;
} else {
item_name = "Sabatons of the Valiant Crusader";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setEndurance();
setPowerRegen();
icon_frame = 107;
};
}
override public function getItemModifiers():void{
super.getItemModifiers();
suffixes.push(["Discretion", 1]);
}
}
}//package
Section 172
//iPlateBreastplate (iPlateBreastplate)
package {
public class iPlateBreastplate extends HeavyArmor {
public function iPlateBreastplate(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Breastplate";
icon_frame = 11;
slot = Equipment.armor;
modifyBaseArmorForSlot();
grey_name = "Battered";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Stalwart Guardian's Breastplate";
base_armor_rating = Math.round((base_armor_rating * Math.round((purple_armor_multiplier * 1.2))));
setStrength();
setEndurance();
setHealthRegen();
icon_frame = 114;
} else {
item_name = "Breastplate of the Valiant Crusader";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setEndurance();
setPowerRegen();
icon_frame = 113;
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 173
//iPlateGloves (iPlateGloves)
package {
public class iPlateGloves extends HeavyArmor {
public function iPlateGloves(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Plate Gauntlets";
icon_frame = 14;
slot = Equipment.gloves;
modifyBaseArmorForSlot();
grey_name = "Battered";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Stalwart Guardian's Gauntlets";
base_armor_rating = Math.round((base_armor_rating * Math.round((purple_armor_multiplier * 1.2))));
setStrength();
setEndurance();
setHealthRegen();
icon_frame = 110;
} else {
if (_local2 == 2){
item_name = "Ogrish Gauntlets";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setStrength(2, max_stat_for_purple);
setEndurance();
setStunChance(10, 20);
icon_frame = 115;
} else {
item_name = "Gauntlets of the Valiant Crusader";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setEndurance();
setPowerRegen();
icon_frame = 109;
};
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
if (prefixes[_local1][0] == "Staggering"){
setStunChance();
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Staggering", 10]);
suffixes.push(["Accuracy", base_accuracy_bonus]);
}
}
}//package
Section 174
//iPlateGreaves (iPlateGreaves)
package {
public class iPlateGreaves extends HeavyArmor {
public function iPlateGreaves(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Plate Greaves";
icon_frame = 18;
slot = Equipment.legs;
modifyBaseArmorForSlot();
grey_name = "Battered";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Stalwart Guardian's Greaves";
base_armor_rating = Math.round((base_armor_rating * Math.round((purple_armor_multiplier * 1.2))));
setStrength();
setEndurance();
setHealthRegen();
icon_frame = 112;
} else {
item_name = "Greaves of the Valiant Crusader";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setEndurance();
setPowerRegen();
icon_frame = 111;
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 175
//iPlateHelmet (iPlateHelmet)
package {
public class iPlateHelmet extends HeavyArmor {
public function iPlateHelmet(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Plate Helm";
item_level = _arg1;
slot = Equipment.head;
modifyBaseArmorForSlot();
icon_frame = 2;
grey_name = "Dented";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Stalwart Guardian's Helm";
base_armor_rating = Math.round((base_armor_rating * Math.round((purple_armor_multiplier * 1.2))));
setStrength();
setEndurance();
setHealthRegen();
icon_frame = 106;
} else {
item_name = "Helm of the Valiant Crusader";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setEndurance();
setPowerRegen();
icon_frame = 105;
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 176
//iQuiver (iQuiver)
package {
public class iQuiver extends Armor {
public function iQuiver(_arg1:int=1, _arg2:int=-1){
type = Armor.special;
whoEquips = Equipment.rangerEquip;
base_armor_rating = 0;
materials.length = 0;
SetRarity(_arg2);
item_level = _arg1;
item_name = "Quiver";
icon_frame = 64;
slot = Equipment.back;
grey_name = "Tattered";
setQuickness(8, 15);
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 1;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Basilisk-hide Quiver";
setDexterity(2, max_stat_for_purple);
setQuickness(5, 10);
setStunChance(5, 10);
icon_frame = 65;
};
}
override public function getItemTypeString(){
return ("Quiver");
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Staggering", 10]);
prefixes.push(["Unerring", base_accuracy_bonus]);
prefixes.push(["Venomous", 5]);
prefixes.push(["Blinding", 10]);
prefixes.push(["Vampiric", 10]);
suffixes.push(["Lethality", 1]);
}
}
}//package
Section 177
//iRing (iRing)
package {
public class iRing extends Jewellery {
public function iRing(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Ring";
slot = ring;
item_level = _arg1;
grey_name = "Tarnished";
whoEquips = Equipment.allEquip;
if (item_rarity == Item.orange){
return;
};
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
if (item_rarity != Item.purple){
if (materials[material] == "Gold"){
icon_frame = 20;
} else {
if (materials[material] == "Silver"){
icon_frame = 21;
} else {
if (materials[material] == "Crystalline"){
icon_frame = 22;
} else {
if (materials[material] == "Obsidian"){
icon_frame = 23;
} else {
icon_frame = 21;
};
};
};
};
};
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Nature's Band";
setHealthRegen();
setPowerRegen(3, 5);
setResistPoison(30, 40);
icon_frame = 61;
} else {
item_name = "Bone Ring";
setVampiric();
setStrength();
setDexterity();
accuracyBonus = 5;
icon_frame = 62;
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function itemStatsString(_arg1:String):String{
var _local2:*;
_local2 = super.itemStatsString(_arg1);
return (_local2);
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
if (prefixes[_local1][0] == "Protective"){
base_armor_rating = prefixes[_local1][1];
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Protective", 15]);
prefixes.push(["Vampiric", 10]);
}
}
}//package
Section 178
//iShieldBuckler (iShieldBuckler)
package {
public class iShieldBuckler extends Shield {
public function iShieldBuckler(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Buckler";
slot = offhand;
item_level = _arg1;
whoEquips = (Equipment.allEquip - Equipment.mageEquip);
base_armor_rating = 50;
mod_quickness = -10;
icon_frame = 26;
grey_name = "Worn";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = dm.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Buckler of the Faded Legion";
base_armor_rating = Math.round((base_armor_rating * 1.2));
setHealthRegen(12);
setEndurance(2, max_stat_for_purple);
icon_frame = 73;
} else {
item_name = "Foe-Holder";
base_armor_rating = Math.round((base_armor_rating * 1.5));
quickRetreat = true;
setEndurance();
setStunChance(10, 20);
icon_frame = 74;
};
}
}
}//package
Section 179
//iShieldTower (iShieldTower)
package {
public class iShieldTower extends Shield {
public function iShieldTower(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Tower Shield";
slot = offhand;
item_level = _arg1;
whoEquips = (Equipment.warriorEquip + Equipment.clericEquip);
base_armor_rating = 100;
mod_quickness = -20;
icon_frame = 28;
grey_name = "Dented";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Aegis of the Immortal Champion";
base_armor_rating = Math.round((base_armor_rating * 1.2));
setResistPoison(60, 80);
setResistStun(60, 80);
setEndurance();
icon_frame = 37;
} else {
item_name = "Retribution";
base_armor_rating = Math.round((base_armor_rating * 1.2));
setDamageReflection(50, 75);
setStrength(2, max_stat_for_purple);
setLethality();
icon_frame = 60;
};
}
}
}//package
Section 180
//iSpear (iSpear)
package {
public class iSpear extends SteelEdgedWeapon {
public function iSpear(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Spear";
slot = weapon;
item_level = _arg1;
whoEquips = (Equipment.warriorEquip + Equipment.rangerEquip);
twoHanded = true;
icon_frame = 49;
base_damage = spear_base_damage;
mod_quickness = (mod_quickness - 10);
grey_name = "Bent";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1:*;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Wicked Barb";
base_damage_mod = 50;
setAccuracy();
setPoisonDamage();
setLethality(6, 12);
icon_frame = 50;
} else {
item_name = "Spear of the Fallen Emperor";
base_damage_mod = 40;
setHealthRegen();
setPowerRegen(4, 6);
setEndurance(2, max_stat_for_purple);
icon_frame = 51;
};
}
override public function itemStatsString(_arg1:String):String{
var _local2:*;
_local2 = super.itemStatsString(_arg1);
_local2 = (_local2 + "\nSpecial(Spear): May make melee attacks past allies from the back row");
return (_local2);
}
}
}//package
Section 181
//iStaff (iStaff)
package {
public class iStaff extends MageWeapon {
public function iStaff(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Staff";
slot = weapon;
item_level = _arg1;
whoEquips = Equipment.mageEquip;
twoHanded = true;
icon_frame = 66;
base_damage = staff_base_damage;
grey_name = "Warped";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Archmage's Channeling Staff";
base_damage_mod = 50;
setPowerRegen(5, 10);
setResistStun(40, 60);
icon_frame = 68;
} else {
item_name = "Luminescent Staff of the Enlightened Magus";
base_damage_mod = 50;
setBlind(25, 35);
setIntellect(2, max_stat_for_purple);
icon_frame = 69;
};
}
}
}//package
Section 182
//iSword (iSword)
package {
public class iSword extends SteelEdgedWeapon {
public function iSword(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Longsword";
slot = weapon;
item_level = _arg1;
whoEquips = (Equipment.allEquip - Equipment.clericEquip);
icon_frame = 3;
base_damage = sword_base_damage;
grey_name = "Notched";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = DungeonMain.RandomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Death's Edge";
lore = "To even touch the blade is to risk death.";
base_damage_mod = 60;
setLethality(10, 20);
icon_frame = 45;
} else {
if (_local2 == 2){
item_name = "Mageblade";
base_damage_mod = 40;
setPowerRegen(4, 6);
setIntellect();
icon_frame = 46;
} else {
item_name = "Orcsbane";
base_damage_mod = 50;
setAccuracy();
setEndurance(2, max_stat_for_purple);
damageBonusVsCreatureType = MonsterCharacter.greenskin;
damageBonusVsCreatureModifier = 1.3;
icon_frame = 59;
};
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
if (prefixes[_local1][0] == "Consecrated"){
whoEquips = (whoEquips + Equipment.clericEquip);
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Consecrated", 0]);
}
}
}//package
Section 183
//Item (Item)
package {
public class Item {
private var _icon_frame:int;// = 1
private var _lore:String;// = ""
private var _item_rarity;// = 0
private var _purple_num:int;// = 0
private var _item_name:String;// = "Item"
private var _item_level:int;// = 1
static const green = 2;
static const white = 1;
static const orange = 5;
static const blue = 3;
static const purple = 4;
static const grey = 0;
public function Item(){
_item_level = 1;
_item_name = "Item";
_icon_frame = 1;
_lore = "";
_item_rarity = 0;
_purple_num = 0;
super();
}
public function get purple_num():int{
return (this._purple_num);
}
public function set purple_num(_arg1:int):void{
this._purple_num = _arg1;
}
public function set icon_frame(_arg1:int):void{
this._icon_frame = _arg1;
}
public function itemStatsString(_arg1:String):String{
return (_arg1);
}
public function getItemTypeString(){
return ("Item");
}
public function get item_rarity():int{
return (this._item_rarity);
}
public function get item_level():int{
return (this._item_level);
}
public function itemData():ItemData{
var _local1:ItemData;
_local1 = new ItemData();
_local1.item_level = this.item_level;
_local1.item_rarity = this.item_rarity;
_local1.purple_num = this.purple_num;
return (_local1);
}
public function get icon_frame():int{
return (this._icon_frame);
}
public function set lore(_arg1:String):void{
this._lore = _arg1;
}
public function set item_name(_arg1:String):void{
this._item_name = _arg1;
}
public function get lore():String{
return (this._lore);
}
public function get item_name():String{
return (this._item_name);
}
public function set item_rarity(_arg1:int):void{
this._item_rarity = _arg1;
}
public function set item_level(_arg1:int):void{
this._item_level = _arg1;
}
}
}//package
Section 184
//ItemData (ItemData)
package {
public class ItemData {
private var _material:int;// = -1
private var _item_rarity;// = 0
private var _suffix:int;// = -1
private var _prefix:int;// = -1
private var _purple_num:int;// = 0
private var _item_level:int;// = 1
public function ItemData():void{
_item_level = 1;
_item_rarity = 0;
_material = -1;
_prefix = -1;
_suffix = -1;
_purple_num = 0;
super();
}
public function get purple_num():int{
return (this._purple_num);
}
public function set purple_num(_arg1:int):void{
this._purple_num = _arg1;
}
public function set material(_arg1:int):void{
this._material = _arg1;
}
public function get suffix():int{
return (this._suffix);
}
public function get prefix():int{
return (this._prefix);
}
public function get item_rarity():int{
return (this._item_rarity);
}
public function get item_level():int{
return (this._item_level);
}
public function set prefix(_arg1:int):void{
this._prefix = _arg1;
}
public function get material():int{
return (this._material);
}
public function set suffix(_arg1:int):void{
this._suffix = _arg1;
}
public function set item_rarity(_arg1:int):void{
this._item_rarity = _arg1;
}
public function set item_level(_arg1:int):void{
this._item_level = _arg1;
}
}
}//package
Section 185
//ItemDestroyTarget (ItemDestroyTarget)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
import flash.geom.*;
public class ItemDestroyTarget extends MovieClip {
var tooltip:Tooltip;
function mouseOverTarget(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:Point;
if (_arg1.buttonDown){
return;
};
if (tooltip == null){
if (!newTooltip()){
return;
};
};
_local2 = _arg1.target.mouseX;
_local3 = _arg1.target.mouseY;
_local4 = _arg1.target.localToGlobal(new Point(_arg1.target.mouseX, _arg1.target.mouseY));
if ((_local4.x + tooltip.width) > DungeonMain.APP_WIDTH){
_local2 = (_local2 + (DungeonMain.APP_WIDTH - (_local4.x + tooltip.width)));
};
if ((_local4.y + tooltip.height) > DungeonMain.APP_HEIGHT){
_local3 = (_local3 + (DungeonMain.APP_HEIGHT - (_local4.y + tooltip.height)));
};
tooltip.x = _local2;
tooltip.y = _local3;
_arg1.updateAfterEvent();
}
private function newTooltip():Boolean{
var _local1:*;
var _local2:*;
_local1 = "Discard Item";
_local2 = "Drag an item here to discard it, or click on the item icon while holding the CTRL key.";
tooltip = new Tooltip(_local1, _local2);
tooltip.mouseEnabled = false;
tooltip.mouseChildren = false;
tooltip.name = "tooltip_destroy";
addChild(tooltip);
return (true);
}
function mouseMoveTarget(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:Point;
if (_arg1.buttonDown){
return;
};
if (tooltip == null){
if (!newTooltip()){
return;
};
};
_local2 = _arg1.target.mouseX;
_local3 = _arg1.target.mouseY;
_local4 = _arg1.target.localToGlobal(new Point(_arg1.target.mouseX, _arg1.target.mouseY));
if ((_local4.x + tooltip.width) > DungeonMain.APP_WIDTH){
_local2 = (_local2 + (DungeonMain.APP_WIDTH - (_local4.x + tooltip.width)));
};
if ((_local4.y + tooltip.height) > DungeonMain.APP_HEIGHT){
_local3 = (_local3 + (DungeonMain.APP_HEIGHT - (_local4.y + tooltip.height)));
};
tooltip.x = _local2;
tooltip.y = _local3;
_arg1.updateAfterEvent();
}
function mouseOutTarget(_arg1:MouseEvent):void{
if (tooltip != null){
removeChild(tooltip);
tooltip = null;
};
}
}
}//package
Section 186
//ItemTooltip (ItemTooltip)
package {
import flash.text.*;
import flash.display.*;
public class ItemTooltip extends Sprite {
const red_text = 0xCC0000;
const white_text = 0xFFFFFF;
const orange_text = 0xFF6600;
const grey_text = 0xCCCCCC;
const purple_text = 0x9900FF;
const green_text = 0x66FF00;
const blue_text = 26367;
public var tooltip_bg:ItemTooltipBg;
public var stats_label:TextField;
public var name_label:TextField;
var item_ref:Item;
public var level_label:TextField;
public var equipped_text:MovieClip;
public var type_label:TextField;
public var usable_label:TextField;
public function ItemTooltip(_arg1:Item=null, _arg2:PlayerCharacter=null, _arg3:Boolean=false){
var _local4:*;
var _local5:String;
super();
if (_arg1 == null){
return;
};
if (!_arg3){
removeChild(equipped_text);
};
item_ref = _arg1;
name_label.autoSize = TextFieldAutoSize.CENTER;
name_label.text = Item(item_ref).item_name;
dm.embolden(name_label);
_local4 = name_label.height;
name_label.autoSize = TextFieldAutoSize.NONE;
if (_local4 == 16){
name_label.height = (_local4 + 5);
} else {
name_label.height = (_local4 + 2);
};
setTextColor();
level_label.y = ((name_label.y + name_label.height) + 2);
type_label.y = ((name_label.y + name_label.height) + 2);
if (item_ref.item_level){
level_label.text = ("Level " + String(item_ref.item_level));
} else {
if ((item_ref is Consumable)){
level_label.text = ("Stack: " + String(Consumable(item_ref).stack));
} else {
removeChild(level_label);
};
};
type_label.text = item_ref.getItemTypeString();
_local5 = "";
if (item_ref.lore != ""){
_local5 = (("\"" + item_ref.lore) + "\"\n\n");
};
_local5 = (_local5 + item_ref.itemStatsString(""));
stats_label.text = _local5;
stats_label.autoSize = TextFieldAutoSize.CENTER;
stats_label.y = ((type_label.y + type_label.height) + 8);
if ((item_ref is Equipment)){
usable_label.text = Equipment(item_ref).usableString();
} else {
usable_label.text = "";
};
usable_label.autoSize = TextFieldAutoSize.CENTER;
usable_label.y = ((stats_label.y + stats_label.height) + 8);
if (_arg2 != null){
if (_arg2.itemUsable(item_ref)){
usable_label.textColor = white_text;
} else {
usable_label.textColor = red_text;
};
};
tooltip_bg.height = ((usable_label.y + usable_label.height) + 12);
}
public function setTextColor(){
var _local1:Item;
_local1 = item_ref;
if (_local1.item_rarity == Item.white){
name_label.textColor = white_text;
} else {
if (_local1.item_rarity == Item.green){
name_label.textColor = green_text;
} else {
if (_local1.item_rarity == Item.blue){
name_label.textColor = blue_text;
} else {
if (_local1.item_rarity == Item.purple){
name_label.textColor = purple_text;
} else {
if (_local1.item_rarity == Item.orange){
name_label.textColor = orange_text;
} else {
name_label.textColor = grey_text;
};
};
};
};
};
}
}
}//package
Section 187
//ItemTooltipBg (ItemTooltipBg)
package {
import flash.display.*;
public dynamic class ItemTooltipBg extends Sprite {
}
}//package
Section 188
//ItemTooltipController (ItemTooltipController)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class ItemTooltipController {
var tooltip:ItemTooltip;
var c_tooltip:ItemTooltip;
private var char_ref:PlayerCharacter;
var stage:Stage;
public function ItemTooltipController():void{
}
public function destroyTooltip():void{
if (tooltip != null){
if (this.stage != null){
stage.removeChild(tooltip);
};
tooltip = null;
};
if (c_tooltip != null){
if (this.stage != null){
stage.removeChild(c_tooltip);
};
c_tooltip = null;
};
}
public function showTooltip(_arg1:MouseEvent, _arg2:Item):void{
var _local3:*;
var _local4:*;
var _local5:Point;
if (((!((_arg1 == null))) && (_arg1.buttonDown))){
return;
};
if (_arg2 == null){
return;
};
if (tooltip == null){
if (((!((char_ref == null))) && ((_arg2 is Equipment)))){
if (((((!((char_ref.gear[Equipment(_arg2).slot] == null))) && (!((char_ref.gear[Equipment(_arg2).slot] == _arg2))))) && (char_ref.itemUsable(_arg2)))){
c_tooltip = new ItemTooltip(char_ref.gear[Equipment(_arg2).slot], char_ref, true);
c_tooltip.mouseEnabled = false;
c_tooltip.mouseChildren = false;
c_tooltip.name = "c_tooltip";
if (this.stage != null){
stage.addChild(c_tooltip);
};
};
};
tooltip = new ItemTooltip(_arg2, char_ref, false);
tooltip.mouseEnabled = false;
tooltip.mouseChildren = false;
tooltip.name = "tooltip";
if (this.stage != null){
stage.addChild(tooltip);
};
};
_local5 = _arg1.target.localToGlobal(new Point(_arg1.target.mouseX, _arg1.target.mouseY));
if ((_local5.x + tooltip.width) > DungeonMain.APP_WIDTH){
_local3 = (DungeonMain.APP_WIDTH - tooltip.width);
} else {
_local3 = _local5.x;
};
if ((_local5.y + tooltip.height) > DungeonMain.APP_HEIGHT){
_local4 = (DungeonMain.APP_HEIGHT - tooltip.height);
} else {
_local4 = _local5.y;
};
tooltip.x = Math.round(_local3);
tooltip.y = Math.round(_local4);
if (c_tooltip != null){
c_tooltip.x = _local3;
c_tooltip.y = (_local4 - c_tooltip.height);
};
_arg1.updateAfterEvent();
}
public function setChar(_arg1:PlayerCharacter){
this.char_ref = _arg1;
}
public function enableDoubleClick(_arg1:InventoryIcon, _arg2:Function):void{
if (tooltip == null){
return;
};
tooltip.doubleClickEnabled = true;
tooltip.addEventListener(MouseEvent.DOUBLE_CLICK, _arg2, false, 0, true);
}
public function removeTooltip(_arg1:MouseEvent, _arg2:Item){
if (tooltip != null){
if (tooltip.item_ref == _arg2){
destroyTooltip();
};
};
}
}
}//package
Section 189
//Jewellery (Jewellery)
package {
public class Jewellery extends Equipment {
public function Jewellery(){
whoEquips = Equipment.allEquip;
grey_name = "Tarnished";
materials.push("Silver", "Gold", "Platinum", "Obsidian", "Crystalline");
base_armor_rating = 0;
grey_chance = 0;
white_chance = 0;
green_chance = 70;
blue_chance = 29;
purple_chance = 1;
}
override public function generateItem(_arg1:int):void{
var _local2:*;
var _local3:*;
_local2 = false;
_local3 = false;
item_rarity = Math.max(Item.green, item_rarity);
if (item_rarity == Item.green){
if (DungeonMain.RandomNum(0, 100) >= 50){
_local3 = true;
} else {
_local2 = true;
};
};
getItemModifiers();
if ((((item_rarity == Item.blue)) || (_local3))){
prefix = rollForPrefix(item_rarity);
};
if ((((item_rarity == Item.blue)) || (_local2))){
suffix = rollForSuffix(item_rarity);
};
if (prefix >= 0){
applyPrefix();
};
if (suffix >= 0){
applySuffix();
};
if (base_armor_rating){
armor_rating = scaleArmorForLevel((base_armor_rating * (1 + (base_armor_mod / 100))));
};
material = rollForMaterial(item_rarity, materials);
if (material >= 0){
item_name = ((materials[material] + " ") + item_name);
};
if (prefix >= 0){
item_name = ((prefixes[prefix][0] + " ") + item_name);
};
if (suffix >= 0){
item_name = ((item_name + " of ") + suffixes[suffix][0]);
};
if (item_rarity == Item.grey){
item_name = ((grey_name + " ") + item_name);
};
}
override public function getItemTypeString(){
return ("Jewellery");
}
override public function itemStatsString(_arg1:String):String{
if (armor_rating){
_arg1 = (String(armor_rating) + " Armor Rating\n");
};
return (super.itemStatsString(_arg1));
}
override public function getItemModifiers():void{
super.getItemModifiers();
suffixes.push(["Might", base_item_stat_bonus]);
suffixes.push(["Deftness", base_item_stat_bonus]);
}
}
}//package
Section 190
//KeepButton (KeepButton)
package {
import flash.display.*;
public dynamic class KeepButton extends MovieClip {
}
}//package
Section 191
//lethal_effect (lethal_effect)
package {
import flash.display.*;
public dynamic class lethal_effect extends MovieClip {
public function lethal_effect(){
addFrameScript(44, frame45);
}
function frame45(){
this.stop();
}
}
}//package
Section 192
//LevelButton (LevelButton)
package {
import flash.display.*;
public dynamic class LevelButton extends MovieClip {
}
}//package
Section 193
//LevelUpGlow (LevelUpGlow)
package {
import flash.display.*;
public dynamic class LevelUpGlow extends MovieClip {
}
}//package
Section 194
//LightArmor (LightArmor)
package {
public class LightArmor extends Armor {
public function LightArmor(){
type = Armor.light;
mod_quickness = (mod_quickness - 0);
whoEquips = Equipment.allEquip;
base_armor_rating = 4;
grey_name = "Threadbare";
materials.push("Linen", "Wool", "Velvet", "Silk", "Suncloth", "Aetherweave");
}
override public function getItemTypeString(){
return ("Light Armor");
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function itemStatsString(_arg1:String):String{
return (super.itemStatsString(_arg1));
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 195
//LightGreenBar (LightGreenBar)
package {
import flash.display.*;
public dynamic class LightGreenBar extends Sprite {
}
}//package
Section 196
//Lightning (Lightning)
package {
import flash.display.*;
public dynamic class Lightning extends MovieClip {
public var flash:LightningFlash;
public function Lightning(){
addFrameScript(0, frame1);
}
function frame1(){
dm.sound.play(SoundControl.lightning);
}
}
}//package
Section 197
//lightning_sound (lightning_sound)
package {
import flash.media.*;
public dynamic class lightning_sound extends Sound {
}
}//package
Section 198
//LightningFlash (LightningFlash)
package {
import flash.display.*;
public dynamic class LightningFlash extends MovieClip {
public var lightning:RandomLightning;
public function LightningFlash(){
addFrameScript(3, frame4);
}
function frame4(){
this.stop();
}
}
}//package
Section 199
//LoadButton (LoadButton)
package {
import flash.display.*;
public dynamic class LoadButton extends MovieClip {
}
}//package
Section 200
//LoaderClass (LoaderClass)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.external.*;
import flash.net.*;
public class LoaderClass extends MovieClip {
public var bar:MovieClip;
var loading:Boolean;// = false
public var total_label:TextField;
public var dungeonMain:MovieClip;
public var loaded_label:TextField;
public var logo:SimpleButton;
public var biclops:SimpleButton;
public function LoaderClass(){
loading = false;
super();
addFrameScript(0, frame1, 1, frame2);
loading = true;
this.gotoAndStop(1);
addEventListener(Event.ENTER_FRAME, enterLoaderFrame);
stage.showDefaultContextMenu = false;
logo.addEventListener(MouseEvent.CLICK, logoClick);
biclops.addEventListener(MouseEvent.CLICK, biclopsClick);
}
function enterLoaderFrame(_arg1:Event):void{
if (loading){
updateText(_arg1);
} else {
removeEventListener(Event.ENTER_FRAME, enterLoaderFrame);
logo.removeEventListener(MouseEvent.CLICK, logoClick);
biclops.removeEventListener(MouseEvent.CLICK, biclopsClick);
this.gotoAndStop(3);
};
}
function frame1(){
this.gotoAndStop(1);
}
function frame2(){
this.gotoAndStop(1);
}
function logoClick(_arg1:MouseEvent):void{
var url:*;
var e = _arg1;
url = "http://www.maxgames.com";
try {
ExternalInterface.call("window.open", url, "_blank", "");
} catch(error) {
navigateToURL(new URLRequest(url), "_blank");
};
}
private function updateText(_arg1:Event):void{
var _local2:*;
var _local3:*;
_local2 = stage.loaderInfo.bytesTotal;
_local3 = stage.loaderInfo.bytesLoaded;
loaded_label.text = (String(Math.round((_local3 / 0x0400))) + "kB");
total_label.text = (String(Math.round((_local2 / 0x0400))) + "kB");
bar.width = (2 * Math.round(((_local3 / _local2) * 100)));
if (_local3 >= _local2){
loading = false;
};
}
function biclopsClick(_arg1:MouseEvent):void{
var url:*;
var e = _arg1;
url = "http://www.biclopsgames.com";
try {
ExternalInterface.call("window.open", url, "_blank", "");
} catch(error) {
navigateToURL(new URLRequest(url), "_blank");
};
}
}
}//package
Section 201
//LoadParty (LoadParty)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class LoadParty extends MovieClip {
public var party1:SaveGameStatus;
public var party3:SaveGameStatus;
public var party2:SaveGameStatus;
public var menu_btn:BackButton;
public function LoadParty(){
DungeonMain.registerAliases();
party1.slot = 1;
party2.slot = 2;
party3.slot = 3;
loadSlot(1);
loadSlot(2);
loadSlot(3);
menu_btn.addEventListener(MouseEvent.MOUSE_DOWN, menuClick);
addEventListener(Event.ADDED_TO_STAGE, added);
}
function added(_arg1:Event):void{
var _local2 = ??pushnamespace
;
var _local3:*;
removeEventListener(Event.ADDED_TO_STAGE, added);
_local2 = 128;
if (((DungeonMain.showHints) && (!(Dungeon.hintShown(_local2))))){
_local3 = new HintDialog("Saving", "Monsters' Den saves your progress automatically. You may quit at any time, and return to continue playing your game later.", true, true);
DungeonMain.hints = (DungeonMain.hints + _local2);
stage.addChild(_local3);
dm.main.saveInterface();
};
}
private function loadSlot(_arg1:int):void{
var _local2:SharedObject;
var _local3:SaveGameStatus;
var _local4:Party;
if ((((_arg1 < 1)) || ((_arg1 > 3)))){
return;
};
_local2 = SharedObject.getLocal(("party" + _arg1));
if (DungeonMain.debug){
};
_local3 = SaveGameStatus(getChildByName(("party" + _arg1)));
if (_local2.size > 0){
_local4 = Party(_local2.data.pc_party);
if (_local4 == null){
_local3.emptySlot();
return;
};
if (_local2.data.char1 != null){
_local4.members[0] = _local2.data.char1;
};
if (_local2.data.char2 != null){
_local4.members[1] = _local2.data.char2;
};
if (_local2.data.char3 != null){
_local4.members[2] = _local2.data.char3;
};
if (_local2.data.char4 != null){
_local4.members[3] = _local2.data.char4;
};
if (_local3 != null){
_local3.setParty(_local4, _local2.data.battle);
};
} else {
_local3.emptySlot();
};
}
public function deleteSlot(_arg1:int):void{
var _local2:SharedObject;
var _local3:SaveGameStatus;
if ((((_arg1 < 1)) || ((_arg1 >= 4)))){
return;
};
_local2 = SharedObject.getLocal(("party" + _arg1));
if (DungeonMain.debug){
};
_local2.clear();
_local2.flush();
_local3 = SaveGameStatus(getChildByName(("party" + _arg1)));
if (_local3 != null){
_local3.emptySlot();
};
}
public function menuClick(_arg1:MouseEvent):void{
if (root != null){
dm.main.mainMenu();
cleanup();
dm.main.removeChild(this);
};
}
public function cleanup():void{
menu_btn.removeEventListener(MouseEvent.MOUSE_DOWN, menuClick);
party1.cleanup();
party2.cleanup();
party3.cleanup();
}
public function newGame(_arg1:int):void{
if (parent != null){
DungeonMain(parent).startGame(_arg1);
cleanup();
parent.removeChild(this);
};
}
}
}//package
Section 202
//lose_power_effect (lose_power_effect)
package {
import flash.display.*;
public dynamic class lose_power_effect extends MovieClip {
}
}//package
Section 203
//mAetherguard (mAetherguard)
package {
public class mAetherguard extends MonsterCharacter {
public function mAetherguard(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.special;
classname = "Planar Entity";
ethereal = 20;
charname = "Aetherguard";
portrait = CharGraphic.aetherguard;
mindless = true;
description = "Slightly resistant to physical damage.";
quickness = 50;
health_max = Math.round((health_max * 1.2));
health = health_max;
damage = Math.round((damage * 1.4));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sAetherLightning(this));
}
}
}//package
Section 204
//mage_staff_sound (mage_staff_sound)
package {
import flash.media.*;
public dynamic class mage_staff_sound extends Sound {
}
}//package
Section 205
//MageWeapon (MageWeapon)
package {
public class MageWeapon extends Weapon {
public function MageWeapon(){
materials.push("Elm", "Oak", "Ash", "Yew", "Voidwood", "Planespine");
whoEquips = Equipment.mageEquip;
}
override public function getItemTypeString(){
return ("Mage Weapon");
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function itemStatsString(_arg1:String):String{
return (super.itemStatsString(_arg1));
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 206
//mArachnoid (mArachnoid)
package {
public class mArachnoid extends MonsterCharacter {
public function mArachnoid(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
charname = "Arachnoid";
portrait = CharGraphic.arachnoid;
mindless = true;
description = "Twisted fusion of man and spider. Tangles its enemies in webbing.";
poisonResist = 25;
quickness = 45;
damage_resistance = 0;
regenerate = 0;
health_max = Math.round((health_max * 1));
health = health_max;
damage = Math.round((damage * 1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sArachnoidWeb(this));
}
}
}//package
Section 207
//mAscendant (mAscendant)
package {
public class mAscendant extends MonsterCharacter {
public function mAscendant(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.special;
power_per_turn = Math.round((power_per_turn * 1.5));
regenerate = 10;
charname = Horde.getBeholderName();
classname = "Ascended Human";
portrait = CharGraphic.ascendant;
mindless = false;
description = "Cult Leader. Defensive spellcaster. Regenerates.";
accuracy = 150;
damage_resistance = 0;
poisonResist = 75;
stunResist = 75;
quickness = 50;
lethalityImmune = true;
damage = Math.round((damage * 1.2));
health_max = Math.round((health_max * 1.45));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sAscendantRanged(this));
skills.push(new sCelestialArmor(this));
skills.push(new sCelestialSpeed(this));
skills.push(new sCelestialAccuracy(this));
}
}
}//package
Section 208
//MaxGamesHudButton (MaxGamesHudButton)
package {
import flash.display.*;
public dynamic class MaxGamesHudButton extends SimpleButton {
}
}//package
Section 209
//MaxGamesIntro (MaxGamesIntro)
package {
import flash.display.*;
public dynamic class MaxGamesIntro extends MovieClip {
public var link_btn:SimpleButton;
public function MaxGamesIntro(){
addFrameScript(240, frame241);
}
function frame241(){
this.stop();
if (((!((parent == null))) && ((parent is DungeonMain)))){
DungeonMain(parent).init();
} else {
if (dm.main != null){
dm.main.init();
};
};
}
}
}//package
Section 210
//mBasilisk (mBasilisk)
package {
public class mBasilisk extends MonsterCharacter {
public function mBasilisk(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
classname = "Creature";
charname = "Basilisk";
portrait = CharGraphic.basilisk;
mindless = true;
description = "Stuns with attacks.";
quickness = 30;
damage_resistance = 0;
causes_stun_percent = 30;
regenerate = 0;
health_max = Math.round((health_max * 1));
health = health_max;
damage = Math.round((damage * 0.8));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sBasiliskPetrify(this));
}
}
}//package
Section 211
//mBeholder (mBeholder)
package {
public class mBeholder extends MonsterCharacter {
public function mBeholder(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
charname = Horde.getBeholderName();
classname = "Beholder";
portrait = CharGraphic.beholder;
mindless = false;
description = "Creature Leader. Powerful spellcaster. Ignores armor.";
accuracy = 150;
damage_resistance = 0;
poisonResist = 30;
stunResist = 50;
quickness = 40;
lethalityImmune = true;
damage = Math.round((damage * 1.5));
health_max = Math.round((health_max * 1.25));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sBeholderRanged(this));
skills.push(new sBeholderDrain(this));
skills.push(new sBeholderRecover(this));
}
}
}//package
Section 212
//mBoneHorror (mBoneHorror)
package {
public class mBoneHorror extends MonsterCharacter {
public function mBoneHorror(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
classname = "Undead";
poisonResist = 50;
charname = "Bone Horror";
portrait = CharGraphic.bone_horror;
mindless = true;
description = "Undead. Lumbering, jagged monstrosity of bone. Reflects damage.";
damage_reflection = 10;
quickness = 20;
health_max = Math.round((health_max * 1.3));
health = health_max;
damage = Math.round((damage * 1.4));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
}
}
}//package
Section 213
//mCultArcher (mCultArcher)
package {
public class mCultArcher extends MonsterCharacter {
public function mCultArcher(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.human;
classname = "Human";
power_per_turn = Math.round((power_per_turn * 1.5));
charname = "Protector";
portrait = CharGraphic.cult_archer;
mindless = true;
description = "Armored. Ranged attack.";
quickness = 60;
damage_resistance = 20;
health_max = Math.round((health_max * 0.9));
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterRangedAttack(this));
skills.push(new sCultistArrow(this));
}
}
}//package
Section 214
//mCultChosen (mCultChosen)
package {
public class mCultChosen extends MonsterCharacter {
public function mCultChosen(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.human;
classname = "Human";
power_per_turn = Math.round((power_per_turn * 1.5));
charname = "Chosen";
portrait = CharGraphic.cult_chosen;
mindless = true;
description = "Armored. Warrior/Spellcaster.";
quickness = 40;
damage_resistance = 20;
health_max = Math.round((health_max * 1));
health = health_max;
damage = Math.round((damage * 1.2));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sCultistMeleeStun(this));
skills.push(new sCultistSever(this));
}
}
}//package
Section 215
//mCultEngine (mCultEngine)
package {
public class mCultEngine extends MonsterCharacter {
public function mCultEngine(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.special;
power_per_turn = Math.round((power_per_turn * 1.5));
charname = Horde.getEngineName();
classname = "Nexus Engine";
portrait = CharGraphic.cult_engine;
mindless = false;
description = "Sacred Icon. Gathers and stores planar energy.";
accuracy = 120;
damage_resistance = 35;
poisonResist = 100;
stunResist = 60;
quickness = 10;
lethalityImmune = true;
damage = Math.round((damage * 1.55));
health_max = Math.round((health_max * 1.3));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sMonsterMeleeAE(this));
skills.push(new sEngineConduit(this));
skills.push(new sVoidCannon(this));
}
}
}//package
Section 216
//mCultNeophyte (mCultNeophyte)
package {
public class mCultNeophyte extends MonsterCharacter {
public function mCultNeophyte(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.human;
classname = "Human";
power_per_turn = Math.round((power_per_turn * 1.5));
charname = "Neophyte";
portrait = CharGraphic.cult_neophyte;
mindless = false;
description = "Sacrifice themselves to summon more powerful allies.";
quickness = 35;
health_max = Math.round((health_max * 0.8));
health = health_max;
damage = Math.round((damage * 1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sTransformAetherguard(this));
}
}
}//package
Section 217
//mCultPriest (mCultPriest)
package {
public class mCultPriest extends MonsterCharacter {
public function mCultPriest(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.human;
classname = "Human";
power_per_turn = Math.round((power_per_turn * 1.5));
charname = "Acolyte";
portrait = CharGraphic.cult_priest;
mindless = false;
description = "Spellcaster. Summons planar entities.";
quickness = 35;
health_max = Math.round((health_max * 0.8));
health = health_max;
damage = Math.round((damage * 0.8));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterMagicAttack(this));
skills.push(new sCultistHeal(this));
skills.push(new sSummonVoidstalker(this));
}
}
}//package
Section 218
//mCultWarrior (mCultWarrior)
package {
public class mCultWarrior extends MonsterCharacter {
public function mCultWarrior(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.human;
classname = "Human";
power_per_turn = Math.round((power_per_turn * 1.5));
charname = "Guardian";
portrait = CharGraphic.cult_warrior;
mindless = true;
description = "Armored.";
quickness = 45;
damage_resistance = 20;
health_max = Math.round((health_max * 0.9));
health = health_max;
damage = Math.round((damage * 0.9));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sCultistMeleeStun(this));
}
}
}//package
Section 219
//mDeathKnight (mDeathKnight)
package {
public class mDeathKnight extends MonsterCharacter {
public function mDeathKnight(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
poisonResist = 50;
charname = Horde.getKnightName();
classname = "Fallen Knight";
portrait = CharGraphic.death_knight;
mindless = false;
description = "Undead Leader. Powerful warrior.";
accuracy = 140;
damage_resistance = 30;
poisonResist = 50;
stunResist = 50;
quickness = 40;
lethalityImmune = true;
damage = Math.round((damage * 1.5));
health_max = Math.round((health_max * 1.3));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sMonsterMeleeAE(this));
skills.push(new sDeathKnightRally(this));
}
}
}//package
Section 220
//mDemon (mDemon)
package {
public class mDemon extends MonsterCharacter {
public function mDemon(_arg1:int=1){
super(_arg1);
charname = "The Corruptor";
classname = "Demon";
type = MonsterCharacter.special;
portrait = CharGraphic.demon;
mindless = false;
description = "Dungeon Lord. Source of the danger to this world.";
accuracy = 140;
damage_resistance = 20;
poisonResist = 50;
stunResist = 75;
power_per_turn = 20;
quickness = 50;
lethalityImmune = true;
damage = Math.round((damage * 1.5));
health_max = Math.round((health_max * 2.5));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sDemonDoubleAttack(this));
skills.push(new sDemonPoison(this));
skills.push(new sDemonClone(this));
}
}
}//package
Section 221
//mDragon (mDragon)
package {
public class mDragon extends MonsterCharacter {
public function mDragon(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
classname = "Dragon";
charname = Horde.getDragonName();
portrait = CharGraphic.dragon;
mindless = false;
description = "Creature Leader. Attacks multiple enemies.";
accuracy = 140;
damage_resistance = 20;
poisonResist = 0;
stunResist = 50;
quickness = 25;
lethalityImmune = true;
damage = Math.round((damage * 1.5));
health_max = Math.round((health_max * 1.6));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sDragonFlame(this));
skills.push(new sDragonTail(this));
}
}
}//package
Section 222
//MediumArmor (MediumArmor)
package {
public class MediumArmor extends Armor {
public function MediumArmor(){
type = Armor.medium;
mod_quickness = (mod_quickness - 1);
whoEquips = (Equipment.allEquip - Equipment.mageEquip);
base_armor_rating = 10;
grey_name = "Patched";
materials.push("Leather", "Studded", "Scaled", "Trollhide", "Symbiotic", "Shiftsteel");
}
override public function getItemTypeString(){
return ("Medium Armor");
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function itemStatsString(_arg1:String):String{
return (super.itemStatsString(_arg1));
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 223
//MeleeWeapon (MeleeWeapon)
package {
public class MeleeWeapon extends Weapon {
public function MeleeWeapon(){
materials.push("Iron", "Steel", "Damascene", "Mithril", "Magesteel", "Planeforged");
}
override public function getItemTypeString(){
if (twoHanded){
return ("2H Melee Weapon");
};
return ("Melee Weapon");
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
suffixes.push(["Might", base_item_stat_bonus]);
}
}
}//package
Section 224
//MenuButton (MenuButton)
package {
import flash.display.*;
public dynamic class MenuButton extends MovieClip {
}
}//package
Section 225
//mGargoyle (mGargoyle)
package {
public class mGargoyle extends MonsterCharacter {
public function mGargoyle(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
classname = "Creature";
type = MonsterCharacter.creature;
charname = "Gargoyle";
portrait = CharGraphic.gargoyle;
mindless = true;
description = "Flying creature. Highly resistant to damage.";
quickness = 60;
damage_resistance = 80;
poisonResist = 100;
regenerate = 0;
health_max = Math.round((health_max * 0.2));
health = health_max;
damage = Math.round((damage * 1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sMonsterFlightAttack(this));
skills.push(new sMonsterStoneForm(this));
}
}
}//package
Section 226
//mGhost (mGhost)
package {
public class mGhost extends MonsterCharacter {
public function mGhost(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
classname = "Undead";
poisonResist = 100;
stunResist = 100;
ethereal = 80;
charname = "Wraith";
portrait = CharGraphic.ghost;
mindless = true;
description = "Highly resistant to physical attacks. Ignores armor.";
quickness = 60;
health_max = Math.round((health_max * 0.3));
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sGhostAttack(this));
skills.push(new sGhostTouch(this));
skills.push(new sGhostHide(this));
}
}
}//package
Section 227
//mGoblinArtificer (mGoblinArtificer)
package {
public class mGoblinArtificer extends MonsterCharacter {
public function mGoblinArtificer(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
classname = "Greenskin";
stunResist = 25;
charname = "Goblin Artificer";
portrait = CharGraphic.goblin;
mindless = true;
description = "Ranged explosive attack. Hated by their kin.";
quickness = 60;
accuracy = 95;
health_max = Math.round((health_max * 0.8));
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sGoblinCrossbow(this));
skills.push(new sGoblinGrenade(this));
}
}
}//package
Section 228
//mGreebler (mGreebler)
package {
public class mGreebler extends MonsterCharacter {
public function mGreebler(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
classname = "Creature";
charname = "Greebler";
portrait = CharGraphic.greebler;
description = "Poisonous claws. Can attack at range.";
quickness = 65;
health_max = Math.round((health_max * 0.8));
health = health_max;
damage = Math.round((damage * 0.8));
poison_damage = Math.round((damage * 0.2));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sMonsterShadowStrike(this));
}
}
}//package
Section 229
//miss_magic_sound (miss_magic_sound)
package {
import flash.media.*;
public dynamic class miss_magic_sound extends Sound {
}
}//package
Section 230
//miss_melee_sound (miss_melee_sound)
package {
import flash.media.*;
public dynamic class miss_melee_sound extends Sound {
}
}//package
Section 231
//miss_ranged_sound (miss_ranged_sound)
package {
import flash.media.*;
public dynamic class miss_ranged_sound extends Sound {
}
}//package
Section 232
//miss_thrown_sound (miss_thrown_sound)
package {
import flash.media.*;
public dynamic class miss_thrown_sound extends Sound {
}
}//package
Section 233
//mLich (mLich)
package {
public class mLich extends MonsterCharacter {
public function mLich(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
classname = "Undead";
poisonResist = 50;
charname = "Lich";
portrait = CharGraphic.lich;
mindless = false;
description = "Undead. Spellcaster.";
quickness = 35;
health_max = Math.round((health_max * 0.8));
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterMagicCold(this));
skills.push(new sLichStun(this));
skills.push(new sLichAE(this));
}
}
}//package
Section 234
//mLightningDrake (mLightningDrake)
package {
public class mLightningDrake extends MonsterCharacter {
public function mLightningDrake(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
charname = "Storm Drake";
portrait = CharGraphic.lightning_drake;
mindless = true;
description = "Flying creature. Has lightning attack.";
quickness = 55;
damage_resistance = 0;
health_max = Math.round((health_max * 1));
health = health_max;
damage = Math.round((damage * 1.1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sMonsterFlightAttack(this));
skills.push(new sLightningDrakeAE(this));
}
}
}//package
Section 235
//mNecromancer (mNecromancer)
package {
public class mNecromancer extends MonsterCharacter {
public function mNecromancer(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
charname = Horde.getNecromancerName();
classname = "Arch-Lich";
portrait = CharGraphic.necromancer;
mindless = false;
description = "Undead Leader. Powerful spellcaster.";
accuracy = 150;
damage_resistance = 10;
poisonResist = 50;
stunResist = 30;
quickness = 35;
lethalityImmune = true;
damage = Math.round((damage * 1.7));
health_max = Math.round((health_max * 1.4));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterMagicCold(this));
skills.push(new sNecroDrain(this));
skills.push(new sNecroSponge(this));
}
}
}//package
Section 236
//monster_arrow (monster_arrow)
package {
import flash.display.*;
public dynamic class monster_arrow extends MovieClip {
public var blood:BloodRandom;
public var spark:monster_arrow_impact;
public function monster_arrow(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.monsterArrow);
this.spark.x = dm.randomNum(15, 43);
this.spark.y = dm.randomNum(15, 43);
}
function frame45(){
this.stop();
}
}
}//package
Section 237
//monster_arrow_drainpower (monster_arrow_drainpower)
package {
import flash.display.*;
public dynamic class monster_arrow_drainpower extends MovieClip {
public var blood:BloodRandom;
public var spark:monster_arrow_impact;
public function monster_arrow_drainpower(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.monsterArrow);
this.spark.x = dm.randomNum(15, 43);
this.spark.y = dm.randomNum(15, 43);
}
function frame45(){
this.stop();
}
}
}//package
Section 238
//monster_arrow_impact (monster_arrow_impact)
package {
import flash.display.*;
public dynamic class monster_arrow_impact extends MovieClip {
public var hit:MovieClip;
public function monster_arrow_impact(){
addFrameScript(11, frame12);
}
function frame12(){
this.gotoAndStop(12);
}
}
}//package
Section 239
//monster_drain_effect (monster_drain_effect)
package {
import flash.display.*;
public dynamic class monster_drain_effect extends MovieClip {
public function monster_drain_effect(){
addFrameScript(44, frame45);
}
function frame45(){
this.stop();
}
}
}//package
Section 240
//monster_magic_attack (monster_magic_attack)
package {
import flash.display.*;
public dynamic class monster_magic_attack extends MovieClip {
public function monster_magic_attack(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.monsterMagicAttack);
}
function frame45(){
this.stop();
}
}
}//package
Section 241
//monster_magic_sound (monster_magic_sound)
package {
import flash.media.*;
public dynamic class monster_magic_sound extends Sound {
}
}//package
Section 242
//monster_thrown (monster_thrown)
package {
import flash.display.*;
public dynamic class monster_thrown extends MovieClip {
public var blood:BloodRandom;
public var spark:monster_arrow_impact;
public function monster_thrown(){
addFrameScript(0, frame1, 4, frame5, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.thrown);
}
function frame5(){
this.spark.x = dm.randomNum(15, 43);
this.spark.y = dm.randomNum(15, 43);
}
function frame45(){
this.stop();
}
}
}//package
Section 243
//MonsterCharacter (MonsterCharacter)
package {
public class MonsterCharacter extends Character {
private var _vampiric_percent:int;// = 0
private var _causes_stun_percent:int;// = 0
private var _accuracy_damage:int;// = 0
private var _regenerate:int;// = 0
private var _mindless:Boolean;// = true
private var _damage_reflection:int;// = 0
private var _damage_resistance:int;// = 0
private var _poison_damage:int;// = 0
private var _ethereal:int;// = 0
static const greenskin = 2;
static const BEGINNER_HEALTH_MOD = 0.7;
static const BASE_HEALTH = 100;
static const EXTREME_HEALTH_MOD = 1.2;
static const HEALTH_SCALE_RATE = 55;
static const BASE_DAMAGE = 20;
static const BEGINNER_DAMAGE_MOD = 0.75;
static const DAMAGE_SCALE_RATE = 32;
static const EXTREME_DAMAGE_MOD = 1.2;
static const human = 4;
static const special = 5;
static const undead = 1;
static const creature = 3;
public function MonsterCharacter(_arg1:int=1){
_regenerate = 0;
_mindless = true;
_damage_resistance = 0;
_ethereal = 0;
_vampiric_percent = 0;
_causes_stun_percent = 0;
_damage_reflection = 0;
_accuracy_damage = 0;
_poison_damage = 0;
super();
this.level = _arg1;
classname = "Monster";
health_max = getHealthMax(_arg1);
damage = getBaseDamage(_arg1);
}
override public function getHealthRegen(_arg1:Boolean=true):int{
var _local2:*;
_local2 = Math.round(((regenerate / 100) * health_max));
if (_arg1){
_local2 = (_local2 + buff_healthRegen);
};
return (_local2);
}
public function set poison_damage(_arg1:int):void{
this._poison_damage = _arg1;
}
override public function getPoisonDamage(_arg1:Boolean=true):int{
return (poison_damage);
}
public function get damage_resistance():int{
return (this._damage_resistance);
}
override public function getVampiric(_arg1:Boolean=true):int{
if (_arg1){
return ((vampiric_percent + buff_vampiric));
};
return (vampiric_percent);
}
public function set damage_resistance(_arg1:int):void{
this._damage_resistance = _arg1;
}
public function set ethereal(_arg1:int):void{
this._ethereal = _arg1;
}
public function set damage_reflection(_arg1:int):void{
this._damage_reflection = _arg1;
}
public function set vampiric_percent(_arg1:int):void{
this._vampiric_percent = _arg1;
}
public function set regenerate(_arg1:int):void{
this._regenerate = _arg1;
}
override public function reduceHealth(_arg1:int):int{
var _local2:*;
var _local3:*;
_local2 = health;
_local3 = super.reduceHealth(_arg1);
if ((((((health <= 0)) && ((_local2 > 0)))) && ((_local3 > 0)))){
if (DungeonMain.MEEZ){
dm.MeezGPF.emote(5);
};
};
return (_local3);
}
public function get accuracy_damage():int{
return (this._accuracy_damage);
}
override public function getDamageReflection(_arg1:Boolean=true):int{
if (_arg1){
return ((damage_reflection + buff_damageReflect));
};
return (damage_reflection);
}
public function resetSkills():void{
var _local1:*;
_local1 = 0;
while (_local1 < skills.length) {
skills[_local1].aiCastCount = 0;
_local1++;
};
}
public function set causes_stun_percent(_arg1:int):void{
this._causes_stun_percent = _arg1;
}
public function get poison_damage():int{
return (this._poison_damage);
}
override public function damageAfterArmor(_arg1:int):int{
var _local2:*;
_local2 = (damage_resistance + buff_damageResist);
if (_local2 >= 100){
_local2 = 99;
};
if (_local2 != 0){
_arg1 = (_arg1 * (1 - (_local2 / 100)));
};
if (_arg1 == 0){
_arg1 = 1;
};
return (_arg1);
}
public function get ethereal():int{
return (this._ethereal);
}
override public function getStunChance(_arg1:Boolean=true):int{
if (_arg1){
return ((causes_stun_percent + buff_stun));
};
return (causes_stun_percent);
}
public function get vampiric_percent():int{
return (this._vampiric_percent);
}
public function initSkills():void{
}
public function isSummoned():Boolean{
return (false);
}
override public function getEffectiveHealth():int{
var _local1:*;
var _local2:*;
_local1 = ((100 - getDamageResist()) / 100);
_local2 = Math.round((health / _local1));
return (_local2);
}
override public function getDamageResist(_arg1:Boolean=true):int{
if (_arg1){
return (Math.min(99, ((damage_resistance + buff_damageResist) + temp_damage_resistance)));
};
return (Math.min(99, damage_resistance));
}
public function get causes_stun_percent():int{
return (this._causes_stun_percent);
}
override public function getAccuracyDamage(_arg1:Boolean=true):int{
return (accuracy_damage);
}
public function get regenerate():int{
return (this._regenerate);
}
public function set mindless(_arg1:Boolean):void{
this._mindless = _arg1;
}
public function set accuracy_damage(_arg1:int):void{
this._accuracy_damage = _arg1;
}
public function get mindless():Boolean{
return (this._mindless);
}
public function get damage_reflection():int{
return (this._damage_reflection);
}
public static function getHealthIncreaseOld(_arg1:int, _arg2:Boolean=true):int{
var _local3 = ??pushnamespace
;
var _local4:*;
var _local5:int;
_local3 = 50;
_arg1--;
_local4 = Math.round((_arg1 * (BASE_HEALTH * (_local3 / 100))));
if (_arg2){
_local5 = 8;
if (_arg1){
_local4 = (_local4 + Math.round((_arg1 * (_arg1 / _local5))));
};
};
return (_local4);
}
public static function getHealthMaxOld(_arg1:int, _arg2:Boolean=true):int{
var _local3:*;
_local3 = (BASE_HEALTH + getHealthIncreaseOld(_arg1, _arg2));
if (!_arg2){
return (_local3);
};
if (_arg1 == 1){
_local3 = Math.round((_local3 * 0.7));
} else {
if (_arg1 == 2){
_local3 = Math.round((_local3 * 0.8));
} else {
if (_arg1 == 3){
_local3 = Math.round((_local3 * 0.9));
};
};
};
if (dm.party != null){
if (dm.party.beginner){
_local3 = (_local3 * BEGINNER_HEALTH_MOD);
};
if (dm.party.extreme){
_local3 = (_local3 * EXTREME_HEALTH_MOD);
};
};
return (_local3);
}
public static function getBaseDamage(_arg1:int):int{
var _local2:*;
_local2 = (BASE_DAMAGE + Math.round(((_arg1 - 1) * (BASE_DAMAGE * (DAMAGE_SCALE_RATE / 100)))));
if (_arg1 == 1){
_local2 = Math.round((_local2 * 0.7));
} else {
if (_arg1 == 2){
_local2 = Math.round((_local2 * 0.8));
} else {
if (_arg1 == 3){
_local2 = Math.round((_local2 * 0.9));
};
};
};
if (dm.party != null){
if (dm.party.beginner){
_local2 = (_local2 * BEGINNER_DAMAGE_MOD);
};
if (dm.party.extreme){
_local2 = (_local2 * EXTREME_DAMAGE_MOD);
};
};
return (_local2);
}
public static function getHealthMax(_arg1:int, _arg2:Boolean=true):int{
var _local3:*;
_local3 = (BASE_HEALTH + getHealthIncrease(_arg1, _arg2));
if (!_arg2){
return (_local3);
};
if (_arg1 == 1){
_local3 = Math.round((_local3 * 0.7));
} else {
if (_arg1 == 2){
_local3 = Math.round((_local3 * 0.8));
} else {
if (_arg1 == 3){
_local3 = Math.round((_local3 * 0.9));
};
};
};
if (dm.party != null){
if (dm.party.beginner){
_local3 = (_local3 * BEGINNER_HEALTH_MOD);
};
if (dm.party.extreme){
_local3 = (_local3 * EXTREME_HEALTH_MOD);
};
};
return (_local3);
}
public static function getHealthIncrease(_arg1:int, _arg2:Boolean=true):int{
var _local3:*;
var _local4:int;
_arg1--;
_local3 = Math.round((_arg1 * (BASE_HEALTH * (HEALTH_SCALE_RATE / 100))));
if (_arg2){
_local4 = 60;
if (dm.party != null){
if (dm.party.extreme){
_local4 = 50;
};
};
if (_arg1){
_local3 = (_local3 + Math.round((_arg1 * (_arg1 / _local4))));
};
};
return (_local3);
}
}
}//package
Section 244
//mOrcBerserker (mOrcBerserker)
package {
public class mOrcBerserker extends MonsterCharacter {
public function mOrcBerserker(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
classname = "Greenskin";
stunResist = 25;
charname = "Orc Berserker";
portrait = CharGraphic.orc;
mindless = true;
description = "Attacks twice.";
quickness = 60;
health_max = Math.round((health_max * 1));
health = health_max;
damage = Math.round((damage * 1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterDoubleAttack(this));
}
}
}//package
Section 245
//mOrcChampion (mOrcChampion)
package {
public class mOrcChampion extends MonsterCharacter {
public function mOrcChampion(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
classname = "Greenskin";
stunResist = 25;
charname = "Orc Champion";
portrait = CharGraphic.orc_champion;
mindless = true;
description = "Orcish elite.";
quickness = 45;
damage_resistance = 10;
health_max = Math.round((health_max * 1.1));
health = health_max;
damage = Math.round((damage * 1.1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sOrcSponge(this));
}
}
}//package
Section 246
//mOrcJuggernaut (mOrcJuggernaut)
package {
public class mOrcJuggernaut extends MonsterCharacter {
public function mOrcJuggernaut(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
stunResist = 25;
charname = Horde.getGreenskinName();
classname = "Half-Troll";
portrait = CharGraphic.orc_juggernaut;
mindless = false;
description = "Greenskin Leader. Slow, hulking warrior. Regenerates.";
accuracy = 120;
damage_resistance = 0;
poisonResist = 50;
stunResist = 75;
quickness = 45;
lethalityImmune = true;
regenerate = 10;
damage = Math.round((damage * 1.5));
health_max = Math.round((health_max * 1.6));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sMonsterDoubleAttack(this));
skills.push(new sTrollHowl(this));
}
}
}//package
Section 247
//mOrcSavage (mOrcSavage)
package {
public class mOrcSavage extends MonsterCharacter {
public function mOrcSavage(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
classname = "Greenskin";
stunResist = 25;
charname = "Orc Savage";
portrait = CharGraphic.orc_woman;
mindless = true;
description = "Strong ranged attack, but inaccurate.";
quickness = 65;
accuracy = 65;
health_max = Math.round((health_max * 1));
health = health_max;
damage = Math.round((damage * 1.1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sOrcAxeThrow(this));
skills.push(new sMonsterDoubleAttack(this));
}
}
}//package
Section 248
//mOrcShaman (mOrcShaman)
package {
public class mOrcShaman extends MonsterCharacter {
public function mOrcShaman(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
classname = "Greenskin";
stunResist = 25;
charname = "Orc Shaman";
portrait = CharGraphic.orc_shaman;
mindless = false;
description = "Spellcaster. Heals allies and curses enemies.";
quickness = 35;
health_max = Math.round((health_max * 0.9));
health = health_max;
damage = Math.round((damage * 1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sMonsterHeal(this));
skills.push(new sMonsterCurse(this));
}
}
}//package
Section 249
//mOrcWarlord (mOrcWarlord)
package {
public class mOrcWarlord extends MonsterCharacter {
public function mOrcWarlord(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
stunResist = 25;
charname = Horde.getGreenskinName();
classname = "Orc Warlord";
portrait = CharGraphic.orc_warlord;
mindless = false;
description = "Greenskin Leader.";
accuracy = 140;
damage_resistance = 20;
poisonResist = 25;
stunResist = 75;
quickness = 35;
lethalityImmune = true;
health_max = Math.round((health_max * 1.5));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
damage = Math.round((damage * 1.6));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sWarlordRevive(this));
skills.push(new sWarlordFocus(this));
skills.push(new sWarlordBuff(this));
}
}
}//package
Section 250
//MovementArrowHead (MovementArrowHead)
package {
import flash.display.*;
public dynamic class MovementArrowHead extends MovieClip {
}
}//package
Section 251
//mPoisonDrake (mPoisonDrake)
package {
public class mPoisonDrake extends MonsterCharacter {
public function mPoisonDrake(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
charname = "Poison Drake";
portrait = CharGraphic.poison_drake;
mindless = true;
description = "Spits poison.";
quickness = 45;
damage_resistance = 0;
poisonResist = 100;
health_max = Math.round((health_max * 1));
health = health_max;
damage = Math.round((damage * 1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sPoisonDrakeShot(this));
skills.push(new sPoisonDrakeAE(this));
}
}
}//package
Section 252
//mSkeleton (mSkeleton)
package {
public class mSkeleton extends MonsterCharacter {
public function mSkeleton(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
classname = "Undead";
poisonResist = 50;
charname = "Skeleton";
portrait = CharGraphic.skeleton;
mindless = true;
description = "Undead. Fragile, but slowly mends.";
quickness = 40;
health_max = Math.round((health_max * 1));
health = health_max;
damage_resistance = -10;
regenerate = 6;
stunResist = 0;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
}
}
}//package
Section 253
//mSkeletonArcher (mSkeletonArcher)
package {
public class mSkeletonArcher extends MonsterCharacter {
public function mSkeletonArcher(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
classname = "Undead";
poisonResist = 50;
charname = "Undead Archer";
portrait = CharGraphic.skeleton_archer;
mindless = true;
description = "Undead. Ranged attack. Fragile, but slowly mends.";
quickness = 50;
health_max = Math.round((health_max * 1));
health = health_max;
damage_resistance = -10;
regenerate = 6;
stunResist = 0;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sMonsterRangedAttack(this));
}
}
}//package
Section 254
//mTroll (mTroll)
package {
public class mTroll extends MonsterCharacter {
public function mTroll(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
classname = "Greenskin";
stunResist = 25;
charname = "Troll";
portrait = CharGraphic.troll;
mindless = true;
description = "Regenerates health. Slow. Strong attack.";
quickness = 20;
accuracy = 80;
damage_resistance = 0;
regenerate = 15;
health_max = Math.round((health_max * 1.2));
health = health_max;
damage = Math.round((damage * 1.6));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sMonsterPierce(this));
}
}
}//package
Section 255
//Music (Music)
package {
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class Music {
const fade_out_time = 500;
const sound_fade_steps = 25;
const fade_in_time = 1000;
var channel:SoundChannel;
var fadeInTimer:Timer;
var active:Boolean;// = false
var fadeStepCount;// = 0
var fadeOutTimer:Timer;
static var volumeSetting = 0.5;
public function Music(_arg1:Sound=null, _arg2:Boolean=true, _arg3:Boolean=true):void{
var _local4:*;
fadeStepCount = 0;
active = false;
super();
if (_arg1 == null){
return;
};
_local4 = 1;
if (_arg2){
_local4 = 99999;
};
active = true;
channel = _arg1.play(0, _local4);
if (_arg3){
this.fadeIn();
} else {
this.setVolume(volumeSetting);
};
}
function musicFadeOutStep(_arg1:TimerEvent):void{
var _local2:*;
var _local3:*;
fadeStepCount--;
_local2 = (1 / sound_fade_steps);
_local3 = (fadeStepCount * _local2);
_local3 = (_local3 * volumeSetting);
channel.soundTransform = new SoundTransform(_local3);
}
public function stop():void{
channel.stop();
active = false;
}
public function fadeIn(_arg1:int=1000):void{
if (channel == null){
return;
};
channel.soundTransform = new SoundTransform(0);
fadeStepCount = 0;
fadeInTimer = new Timer((_arg1 / sound_fade_steps), sound_fade_steps);
fadeInTimer.addEventListener(TimerEvent.TIMER, musicFadeInStep);
fadeInTimer.addEventListener(TimerEvent.TIMER_COMPLETE, musicFadeInDone);
fadeInTimer.start();
}
public function setVolume(_arg1:Number):void{
if (channel == null){
return;
};
_arg1 = Math.max(0, _arg1);
_arg1 = Math.min(volumeSetting, _arg1);
channel.soundTransform = new SoundTransform(_arg1);
}
public function mute():void{
setVolume(0);
}
function musicFadeInDone(_arg1:TimerEvent):void{
fadeInTimer.removeEventListener(TimerEvent.TIMER, musicFadeInStep);
fadeInTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, musicFadeInDone);
channel.soundTransform = new SoundTransform(volumeSetting);
}
function musicFadeInStep(_arg1:TimerEvent):void{
var _local2:*;
var _local3:*;
fadeStepCount++;
_local2 = (1 / sound_fade_steps);
_local3 = (fadeStepCount * _local2);
_local3 = (_local3 * volumeSetting);
channel.soundTransform = new SoundTransform(_local3);
}
function musicFadeOutDone(_arg1:TimerEvent):void{
fadeOutTimer.removeEventListener(TimerEvent.TIMER, musicFadeOutStep);
fadeOutTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, musicFadeOutDone);
channel.stop();
}
public function fadeOut(_arg1:int=1000):void{
if (channel == null){
return;
};
active = false;
fadeStepCount = sound_fade_steps;
channel.soundTransform = new SoundTransform(volumeSetting);
fadeOutTimer = new Timer((_arg1 / sound_fade_steps), sound_fade_steps);
fadeOutTimer.addEventListener(TimerEvent.TIMER, musicFadeOutStep);
fadeOutTimer.addEventListener(TimerEvent.TIMER_COMPLETE, musicFadeOutDone);
fadeOutTimer.start();
}
}
}//package
Section 256
//mVampire (mVampire)
package {
public class mVampire extends MonsterCharacter {
public function mVampire(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
classname = "Undead";
poisonResist = 50;
charname = "Vampire";
portrait = CharGraphic.vampire;
mindless = true;
description = "Undead. Drains health.";
quickness = 60;
vampiric_percent = Math.floor((75 + (_arg1 * 0.5)));
health_max = Math.round((health_max * 0.9));
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sVampireAttack(this));
}
}
}//package
Section 257
//mVoidstalker (mVoidstalker)
package {
public class mVoidstalker extends MonsterCharacter {
public function mVoidstalker(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.special;
classname = "Planar Entity";
ethereal = 20;
charname = "Voidstalker";
portrait = CharGraphic.voidstalker;
description = "Slightly resistant to physical damage. Reduces target's accuracy. Can attack at range.";
accuracy_damage = 30;
quickness = 80;
health_max = Math.round((health_max * 0.7));
health = health_max;
damage = Math.round((damage * 0.9));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sMonsterShadowStrike(this));
}
override public function isSummoned():Boolean{
return (true);
}
}
}//package
Section 258
//mZombie (mZombie)
package {
public class mZombie extends MonsterCharacter {
public function mZombie(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
classname = "Undead";
poisonResist = 50;
charname = "Zombie";
portrait = CharGraphic.zombie;
mindless = true;
description = "Undead. Slow, but tough. Has debilitating attacks.";
quickness = 20;
health_max = Math.round((health_max * 1.3));
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sZombieAttack(this));
skills.push(new sZombieAE(this));
}
}
}//package
Section 259
//NotYetButton (NotYetButton)
package {
import flash.display.*;
public dynamic class NotYetButton extends MovieClip {
}
}//package
Section 260
//NumericIndicatorHealth (NumericIndicatorHealth)
package {
import flash.text.*;
import flash.display.*;
public dynamic class NumericIndicatorHealth extends Sprite {
public var bar:RedBarHorz;
public var numbers:TextField;
}
}//package
Section 261
//NumericIndicatorPower (NumericIndicatorPower)
package {
import flash.text.*;
import flash.display.*;
public dynamic class NumericIndicatorPower extends Sprite {
public var bar:BlueBarHorz;
public var numbers:TextField;
}
}//package
Section 262
//Offhand (Offhand)
package {
public class Offhand extends Equipment {
override public function generateItem(_arg1:int):void{
var _local2:*;
var _local3:*;
_local2 = false;
_local3 = false;
if (item_rarity == Item.green){
if (DungeonMain.RandomNum(0, 100) >= 50){
_local3 = true;
} else {
_local2 = true;
};
};
if (item_rarity == Item.grey){
item_rarity = Item.white;
};
getItemModifiers();
if ((((item_rarity == Item.blue)) || (_local3))){
prefix = rollForPrefix(item_rarity);
};
if ((((item_rarity == Item.blue)) || (_local2))){
suffix = rollForSuffix(item_rarity);
};
if (prefix >= 0){
applyPrefix();
};
if (suffix >= 0){
applySuffix();
};
if (base_armor_rating){
armor_rating = scaleArmorForLevel((base_armor_rating * (1 + (base_armor_mod / 100))));
};
if (prefix >= 0){
item_name = ((prefixes[prefix][0] + " ") + item_name);
};
if (suffix >= 0){
item_name = ((item_name + " of ") + suffixes[suffix][0]);
};
}
override public function getItemTypeString(){
return ("Offhand");
}
override public function itemStatsString(_arg1:String):String{
if (armor_rating){
_arg1 = (_arg1 + (String(armor_rating) + " Armor Rating\n"));
};
return (super.itemStatsString(_arg1));
}
override public function getItemModifiers():void{
super.getItemModifiers();
suffixes.push(["Might", base_item_stat_bonus]);
}
}
}//package
Section 263
//OptionsScreen (OptionsScreen)
package {
import flash.events.*;
import flash.display.*;
public class OptionsScreen extends MovieClip {
public var yes_btn:ContinueButton;
public var quality_selector:QualitySelectorMenu;
public var showHintsBox:dCheckBox;
public var vc:VolumeControlMenu;
public function OptionsScreen(){
this.yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, exitClick);
vc.init();
showHintsBox.setChecked(DungeonMain.showHints);
showHintsBox.setDescription("Show hints and tips");
}
function exitClick(_arg1:MouseEvent):void{
if (this.parent != null){
DungeonMain.showHints = showHintsBox.checked;
if (dm.main != null){
dm.main.saveInterface();
};
parent.removeChild(this);
cleanup();
};
}
private function cleanup():void{
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, exitClick);
}
}
}//package
Section 264
//Paperdoll (Paperdoll)
package {
import flash.display.*;
public dynamic class Paperdoll extends Sprite {
public var weapon:PaperdollEmptySlot;
public var legs:PaperdollEmptySlot;
public var ring:PaperdollEmptySlot;
public var armor:PaperdollEmptySlot;
public var gloves:PaperdollEmptySlot;
public var offhand:PaperdollEmptySlot;
public var boots:PaperdollEmptySlot;
public var cloak:PaperdollEmptySlot;
public var head:PaperdollEmptySlot;
}
}//package
Section 265
//PaperdollEmptySlot (PaperdollEmptySlot)
package {
import flash.display.*;
public dynamic class PaperdollEmptySlot extends MovieClip {
public function PaperdollEmptySlot(){
addFrameScript(0, frame1);
}
function frame1(){
this.gotoAndStop(1);
}
}
}//package
Section 266
//Party (Party)
package {
public class Party {
var save_slot:int;// = 1
var overflow:Array;
private var _level:int;// = 1
var members:Array;
private var _stat_rooms_explored:int;// = 0
private var _sneaking:int;// = 0
private var _beginner:Boolean;// = false
private var _stat_leaders_defeated:int;// = 0
private var _stat_member_deaths:int;// = 0
private var _stat_party_defeats:int;// = 0
private var _stat_rooms_total:int;// = 0
var inventory:Array;
private var _stat_hordes_defeated:int;// = 0
private var _stat_shrines_used:int;// = 0
private var _hardcore:Boolean;// = false
private var _extreme:Boolean;// = false
private var _version12:Boolean;// = false
static const MAX_INVENTORY = 45;
static const SCORE_SHRINES = -150;
static const MAX_OVERFLOW = 15;
static const SCORE_DEATHS = -100;
static const SCORE_DEFEATS = -1000;
static const SCORE_LEVEL = 1000;
static const max_size = 4;
static const SCORE_LEADERS = 500;
public function Party(){
var _local1:*;
var _local2:*;
members = new Array();
save_slot = 1;
inventory = new Array();
overflow = new Array();
_level = 1;
_hardcore = false;
_beginner = false;
_extreme = false;
_version12 = false;
_sneaking = 0;
_stat_party_defeats = 0;
_stat_member_deaths = 0;
_stat_shrines_used = 0;
_stat_hordes_defeated = 0;
_stat_leaders_defeated = 0;
_stat_rooms_explored = 0;
_stat_rooms_total = 0;
super();
_local1 = 0;
while (_local1 < 5) {
addToInventory(new SneakyScroll());
_local1++;
};
_local1 = 0;
while (_local1 < 5) {
addToInventory(new PotionHealthSmall());
_local1++;
};
_local1 = 0;
while (_local1 < 5) {
addToInventory(new PotionPowerSmall());
_local1++;
};
_local1 = 0;
while (_local1 < 5) {
addToInventory(new PotionReviveWeak());
_local1++;
};
if (DungeonMain.debugitems){
_local1 = 0;
while (_local1 < 5) {
addToInventory(new CleanSlate());
_local1++;
};
};
}
public function set level(_arg1:int):void{
this._level = _arg1;
}
public function getScore():int{
var _local1:int;
_local1 = 0;
_local1 = (_local1 + getLevelScore());
_local1 = (_local1 + (stat_leaders_defeated * SCORE_LEADERS));
_local1 = (_local1 + (stat_member_deaths * SCORE_DEATHS));
_local1 = (_local1 + (stat_shrines_used * SCORE_SHRINES));
_local1 = (_local1 + (stat_party_defeats * SCORE_DEFEATS));
return (_local1);
}
public function get level():int{
return (this._level);
}
public function roomMovedRegen():void{
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = 0;
while (_local1 < members.length) {
_local2 = Math.round((members[_local1].getHealthRegen() / 3));
_local3 = Math.round((members[_local1].getPowerRegen() / 3));
members[_local1].increaseHealth(_local2);
members[_local1].increasePower(_local3);
_local1++;
};
}
public function memberInPos(_arg1:int):PlayerCharacter{
var _local2:*;
if (_arg1 <= 0){
return (null);
};
if (_arg1 > 6){
return (null);
};
_local2 = 0;
while (_local2 < members.length) {
if (members[_local2].pos == _arg1){
return (members[_local2]);
};
_local2++;
};
return (null);
}
public function getConsumables():Array{
var _local1:*;
var _local2:Array;
_local1 = 0;
_local2 = new Array(0);
_local1 = 0;
while (_local1 < inventory.length) {
if ((inventory[_local1] is Consumable)){
_local2.push(inventory[_local1]);
};
_local1++;
};
_local1 = 0;
while (_local1 < overflow.length) {
if ((overflow[_local1] is Consumable)){
_local2.push(overflow[_local1]);
};
_local1++;
};
return (_local2);
}
public function get hardcore():Boolean{
return (this._hardcore);
}
public function scanForItemUpdates():Boolean{
var _local1:Array;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
if (version12){
return (false);
};
_local1 = dm.joinArrays(inventory, overflow);
_local2 = 0;
while (_local2 < members.length) {
_local4 = 0;
while (_local4 < Equipment.gearSlots) {
if (members[_local2].gear[_local4] != null){
_local1.push(members[_local2].gear[_local4]);
};
_local4++;
};
_local2++;
};
_local3 = 0;
while (_local3 < _local1.length) {
_local5 = Item(_local1[_local3]).item_level;
if (_local5 > 9){
if ((_local1[_local3] is Weapon)){
_local7 = (30 * (_local5 - 1));
_local8 = Math.round((Weapon(_local1[_local3]).damage / (((_local5 - 1) * (_local7 / 300)) + 1)));
Weapon(_local1[_local3]).damage = Weapon(_local1[_local3]).scaleWeaponDamageForLevel(_local8);
} else {
if ((_local1[_local3] is iPlateGloves)){
if (_local1[_local3].icon_frame == 108){
_local1[_local3].icon_frame = 110;
} else {
if (_local1[_local3].icon_frame == 107){
_local1[_local3].icon_frame = 109;
};
};
};
};
_local6 = 0;
if (_local1[_local3].mod_strength){
_local6 = _local1[_local3].mod_strength;
if (_local6 <= Equipment.max_stat_for_purple){
_local1[_local3].mod_strength = 0;
_local1[_local3].setStrength((_local6 - 2), _local6);
};
};
if (_local1[_local3].mod_endurance){
_local6 = _local1[_local3].mod_endurance;
if (_local6 <= Equipment.max_stat_for_purple){
_local1[_local3].mod_endurance = 0;
_local1[_local3].setEndurance((_local6 - 2), _local6);
};
};
if (_local1[_local3].mod_dexterity){
_local6 = _local1[_local3].mod_dexterity;
if (_local6 <= Equipment.max_stat_for_purple){
_local1[_local3].mod_dexterity = 0;
_local1[_local3].setDexterity((_local6 - 2), _local6);
};
};
if (_local1[_local3].mod_intellect){
_local6 = _local1[_local3].mod_intellect;
if (_local6 <= Equipment.max_stat_for_purple){
_local1[_local3].mod_intellect = 0;
_local1[_local3].setIntellect((_local6 - 2), _local6);
};
};
};
_local3++;
};
_local3 = 0;
while (_local3 < 4) {
addToInventory(new CleanSlate());
_local3++;
};
this.version12 = true;
return (true);
}
public function set hardcore(_arg1:Boolean):void{
this._hardcore = _arg1;
}
public function unequipItem(_arg1:Equipment):Boolean{
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = false;
_local3 = -1;
_local4 = 0;
while (_local4 < members.length) {
if (members[_local4].gear[_arg1.slot] == _arg1){
_local3 = _local4;
break;
};
_local4++;
};
if (_local3 != -1){
if (addToInventory(_arg1)){
members[_local3].gear[_arg1.slot] = null;
_local2 = true;
};
} else {
_local2 = true;
};
return (_local2);
}
public function setMemberPos(_arg1:int, _arg2:int){
var _local3:*;
var _local4:*;
var _local5:Boolean;
var _local6:Boolean;
_local5 = false;
_local3 = 0;
while (_local3 < members.length) {
if (members[_local3].pos == _arg2){
_local5 = true;
};
_local3++;
};
if (_local5){
_local3 = 1;
while (_local3 < 7) {
_local6 = true;
_local4 = 0;
while (_local4 < members.length) {
if (members[_local4].pos == _local3){
_local6 = false;
};
_local4++;
};
if (_local6){
members[_arg1].pos = _local3;
break;
};
_local3++;
};
} else {
members[_arg1].pos = _arg2;
};
}
public function set sneaking(_arg1:int):void{
this._sneaking = _arg1;
}
public function getEquipment():Array{
var _local1:*;
var _local2:Array;
_local1 = 0;
_local2 = new Array(0);
_local1 = 0;
while (_local1 < inventory.length) {
if ((inventory[_local1] is Equipment)){
_local2.push(inventory[_local1]);
};
_local1++;
};
_local1 = 0;
while (_local1 < overflow.length) {
if ((overflow[_local1] is Equipment)){
_local2.push(overflow[_local1]);
};
_local1++;
};
return (_local2);
}
public function get stat_member_deaths():int{
return (this._stat_member_deaths);
}
public function addDemonLoot():void{
var _local1:iRing;
var _local2:iCloak;
_local1 = new iRing(DungeonMain.MAX_LEVEL, Item.orange);
_local1.item_name = "Signet of the Demonslayer";
_local1.lore = "Presented to honor those who freed the world from the demon's tyranny.";
_local1.replenishing = 20;
_local1.powerRegen = 5;
_local1.resistPoison = 50;
_local1.resistStun = 50;
_local1.icon_frame = 116;
addToInventory(_local1);
_local2 = new iCloak(DungeonMain.MAX_LEVEL, Item.orange);
_local2.item_name = "Demonhide Cloak";
_local2.lore = "Fashioned from the skin of the demon himself.";
_local2.armor_rating = 150;
_local2.lethality = 5;
_local2.mod_strength = 2;
_local2.mod_endurance = 2;
_local2.mod_intellect = 2;
_local2.mod_dexterity = 2;
_local2.icon_frame = 117;
addToInventory(_local2);
}
public function get stat_party_defeats():int{
return (this._stat_party_defeats);
}
public function set beginner(_arg1:Boolean):void{
this._beginner = _arg1;
}
public function get extreme():Boolean{
return (this._extreme);
}
public function set stat_shrines_used(_arg1:int):void{
this._stat_shrines_used = _arg1;
}
public function set stat_member_deaths(_arg1:int):void{
this._stat_member_deaths = _arg1;
}
public function destroyItem(_arg1:Item):Boolean{
var _local2:*;
var _local3:*;
_local2 = false;
_local3 = 0;
while (_local3 < Party.MAX_INVENTORY) {
if (inventory[_local3] == _arg1){
(inventory[_local3] == null);
inventory.splice(_local3, 1);
_local2 = true;
break;
};
_local3++;
};
if (!_local2){
_local3 = 0;
while (_local3 < Party.MAX_OVERFLOW) {
if (overflow[_local3] == _arg1){
(overflow[_local3] == null);
overflow.splice(_local3, 1);
_local2 = true;
break;
};
_local3++;
};
};
if (!_local2){
return (false);
};
balanceInventory();
return (true);
}
public function removeFromInventory(_arg1:Item):Boolean{
var _local2:*;
var _local3:*;
_local2 = false;
_local3 = getItemIndex(_arg1);
if (_local3 >= 0){
inventory.splice(_local3, 1);
_local2 = true;
} else {
_local3 = getOverflowIndex(_arg1);
if (_local3 >= 0){
overflow.splice(_local3, 1);
_local2 = true;
};
};
if (_local2){
balanceInventory();
};
return (_local2);
}
public function get stat_leaders_defeated():int{
return (this._stat_leaders_defeated);
}
private function sameConsumableType(_arg1:Item, _arg2:Item):Boolean{
if ((((_arg1 is Consumable)) && ((_arg2 is Consumable)))){
if (_arg1.item_name == _arg2.item_name){
return (true);
};
return (false);
//unresolved jump
};
return (false);
}
public function fullRecovery():void{
var _local1:*;
_local1 = 0;
while (_local1 < members.length) {
members[_local1].health = members[_local1].health_max;
members[_local1].power = members[_local1].power_max;
members[_local1].clearStatusEffects();
_local1++;
};
}
public function set stat_rooms_explored(_arg1:int):void{
this._stat_rooms_explored = _arg1;
}
public function set stat_party_defeats(_arg1:int):void{
this._stat_party_defeats = _arg1;
}
public function getItemIndex(_arg1:Item):int{
var _local2:*;
_local2 = 0;
while (_local2 < inventory.length) {
if (this.inventory[_local2] == _arg1){
return (_local2);
};
_local2++;
};
return (-1);
}
public function findEmptySlot(_arg1:Boolean):int{
var _local2:*;
if (_arg1){
_local2 = 1;
while (_local2 <= 3) {
if (memberInPos(_local2) == null){
return (_local2);
};
_local2++;
};
};
_local2 = 4;
while (_local2 <= 6) {
if (memberInPos(_local2) == null){
return (_local2);
};
_local2++;
};
if (_arg1){
return (0);
};
_local2 = 1;
while (_local2 <= 3) {
if (memberInPos(_local2) == null){
return (_local2);
};
_local2++;
};
return (0);
}
public function get sneaking():int{
return (this._sneaking);
}
public function addToInventory(_arg1:Item):Boolean{
var _local2:*;
if (_arg1 == null){
return (false);
};
if ((_arg1 is Consumable)){
_local2 = 0;
while (_local2 < inventory.length) {
if (sameConsumableType(inventory[_local2], _arg1)){
inventory[_local2].stack++;
return (true);
};
_local2++;
};
_local2 = 0;
while (_local2 < overflow.length) {
if (sameConsumableType(overflow[_local2], _arg1)){
overflow[_local2].stack++;
return (true);
};
_local2++;
};
};
if (inventory.length < Party.MAX_INVENTORY){
inventory.push(_arg1);
return (true);
};
if (overflow.length < Party.MAX_OVERFLOW){
overflow.push(_arg1);
return (true);
};
return (false);
}
public function set stat_rooms_total(_arg1:int):void{
this._stat_rooms_total = _arg1;
}
public function get stat_shrines_used():int{
return (this._stat_shrines_used);
}
public function set extreme(_arg1:Boolean):void{
this._extreme = _arg1;
}
public function get beginner():Boolean{
return (this._beginner);
}
public function getTotalExplorePercent():Number{
return ((stat_rooms_explored / stat_rooms_total));
}
public function get stat_rooms_explored():int{
return (this._stat_rooms_explored);
}
public function set stat_leaders_defeated(_arg1:int):void{
this._stat_leaders_defeated = _arg1;
}
public function isPartyDead():Boolean{
var _local1:*;
_local1 = 0;
while (_local1 < members.length) {
if (members[_local1].health > 0){
return (false);
};
_local1++;
};
return (true);
}
public function get stat_rooms_total():int{
return (this._stat_rooms_total);
}
public function getLevelScore():int{
var _local1:int;
var _local2:Number;
var _local3:Number;
_local1 = 0;
_local2 = getTotalExplorePercent();
_local3 = getTotalClearPercent();
_local1 = (_local1 + (level * SCORE_LEVEL));
_local1 = (_local1 * (_local2 + _local3));
return (Math.round(_local1));
}
public function levelUp():void{
var _local1:*;
_local1 = 0;
while (_local1 < members.length) {
members[_local1].levelUp();
_local1++;
};
}
public function balanceInventory():void{
while (((overflow.length) && ((inventory.length < Party.MAX_INVENTORY)))) {
inventory.push(overflow[0]);
overflow.splice(0, 1);
};
}
public function set version12(_arg1:Boolean):void{
this._version12 = _arg1;
}
public function getOverflowIndex(_arg1:Item):int{
var _local2:*;
_local2 = 0;
while (_local2 < overflow.length) {
if (this.overflow[_local2] == _arg1){
return (_local2);
};
_local2++;
};
return (-1);
}
public function getTotalClearPercent():Number{
return ((stat_hordes_defeated / (level * 10)));
}
public function get version12():Boolean{
return (this._version12);
}
public function deathPenalty():Boolean{
var _local1:*;
var _local2:*;
var _local3:Array;
var _local4:*;
_local1 = false;
fullRecovery();
if (this.beginner){
return (_local1);
};
_local2 = 0;
while (_local2 < members.length) {
_local1 = ((members[_local2].loseRandomEquipment()) || (_local1));
_local2++;
};
_local3 = dm.shuffleArray(inventory);
_local4 = 0;
while (_local4 < _local3.length) {
if ((_local3[_local4] is Equipment)){
_local1 = ((_local1) || (destroyItem(_local3[_local4])));
};
_local4++;
};
return (_local1);
}
public function set stat_hordes_defeated(_arg1:int):void{
this._stat_hordes_defeated = _arg1;
}
public function get stat_hordes_defeated():int{
return (this._stat_hordes_defeated);
}
}
}//package
Section 267
//PartyCreation (PartyCreation)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
import flash.utils.*;
public class PartyCreation extends MovieClip {
var tooltip:Tooltip;
public var empty1:CharCreationEmpty;
public var empty4:CharCreationEmpty;
public var back_button:BackButton;
public var enter_button:ContinueButton;
public var empty3:CharCreationEmpty;
var pc_party:Party;
public var char3:CharCreationPanel;
public var empty2:CharCreationEmpty;
public var char1:CharCreationPanel;
public var char2:CharCreationPanel;
var timerCount;// = 0
public var char4:CharCreationPanel;
var addCharTimer:Timer;
public function PartyCreation():void{
var _local1:*;
timerCount = 0;
super();
pc_party = new Party();
enter_button.addEventListener(MouseEvent.MOUSE_DOWN, enterClick);
back_button.addEventListener(MouseEvent.MOUSE_DOWN, backClick);
_local1 = 1;
while (_local1 <= 4) {
CharCreationPanel(getChildByName(("char" + _local1))).slot = _local1;
_local1++;
};
empty1.addEventListener(MouseEvent.MOUSE_DOWN, createClick);
empty2.addEventListener(MouseEvent.MOUSE_DOWN, createClick);
empty3.addEventListener(MouseEvent.MOUSE_DOWN, createClick);
empty4.addEventListener(MouseEvent.MOUSE_DOWN, createClick);
timerCount = 1;
if (!char1.animating){
char1.createChar();
};
addCharTimer = new Timer(250, 3);
addCharTimer.addEventListener(TimerEvent.TIMER, addCharTimerTick);
addCharTimer.start();
}
public function isNameTaken(_arg1:String):Boolean{
var _local2:*;
var _local3:CharCreationPanel;
_local2 = 1;
while (_local2 <= 4) {
_local3 = CharCreationPanel(getChildByName(("char" + _local2)));
if (_local3.char == null){
} else {
if (_local3.char.charname == _arg1){
return (true);
};
};
_local2++;
};
return (false);
}
function createClick(_arg1:MouseEvent):void{
var _local2:*;
_local2 = 1;
while (_local2 <= 4) {
if (_arg1.currentTarget == getChildByName(("empty" + _local2))){
if (CharCreationPanel(getChildByName(("char" + _local2))).animating){
return;
};
CharCreationPanel(getChildByName(("char" + _local2))).createChar();
};
_local2++;
};
}
private function charCount():int{
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = 0;
_local2 = 1;
while (_local2 <= 4) {
_local3 = CharCreationPanel(getChildByName(("char" + _local2)));
if (_local3 == null){
} else {
if (_local3.char == null){
} else {
_local1++;
};
};
_local2++;
};
return (_local1);
}
function enterClick(_arg1:MouseEvent):void{
var _local2:CharCreationPanel;
var _local3:int;
var _local4:*;
var _local5:*;
var _local6:*;
_local3 = charCount();
if (_local3 == 0){
_local5 = new WarningDialog();
_local5.setText("You must add some characters to your party before entering the dungeon.");
addChild(_local5);
return;
};
pc_party.members.length = 0;
_local4 = 1;
while (_local4 <= 4) {
_local2 = CharCreationPanel(getChildByName(("char" + _local4)));
if (_local2 == null){
} else {
if (_local2.char == null){
} else {
_local2.finalize();
_local6 = pc_party.members.push(convertClass(_local2.char, _local2.selected_class));
};
};
_local4++;
};
this.cleanup();
dm.main.creationFinished(pc_party);
}
function addCharTimerTick(_arg1:TimerEvent):void{
var _local2:*;
timerCount++;
_local2 = CharCreationPanel(getChildByName(("char" + timerCount)));
if (_local2 == null){
return;
};
if (_local2.char != null){
return;
};
if (_local2.animating){
return;
};
_local2.createChar();
}
public function cleanup():void{
var _local1:*;
addCharTimer.removeEventListener(TimerEvent.TIMER, addCharTimerTick);
enter_button.removeEventListener(MouseEvent.MOUSE_DOWN, enterClick);
back_button.removeEventListener(MouseEvent.MOUSE_DOWN, backClick);
empty1.removeEventListener(MouseEvent.MOUSE_DOWN, createClick);
empty2.removeEventListener(MouseEvent.MOUSE_DOWN, createClick);
empty3.removeEventListener(MouseEvent.MOUSE_DOWN, createClick);
empty4.removeEventListener(MouseEvent.MOUSE_DOWN, createClick);
_local1 = 1;
while (_local1 <= 4) {
CharCreationPanel(getChildByName(("char" + _local1))).cleanup();
_local1++;
};
}
private function convertClass(_arg1:PlayerCharacter, _arg2:int):PlayerCharacter{
var _local3:*;
var _local4:*;
var _local5:Boolean;
var _local6:PlayerCharacter;
_local3 = _arg1.charname;
_local4 = _arg1.portrait;
_local5 = _arg1.male;
if (_arg2 == PlayerCharacter.warrior){
_local6 = new PC_Warrior(pc_party);
} else {
if (_arg2 == PlayerCharacter.mage){
_local6 = new PC_Mage(pc_party);
} else {
if (_arg2 == PlayerCharacter.ranger){
_local6 = new PC_Ranger(pc_party);
} else {
if (_arg2 == PlayerCharacter.rogue){
_local6 = new PC_Rogue(pc_party);
} else {
if (_arg2 == PlayerCharacter.cleric){
_local6 = new PC_Cleric(pc_party);
};
};
};
};
};
_local6.charname = _local3;
_local6.portrait = _local4;
_local6.male = _local5;
return (_local6);
}
function backClick(_arg1:MouseEvent):void{
pc_party = null;
if (((parent) && ((parent is DungeonMain)))){
this.cleanup();
DungeonMain(parent).loadGameMenu();
DungeonMain(parent).removeChild(this);
};
}
}
}//package
Section 268
//PC_Cleric (PC_Cleric)
package {
public class PC_Cleric extends PlayerCharacter {
public function PC_Cleric(_arg1:Party=null){
this.party = _arg1;
quickness = 60;
charname = "Jeremy";
playerclass = PlayerCharacter.cleric;
classname = "Cleric";
portrait = CharGraphic.cleric1;
pos = 0;
health_max = getMaxHealth();
health = health_max;
skills.push(new sWeaponAttack(this));
skills.push(new sClericHeal(this));
skills.push(new sClericSmite(this));
skills.push(new sClericFlash(this));
skills.push(new sClericHealGroup(this));
skills.push(new sClericDamageBuff(this));
skills.push(new sClericRevive(this));
skills.push(new sClericAE(this));
skills.push(new sClericPurify(this));
skills.push(new sClericShield(this));
skills.push(new sClericMelee(this));
setActiveSkillsDefault();
generateDefaultGear();
}
public function generateDefaultGear(){
var _local1:Armor;
var _local2:*;
_local1 = new iPlateBreastplate(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local1 = new iPlateGloves(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local1 = new iPlateBoots(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local1 = new iPlateGreaves(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local2 = new iMace(1, Item.grey);
this.gear[_local2.slot] = _local2;
}
}
}//package
Section 269
//PC_Mage (PC_Mage)
package {
public class PC_Mage extends PlayerCharacter {
public function PC_Mage(_arg1:Party=null){
this.party = _arg1;
quickness = 40;
charname = "Errol";
playerclass = PlayerCharacter.mage;
classname = "Mage";
portrait = CharGraphic.mage1;
pos = 0;
health_max = getMaxHealth();
health = health_max;
skills.push(new sMageAttack(this));
skills.push(new sMageBolt(this));
skills.push(new sMageExplosion(this));
skills.push(new sMageAE(this));
skills.push(new sMagePrison(this));
skills.push(new sMageInvisibility(this));
skills.push(new sMageArmor(this));
skills.push(new sMageThorns(this));
skills.push(new sMageSword(this));
skills.push(new sMageTouch(this));
skills.push(new sMageDrain(this));
setActiveSkillsDefault();
generateDefaultGear();
}
public function generateDefaultGear(){
this.gear[Equipment.head] = new iClothHat(1, Item.grey);
this.gear[Equipment.armor] = new iClothRobe(1, Item.grey);
this.gear[Equipment.gloves] = new iClothGloves(1, Item.grey);
this.gear[Equipment.legs] = new iClothLegs(1, Item.grey);
this.gear[Equipment.boots] = new iClothShoes(1, Item.grey);
this.gear[Equipment.weapon] = new iStaff(1, Item.grey);
}
}
}//package
Section 270
//PC_Ranger (PC_Ranger)
package {
public class PC_Ranger extends PlayerCharacter {
public function PC_Ranger(_arg1:Party=null){
this.party = _arg1;
quickness = 55;
charname = "Hamish";
playerclass = PlayerCharacter.ranger;
classname = "Ranger";
portrait = CharGraphic.ranger1;
pos = 0;
health_max = getMaxHealth();
health = health_max;
skills.push(new sRangedAttack(this));
skills.push(new sRangerPenetrate(this));
skills.push(new sRangerRegen(this));
skills.push(new sRangerHeal(this));
skills.push(new sRangerHunt(this));
skills.push(new sRangerAE(this));
skills.push(new sRangerStun(this));
skills.push(new sRangerMultiMelee(this));
skills.push(new sRangerPoison(this));
skills.push(new sRangerFocus(this));
skills.push(new sRangerHaste(this));
setActiveSkillsDefault();
generateDefaultGear();
}
public function generateDefaultGear(){
this.gear[Equipment.head] = new iLeatherHat(1, Item.grey);
this.gear[Equipment.armor] = new iLeatherChest(1, Item.grey);
this.gear[Equipment.gloves] = new iLeatherGloves(1, Item.grey);
this.gear[Equipment.legs] = new iLeatherLegs(1, Item.grey);
this.gear[Equipment.boots] = new iLeatherBoots(1, Item.grey);
this.gear[Equipment.weapon] = new iBow(1, Item.grey);
}
}
}//package
Section 271
//PC_Rogue (PC_Rogue)
package {
public class PC_Rogue extends PlayerCharacter {
public function PC_Rogue(_arg1:Party=null){
this.party = _arg1;
quickness = 70;
charname = "Deepak";
playerclass = PlayerCharacter.rogue;
classname = "Rogue";
portrait = CharGraphic.rogue1;
pos = 0;
health_max = getMaxHealth();
health = health_max;
skills.push(new sWeaponAttack(this));
skills.push(new sRoguePoison(this));
skills.push(new sRogueCritical(this));
skills.push(new sRogueSneakAttack(this));
skills.push(new sRogueBlind(this));
skills.push(new sRogueOpening(this));
skills.push(new sRogueHide(this));
skills.push(new sRogueSap(this));
skills.push(new sRogueLuck(this));
skills.push(new sRogueFinisher(this));
skills.push(new sRogueCripple(this));
setActiveSkillsDefault();
generateDefaultGear();
}
public function generateDefaultGear(){
this.gear[Equipment.head] = new iLeatherHat(1, Item.grey);
this.gear[Equipment.armor] = new iLeatherChest(1, Item.grey);
this.gear[Equipment.gloves] = new iLeatherGloves(1, Item.grey);
this.gear[Equipment.legs] = new iLeatherLegs(1, Item.grey);
this.gear[Equipment.boots] = new iLeatherBoots(1, Item.grey);
this.gear[Equipment.weapon] = new iDagger(1, Item.grey);
}
}
}//package
Section 272
//PC_Warrior (PC_Warrior)
package {
public class PC_Warrior extends PlayerCharacter {
public function PC_Warrior(_arg1:Party=null){
this.party = _arg1;
quickness = 50;
health_max = getMaxHealth();
health = health_max;
level = 1;
charname = "Bruce";
playerclass = PlayerCharacter.warrior;
classname = "Warrior";
portrait = CharGraphic.warrior1;
pos = 0;
skills.push(new sWeaponAttack(this));
skills.push(new sWarriorPowerAttack(this));
skills.push(new sWarriorDefiance(this));
skills.push(new sWarriorAE(this));
skills.push(new sWarriorAdrenaline(this));
skills.push(new sWarriorHeal(this));
skills.push(new sWarriorShield(this));
skills.push(new sWarriorInspire(this));
skills.push(new sWarriorExecute(this));
skills.push(new sWarriorBloodlust(this));
skills.push(new sWarriorSpeedAttack(this));
setActiveSkillsDefault();
generateDefaultGear();
}
public function generateDefaultGear(){
var _local1:Armor;
var _local2:*;
_local1 = new iPlateHelmet(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local1 = new iPlateBreastplate(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local1 = new iPlateGloves(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local1 = new iPlateBoots(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local1 = new iPlateGreaves(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local2 = new iSword(1, Item.grey);
this.gear[_local2.slot] = _local2;
}
}
}//package
Section 273
//player_arrow (player_arrow)
package {
import flash.display.*;
public dynamic class player_arrow extends MovieClip {
public var spark:MovieClip;
public function player_arrow(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.playerArrow);
this.spark.x = dm.randomNum(15, 43);
this.spark.y = dm.randomNum(15, 43);
}
function frame45(){
this.stop();
}
}
}//package
Section 274
//player_mage_attack (player_mage_attack)
package {
import flash.display.*;
public dynamic class player_mage_attack extends MovieClip {
public function player_mage_attack(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.playerMagicAttack);
}
function frame45(){
this.stop();
}
}
}//package
Section 275
//player_multi_slash (player_multi_slash)
package {
import flash.display.*;
public dynamic class player_multi_slash extends MovieClip {
public var hslash:MovieClip;
public function player_multi_slash(){
addFrameScript(0, frame1, 11, frame12);
}
function frame12(){
this.stop();
this.gotoAndStop(12);
}
function frame1(){
dm.sound.play(SoundControl.playerSlash);
}
}
}//package
Section 276
//player_power_slash (player_power_slash)
package {
import flash.display.*;
public dynamic class player_power_slash extends MovieClip {
public function player_power_slash(){
addFrameScript(11, frame12);
}
function frame12(){
this.stop();
}
}
}//package
Section 277
//player_slash (player_slash)
package {
import flash.display.*;
public dynamic class player_slash extends MovieClip {
public var hslash:MovieClip;
public function player_slash(){
addFrameScript(0, frame1, 11, frame12);
}
function frame12(){
this.gotoAndStop(12);
}
function frame1(){
dm.sound.play(SoundControl.playerSlash);
}
}
}//package
Section 278
//PlayerCharacter (PlayerCharacter)
package {
public class PlayerCharacter extends Character {
const CLONE_DAMAGE_MULTIPLIER = 0.5;
const CLONE_HEALTH_MULTIPLIER = 2;
private var _skill_points:int;// = 0
var retreated:Boolean;// = false
var retreating:Boolean;// = false
var party:Party;
private var _male:Boolean;// = true
var old_stat_points:int;// = 0
protected var playerclass:int;
var old_strength:int;// = 0
var old_intellect:int;// = 0
private var _stat_points:int;// = 0
var gear:Array;
var old_dexterity:int;// = 0
var old_endurance:int;// = 0
static const warrior = 1;
static const HEALTH_PER_ENDURANCE = 4;
static const cleric = 2;
static const mage = 3;
static const ranger = 4;
static const STATS_PER_LEVEL = 3;
static const rogue = 5;
static var base_health = 50;
public function PlayerCharacter(_arg1:Party=null){
gear = new Array(Equipment.gearSlots);
_stat_points = 0;
_skill_points = 0;
_male = true;
retreating = false;
retreated = false;
old_strength = 0;
old_endurance = 0;
old_dexterity = 0;
old_intellect = 0;
old_stat_points = 0;
super();
level = 1;
classname = "Player";
portrait = CharGraphic.warrior1;
pos = 0;
if (_arg1 != null){
this.party = _arg1;
};
}
public function getDexterityDamageBonus():int{
var _local1:*;
_local1 = getDexterity();
return (getBonus(_local1));
}
override public function getHealthRegen(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = 0;
if (_arg1){
_local2 = (_local2 + buff_healthRegen);
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].healthRegen);
};
_local3++;
};
return (_local2);
}
public function get male():Boolean{
return (this._male);
}
override public function getVampiric(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = 0;
if (_arg1){
_local2 = (_local2 + buff_vampiric);
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].vampiric_percent);
};
_local3++;
};
return (_local2);
}
public function set male(_arg1:Boolean):void{
this._male = _arg1;
}
public function multiplyDamageForTargetType(_arg1:int, _arg2:int):int{
var _local3:*;
var _local4:*;
_local3 = 0;
_local4 = 1;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (((!((gear[_local3] == null))) && ((gear[_local3].damageBonusVsCreatureType == _arg2)))){
_local4 = (_local4 * gear[_local3].damageBonusVsCreatureModifier);
};
_local3++;
};
return (Math.round((_arg1 * _local4)));
}
public function getMaxHealth():int{
var _local1:*;
_local1 = getEndurance();
return (getHealthForEndurance(_local1));
}
override public function getPowerRegen(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = power_per_turn;
if (_arg1){
_local2 = (_local2 + buff_powerRegen);
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].powerRegen);
};
_local3++;
};
return (Math.round((_local2 * powerRegenMod)));
}
public function equip(_arg1:Equipment):Boolean{
var _local2:Boolean;
_local2 = itemUsable(_arg1);
if ((_arg1 is Offhand)){
if (gear[Equipment.weapon] != null){
if (gear[Equipment.weapon].twoHanded){
_local2 = false;
};
};
};
if ((_arg1 is Weapon)){
if (Weapon(_arg1).twoHanded){
if (gear[Equipment.offhand] != null){
_local2 = false;
};
};
};
if (!_local2){
return (false);
};
if (!party.unequipItem(_arg1)){
return (false);
};
if (gear[_arg1.slot] != null){
if (!party.unequipItem(gear[_arg1.slot])){
return (false);
};
};
if (party.removeFromInventory(_arg1)){
gear[_arg1.slot] = _arg1;
return (true);
};
return (false);
}
override public function genderPossessive(_arg1:Boolean=false):String{
if (_arg1){
if (this.male){
return ("His");
};
return ("Her");
//unresolved jump
};
if (this.male){
return ("his");
};
return ("her");
}
public function loseRandomEquipment():Boolean{
var _local1:Array;
var _local2:Array;
var _local3:Array;
var _local4:*;
var _local5:Boolean;
_local1 = new Array();
_local2 = new Array();
_local3 = new Array();
_local4 = 0;
while (_local4 < Equipment.gearSlots) {
if (gear[_local4] == null){
} else {
if ((((gear[_local4].item_rarity == Item.grey)) || ((gear[_local4].item_rarity == Item.white)))){
_local1.push(gear[_local4]);
};
if ((((gear[_local4].item_rarity == Item.green)) || ((gear[_local4].item_rarity == Item.blue)))){
_local2.push(gear[_local4]);
};
if (gear[_local4].item_rarity == Item.purple){
_local3.push(gear[_local4]);
};
};
_local4++;
};
_local5 = false;
if (_local1.length){
_local5 = destroyEquipment(_local1[DungeonMain.RandomNum(0, (_local1.length - 1))]);
} else {
if (_local2.length){
_local5 = destroyEquipment(_local2[DungeonMain.RandomNum(0, (_local2.length - 1))]);
} else {
if (_local3.length){
_local5 = destroyEquipment(_local3[DungeonMain.RandomNum(0, (_local3.length - 1))]);
};
};
};
if (DungeonMain.debug){
};
return (_local5);
}
override public function genderPronoun(_arg1:Boolean=false):String{
if (_arg1){
if (this.male){
return ("He");
};
return ("She");
//unresolved jump
};
if (this.male){
return ("he");
};
return ("she");
}
override public function getLethality(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = 0;
if (((DungeonMain.debug) && (DungeonMain.instantKill))){
return (100);
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].lethality);
};
_local3++;
};
return (_local2);
}
private function getBonus(_arg1:int):int{
var _local2:*;
_local2 = (_arg1 * 2);
return (_local2);
}
public function set stat_points(_arg1:int):void{
this._stat_points = _arg1;
}
override public function getAccuracy(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = accuracy;
if (_arg1){
_local2 = (_local2 + (buff_accuracy - accuracy_penalty));
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].accuracyBonus);
};
_local3++;
};
_local2 = Math.max(ACCURACY_MINIMUM, _local2);
return (_local2);
}
override public function getDamageReflection(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = 0;
if (_arg1){
_local2 = (_local2 + buff_damageReflect);
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].damageReflection);
};
_local3++;
};
return (_local2);
}
public function setActiveSkillsDefault():void{
var _local1:*;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < skills.length) {
if (_local1 >= 3){
break;
};
if (skills[_local2] != null){
skills[_local2].unlocked = true;
skills[_local2].active = true;
skills[_local2].position = (_local2 + 1);
_local1++;
};
_local2++;
};
if (DungeonMain.skillsUnlocked){
_local2 = 0;
while (_local2 < skills.length) {
skills[_local2].unlocked = true;
_local2++;
};
};
}
override public function getStunChance(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = 0;
if (_arg1){
_local2 = (_local2 + buff_stun);
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].causes_stun_percent);
};
_local3++;
};
return (_local2);
}
public function getArmorRating():int{
var _local1:*;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
if (gear[_local2] != null){
_local1 = (_local1 + gear[_local2].armor_rating);
};
_local2++;
};
return (_local1);
}
public function get skill_points():int{
return (this._skill_points);
}
override public function getEffectiveHealth():int{
var _local1:*;
var _local2:*;
_local1 = ((100 - getDamageResist()) / 100);
_local2 = Math.round((health / _local1));
return (_local2);
}
override public function getDamageResist(_arg1:Boolean=true):int{
var _local2:*;
_local2 = 0;
if (_arg1){
_local2 = (_local2 + ((buff_damageResist + temp_damage_resistance) + potion_damage_resist));
};
_local2 = (_local2 + getDamageReductionFromArmor());
if (_local2 >= 100){
_local2 = 99;
};
return (_local2);
}
private function destroyEquipment(_arg1:Equipment):Boolean{
var _local2:*;
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
if (gear[_local2] == _arg1){
gear[_local2] = null;
return (true);
};
_local2++;
};
return (false);
}
override public function getAccuracyDamage(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = 0;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].blind);
};
_local3++;
};
return (_local2);
}
public function getIntellectDamageBonus():int{
var _local1:*;
_local1 = getIntellect();
return (getBonus(_local1));
}
override public function getIntellect(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = this.intellect;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].mod_intellect);
};
_local3++;
};
return (_local2);
}
public function canQuickRetreat():Boolean{
var _local1:*;
var _local2:*;
_local1 = false;
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
if (gear[_local2] != null){
if (gear[_local2].quickRetreat){
return (true);
};
};
_local2++;
};
return (false);
}
override public function getPoisonDamage(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = 0;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].poisonDamage);
};
_local3++;
};
return (_local2);
}
override public function getDexterity(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = this.dexterity;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].mod_dexterity);
};
_local3++;
};
return (_local2);
}
override public function getQuickness(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = this.quickness;
if (_arg1){
_local2 = (_local2 + ((buff_quickness + potion_quickness_bonus) - crippled));
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].mod_quickness);
};
_local3++;
};
_local2 = Math.max(_local2, 0);
return (_local2);
}
public function levelTo(_arg1:int):void{
var _local2:*;
_local2 = level;
while (_local2 <= _arg1) {
levelUp();
_arg1++;
};
}
public function getWeaponDamage():int{
var _local1:*;
_local1 = 0;
if (gear[Equipment.weapon] == null){
return (getUnarmedDamage());
};
if ((gear[Equipment.weapon] is iDagger)){
_local1 = (getStrengthDamageBonus() + getDexterityDamageBonus());
} else {
if ((gear[Equipment.weapon] is MeleeWeapon)){
_local1 = getStrengthDamageBonus();
} else {
if ((gear[Equipment.weapon] is RangedWeapon)){
_local1 = getDexterityDamageBonus();
} else {
if ((gear[Equipment.weapon] is MageWeapon)){
_local1 = getIntellectDamageBonus();
};
};
};
};
return ((this.gear[Equipment.weapon].damage + _local1));
}
public function set skill_points(_arg1:int):void{
this._skill_points = _arg1;
}
public function get stat_points():int{
return (this._stat_points);
}
override public function getStunResist(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = stunResist;
if (_arg1){
_local2 = (_local2 + (buff_resistStun + potion_stun_resist));
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].resistStun);
};
_local3++;
};
if (_local2 > 100){
_local2 = 100;
};
return (_local2);
}
public function levelUp():void{
var _local1:*;
level++;
strength = (strength + STATS_PER_LEVEL);
endurance = (endurance + STATS_PER_LEVEL);
dexterity = (dexterity + STATS_PER_LEVEL);
intellect = (intellect + STATS_PER_LEVEL);
stat_points = (stat_points + STATS_PER_LEVEL);
if (level <= DungeonMain.MAX_LEVEL){
skill_points++;
};
_local1 = health_max;
health_max = getMaxHealth();
health = (health + (health_max - _local1));
}
public function unequip(_arg1:Equipment):Boolean{
if (party == null){
return (false);
};
if (party.addToInventory(gear[_arg1.slot])){
gear[_arg1.slot] = null;
return (true);
};
return (false);
}
override public function getEndurance(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = this.endurance;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].mod_endurance);
};
_local3++;
};
return (_local2);
}
public function getUnarmedDamage():int{
return ((getStrength() * 2));
}
override public function reduceHealth(_arg1:int):int{
var _local2:*;
var _local3:*;
_local2 = health;
_local3 = super.reduceHealth(_arg1);
if ((((((health <= 0)) && ((_local2 > 0)))) && ((_local3 > 0)))){
party.stat_member_deaths++;
if (DungeonMain.MEEZ){
dm.MeezGPF.emote(2);
};
};
return (_local3);
}
public function getReplenishing():int{
var _local1:*;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
if (gear[_local2] != null){
_local1 = (_local1 + gear[_local2].replenishing);
};
_local2++;
};
return (_local1);
}
public function getEvilClone():MonsterCharacter{
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = new MonsterCharacter(level);
_local1.charname = ("Dark " + this.charname);
_local1.classname = ("Corrupted " + this.classname);
_local1.type = MonsterCharacter.human;
_local1.description = "A twisted shadow cast by the Corruptor's power.";
_local1.level = this.level;
_local1.portrait = this.portrait;
_local1.lethalityImmune = true;
_local1.health_max = Math.round((this.health_max * CLONE_HEALTH_MULTIPLIER));
_local1.health = _local1.health_max;
_local1.power_per_turn = this.getPowerRegen(false);
_local1.strength = this.getStrength(false);
_local1.endurance = this.getEndurance(false);
_local1.dexterity = this.getDexterity(false);
_local1.intellect = this.getIntellect(false);
_local1.quickness = Math.max((this.getQuickness(false) - 5), 0);
_local1.accuracy = this.getAccuracy(false);
_local1.poisonResist = this.getPoisonResist(false);
_local1.stunResist = this.getStunResist(false);
_local1.pos = 0;
_local1.mindless = false;
_local1.ethereal = 0;
_local1.damage_resistance = this.getDamageResist(false);
_local1.vampiric_percent = this.getVampiric(false);
_local1.causes_stun_percent = this.getStunChance(false);
_local1.damage_reflection = Math.round((this.getDamageReflection(false) * 0.4));
_local1.accuracy_damage = this.getAccuracyDamage(false);
_local1.poison_damage = this.getPoisonDamage(false);
_local1.regenerate = Math.round(((this.getHealthRegen(false) / _local1.health_max) * 100));
_local2 = 0;
while (_local2 < skills.length) {
if (((skills[_local2].active) && (skills[_local2].usable(true)))){
_local3 = new skills[_local2].constructor(_local1);
_local3.damage = Math.round((skills[_local2].getDamage() * CLONE_DAMAGE_MULTIPLIER));
_local3.requiresWeapon = false;
_local3.requiresMelee = false;
_local3.requiresRanged = false;
_local3.requiresShield = false;
if (_local3.usesWeaponRange){
if (((!((gear[Equipment.weapon] == null))) && ((((gear[Equipment.weapon] is RangedWeapon)) || ((gear[Equipment.weapon] is MageWeapon)))))){
_local3.rangedAttack = true;
};
_local3.usesWeaponRange = false;
};
_local1.skills.push(_local3);
};
_local2++;
};
return (_local1);
}
public function recalculateMaxHealth():void{
health_max = getMaxHealth();
if (health > health_max){
health = health_max;
};
}
override public function damageAfterArmor(_arg1:int):int{
var _local2:*;
var _local3:*;
_local2 = getDamageResist();
if (_local2 >= 100){
_local2 = 99;
};
_local3 = (1 - (_local2 / 100));
if (_local2 != 0){
_arg1 = (_arg1 * _local3);
};
if (_arg1 == 0){
_arg1 = 1;
};
return (_arg1);
}
override public function getPoisonResist(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = poisonResist;
if (_arg1){
_local2 = (_local2 + (buff_resistPoison + potion_poison_resist));
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].resistPoison);
};
_local3++;
};
if (_local2 > 100){
_local2 = 100;
};
return (_local2);
}
override public function genderSelf(_arg1:Boolean=false):String{
if (_arg1){
if (this.male){
return ("Himself");
};
return ("Herself");
//unresolved jump
};
if (this.male){
return ("himself");
};
return ("herself");
}
override public function getStrength(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = this.strength;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].mod_strength);
};
_local3++;
};
return (_local2);
}
public function getStrengthDamageBonus():int{
var _local1:*;
_local1 = getStrength();
return (getBonus(_local1));
}
override public function getHealingBonus(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = 0;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].mod_healing);
};
_local3++;
};
return (_local2);
}
public function getDamageReductionFromArmor():int{
var _local1:*;
var _local2 = ??pushnamespace
;
var _local3:*;
_local1 = getArmorRating();
_local2 = 250;
_local3 = (_local2 * (1 + ((level - 1) * Equipment.armor_scale_constant)));
return (Math.round(((_local1 / _local3) * 40)));
}
public function itemUsable(_arg1:Item):Boolean{
var _local2:Boolean;
var _local3:Equipment;
if (!(_arg1 is Equipment)){
return (true);
};
_local2 = false;
_local3 = Equipment(_arg1);
if (_local3.whoEquips == Equipment.allEquip){
_local2 = true;
} else {
if ((((playerclass == PlayerCharacter.cleric)) && (((_local3.whoEquips & Equipment.clericEquip) == Equipment.clericEquip)))){
_local2 = true;
};
if ((((playerclass == PlayerCharacter.warrior)) && (((_local3.whoEquips & Equipment.warriorEquip) == Equipment.warriorEquip)))){
_local2 = true;
};
if ((((playerclass == PlayerCharacter.rogue)) && (((_local3.whoEquips & Equipment.rogueEquip) == Equipment.rogueEquip)))){
_local2 = true;
};
if ((((playerclass == PlayerCharacter.ranger)) && (((_local3.whoEquips & Equipment.rangerEquip) == Equipment.rangerEquip)))){
_local2 = true;
};
if ((((playerclass == PlayerCharacter.mage)) && (((_local3.whoEquips & Equipment.mageEquip) == Equipment.mageEquip)))){
_local2 = true;
};
};
return (_local2);
}
public static function baseHealthForLevel(_arg1:int):int{
return (getHealthForEndurance((1 + (_arg1 * STATS_PER_LEVEL))));
}
public static function getHealthForEndurance(_arg1:int):int{
return ((base_health + ((_arg1 - 1) * HEALTH_PER_ENDURANCE)));
}
}
}//package
Section 279
//PlayGameButton (PlayGameButton)
package {
import flash.display.*;
public dynamic class PlayGameButton extends SimpleButton {
}
}//package
Section 280
//poison_drake_sound (poison_drake_sound)
package {
import flash.media.*;
public dynamic class poison_drake_sound extends Sound {
}
}//package
Section 281
//poison_sound (poison_sound)
package {
import flash.media.*;
public dynamic class poison_sound extends Sound {
}
}//package
Section 282
//poisoneffect (poisoneffect)
package {
import flash.display.*;
public dynamic class poisoneffect extends MovieClip {
public function poisoneffect(){
addFrameScript(4, frame5, 49, frame50);
}
function frame5(){
dm.sound.play(SoundControl.poison, 0.75);
}
function frame50(){
this.stop();
}
}
}//package
Section 283
//PortraitAnimation (PortraitAnimation)
package {
import flash.display.*;
public class PortraitAnimation {
static const playerMultiSlash = 29;
static const creatureSpear = 52;
static const poison = 16;
static const cosmicPrison = 15;
static const restore = 42;
static const curse = 8;
static const explosion = 13;
static const freeze = 12;
static const lethal = 17;
static const cultistArrow = 57;
static const swoopAttack = 61;
static const playerSlash = 28;
static const playerArrow = 26;
static const fireBuff = 5;
static const fearDeath = 71;
static const regenBuff = 7;
static const armorBuff = 4;
static const fire = 11;
static const quicknessBuff = 6;
static const gainHealth = 41;
static const ghostAttack = 60;
static const playerPowerSlash = 30;
static const protectAllies = 20;
static const monsterThrown = 58;
static const lightning = 18;
static const gainPower = 40;
static const monsterArrow = 55;
static const buff = 3;
static const debuff = 14;
static const revive = 2;
static const monsterThorns = 90;
static const defiance = 21;
static const web = 70;
static const blind = 9;
static const creatureWeapon = 51;
static const playerUnarmed = 27;
static const holyDamage = 10;
static const heal = 1;
static const mageAttack = 25;
static const disintegrate = 99;
static const monsterDrain = 98;
static const summon = 80;
static const powerDrain = 39;
static const monsterMagic = 56;
static const transform = 81;
static const creatureSlash = 50;
static const clone = 100;
public static function getAnimation(_arg1:int):MovieClip{
var _local2:MovieClip;
if (_arg1 <= 0){
return (null);
};
_local2 = null;
switch (_arg1){
case heal:
_local2 = new healeffect();
break;
case revive:
_local2 = new revive_effect();
break;
case buff:
case quicknessBuff:
case monsterThorns:
case regenBuff:
_local2 = new buff_effect();
break;
case armorBuff:
case protectAllies:
case defiance:
_local2 = new armor_buff_effect();
break;
case debuff:
_local2 = new debuff_effect();
break;
case poison:
_local2 = new poisoneffect();
break;
case curse:
_local2 = new curse_effect();
break;
case blind:
_local2 = new blind_effect();
break;
case holyDamage:
_local2 = new smite_effect();
break;
case lethal:
_local2 = new lethal_effect();
break;
case fire:
case explosion:
case fireBuff:
_local2 = new fire_effect();
break;
case lightning:
_local2 = new Lightning();
break;
case freeze:
_local2 = new frozen_effect();
break;
case cosmicPrison:
_local2 = new cosmic_prison();
break;
case fearDeath:
_local2 = new feardeath_effect();
break;
case playerArrow:
_local2 = new player_arrow();
break;
case playerSlash:
_local2 = new player_slash();
break;
case playerMultiSlash:
_local2 = new player_multi_slash();
break;
case playerPowerSlash:
_local2 = new player_power_slash();
break;
case mageAttack:
_local2 = new player_mage_attack();
break;
case summon:
_local2 = new summon_effect();
break;
case transform:
_local2 = new transform_effect();
break;
case powerDrain:
_local2 = new lose_power_effect();
break;
case gainPower:
_local2 = new gain_power_effect();
break;
case gainHealth:
_local2 = new gain_health_effect();
break;
case restore:
_local2 = new gain_both_effect();
break;
case creatureSlash:
case swoopAttack:
case ghostAttack:
_local2 = new creature_slash();
break;
case creatureWeapon:
_local2 = new creature_weapon();
break;
case creatureSpear:
_local2 = new creature_spear();
break;
case monsterMagic:
_local2 = new monster_magic_attack();
break;
case monsterArrow:
_local2 = new monster_arrow();
break;
case cultistArrow:
_local2 = new monster_arrow_drainpower();
break;
case monsterThrown:
_local2 = new monster_thrown();
break;
case web:
_local2 = new web_effect();
break;
case disintegrate:
_local2 = new disintegrate_effect();
break;
case monsterDrain:
_local2 = new monster_drain_effect();
break;
case clone:
_local2 = new clone_effect();
break;
};
return (_local2);
}
}
}//package
Section 284
//PortraitAnimationFrame (PortraitAnimationFrame)
package {
import flash.display.*;
public class PortraitAnimationFrame extends MovieClip {
public function PortraitAnimationFrame(_arg1:int=0){
this.gotoAndStop(_arg1);
}
}
}//package
Section 285
//PortraitEffected (PortraitEffected)
package {
import flash.display.*;
public dynamic class PortraitEffected extends MovieClip {
}
}//package
Section 286
//PortraitHighlight (PortraitHighlight)
package {
import flash.display.*;
public dynamic class PortraitHighlight extends MovieClip {
}
}//package
Section 287
//potion_sound (potion_sound)
package {
import flash.media.*;
public dynamic class potion_sound extends Sound {
}
}//package
Section 288
//PotionHealth (PotionHealth)
package {
public class PotionHealth extends Consumable {
public function PotionHealth(_arg1:int=1){
item_name = "Healing Potion";
restore_health = 75;
item_rarity = Item.green;
icon_frame = 4;
}
}
}//package
Section 289
//PotionHealthSmall (PotionHealthSmall)
package {
public class PotionHealthSmall extends Consumable {
public function PotionHealthSmall(_arg1:int=1){
item_name = "Weak Healing Potion";
restore_health = 40;
item_rarity = Item.green;
icon_frame = 80;
}
}
}//package
Section 290
//PotionPoisonResist (PotionPoisonResist)
package {
public class PotionPoisonResist extends Consumable {
public function PotionPoisonResist(_arg1:int=1){
item_name = "Snake's Blood Potion";
restore_health = 20;
poison_resist = 100;
item_rarity = Item.green;
icon_frame = 77;
}
}
}//package
Section 291
//PotionPower (PotionPower)
package {
public class PotionPower extends Consumable {
public function PotionPower(_arg1:int=1){
item_name = "Power Potion";
restore_power = 75;
item_rarity = Item.green;
icon_frame = 5;
}
}
}//package
Section 292
//PotionPowerSmall (PotionPowerSmall)
package {
public class PotionPowerSmall extends Consumable {
public function PotionPowerSmall(_arg1:int=1){
item_name = "Weak Power Potion";
restore_power = 40;
item_rarity = Item.green;
icon_frame = 81;
}
}
}//package
Section 293
//PotionQuickness (PotionQuickness)
package {
public class PotionQuickness extends Consumable {
public function PotionQuickness(_arg1:int=1){
item_name = "Elixir of Speed";
quickness_bonus = 20;
item_rarity = Item.green;
icon_frame = 78;
}
}
}//package
Section 294
//PotionRejuve (PotionRejuve)
package {
public class PotionRejuve extends Consumable {
public function PotionRejuve(_arg1:int=1){
item_name = "Rejuvenation Potion";
restore_health = 75;
restore_power = 75;
item_rarity = Item.green;
icon_frame = 7;
}
}
}//package
Section 295
//PotionRejuveSmall (PotionRejuveSmall)
package {
public class PotionRejuveSmall extends Consumable {
public function PotionRejuveSmall(_arg1:int=1){
item_name = "Weak Rejuvenation Potion";
restore_health = 40;
restore_power = 40;
item_rarity = Item.green;
icon_frame = 83;
}
}
}//package
Section 296
//PotionRevive (PotionRevive)
package {
public class PotionRevive extends Consumable {
public function PotionRevive(_arg1:int=1){
item_name = "Revival Potion";
restore_health = 75;
resurrect = true;
item_rarity = Item.green;
icon_frame = 6;
}
}
}//package
Section 297
//PotionReviveWeak (PotionReviveWeak)
package {
public class PotionReviveWeak extends Consumable {
public function PotionReviveWeak(_arg1:int=1){
item_name = "Weak Revival Potion";
restore_health = 30;
resurrect = true;
item_rarity = Item.green;
icon_frame = 82;
}
}
}//package
Section 298
//PotionShield (PotionShield)
package {
public class PotionShield extends Consumable {
public function PotionShield(_arg1:int=1){
item_name = "Elixir of Protection";
damage_resist = 20;
stun_resist = 50;
item_rarity = Item.green;
icon_frame = 79;
}
}
}//package
Section 299
//power_up_sound (power_up_sound)
package {
import flash.media.*;
public dynamic class power_up_sound extends Sound {
}
}//package
Section 300
//PowerBar (PowerBar)
package {
import flash.display.*;
public dynamic class PowerBar extends MovieClip {
public var bar:MovieClip;
public var lightbar:MovieClip;
}
}//package
Section 301
//ProceedButton (ProceedButton)
package {
import flash.events.*;
import flash.display.*;
public class ProceedButton extends MovieClip {
public var bg:MovieClip;
public function ProceedButton(){
addFrameScript(14, frame15);
this.addEventListener(Event.ADDED_TO_STAGE, added);
this.addEventListener(Event.REMOVED_FROM_STAGE, removed);
}
function added(_arg1:Event):void{
bg.gotoAndStop(1);
this.addEventListener(MouseEvent.MOUSE_OVER, mouseOn);
this.addEventListener(MouseEvent.MOUSE_MOVE, mouseOn);
this.addEventListener(MouseEvent.MOUSE_OUT, mouseOff);
}
function frame15(){
this.gotoAndStop(15);
this.bg.gotoAndStop(1);
}
function mouseOn(_arg1:MouseEvent):void{
bg.gotoAndStop(2);
}
function mouseOff(_arg1:MouseEvent):void{
bg.gotoAndStop(1);
}
function removed(_arg1:Event):void{
this.removeEventListener(MouseEvent.MOUSE_OVER, mouseOn);
this.removeEventListener(MouseEvent.MOUSE_MOVE, mouseOn);
this.removeEventListener(MouseEvent.MOUSE_OUT, mouseOff);
this.removeEventListener(Event.ADDED_TO_STAGE, added);
this.removeEventListener(Event.REMOVED_FROM_STAGE, removed);
}
}
}//package
Section 302
//ProgressCleared (ProgressCleared)
package {
import flash.text.*;
import flash.display.*;
public dynamic class ProgressCleared extends MovieClip {
public var label:TextField;
public var bar_mask:MovieClip;
public var holder:ProgressHolder;
}
}//package
Section 303
//ProgressExplored (ProgressExplored)
package {
import flash.text.*;
import flash.display.*;
public dynamic class ProgressExplored extends MovieClip {
public var label:TextField;
public var bar_mask:MovieClip;
public var holder:ProgressHolder;
}
}//package
Section 304
//ProgressHolder (ProgressHolder)
package {
import flash.display.*;
public dynamic class ProgressHolder extends MovieClip {
}
}//package
Section 305
//punch_sound (punch_sound)
package {
import flash.media.*;
public dynamic class punch_sound extends Sound {
}
}//package
Section 306
//QualitySelector (QualitySelector)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class QualitySelector extends MovieClip {
public var best:TextField;
public var low:TextField;
public var high:TextField;
public var med:TextField;
public function QualitySelector():void{
best.addEventListener(MouseEvent.MOUSE_DOWN, clickBest);
high.addEventListener(MouseEvent.MOUSE_DOWN, clickHigh);
med.addEventListener(MouseEvent.MOUSE_DOWN, clickMed);
low.addEventListener(MouseEvent.MOUSE_DOWN, clickLow);
addEventListener(Event.ADDED_TO_STAGE, added);
}
function added(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, added);
setFrameFromQuality();
}
function clickMed(_arg1:MouseEvent):void{
this.gotoAndStop("med");
stage.quality = StageQuality.MEDIUM;
}
function clickHigh(_arg1:MouseEvent):void{
this.gotoAndStop("high");
stage.quality = StageQuality.HIGH;
}
function clickLow(_arg1:MouseEvent):void{
this.gotoAndStop("low");
stage.quality = StageQuality.LOW;
}
public function cleanup():void{
best.removeEventListener(MouseEvent.MOUSE_DOWN, clickBest);
high.removeEventListener(MouseEvent.MOUSE_DOWN, clickHigh);
med.removeEventListener(MouseEvent.MOUSE_DOWN, clickMed);
low.removeEventListener(MouseEvent.MOUSE_DOWN, clickLow);
}
function clickBest(_arg1:MouseEvent):void{
this.gotoAndStop("best");
stage.quality = StageQuality.BEST;
}
public function setFrameFromQuality():void{
if (stage.quality == "LOW"){
this.gotoAndStop("low");
} else {
if (stage.quality == "MEDIUM"){
this.gotoAndStop("med");
} else {
if (stage.quality == "HIGH"){
this.gotoAndStop("high");
} else {
if (stage.quality == "BEST"){
this.gotoAndStop("best");
};
};
};
};
}
}
}//package
Section 307
//QualitySelectorMenu (QualitySelectorMenu)
package {
public dynamic class QualitySelectorMenu extends QualitySelector {
}
}//package
Section 308
//RandomBones (RandomBones)
package {
public dynamic class RandomBones extends RandomFrame {
public function RandomBones(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package
Section 309
//RandomFloor (RandomFloor)
package {
import flash.display.*;
public dynamic class RandomFloor extends MovieClip {
}
}//package
Section 310
//RandomFrame (RandomFrame)
package {
import flash.display.*;
public class RandomFrame extends MovieClip {
public function RandomFrame():void{
var _local1:int;
super();
_local1 = dmf.randomNum(1, this.totalFrames);
this.gotoAndStop(_local1);
}
}
}//package
Section 311
//RandomGear (RandomGear)
package {
public dynamic class RandomGear extends RandomFrame {
public function RandomGear(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package
Section 312
//RandomLightning (RandomLightning)
package {
import flash.display.*;
public dynamic class RandomLightning extends MovieClip {
public var f;
public var r;
public function RandomLightning(){
addFrameScript(0, frame1);
}
function frame1(){
f = dm.randomNum(1, this.totalFrames);
this.gotoAndStop(f);
r = dm.randomNum(0, 359);
this.rotation = r;
}
}
}//package
Section 313
//RangedWeapon (RangedWeapon)
package {
public class RangedWeapon extends Weapon {
public function RangedWeapon(){
materials.push("Elm", "Oak", "Ash", "Yew", "Voidwood", "Planespine");
}
override public function getItemTypeString(){
return ("Ranged Weapon");
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Venomous", 5]);
suffixes.push(["Deftness", base_item_stat_bonus]);
}
}
}//package
Section 314
//RarityButton (RarityButton)
package {
import flash.display.*;
public dynamic class RarityButton extends MovieClip {
}
}//package
Section 315
//RatingDialog (RatingDialog)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class RatingDialog extends MovieClip {
public var yes_btn:ContinueButton;
public var total:TextField;
public var col1:TextField;
public var col3:TextField;
public var col2:TextField;
public function RatingDialog(_arg1:Party=null){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
super();
yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
if (_arg1 != null){
_local2 = _arg1.level;
_local3 = Math.round(((_arg1.stat_rooms_explored / _arg1.stat_rooms_total) * 100));
_local4 = Math.round(((_arg1.stat_hordes_defeated / (_local2 * 10)) * 100));
_local5 = (_local3 + _local4);
_local6 = _arg1.stat_member_deaths;
_local7 = _arg1.stat_shrines_used;
_local8 = _arg1.stat_party_defeats;
_local9 = _arg1.stat_leaders_defeated;
_arg1.getLevelScore();
col1.text = ((((((((((_local2 + "\n") + _local4) + "\n\n") + _local9) + "\n") + _local7) + "\n") + _local6) + "\n") + _local8);
col2.text = ((((((((((Party.SCORE_LEVEL + "\n") + _local3) + "\n\n") + Party.SCORE_LEADERS) + "\n") + Party.SCORE_SHRINES) + "\n") + Party.SCORE_DEATHS) + "\n") + Party.SCORE_DEFEATS);
col3.text = (((((((((((((_arg1.level * Party.SCORE_LEVEL) + "\nx") + _local5) + "%\n") + _arg1.getLevelScore()) + "\n") + (_local9 * Party.SCORE_LEADERS)) + "\n") + (_local7 * Party.SCORE_SHRINES)) + "\n") + (_local6 * Party.SCORE_DEATHS)) + "\n") + (_local8 * Party.SCORE_DEFEATS));
total.text = String(_arg1.getScore());
};
}
function clickOkay(_arg1:MouseEvent):void{
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
if (parent != null){
parent.removeChild(this);
cleanup();
};
}
private function cleanup():void{
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
}
}
}//package
Section 316
//rCell (rCell)
package {
public class rCell extends DungeonRoom {
static var grid_height = 2;
static var grid_width = 2;
override public function getGridHeight():int{
return (grid_height);
}
override public function getGridWidth():int{
return (grid_width);
}
}
}//package
Section 317
//rChamber (rChamber)
package {
public class rChamber extends DungeonRoom {
static var grid_height = 3;
static var grid_width = 3;
override public function getGridHeight():int{
return (grid_height);
}
override public function getGridWidth():int{
return (grid_width);
}
}
}//package
Section 318
//rCorridorH (rCorridorH)
package {
import flash.display.*;
public class rCorridorH extends DungeonCorridor {
public var gfx:MovieClip;
static var grid_height = 1;
static var grid_width = 2;
public function rCorridorH(){
isCorridorH = true;
}
override public function getGridHeight():int{
return (grid_height);
}
override public function setAlpha(_arg1:Number):void{
gfx.alpha = _arg1;
setAlphaChildren(_arg1);
}
override public function getGridWidth():int{
return (grid_width);
}
override public function getAlpha():Number{
return (gfx.alpha);
}
override public function setChild(_arg1:DisplayObject):void{
addChild(_arg1);
}
}
}//package
Section 319
//rCorridorV (rCorridorV)
package {
import flash.display.*;
public class rCorridorV extends DungeonCorridor {
public var gfx:MovieClip;
static var grid_height = 2;
static var grid_width = 1;
override public function getGridHeight():int{
return (grid_height);
}
override public function setAlpha(_arg1:Number):void{
gfx.alpha = _arg1;
setAlphaChildren(_arg1);
}
override public function getGridWidth():int{
return (grid_width);
}
override public function getAlpha():Number{
return (gfx.alpha);
}
override public function setChild(_arg1:DisplayObject):void{
addChild(_arg1);
}
}
}//package
Section 320
//rDemonRoom (rDemonRoom)
package {
import flash.display.*;
public class rDemonRoom extends DungeonRoom {
public var rune1:MovieClip;
public var rune2:MovieClip;
public var rune6:MovieClip;
public var rune8:MovieClip;
public var rune9:MovieClip;
public var rune7:MovieClip;
public var rune3:MovieClip;
public var rune4:MovieClip;
public var rune5:MovieClip;
static var grid_height = 5;
static var grid_width = 5;
override public function getGridHeight():int{
return (grid_height);
}
override public function getGridWidth():int{
return (grid_width);
}
public function toFrame(_arg1:int):void{
var _local2:*;
var _local3:*;
this.gotoAndStop(_arg1);
_local2 = 1;
while (_local2 < _arg1) {
_local3 = getChildByName(("rune" + _local2));
if (_local3 == null){
} else {
_local3.gotoAndPlay(1);
};
_local2++;
};
}
}
}//package
Section 321
//RecoveryShrine (RecoveryShrine)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class RecoveryShrine extends MovieClip {
var used:Boolean;
var room:DungeonRoom;
public function RecoveryShrine(){
addFrameScript(0, frame1);
used = false;
this.gotoAndStop(1);
}
function onFadeComplete(_arg1:TimerEvent):void{
if (parent != null){
parent.removeChild(this);
};
}
function frame1(){
this.gotoAndStop(1);
}
public function fade():void{
var _local1:Timer;
used = true;
this.gotoAndPlay(2);
_local1 = new Timer(500, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, onFadeComplete);
_local1.start();
}
}
}//package
Section 322
//RedBar (RedBar)
package {
import flash.display.*;
public dynamic class RedBar extends MovieClip {
}
}//package
Section 323
//RedBarHorz (RedBarHorz)
package {
import flash.display.*;
public dynamic class RedBarHorz extends MovieClip {
}
}//package
Section 324
//RestDialog (RestDialog)
package {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public class RestDialog extends MovieClip {
public var yes_btn:YesButton;
public var no_btn:NotYetButton;
public function RestDialog(){
this.yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickYes);
this.no_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickNo);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function clickYes(_arg1:MouseEvent):void{
if (((!((parent == null))) && ((parent is Dungeon)))){
cleanup();
Dungeon(parent).useRest();
};
}
function clickNo(_arg1:MouseEvent):void{
if (parent != null){
cleanup();
parent.removeChild(this);
};
}
private function cleanup():void{
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickYes);
no_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickNo);
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
clickYes(null);
} else {
if (_arg1.keyCode == Keyboard.ESCAPE){
clickNo(null);
};
};
}
}
}//package
Section 325
//RestScreen (RestScreen)
package {
import flash.display.*;
public dynamic class RestScreen extends MovieClip {
public function RestScreen(){
addFrameScript(14, frame15, 30, frame31);
}
function frame15(){
if (((!((this.parent == null))) && ((this.parent is Dungeon)))){
Dungeon(this.parent).updateChars();
Dungeon(this.parent).removeRestButton();
};
}
function frame31(){
if (this.parent != null){
parent.removeChild(this);
};
}
}
}//package
Section 326
//RetreatedEffect (RetreatedEffect)
package {
import flash.display.*;
public dynamic class RetreatedEffect extends Sprite {
}
}//package
Section 327
//return_of_the_knights_b (return_of_the_knights_b)
package {
import flash.media.*;
public dynamic class return_of_the_knights_b extends Sound {
}
}//package
Section 328
//ReturnButton (ReturnButton)
package {
import flash.display.*;
public dynamic class ReturnButton extends MovieClip {
}
}//package
Section 329
//revive_effect (revive_effect)
package {
import flash.display.*;
public dynamic class revive_effect extends MovieClip {
public var gfx:CharGraphic;
public function revive_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.heal);
}
function frame45(){
this.stop();
}
}
}//package
Section 330
//rGallery (rGallery)
package {
public class rGallery extends DungeonRoom {
static var grid_height = 4;
static var grid_width = 3;
override public function getGridHeight():int{
return (grid_height);
}
override public function getGridWidth():int{
return (grid_width);
}
}
}//package
Section 331
//rLargeRoom (rLargeRoom)
package {
public class rLargeRoom extends DungeonRoom {
static var grid_height = 4;
static var grid_width = 4;
override public function getGridHeight():int{
return (grid_height);
}
override public function getGridWidth():int{
return (grid_width);
}
}
}//package
Section 332
//rollingthunder_c (rollingthunder_c)
package {
import flash.media.*;
public dynamic class rollingthunder_c extends Sound {
}
}//package
Section 333
//RoomFlash (RoomFlash)
package {
import flash.display.*;
public dynamic class RoomFlash extends MovieClip {
public function RoomFlash(){
addFrameScript(8, frame9);
}
function frame9(){
if (this.parent != null){
parent.removeChild(this);
};
}
}
}//package
Section 334
//rTallRoom (rTallRoom)
package {
public class rTallRoom extends DungeonRoom {
static var grid_height = 4;
static var grid_width = 2;
override public function getGridHeight():int{
return (grid_height);
}
override public function getGridWidth():int{
return (grid_width);
}
}
}//package
Section 335
//rWideRoom (rWideRoom)
package {
public class rWideRoom extends DungeonRoom {
static var grid_height = 2;
static var grid_width = 4;
override public function getGridHeight():int{
return (grid_height);
}
override public function getGridWidth():int{
return (grid_width);
}
}
}//package
Section 336
//sAetherLightning (sAetherLightning)
package {
public class sAetherLightning extends Skill {
public function sAetherLightning(_arg1:Character){
char_ref = _arg1;
aiTargetsBackRow = true;
rangedAttack = true;
power_cost = 50;
damage = Math.round((char_ref.damage * 0.8));
splashDamageMultiplier = 0.7;
skillname = "Ion Bolt";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.lightning;
}
}
}//package
Section 337
//sArachnoidWeb (sArachnoidWeb)
package {
public class sArachnoidWeb extends Skill {
public function sArachnoidWeb(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
rangedAttack = true;
hitsAllEnemies = true;
damage = 0;
power_cost = 80;
attacksWithAccuracyMod = 0.75;
crippling = 15;
damageAccuracy = 20;
skillname = "Web";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.web;
}
}
}//package
Section 338
//sAscendantRanged (sAscendantRanged)
package {
public class sAscendantRanged extends Skill {
public function sAscendantRanged(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = Math.round((_arg1.damage * 1));
power_cost = 10;
ignoresArmor = false;
damageAccuracy = 10;
skillname = "Energy Flare";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.holyDamage;
}
}
}//package
Section 339
//SaveDeleteDialog (SaveDeleteDialog)
package {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public class SaveDeleteDialog extends MovieClip {
public var yes_btn:DeleteButton;
var slot:int;// = 0
public var no_btn:KeepButton;
public function SaveDeleteDialog(_arg1:int=0){
slot = 0;
super();
this.slot = _arg1;
this.yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickYes);
this.no_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickNo);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function clickYes(_arg1:MouseEvent):void{
if (((!((parent == null))) && ((parent is LoadParty)))){
LoadParty(parent).deleteSlot(slot);
cleanup();
parent.removeChild(this);
};
}
function clickNo(_arg1:MouseEvent):void{
if (parent != null){
parent.removeChild(this);
cleanup();
};
}
private function cleanup(){
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickYes);
no_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickNo);
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ESCAPE){
clickNo(null);
};
}
}
}//package
Section 340
//SaveGameEmpty (SaveGameEmpty)
package {
import flash.display.*;
public dynamic class SaveGameEmpty extends MovieClip {
}
}//package
Section 341
//SaveGameStatus (SaveGameStatus)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class SaveGameStatus extends MovieClip {
private var scrolling:Boolean;// = false
var slot:int;// = 1
public var infinite_mode_icon:MovieClip;
public var bg:SaveGameStatusBG;
public var del_btn:DeleteButton;
public var load_btn:LoadButton;
public var version_number:TextField;
public var level_label:TextField;
public var score:TextField;
public var char3:CharacterPortrait;
public var stats:StatusStatScroller;
public var empty_panel:MovieClip;
var empty:Boolean;// = false
public var char1:CharacterPortrait;
public var char2:CharacterPortrait;
public var char4:CharacterPortrait;
public function SaveGameStatus():void{
empty = false;
slot = 1;
scrolling = false;
super();
DungeonMain.registerAliases();
char1.mouseEnabled = false;
char2.mouseEnabled = false;
char3.mouseEnabled = false;
char4.mouseEnabled = false;
level_label.mouseEnabled = false;
stats.explore_rate.mouseEnabled = false;
stats.clear_rate.mouseEnabled = false;
stats.member_deaths.mouseEnabled = false;
stats.party_defeats.mouseEnabled = false;
stats.clear_rate.mouseEnabled = false;
stats.shrines_used.mouseEnabled = false;
load_btn.addEventListener(MouseEvent.MOUSE_DOWN, loadClick);
del_btn.addEventListener(MouseEvent.MOUSE_DOWN, deleteClick);
empty_panel.addEventListener(MouseEvent.MOUSE_DOWN, emptyClick);
removeChild(empty_panel);
stats.stop();
addEventListener(Event.ENTER_FRAME, enterFrameCheck);
}
public function emptySlot():void{
empty = true;
level_label.text = (slot + ". Empty Slot");
if (!contains(empty_panel)){
addChild(empty_panel);
};
}
function emptyClick(_arg1:MouseEvent):void{
if (parent != null){
LoadParty(parent).newGame(slot);
};
}
function loadClick(_arg1:MouseEvent):void{
if (parent == null){
return;
};
dm.main.loadGame(slot);
}
function deleteClick(_arg1:MouseEvent):void{
var _local2:SaveDeleteDialog;
if (((!((parent == null))) && ((parent is LoadParty)))){
_local2 = new SaveDeleteDialog(slot);
_local2.name = "dialog";
parent.addChild(_local2);
};
}
function enterFrameCheck(_arg1:Event):void{
var _local2:Boolean;
_local2 = false;
if ((((bg.mouseX > bg.width)) || ((bg.mouseX < 0)))){
_local2 = true;
};
if ((((bg.mouseY > bg.height)) || ((bg.mouseY < 0)))){
_local2 = true;
};
if (parent.getChildByName("dialog") != null){
_local2 = true;
};
if (_local2){
bg.gotoAndStop("normal");
if (scrolling){
stats.stop();
};
scrolling = false;
} else {
bg.gotoAndStop("highlight");
if (!scrolling){
stats.play();
};
scrolling = true;
};
}
public function cleanup():void{
load_btn.removeEventListener(MouseEvent.MOUSE_DOWN, loadClick);
del_btn.removeEventListener(MouseEvent.MOUSE_DOWN, deleteClick);
empty_panel.removeEventListener(MouseEvent.MOUSE_DOWN, emptyClick);
removeEventListener(Event.ENTER_FRAME, enterFrameCheck);
}
public function setParty(_arg1:Party, _arg2:Boolean=false):void{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:CharacterPortrait;
if (_arg1 == null){
emptySlot();
return;
};
empty = false;
_local3 = ((slot + ". Dungeon Level ") + _arg1.level);
if (_arg2){
_local3 = (_local3 + " - In Combat");
};
if (_arg1.hardcore){
_local3 = (_local3 + " (Hardcore)");
} else {
if (_arg1.beginner){
_local3 = (_local3 + " (Beginner)");
} else {
if (_arg1.extreme){
_local3 = (_local3 + " (Extreme)");
} else {
_local3 = (_local3 + " (Standard)");
};
};
};
level_label.text = _local3;
dm.embolden(level_label);
_local4 = Math.round(((_arg1.stat_rooms_explored / _arg1.stat_rooms_total) * 100));
_local5 = Math.round(((_arg1.stat_hordes_defeated / (_arg1.level * 10)) * 100));
if (DungeonMain.debug){
};
stats.explore_rate.text = (String(_local4) + "%");
stats.clear_rate.text = (String(_local5) + "%");
stats.leaders.text = String(_arg1.stat_leaders_defeated);
stats.member_deaths.text = String(_arg1.stat_member_deaths);
stats.party_defeats.text = String(_arg1.stat_party_defeats);
stats.shrines_used.text = String(_arg1.stat_shrines_used);
score.text = String(_arg1.getScore());
_local6 = 0;
while (_local6 < 4) {
_local7 = CharacterPortrait(getChildByName(("char" + (_local6 + 1))));
if (_arg1.members[_local6] != null){
_local7.setChar(_arg1.members[_local6]);
} else {
removeChild(_local7);
};
_local6++;
};
if (_arg1.level <= DungeonMain.MAX_LEVEL){
removeChild(infinite_mode_icon);
};
if (!_arg1.version12){
removeChild(version_number);
};
}
}
}//package
Section 342
//SaveGameStatusBG (SaveGameStatusBG)
package {
import flash.display.*;
public dynamic class SaveGameStatusBG extends MovieClip {
}
}//package
Section 343
//sBasiliskPetrify (sBasiliskPetrify)
package {
public class sBasiliskPetrify extends Skill {
public function sBasiliskPetrify(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 2;
hitsAllMeleeRange = true;
power_cost = 65;
damage = 0;
stun_percent = 100;
skillname = "Petrify";
verbage = ("uses " + skillname);
}
}
}//package
Section 344
//sBeholderDrain (sBeholderDrain)
package {
public class sBeholderDrain extends Skill {
public function sBeholderDrain(_arg1:Character){
char_ref = _arg1;
aiNotUnlessHurt = true;
aiTargetHealthiest = true;
rangedAttack = true;
damage = Math.round((_arg1.damage * 0.5));
vampiric_percent = Math.floor((100 + (level * 1)));
curse = 0.2;
power_cost = 40;
ignoresArmor = true;
skillname = "Steal Soul";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.monsterDrain;
}
}
}//package
Section 345
//sBeholderRanged (sBeholderRanged)
package {
public class sBeholderRanged extends Skill {
public function sBeholderRanged(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = Math.round((_arg1.damage * 1.3));
power_cost = 70;
ignoresArmor = true;
skillname = "Disentegrate";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.disintegrate;
}
}
}//package
Section 346
//sBeholderRecover (sBeholderRecover)
package {
public class sBeholderRecover extends Skill {
public function sBeholderRecover(_arg1:Character){
char_ref = _arg1;
aiNotUnlessLowPower = true;
targetsSelf = true;
damage = Math.round((_arg1.health_max * 0.1));
powerRestore = 100;
power_cost = 0;
skillname = "Channeling";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.gainPower;
}
}
}//package
Section 347
//sCelestialAccuracy (sCelestialAccuracy)
package {
public class sCelestialAccuracy extends Skill {
public function sCelestialAccuracy(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 1;
damage = 0;
power_cost = 40;
targetsFriendlies = true;
hitsAllFriendlies = true;
buff_accuracy = 20;
skillname = "Celestial Guidance";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.buff;
}
}
}//package
Section 348
//sCelestialArmor (sCelestialArmor)
package {
public class sCelestialArmor extends Skill {
public function sCelestialArmor(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 1;
damage = 0;
power_cost = 40;
targetsFriendlies = true;
hitsAllFriendlies = true;
buff_damageResist = 20;
skillname = "Celestial Protection";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.armorBuff;
}
override public function description():String{
return ((("Caster gains an additional " + buff_damageResist) + "% damage resistance for the remainder of the battle."));
}
}
}//package
Section 349
//sCelestialSpeed (sCelestialSpeed)
package {
public class sCelestialSpeed extends Skill {
public function sCelestialSpeed(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 1;
damage = 0;
power_cost = 40;
targetsFriendlies = true;
hitsAllFriendlies = true;
buff_quickness = 10;
skillname = "Celestial Motion";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.buff;
}
}
}//package
Section 350
//sClericAE (sClericAE)
package {
public class sClericAE extends Skill {
public function sClericAE(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
aiCastLimit = 0;
magicStrength = 0.5;
damage = getBaseMagicDamage(magicStrength);
rangedAttack = true;
hitsAllEnemies = true;
power_cost = 55;
iconFrame = 26;
skillname = "Litany of Pain";
verbage = ("intones the " + skillname);
specialAnimation = PortraitAnimation.holyDamage;
}
override public function description():String{
return ((("Magic area attack. Inflicts " + getDamage()) + " damage to all enemies."));
}
}
}//package
Section 351
//sClericDamageBuff (sClericDamageBuff)
package {
public class sClericDamageBuff extends Skill {
public function sClericDamageBuff(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
targetsFriendlies = true;
rangedAttack = true;
power_cost = 30;
targetDamageMod = 1.75;
iconFrame = 42;
skillname = "Anoint";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.buff;
}
override public function description():String{
return ((("Target party member deals " + Math.round((targetDamageMod * 100))) + "% normal damage on next attack."));
}
}
}//package
Section 352
//sClericFlash (sClericFlash)
package {
public class sClericFlash extends Skill {
public function sClericFlash(_arg1:Character){
char_ref = _arg1;
increasesWith = intellect;
magicStrength = 0.3;
damage = getBaseMagicDamage(magicStrength);
onlyDamagesUndead = true;
rangedAttack = true;
hitsAllEnemies = true;
power_cost = 40;
damageAccuracy = 30;
alwaysHits = true;
iconFrame = 13;
skillname = "Holy Light";
verbage = ("calls down " + skillname);
specialAnimation = PortraitAnimation.blind;
}
override public function description():String{
return ((((("Reduce all enemies' accuracy by " + damageAccuracy) + "% for the remainder of the battle. Deals ") + getDamage()) + " damage to Undead. Always hits."));
}
}
}//package
Section 353
//sClericHeal (sClericHeal)
package {
public class sClericHeal extends Skill {
public function sClericHeal(_arg1:Character){
char_ref = _arg1;
increasesWith = intellect;
nonCombat = true;
skillname = "Heal";
targetsFriendlies = true;
rangedAttack = true;
healing = 40;
power_cost = 25;
removesPoison = true;
iconFrame = 9;
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.heal;
}
override public function description():String{
return ((("Restore " + scaleHeal(healing)) + " health to one member of your party. Cures poison."));
}
}
}//package
Section 354
//sClericHealGroup (sClericHealGroup)
package {
public class sClericHealGroup extends Skill {
public function sClericHealGroup(_arg1:Character){
char_ref = _arg1;
increasesWith = intellect;
nonCombat = true;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
removesPoison = true;
healing = 20;
power_cost = 60;
iconFrame = 10;
skillname = "Heal All";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.heal;
}
override public function description():String{
return ((("Restore " + scaleHeal(healing)) + " health to every member of your party. Cures poison."));
}
}
}//package
Section 355
//sClericMelee (sClericMelee)
package {
public class sClericMelee extends Skill {
public function sClericMelee(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
addWeaponDamage = true;
scaleWeaponDamage = 2;
power_cost = 50;
requiresMelee = true;
iconFrame = 4;
skillname = "Fervor";
verbage = ("attacks with " + skillname);
specialAnimation = PortraitAnimation.playerPowerSlash;
}
override public function description():String{
return ((((("Melee attack for " + (scaleWeaponDamage * 100)) + "% weapon damage (") + getDamage()) + ")"));
}
}
}//package
Section 356
//sClericPurify (sClericPurify)
package {
public class sClericPurify extends Skill {
public function sClericPurify(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
power_cost = 20;
removesPoison = true;
removesCurse = true;
buff_resistPoison = 50;
iconFrame = 45;
skillname = "Purify";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.buff;
}
override public function description():String{
return ((("Removes poison and curse effects from all party members, and increases their poison resistance by " + buff_resistPoison) + " for the remainder of the battle."));
}
}
}//package
Section 357
//sClericRevive (sClericRevive)
package {
public class sClericRevive extends Skill {
public function sClericRevive(_arg1:Character){
char_ref = _arg1;
increasesWith = intellect;
nonCombat = true;
targetsFriendlies = true;
rangedAttack = true;
healing = 30;
power_cost = 60;
removesPoison = true;
resurrects = true;
iconFrame = 47;
skillname = "Revive";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.revive;
}
override public function description():String{
return ((("Revives fallen party member with " + scaleHeal(healing)) + " health."));
}
}
}//package
Section 358
//sClericShield (sClericShield)
package {
public class sClericShield extends Skill {
public function sClericShield(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
aiCastLimit = 1;
damage = 0;
power_cost = 55;
targetsSelf = true;
invulnerable = 1;
powerRegenMod = 0;
iconFrame = 19;
skillname = "Shield of Faith";
verbage = ("is enclosed in a " + skillname);
specialAnimation = PortraitAnimation.armorBuff;
}
override public function description():String{
return ((("Caster takes no damage until " + char_ref.genderPossessive()) + " next turn. Caster recovers no power at beginning of next turn."));
}
}
}//package
Section 359
//sClericSmite (sClericSmite)
package {
public class sClericSmite extends Skill {
public function sClericSmite(_arg1:Character){
char_ref = _arg1;
increasesWith = intellect;
magicStrength = 0.75;
damage = getBaseMagicDamage(magicStrength);
rangedAttack = true;
power_cost = 30;
undeadMultiplier = 2;
alwaysHits = true;
iconFrame = 44;
skillname = "Smite";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.holyDamage;
}
override public function description():String{
return ((((("Ranged magic attack for " + getDamage()) + " damage. Deals ") + Math.round((undeadMultiplier * 100))) + "% damage to undead. Always hits."));
}
}
}//package
Section 360
//sCultistArrow (sCultistArrow)
package {
public class sCultistArrow extends Skill {
public function sCultistArrow(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = Math.round((_arg1.damage * 0.5));
powerDamage = 25;
power_cost = 75;
skillname = "Draining Shot";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.cultistArrow;
}
}
}//package
Section 361
//sCultistHeal (sCultistHeal)
package {
public class sCultistHeal extends Skill {
public function sCultistHeal(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
healing = Math.round((_arg1.health_max / 6));
powerRestore = 20;
power_cost = 100;
removesPoison = false;
skillname = "Energy Flow";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.restore;
}
override public function description():String{
return ((("Restore " + scaleHeal(healing)) + " health to one member of your party. Cures poison."));
}
}
}//package
Section 362
//sCultistMeleeStun (sCultistMeleeStun)
package {
public class sCultistMeleeStun extends Skill {
public function sCultistMeleeStun(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 1.2));
power_cost = 40;
stun_percent = 60;
skillname = "Impact";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.creatureWeapon;
}
}
}//package
Section 363
//sCultistSever (sCultistSever)
package {
public class sCultistSever extends Skill {
public function sCultistSever(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 1;
damage = 0;
rangedAttack = true;
hitsAllEnemies = true;
attacksWithAccuracyMod = 0.5;
power_cost = 60;
cancelPowerRegen = true;
skillname = "Sever";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.debuff;
}
}
}//package
Section 364
//sDeathKnightRally (sDeathKnightRally)
package {
public class sDeathKnightRally extends Skill {
public function sDeathKnightRally(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
power_cost = 25;
buff_damage = 1.25;
healing = Math.round((_arg1.health_max / 6));
skillname = "Rally";
verbage = "rallies his troops";
specialAnimation = PortraitAnimation.buff;
}
override public function description():String{
return ("");
}
}
}//package
Section 365
//sDemonClone (sDemonClone)
package {
public class sDemonClone extends Skill {
public function sDemonClone(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
aiTopPriority = true;
damage = 0;
rangedAttack = true;
hitsAllEnemies = true;
alwaysHits = true;
clonesPlayers = true;
power_cost = 50;
skillname = "Dark Mirror";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.clone;
}
}
}//package
Section 366
//sDemonDoubleAttack (sDemonDoubleAttack)
package {
public class sDemonDoubleAttack extends Skill {
public function sDemonDoubleAttack(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 0.6));
power_cost = 40;
attacksTwoTargets = true;
skillname = "Demonic Rage";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.creatureSlash;
}
}
}//package
Section 367
//sDemonPoison (sDemonPoison)
package {
public class sDemonPoison extends Skill {
public function sDemonPoison(_arg1:Character){
char_ref = _arg1;
aiLowestPriority = true;
rangedAttack = true;
power_cost = 30;
damage = 0;
poisonDamage = Math.round((_arg1.damage / 6));
damageAccuracy = 15;
crippling = 10;
skillname = "Touch of Corruption";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.poison;
}
}
}//package
Section 368
//sDragonFlame (sDragonFlame)
package {
public class sDragonFlame extends Skill {
public function sDragonFlame(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
hitsAllEnemies = true;
damage = Math.round((_arg1.damage * 0.6));
power_cost = 30;
hasPortraitAnimation = true;
portraitAnimationFrame = 6;
skillname = "Flame Breath";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.fire;
}
}
}//package
Section 369
//sDragonTail (sDragonTail)
package {
public class sDragonTail extends Skill {
public function sDragonTail(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 0.8));
power_cost = 40;
hitsAllMeleeRange = true;
hasPortraitAnimation = true;
portraitAnimationFrame = 4;
skillname = "Tail Swipe";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.creatureWeapon;
}
override public function description():String{
return ("");
}
}
}//package
Section 370
//SelectArrow (SelectArrow)
package {
import flash.display.*;
public dynamic class SelectArrow extends SimpleButton {
}
}//package
Section 371
//sEngineConduit (sEngineConduit)
package {
public class sEngineConduit extends Skill {
public function sEngineConduit(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 1;
aiNotUnlessLowPower = true;
rangedAttack = true;
targetsFriendlies = true;
hitsAllFriendlies = true;
powerRestore = 50;
power_cost = 50;
iconFrame = 1;
skillname = "Conduit";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.gainPower;
}
}
}//package
Section 372
//sGhostAttack (sGhostAttack)
package {
public class sGhostAttack extends Skill {
public function sGhostAttack(_arg1:Character){
char_ref = _arg1;
damage = _arg1.damage;
power_cost = 0;
ignoresArmor = true;
skillname = "Attack";
verbage = "attacks";
specialAnimation = PortraitAnimation.ghostAttack;
}
}
}//package
Section 373
//sGhostHide (sGhostHide)
package {
public class sGhostHide extends Skill {
public function sGhostHide(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
aiNotUnlessHurt = true;
damage = 0;
healing = Math.round((char_ref.health_max / 2));
power_cost = 50;
targetsSelf = true;
hidesTarget = true;
skillname = "Vanish";
verbage = "fades from view";
}
override public function description():String{
return ("");
}
}
}//package
Section 374
//sGhostTouch (sGhostTouch)
package {
public class sGhostTouch extends Skill {
public function sGhostTouch(_arg1:Character){
char_ref = _arg1;
damage = 0;
power_cost = 40;
powerDamage = 30;
stun_percent = 25;
curse = 0.3;
skillname = "Spectral Touch";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.curse;
}
}
}//package
Section 375
//sGoblinCrossbow (sGoblinCrossbow)
package {
public class sGoblinCrossbow extends Skill {
public function sGoblinCrossbow(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 0.5));
power_cost = 0;
rangedAttack = true;
attacksTwoTargets = true;
skillname = "Repeating Crossbow";
verbage = "shoots";
specialAnimation = PortraitAnimation.monsterArrow;
}
}
}//package
Section 376
//sGoblinGrenade (sGoblinGrenade)
package {
public class sGoblinGrenade extends Skill {
public function sGoblinGrenade(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = char_ref.damage;
power_cost = 30;
splashDamageMultiplier = 0.6;
skillname = "Grenade";
verbage = ("hurls " + skillname);
specialAnimation = PortraitAnimation.explosion;
}
override public function description():String{
return ("");
}
}
}//package
Section 377
//Shield (Shield)
package {
public class Shield extends Offhand {
override public function generateItem(_arg1:int):void{
var _local2:*;
var _local3:*;
_local2 = false;
_local3 = false;
if (item_rarity == Item.grey){
item_rarity = Item.white;
};
getItemModifiers();
if (item_rarity == Item.green){
if (DungeonMain.RandomNum(0, 100) >= 50){
_local3 = true;
} else {
_local2 = true;
};
};
if ((((item_rarity == Item.blue)) || (_local3))){
prefix = rollForPrefix(item_rarity);
};
if ((((item_rarity == Item.blue)) || (_local2))){
suffix = rollForSuffix(item_rarity);
};
if (prefix >= 0){
applyPrefix();
};
if (suffix >= 0){
applySuffix();
};
if (base_armor_rating){
armor_rating = scaleArmorForLevel((base_armor_rating * (1 + (base_armor_mod / 100))));
};
if (prefix >= 0){
item_name = ((prefixes[prefix][0] + " ") + item_name);
};
if (suffix >= 0){
item_name = ((item_name + " of ") + suffixes[suffix][0]);
};
}
override public function getItemTypeString(){
return ("Shield");
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Thick", 1.2]);
}
}
}//package
Section 378
//ShrineUseDialog (ShrineUseDialog)
package {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public class ShrineUseDialog extends MovieClip {
public var yes_btn:YesButton;
public var no_btn:NotYetButton;
public function ShrineUseDialog(){
this.yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickYes);
this.no_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickNo);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function clickYes(_arg1:MouseEvent):void{
if (((!((parent == null))) && ((parent is Dungeon)))){
cleanup();
Dungeon(parent).useShrine();
};
}
function clickNo(_arg1:MouseEvent):void{
if (parent != null){
cleanup();
parent.removeChild(this);
};
}
private function cleanup():void{
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickYes);
no_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickNo);
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
clickYes(null);
} else {
if (_arg1.keyCode == Keyboard.ESCAPE){
clickNo(null);
};
};
}
}
}//package
Section 379
//Skill (Skill)
package {
public class Skill {
var showWeaponAnimation:Boolean;// = false
var requiresRanged:Boolean;// = false
var undeadMultiplier;// = 0
var nonCombat:Boolean;// = false
var clonesPlayers:Boolean;// = false
var char_ref:Character;
var invulnerable:int;// = 0
var onlyDamagesUndead;// = false
var makeDamageSponge:Boolean;// = false
var increaseRate:Number;// = 1
var aiNotUnlessLowPower:Boolean;// = false
var crippling:int;// = 0
var aiTargetsBackRow:Boolean;// = false
var skillname:String;// = "Skill"
var cancelPowerRegen:Boolean;// = false
var hidesTarget;// = false
private var _power_cost:int;// = 0
var requiresMelee:Boolean;// = false
var removesPoison:Boolean;// = false
var aiCastLimit:int;// = -1
var iconFrame;// = 1
var transformCreatureClass:MonsterCharacter;// = null
var cannotDie:int;// = 0
var targetDamageMod;// = 1
var curse;// = 0
var costsRemainingPower:Boolean;// = false
var vampiric_percent:int;// = 0
var poisonDamage:int;// = 0
var attacksTwoTargets:Boolean;// = false
var buff_damageResist;// = 0
var addsPowerToLethality:Boolean;// = false
var hitsAllEnemies;// = false
var hasPortraitAnimation:Boolean;// = false
var requiresShield:Boolean;// = false
var specialAnimation:int;// = 0
var aiTopPriority:Boolean;// = false
var powerDamage:int;// = 0
var increasesWith:int;// = 5
var buff_quickness;// = 0
var aiNotUnlessHurt:Boolean;// = false
var portraitAnimationDuration:int;// = 1500
var ignoresArmor:Boolean;// = false
var buff_damage;// = 1
var portraitAnimationFrame:int;// = 0
var unlocked:Boolean;// = false
var aiAllowSuicide:Boolean;// = false
var healing:int;// = 0
var tempDamageResistance:int;// = 0
var buff_vampiric;// = 0
var active:Boolean;// = false
var gainPowerFromKill:int;// = 0
var extraSpeedAttacks:int;// = 0
var magicStrength:Number;// = 0
var lethality:int;// = 0
var splashDamageMultiplier;// = 0
var usesWeaponRange;// = false
var damageBonusVsCreatureModifier;// = 1
var buff_stun;// = 0
var position:int;// = 1
var scaleWeaponDamage;// = 1
var allyBonusAttack:Boolean;// = false
var buff_resistStun;// = 0
var targetsStunned;// = false
var targetsFriendlies;// = false
var buff_healthRegen;// = 0
var hitsAllMeleeRange;// = false
var piercesColumn;// = false
var buff_damageReflect;// = 0
var removesCurse:Boolean;// = false
var buff_accuracy;// = 0
var requiresWeapon:Boolean;// = false
var targetsEmpty;// = false
var damage:int;// = 0
var targetsSelf;// = false
var verbage:String;
var damageBonusVsCreatureType;// = 0
var damageAccuracy:int;// = 0
var aiTargetHealthiest:Boolean;// = false
var buff_powerRegen;// = 0
var powerRegenMod:Number;// = 1
var attacksMultipleTimes:int;// = 0
var hitsAllFriendlies;// = false
var aiLowestPriority:Boolean;// = false
var stun_percent:int;// = 0
var nonLethal:Boolean;// = false
var suppressStunAnim:Boolean;// = false
var aiCastCount:int;// = 0
var powerRestore:int;// = 0
var health_cost:int;// = 0
var summonsCreatureClass:MonsterCharacter;// = null
var unarmedAttack;// = false
var addWeaponDamage;// = false
var targetsFriendlyFrontRow:Boolean;// = false
var rangedAttack;// = false
var resurrects:Boolean;// = false
var powerDrain:Boolean;// = false
var alwaysHits:Boolean;// = false
var buff_resistPoison;// = 0
var attacksWithAccuracyMod;// = 1
static const intellect = 4;
static const strength = 1;
static const dexterity = 3;
static const endurance = 2;
static const level = 6;
static const weapon = 5;
static const none = 0;
public function Skill(){
skillname = "Skill";
verbage = ("uses " + String(skillname));
iconFrame = 1;
active = false;
position = 1;
unlocked = false;
nonCombat = false;
aiCastLimit = -1;
aiCastCount = 0;
aiNotUnlessHurt = false;
aiTargetHealthiest = false;
aiNotUnlessLowPower = false;
aiTopPriority = false;
aiLowestPriority = false;
aiAllowSuicide = false;
aiTargetsBackRow = false;
increasesWith = Skill.weapon;
increaseRate = 1;
requiresWeapon = false;
requiresMelee = false;
requiresRanged = false;
requiresShield = false;
_power_cost = 0;
health_cost = 0;
damage = 0;
healing = 0;
buff_resistPoison = 0;
buff_resistStun = 0;
buff_damageResist = 0;
buff_damageReflect = 0;
buff_healthRegen = 0;
buff_powerRegen = 0;
buff_vampiric = 0;
buff_stun = 0;
buff_quickness = 0;
buff_damage = 1;
buff_accuracy = 0;
powerRegenMod = 1;
powerDamage = 0;
powerDrain = false;
gainPowerFromKill = 0;
powerRestore = 0;
clonesPlayers = false;
lethality = 0;
costsRemainingPower = false;
addsPowerToLethality = false;
hidesTarget = false;
unarmedAttack = false;
summonsCreatureClass = null;
transformCreatureClass = null;
makeDamageSponge = false;
tempDamageResistance = 0;
targetsFriendlyFrontRow = false;
targetsStunned = false;
cancelPowerRegen = false;
damageAccuracy = 0;
crippling = 0;
targetDamageMod = 1;
nonLethal = false;
undeadMultiplier = 0;
onlyDamagesUndead = false;
vampiric_percent = 0;
stun_percent = 0;
alwaysHits = false;
allyBonusAttack = false;
attacksMultipleTimes = 0;
attacksWithAccuracyMod = 1;
extraSpeedAttacks = 0;
attacksTwoTargets = false;
curse = 0;
removesCurse = false;
poisonDamage = 0;
removesPoison = false;
resurrects = false;
cannotDie = 0;
invulnerable = 0;
ignoresArmor = false;
rangedAttack = false;
usesWeaponRange = false;
targetsFriendlies = false;
targetsSelf = false;
targetsEmpty = false;
hitsAllFriendlies = false;
hitsAllEnemies = false;
hitsAllMeleeRange = false;
piercesColumn = false;
splashDamageMultiplier = 0;
scaleWeaponDamage = 1;
addWeaponDamage = false;
magicStrength = 0;
damageBonusVsCreatureType = 0;
damageBonusVsCreatureModifier = 1;
hasPortraitAnimation = false;
portraitAnimationFrame = 0;
portraitAnimationDuration = 1500;
specialAnimation = 0;
showWeaponAnimation = false;
suppressStunAnim = false;
super();
}
public function description():String{
return ("Blank skill description");
}
public function isPhysical():Boolean{
if (skillname == "Magic Attack"){
return (false);
};
if (((((((unarmedAttack) || (addWeaponDamage))) || (requiresMelee))) || (requiresRanged))){
return (true);
};
return (false);
}
public function getCostString():String{
var _local1:*;
if (((costsRemainingPower) && (power_cost))){
_local1 = (("Requires " + power_cost) + " power\n Uses remaining power");
} else {
if (costsRemainingPower){
_local1 = "Uses remaining power";
} else {
if (power_cost){
_local1 = (("Uses " + power_cost) + " power");
};
};
};
return (_local1);
}
public function getDamage():int{
var _local1:PlayerCharacter;
var _local2:int;
var _local3:*;
var _local4:*;
_local1 = null;
_local2 = damage;
if (((!((char_ref == null))) && ((char_ref is PlayerCharacter)))){
_local1 = PlayerCharacter(char_ref);
};
if (((unarmedAttack) && (!((_local1 == null))))){
return (_local1.getUnarmedDamage());
};
if (((addWeaponDamage) && (!((_local1 == null))))){
_local3 = _local1.getWeaponDamage();
_local3 = (_local3 * scaleWeaponDamage);
_local2 = (_local2 + Math.round(_local3));
};
if (((((((damage) && (!((_local1 == null))))) && (!((increasesWith == Skill.none))))) && (!((increasesWith == Skill.level))))){
_local4 = getStat(increasesWith);
if (_local4 > 0){
_local2 = (_local2 + getScaledDamage(_local4));
};
};
return (_local2);
}
public function scaleHeal(_arg1:int, _arg2:int=1):int{
var _local3:*;
var _local4:int;
var _local5:*;
if (_arg1 <= 0){
return (0);
};
_local3 = getStat(increasesWith);
if (_local3 > 0){
_local5 = (1 + (((_local3 - 1) * 0.05) * increaseRate));
_arg1 = Math.round((_arg1 * _local5));
};
_local4 = (_arg1 + Math.round((char_ref.getHealingBonus() / _arg2)));
return (_local4);
}
public function get power_cost():int{
return (this._power_cost);
}
private function getStat(_arg1:int):int{
var _local2:*;
_local2 = 0;
if (_arg1 == Skill.strength){
_local2 = char_ref.getStrength();
} else {
if (_arg1 == Skill.dexterity){
_local2 = char_ref.getDexterity();
} else {
if (_arg1 == Skill.endurance){
_local2 = char_ref.getEndurance();
} else {
if (_arg1 == Skill.intellect){
_local2 = char_ref.getIntellect();
};
};
};
};
return (_local2);
}
private function getScaledDamage(_arg1:int):int{
var _local2:int;
var _local3:Number;
_arg1--;
_local2 = (30 * (char_ref.level - 1));
_local3 = ((_arg1 * increaseRate) * (_local2 / ((PlayerCharacter.STATS_PER_LEVEL * char_ref.level) * 2)));
if (magicStrength > 0){
_local3 = (_local3 * magicStrength);
};
return (Math.round(_local3));
}
public function scalePoison():int{
if (((!((increasesWith == Skill.none))) && (!((increasesWith == Skill.weapon))))){
return ((poisonDamage + getScaledDamage(getStat(increasesWith))));
};
return (poisonDamage);
}
public function usable(_arg1=false):Boolean{
var _local2:*;
var _local3:*;
if ((char_ref is PlayerCharacter)){
_local2 = PlayerCharacter(char_ref).gear[Equipment.weapon];
_local3 = PlayerCharacter(char_ref).gear[Equipment.offhand];
if (((requiresWeapon) && ((_local2 == null)))){
return (false);
};
if (((requiresMelee) && (!((_local2 is MeleeWeapon))))){
return (false);
};
if (((requiresRanged) && (!((_local2 is RangedWeapon))))){
return (false);
};
if (((requiresShield) && (!((_local3 is Shield))))){
return (false);
};
};
if (char_ref.power < power_cost){
return (false);
};
return (true);
}
public function getDefianceHealth():int{
var _local1:*;
_local1 = 1;
if (((!((char_ref == null))) && ((char_ref is PlayerCharacter)))){
_local1 = char_ref.getEndurance();
};
return (_local1);
}
public function set power_cost(_arg1:int):void{
this._power_cost = _arg1;
}
public static function getBaseMagicDamage(_arg1:Number):int{
var _local2:*;
_local2 = Math.round(((Weapon.staff_base_damage * 2.2) * _arg1));
return (_local2);
}
}
}//package
Section 380
//SkillBar (SkillBar)
package {
import flash.events.*;
import flash.display.*;
public class SkillBar extends Sprite {
public var slot3:SkillIconEmpty;
var icons:Array;
public var slot2:SkillIconEmpty;
var selected_id:int;
var sih:SkillIconHighlight;
public var slot5:SkillIconEmpty;
public var slot1:SkillIconEmpty;
public var slot4:SkillIconEmpty;
public var slot6:SkillIconEmpty;
static const max_skills = 6;
public function SkillBar(){
icons = new Array();
super();
icons.length = 0;
selected_id = 0;
sih = new SkillIconHighlight();
addChild(sih);
}
public function incrementSkill(){
var _local1:*;
_local1 = (selected_id + 1);
if (_local1 >= icons.length){
_local1 = 0;
};
setSelectedSkill(_local1);
}
public function setSelectedSkill(_arg1:int):void{
sih.x = icons[_arg1].x;
sih.y = icons[_arg1].y;
selected_id = _arg1;
Battlefield(parent).powerPreview();
}
public function setSelectedSkillByPosition(_arg1:int):void{
var _local2:*;
_local2 = 0;
while (_local2 < icons.length) {
if (icons[_local2].skill_ref.position == _arg1){
setSelectedSkill(_local2);
Battlefield(parent).ValidTargetsForPlayer(icons[_local2].skill_ref);
break;
};
_local2++;
};
}
public function cleanup():void{
var _local1:*;
_local1 = 0;
while (_local1 < icons.length) {
icons[_local1].cleanup();
icons[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, skillClick);
_local1++;
};
}
public function decrementSkill(){
var _local1:*;
_local1 = (selected_id - 1);
if (_local1 < 0){
_local1 = (icons.length - 1);
};
setSelectedSkill(_local1);
}
public function addIcon(_arg1:SkillIcon):Boolean{
var _local2:*;
var _local3:*;
var _local4:SkillIconEmpty;
if (icons.length < max_skills){
_local4 = SkillIconEmpty(getChildByName(("slot" + _arg1.skill_ref.position)));
if (_local4 == null){
return (false);
};
_arg1.x = _local4.x;
_arg1.y = _local4.y;
icons.push(_arg1);
_arg1.setUsable(_arg1.skill_ref.usable());
addChild(_arg1);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, skillClick);
reOrderByPosition();
setSelectedSkill(0);
return (true);
};
return (false);
}
public function skillClick(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
_local2 = 0;
while (_local2 < icons.length) {
if (icons[_local2] == SkillIcon(_arg1.currentTarget)){
setSelectedSkill(_local2);
Battlefield(parent).ValidTargetsForPlayer(icons[_local2].skill_ref);
break;
};
_local2++;
};
}
public function getSelectedSkill():Skill{
var _local1:*;
_local1 = null;
if (selected_id < icons.length){
_local1 = SkillIcon(icons[selected_id]).skill_ref;
};
return (_local1);
}
private function reOrderByPosition():void{
var _local1:Array;
var _local2:*;
var _local3:*;
_local1 = new Array();
_local2 = 1;
while (_local2 <= 6) {
_local3 = 0;
while (_local3 < icons.length) {
if (icons[_local3].skill_ref.position == _local2){
_local1.push(icons[_local3]);
};
_local3++;
};
_local2++;
};
icons = _local1;
}
}
}//package
Section 381
//SkillIcon (SkillIcon)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class SkillIcon extends MovieClip {
var tooltip:SkillTooltip;
var char_ref:PlayerCharacter;
public var bg:SkillIconBG;
var skill_ref:Skill;
var tt_text:String;
var tt_title:String;
public function SkillIcon(){
bg.addEventListener(MouseEvent.MOUSE_OVER, mouseOverTarget);
bg.addEventListener(MouseEvent.MOUSE_MOVE, mouseOverTarget);
bg.addEventListener(MouseEvent.MOUSE_OUT, mouseOutTarget);
this.addEventListener(Event.ADDED_TO_STAGE, added);
}
function added(_arg1:Event):void{
this.addEventListener(Event.REMOVED_FROM_STAGE, removed);
}
public function setUsable(_arg1:Boolean):void{
if (_arg1){
bg.gotoAndStop(1);
} else {
bg.gotoAndStop(2);
};
}
public function setSkill(_arg1:Skill){
if (_arg1 == null){
return;
};
this.skill_ref = _arg1;
tt_text = skill_ref.description();
tt_title = skill_ref.skillname;
this.gotoAndStop(_arg1.iconFrame);
if (((!((skill_ref.char_ref == null))) && ((skill_ref.char_ref is PlayerCharacter)))){
this.char_ref = PlayerCharacter(skill_ref.char_ref);
};
}
function mouseOverTarget(_arg1:MouseEvent):void{
var _local2:Point;
var _local3:*;
var _local4:*;
var _local5 = ??pushnamespace
;
if (_arg1.buttonDown){
return;
};
if (tooltip == null){
if (!newTooltip()){
return;
};
};
_local2 = _arg1.target.localToGlobal(new Point(_arg1.target.mouseX, _arg1.target.mouseY));
_local3 = _local2.x;
_local4 = _local2.y;
_local5 = 0;
if (((_local2.x + tooltip.width) + _local5) > DungeonMain.APP_WIDTH){
_local3 = (_local3 + (DungeonMain.APP_WIDTH - ((_local2.x + tooltip.width) + _local5)));
};
if (((_local2.y + tooltip.height) + _local5) > DungeonMain.APP_HEIGHT){
_local4 = (_local4 + (DungeonMain.APP_HEIGHT - ((_local2.y + tooltip.height) + _local5)));
};
tooltip.x = _local3;
tooltip.y = _local4;
_arg1.updateAfterEvent();
}
private function newTooltip():Boolean{
var _local1:String;
var _local2:String;
var _local3:Boolean;
var _local4:Boolean;
_local3 = false;
if (skill_ref.requiresWeapon){
_local1 = "Requires Weapon";
if (char_ref.gear[Equipment.weapon] != null){
_local3 = true;
};
} else {
if (skill_ref.requiresMelee){
_local1 = "Requires Melee Weapon";
if (((!((char_ref.gear[Equipment.weapon] == null))) && ((char_ref.gear[Equipment.weapon] is MeleeWeapon)))){
_local3 = true;
};
} else {
if (skill_ref.requiresRanged){
_local1 = "Requires Ranged Weapon";
if (((!((char_ref.gear[Equipment.weapon] == null))) && ((char_ref.gear[Equipment.weapon] is RangedWeapon)))){
_local3 = true;
};
} else {
if (skill_ref.requiresShield){
_local1 = "Requires Shield";
if (((!((char_ref.gear[Equipment.offhand] == null))) && ((char_ref.gear[Equipment.offhand] is Shield)))){
_local3 = true;
};
};
};
};
};
if (skill_ref.increasesWith != Skill.none){
if (skill_ref.increasesWith == Skill.weapon){
_local2 = "Effect increases with Weapon Damage";
};
if (skill_ref.increasesWith == Skill.level){
_local2 = "Effect increases with Level";
};
if (skill_ref.increasesWith == Skill.strength){
_local2 = "Effect increases with Strength";
};
if (skill_ref.increasesWith == Skill.intellect){
_local2 = "Effect increases with Intellect";
};
if (skill_ref.increasesWith == Skill.endurance){
_local2 = "Effect increases with Endurance";
};
if (skill_ref.increasesWith == Skill.dexterity){
_local2 = "Effect increases with Dexterity";
};
};
_local4 = false;
if ((((char_ref.power > 0)) && ((char_ref.power >= skill_ref.power_cost)))){
_local4 = true;
};
tooltip = new SkillTooltip(tt_title, tt_text, _local1, _local3, _local2, skill_ref.getCostString(), _local4);
tooltip.mouseEnabled = false;
tooltip.mouseChildren = false;
tooltip.name = "tooltip_skill";
stage.addChild(tooltip);
return (true);
}
function mouseOutTarget(_arg1:MouseEvent):void{
if (((!((tooltip == null))) && (!((stage == null))))){
stage.removeChild(tooltip);
tooltip = null;
};
}
public function setOwner(_arg1:PlayerCharacter){
this.char_ref = _arg1;
}
function removed(_arg1:Event):void{
this.removeEventListener(Event.REMOVED_FROM_STAGE, removed);
if (this.tooltip != null){
mouseOutTarget(null);
};
}
public function cleanup():void{
this.removeEventListener(Event.ADDED_TO_STAGE, added);
bg.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverTarget);
bg.removeEventListener(MouseEvent.MOUSE_MOVE, mouseOverTarget);
bg.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutTarget);
}
}
}//package
Section 382
//SkillIconBG (SkillIconBG)
package {
import flash.display.*;
public class SkillIconBG extends MovieClip {
public function SkillIconBG(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package
Section 383
//SkillIconEmpty (SkillIconEmpty)
package {
import flash.display.*;
public dynamic class SkillIconEmpty extends Sprite {
}
}//package
Section 384
//SkillIconHighlight (SkillIconHighlight)
package {
import flash.display.*;
public dynamic class SkillIconHighlight extends MovieClip {
}
}//package
Section 385
//SkillsPreview (SkillsPreview)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class SkillsPreview extends MovieClip {
public var start2:SkillIcon;
public var start1:SkillIcon;
public var start3:SkillIcon;
public var class_label:TextField;
public var unlock4:SkillIcon;
public var unlock5:SkillIcon;
public var unlock2:SkillIcon;
public var unlock3:SkillIcon;
public var unlock8:SkillIcon;
public var unlock1:SkillIcon;
public var unlock6:SkillIcon;
public var unlock7:SkillIcon;
public var continue_btn:ContinueButton;
public function SkillsPreview(_arg1:PlayerCharacter=null){
var _local2:*;
var _local3:SkillIcon;
var _local4:String;
super();
_local2 = 0;
if (_arg1 != null){
class_label.text = (_arg1.classname + " Skills");
dm.embolden(class_label);
_local2 = 0;
while (_local2 < 11) {
_local4 = "null";
if (_arg1.skills[_local2] != null){
_local4 = _arg1.skills[_local2].skillname;
};
_local2++;
};
_local2 = 0;
while (_local2 < 3) {
_local3 = SkillIcon(getChildByName(("start" + String((_local2 + 1)))));
if (_local3 != null){
_local3.setOwner(_arg1);
_local3.setSkill(_arg1.skills[_local2]);
};
_local2++;
};
_local2 = 3;
while (_local2 <= 10) {
_local3 = SkillIcon(getChildByName(("unlock" + String((_local2 - 2)))));
if (_local3 != null){
_local3.setOwner(_arg1);
_local3.setSkill(_arg1.skills[_local2]);
};
_local2++;
};
};
continue_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
}
private function cleanup():void{
continue_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
}
function clickOkay(_arg1:MouseEvent):void{
continue_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
if (dm.stage != null){
dm.stage.removeChild(this);
cleanup();
};
}
}
}//package
Section 386
//SkillTooltip (SkillTooltip)
package {
import flash.text.*;
import flash.display.*;
public class SkillTooltip extends Sprite {
const red_text = 0xCC0000;
const white_text = 0xFFFFFF;
const grey_text = 0xCCCCCC;
const purple_text = 0x9900FF;
const green_text = 0x66FF00;
const blue_text = 26367;
public var tooltip_bg:ItemTooltipBg;
public var requires_label:TextField;
public var text_label:TextField;
public var title_label:TextField;
public var power_cost_label:TextField;
public var increase_label:TextField;
public function SkillTooltip(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:Boolean=false, _arg5:String="", _arg6:String="", _arg7:Boolean=false){
var _local8:*;
var _local9:*;
super();
if (_arg1 == null){
_arg1 = "Blank";
};
if (_arg2 == null){
_arg2 = "Tooltip contents failed to load.";
};
title_label.autoSize = TextFieldAutoSize.CENTER;
title_label.text = _arg1;
dm.embolden(title_label);
_local8 = title_label.height;
title_label.autoSize = TextFieldAutoSize.NONE;
if (_local8 == 16){
title_label.height = (_local8 + 5);
};
_local9 = ((title_label.y + title_label.height) + 4);
if (_arg3 != null){
requires_label.y = (_local9 - 3);
_local9 = (_local9 + (requires_label.height + 3));
requires_label.text = _arg3;
dm.embolden(requires_label);
if (_arg4){
requires_label.textColor = white_text;
} else {
requires_label.textColor = red_text;
};
} else {
removeChild(requires_label);
};
if (_arg5 != null){
increase_label.y = (_local9 - 3);
if (_arg3 != null){
increase_label.y = (increase_label.y - 4);
};
_local9 = (_local9 + (increase_label.height + 3));
increase_label.text = _arg5;
} else {
removeChild(increase_label);
};
text_label.y = (_local9 + 3);
text_label.text = _arg2;
text_label.autoSize = TextFieldAutoSize.CENTER;
_local9 = ((text_label.y + text_label.height) + 4);
if (_arg6 != null){
power_cost_label.y = (_local9 + 6);
_local9 = (_local9 + (2 + power_cost_label.height));
power_cost_label.text = _arg6;
dm.embolden(power_cost_label);
if (_arg7){
power_cost_label.textColor = white_text;
} else {
power_cost_label.textColor = red_text;
};
} else {
removeChild(power_cost_label);
};
tooltip_bg.height = (_local9 + 15);
}
}
}//package
Section 387
//slash1_sound (slash1_sound)
package {
import flash.media.*;
public dynamic class slash1_sound extends Sound {
}
}//package
Section 388
//sLichAE (sLichAE)
package {
public class sLichAE extends Skill {
public function sLichAE(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
rangedAttack = true;
hitsAllEnemies = true;
damage = Math.round((_arg1.damage / 4));
poisonDamage = Math.round((_arg1.damage / 6));
power_cost = 60;
skillname = "Poison Cloud";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.poison;
}
}
}//package
Section 389
//sLichStun (sLichStun)
package {
public class sLichStun extends Skill {
public function sLichStun(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 2;
rangedAttack = true;
hitsAllEnemies = true;
alwaysHits = true;
damage = Math.round((_arg1.damage / 4));
stun_percent = 60;
power_cost = 75;
skillname = "Fear of Death";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.fearDeath;
}
}
}//package
Section 390
//sLightningDrakeAE (sLightningDrakeAE)
package {
public class sLightningDrakeAE extends Skill {
public function sLightningDrakeAE(_arg1:Character){
char_ref = _arg1;
aiTopPriority = true;
damage = Math.round((_arg1.damage * 0.8));
power_cost = 60;
hitsAllMeleeRange = true;
skillname = "Lightning Arc";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.lightning;
}
}
}//package
Section 391
//sMageAE (sMageAE)
package {
public class sMageAE extends Skill {
public function sMageAE(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
aiCastLimit = 0;
magicStrength = 0.7;
damage = getBaseMagicDamage(magicStrength);
rangedAttack = true;
hitsAllEnemies = true;
power_cost = 55;
iconFrame = 40;
skillname = "Electrical Storm";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.lightning;
}
override public function description():String{
return ((("Magic area attack. Inflicts " + getDamage()) + " damage to all enemies."));
}
}
}//package
Section 392
//sMageArmor (sMageArmor)
package {
public class sMageArmor extends Skill {
public function sMageArmor(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 1;
damage = 0;
power_cost = 25;
targetsSelf = true;
buff_damageResist = 40;
iconFrame = 19;
skillname = "Arcane Armor";
verbage = ("summons " + skillname);
specialAnimation = PortraitAnimation.armorBuff;
}
override public function description():String{
return ((("Caster gains an additional " + buff_damageResist) + "% damage resistance for the remainder of the battle."));
}
}
}//package
Section 393
//sMageAttack (sMageAttack)
package {
public class sMageAttack extends Skill {
public function sMageAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
unlocked = true;
damage = 0;
addWeaponDamage = true;
rangedAttack = true;
power_cost = 0;
skillname = "Magic Attack";
if ((_arg1 is PlayerCharacter)){
verbage = (("fires a bolt from " + PlayerCharacter(char_ref).genderPossessive()) + " staff");
} else {
verbage = "fires a staff bolt";
};
iconFrame = 32;
specialAnimation = PortraitAnimation.mageAttack;
}
override public function description():String{
return ((("Ranged magic attack with equipped weapon. Causes " + getDamage()) + " damage.\n\n[Skill cannot be removed]"));
}
}
}//package
Section 394
//sMageBolt (sMageBolt)
package {
public class sMageBolt extends Skill {
public function sMageBolt(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
magicStrength = 1;
damage = getBaseMagicDamage(magicStrength);
rangedAttack = true;
power_cost = 25;
stun_percent = 25;
iconFrame = 37;
skillname = "Freeze";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.freeze;
}
override public function description():String{
return ((((("Ranged magic attack for " + getDamage()) + " damage. ") + stun_percent) + "% chance to stun the target."));
}
}
}//package
Section 395
//sMageDrain (sMageDrain)
package {
public class sMageDrain extends Skill {
public function sMageDrain(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
rangedAttack = true;
hitsAllEnemies = true;
damage = 0;
powerDamage = 20;
powerDrain = true;
power_cost = 50;
iconFrame = 54;
skillname = "Power Siphon";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.monsterDrain;
}
override public function description():String{
return ((("Drains up to " + powerDamage) + " power from each enemy."));
}
}
}//package
Section 396
//sMageExplosion (sMageExplosion)
package {
public class sMageExplosion extends Skill {
public function sMageExplosion(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
aiTargetsBackRow = true;
magicStrength = 0.8;
damage = getBaseMagicDamage(magicStrength);
rangedAttack = true;
power_cost = 35;
splashDamageMultiplier = 0.7;
skillname = "Fireball";
verbage = ("casts " + skillname);
iconFrame = 55;
specialAnimation = PortraitAnimation.explosion;
}
override public function description():String{
return ((((("Ranged magic attack for " + getDamage()) + " damage. Characters (including allies) in adjacent squares take ") + Math.round((getDamage() * splashDamageMultiplier))) + " damage."));
}
}
}//package
Section 397
//sMageInvisibility (sMageInvisibility)
package {
public class sMageInvisibility extends Skill {
public function sMageInvisibility(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 0;
damage = 0;
power_cost = 30;
targetsFriendlies = true;
rangedAttack = true;
hidesTarget = true;
iconFrame = 16;
skillname = "Invisibility";
verbage = ("casts " + skillname);
}
override public function description():String{
return ("Target may not be directly attacked until their next turn.");
}
}
}//package
Section 398
//sMagePrison (sMagePrison)
package {
public class sMagePrison extends Skill {
public function sMagePrison(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
rangedAttack = true;
stun_percent = 100;
alwaysHits = true;
tempDamageResistance = 40;
magicStrength = 0.3;
damage = getBaseMagicDamage(magicStrength);
power_cost = 30;
skillname = "Cosmic Prison";
verbage = ("conjures a " + skillname);
iconFrame = 39;
suppressStunAnim = true;
specialAnimation = PortraitAnimation.cosmicPrison;
}
override public function description():String{
return ((((("Encase the target in an arcane prison, causing " + getDamage()) + " damage. The target is stunned, but gains ") + tempDamageResistance) + "% damage resistance until their next turn. Does not miss.\n\n(Note: If the stun effect is resisted, the damage resistance bonus still applies)"));
}
}
}//package
Section 399
//sMageSword (sMageSword)
package {
public class sMageSword extends Skill {
public function sMageSword(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
power_cost = 75;
iconFrame = 4;
requiresMelee = true;
addWeaponDamage = true;
rangedAttack = true;
scaleWeaponDamage = 1;
attacksWithAccuracyMod = 0.75;
attacksMultipleTimes = 4;
skillname = "Ensorcelled Blade";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.playerMultiSlash;
}
override public function description():String{
return ((((((("Four ranged attacks with equipped melee weapon on any target. (" + getDamage()) + "x") + attacksMultipleTimes) + " damage)\nAttacks are made at ") + Math.round((attacksWithAccuracyMod * 100))) + "% of user's current accuracy."));
}
}
}//package
Section 400
//sMageThorns (sMageThorns)
package {
public class sMageThorns extends Skill {
public function sMageThorns(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
damage = 0;
power_cost = 25;
targetsFriendlies = true;
rangedAttack = true;
buff_damageReflect = 100;
iconFrame = 41;
skillname = "Flickering Flames";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.fireBuff;
}
override public function description():String{
return ((("Target reflects " + buff_damageReflect) + "% of damage taken back onto attacker for the remainder of the battle."));
}
}
}//package
Section 401
//sMageTouch (sMageTouch)
package {
public class sMageTouch extends Skill {
public function sMageTouch(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
magicStrength = 1.35;
damage = getBaseMagicDamage(magicStrength);
rangedAttack = false;
power_cost = 25;
iconFrame = 35;
skillname = "Incinerate";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.fire;
}
override public function description():String{
return ((("Close range magic attack. Causes " + getDamage()) + " damage to a single target in melee range."));
}
}
}//package
Section 402
//smite_effect (smite_effect)
package {
import flash.display.*;
public dynamic class smite_effect extends MovieClip {
public function smite_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.smite);
}
function frame45(){
this.stop();
}
}
}//package
Section 403
//sMonsterAttack (sMonsterAttack)
package {
public class sMonsterAttack extends Skill {
public function sMonsterAttack(_arg1:Character){
char_ref = _arg1;
damage = _arg1.damage;
power_cost = 0;
skillname = "Attack";
verbage = "attacks";
specialAnimation = PortraitAnimation.creatureSlash;
}
}
}//package
Section 404
//sMonsterAttackWeapon (sMonsterAttackWeapon)
package {
public class sMonsterAttackWeapon extends Skill {
public function sMonsterAttackWeapon(_arg1:Character){
char_ref = _arg1;
damage = _arg1.damage;
power_cost = 0;
skillname = "Attack";
verbage = "attacks";
specialAnimation = PortraitAnimation.creatureWeapon;
}
}
}//package
Section 405
//sMonsterCurse (sMonsterCurse)
package {
public class sMonsterCurse extends Skill {
public function sMonsterCurse(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 2;
rangedAttack = true;
damage = 0;
power_cost = 25;
curse = 0.5;
skillname = "Curse";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.curse;
}
}
}//package
Section 406
//sMonsterDoubleAttack (sMonsterDoubleAttack)
package {
public class sMonsterDoubleAttack extends Skill {
public function sMonsterDoubleAttack(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 0.65));
power_cost = 25;
attacksTwoTargets = true;
skillname = "Double Attack";
verbage = "attacks savagely";
specialAnimation = PortraitAnimation.creatureWeapon;
}
}
}//package
Section 407
//sMonsterFlightAttack (sMonsterFlightAttack)
package {
public class sMonsterFlightAttack extends Skill {
public function sMonsterFlightAttack(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = Math.round((_arg1.damage * 0.9));
power_cost = 30;
skillname = "Flying Attack";
verbage = "swoops down on the enemy";
specialAnimation = PortraitAnimation.swoopAttack;
}
}
}//package
Section 408
//sMonsterHeal (sMonsterHeal)
package {
public class sMonsterHeal extends Skill {
public function sMonsterHeal(_arg1:Character){
char_ref = _arg1;
targetsFriendlies = true;
rangedAttack = true;
healing = Math.round((_arg1.health_max * 0.6));
power_cost = 40;
removesPoison = true;
skillname = "Heal";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.heal;
}
override public function description():String{
return ((("Restore " + scaleHeal(healing)) + " health to one member of your party. Cures poison."));
}
}
}//package
Section 409
//sMonsterMagicAttack (sMonsterMagicAttack)
package {
public class sMonsterMagicAttack extends Skill {
public function sMonsterMagicAttack(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = _arg1.damage;
power_cost = 0;
skillname = "Arcane Bolt";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.monsterMagic;
}
}
}//package
Section 410
//sMonsterMagicCold (sMonsterMagicCold)
package {
public class sMonsterMagicCold extends Skill {
public function sMonsterMagicCold(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = _arg1.damage;
power_cost = 0;
skillname = "Deathly Chill";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.freeze;
}
}
}//package
Section 411
//sMonsterMeleeAE (sMonsterMeleeAE)
package {
public class sMonsterMeleeAE extends Skill {
public function sMonsterMeleeAE(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 0.8));
power_cost = 55;
hitsAllMeleeRange = true;
skillname = "Hew";
verbage = "hews through the enemy";
specialAnimation = PortraitAnimation.creatureWeapon;
}
override public function description():String{
return ("");
}
}
}//package
Section 412
//sMonsterPierce (sMonsterPierce)
package {
public class sMonsterPierce extends Skill {
public function sMonsterPierce(_arg1:Character){
char_ref = _arg1;
damage = Math.round((char_ref.damage * 0.9));
power_cost = 40;
piercesColumn = true;
skillname = "Spear Lunge";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.creatureSpear;
}
override public function description():String{
return ("");
}
}
}//package
Section 413
//sMonsterRangedAttack (sMonsterRangedAttack)
package {
public class sMonsterRangedAttack extends Skill {
public function sMonsterRangedAttack(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 1));
skillname = "Arrow";
rangedAttack = true;
power_cost = 20;
verbage = ("fires " + skillname);
specialAnimation = PortraitAnimation.monsterArrow;
}
}
}//package
Section 414
//sMonsterShadowStrike (sMonsterShadowStrike)
package {
public class sMonsterShadowStrike extends Skill {
public function sMonsterShadowStrike(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = Math.round((_arg1.damage * 1.1));
power_cost = 60;
skillname = "Shadowstrike";
verbage = "strikes from the shadows";
specialAnimation = PortraitAnimation.creatureSlash;
}
}
}//package
Section 415
//sMonsterStoneForm (sMonsterStoneForm)
package {
public class sMonsterStoneForm extends Skill {
public function sMonsterStoneForm(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
aiNotUnlessHurt = true;
targetsSelf = true;
cannotDie = 1;
healing = Math.round((0.5 * _arg1.health_max));
power_cost = 50;
skillname = "Stone Form";
verbage = ("enters " + skillname);
specialAnimation = PortraitAnimation.armorBuff;
}
}
}//package
Section 416
//SneakyScroll (SneakyScroll)
package {
public class SneakyScroll extends Consumable {
public function SneakyScroll(_arg1:int=1){
item_name = "Scroll of Deception";
sneaky = true;
item_rarity = Item.blue;
icon_frame = 84;
}
}
}//package
Section 417
//sNecroDrain (sNecroDrain)
package {
public class sNecroDrain extends Skill {
public function sNecroDrain(_arg1:Character){
char_ref = _arg1;
aiNotUnlessHurt = true;
rangedAttack = true;
targetsFriendlies = true;
damage = _arg1.damage;
vampiric_percent = Math.round((200 + (level * 1.5)));
powerDamage = 50;
powerDrain = true;
power_cost = 10;
skillname = "Drain Minion";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.monsterDrain;
}
override public function description():String{
return ("");
}
}
}//package
Section 418
//sNecroSponge (sNecroSponge)
package {
public class sNecroSponge extends Skill {
public function sNecroSponge(_arg1:Character){
char_ref = _arg1;
damage = 0;
power_cost = 30;
targetsFriendlies = true;
rangedAttack = true;
targetsFriendlyFrontRow = true;
makeDamageSponge = true;
skillname = "Servitude";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.protectAllies;
}
override public function description():String{
return ("");
}
}
}//package
Section 419
//sOrcAxeThrow (sOrcAxeThrow)
package {
public class sOrcAxeThrow extends Skill {
public function sOrcAxeThrow(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 1));
rangedAttack = true;
power_cost = 20;
skillname = "Axe";
verbage = ("throws " + skillname);
specialAnimation = PortraitAnimation.monsterThrown;
}
}
}//package
Section 420
//sOrcSponge (sOrcSponge)
package {
public class sOrcSponge extends Skill {
public function sOrcSponge(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 2;
damage = 0;
power_cost = 50;
targetsSelf = true;
makeDamageSponge = true;
skillname = "Challenge";
verbage = ("issues a " + skillname);
specialAnimation = PortraitAnimation.protectAllies;
}
override public function description():String{
return ("");
}
}
}//package
Section 421
//SoundButton (SoundButton)
package {
import flash.events.*;
import flash.display.*;
public class SoundButton extends MovieClip {
var sound_enabled:Boolean;// = true
public var control:VolumeControl;
public var sound_icon:SoundIcon;
public function SoundButton(){
sound_enabled = true;
super();
this.addEventListener(MouseEvent.MOUSE_DOWN, clickedOn);
iconTest();
}
public function removeControl(_arg1:Boolean=false):void{
if (control == null){
return;
};
if (!_arg1){
iconTest();
};
if (stage.contains(control)){
removeEventListener(Event.ENTER_FRAME, controlMouseOut);
stage.removeChild(control);
control.cleanup();
control = null;
};
}
function clickedOn(_arg1:MouseEvent):void{
if (control != null){
return;
};
createControl();
}
private function soundOn(_arg1:Boolean=false):void{
sound_icon.gotoAndStop("on");
}
public function cleanup():void{
this.removeEventListener(MouseEvent.MOUSE_DOWN, clickedOn);
removeControl(true);
}
private function createControl():void{
if (control != null){
removeControl();
};
control = new VolumeControl(this);
control.y = (this.y - (control.height - this.height));
control.x = this.x;
addEventListener(Event.ENTER_FRAME, controlMouseOut);
stage.addChild(control);
}
private function iconTest():void{
this.sound_enabled = (GlobalVolume.volumeSetting > 0);
if (sound_enabled){
soundOn();
} else {
soundOff();
};
}
private function soundOff(_arg1:Boolean=false):void{
sound_icon.gotoAndStop("off");
}
function controlMouseOut(_arg1:Event):void{
var _local2:Boolean;
_local2 = false;
if ((((control.mouseX > control.width)) || ((control.mouseX < 0)))){
_local2 = true;
};
if ((((control.mouseY > control.height)) || ((control.mouseY < 0)))){
_local2 = true;
};
if (_local2){
removeControl();
};
}
}
}//package
Section 422
//SoundControl (SoundControl)
package {
import flash.events.*;
import flash.media.*;
public class SoundControl {
var channels:Array;
var channel_ids:Array;
static const powerUp = 56;
static const miss_ranged = 111;
static const poisonDrake = 81;
static const equipGeneric = 1;
static const poison = 75;
static const equipSpear = 6;
static const battleStart = 40;
static const cosmicPrison = 74;
static const smite = 54;
static const equipStaff = 10;
static const freeze = 52;
static const curse = 76;
static const playerSlash = 64;
static const flames = 53;
static const playerArrow = 62;
static const monsterMagicAttack = 61;
static const destroyItem = 20;
static const playerMagicAttack = 60;
static const punch = 67;
static const equipShield = 9;
static const monsterClaws = 66;
static const equipSword = 2;
static const equipAxe = 3;
static const armorBuff = 90;
static const miss_melee = 110;
static const equipMace = 5;
static const thrown = 69;
static const lightning = 51;
static const potionSound = 15;
static const miss_magic = 113;
static const monsterArrow = 63;
static const monsterSlash = 65;
static const buff = 58;
static const blind = 78;
static const lootItem = 21;
static const writing = 41;
static const clone = 99;
static const heal = 57;
static const equipDagger = 4;
static const disintegrate = 68;
static const miss_thrown = 112;
static const debuff = 77;
static const hideSound = 16;
static const summon = 100;
static const basilisk = 82;
static const equipCrossbow = 8;
static const web = 80;
static const equipBow = 7;
static var volumeSetting = GlobalVolume.volumeFull;
public function SoundControl():void{
channels = new Array();
channel_ids = new Array();
}
public function playSoundForSkill(_arg1:Skill, _arg2:Character):void{
this.play(getSoundForSkill(_arg1, _arg2));
}
public function soundFromConstant(_arg1:int):Sound{
var _local2:Sound;
switch (_arg1){
case equipGeneric:
_local2 = new equip_sound();
break;
case equipStaff:
_local2 = new equip_staff_sound();
break;
case equipSword:
case equipDagger:
case equipMace:
case equipAxe:
case equipSpear:
_local2 = new equip_sword_sound();
break;
case equipBow:
case equipCrossbow:
_local2 = new equip_bow_sound();
break;
case equipShield:
_local2 = new equip_shield_sound();
break;
case potionSound:
_local2 = new potion_sound();
break;
case hideSound:
_local2 = new hide3_sound();
break;
case destroyItem:
_local2 = new destroy_item_sound();
break;
case lootItem:
_local2 = new coins_sound();
break;
case battleStart:
_local2 = new battle_start2();
break;
case writing:
_local2 = new writing_sound();
break;
case lightning:
_local2 = new lightning_sound();
break;
case freeze:
_local2 = new freeze_sound();
break;
case poison:
_local2 = new poison_sound();
break;
case flames:
_local2 = new flames_sound();
break;
case curse:
_local2 = new curse_sound();
break;
case blind:
_local2 = new blind_sound();
break;
case armorBuff:
_local2 = new armor_buff_sound();
break;
case punch:
_local2 = new punch_sound();
break;
case playerMagicAttack:
_local2 = new mage_staff_sound();
break;
case monsterMagicAttack:
_local2 = new monster_magic_sound();
break;
case powerUp:
_local2 = new power_up_sound();
break;
case playerArrow:
case monsterArrow:
_local2 = new arrow_fire_sound();
break;
case smite:
_local2 = new summon1_sound();
break;
case clone:
case summon:
_local2 = new summon2_sound();
break;
case web:
_local2 = new web_squirt_sound();
break;
case playerSlash:
case monsterSlash:
_local2 = new slash1_sound();
break;
case monsterClaws:
_local2 = new creature_slash_sound();
break;
case heal:
_local2 = new heal1_sound();
break;
case buff:
_local2 = new buff_chant_sound();
break;
case debuff:
_local2 = new debuff_sound();
break;
case cosmicPrison:
_local2 = new cosmic_prison_sound();
break;
case disintegrate:
_local2 = new disintegrate_sound();
break;
case thrown:
_local2 = new thrown_sound();
break;
case basilisk:
_local2 = new basilisk_sound();
break;
case poisonDrake:
_local2 = new poison_drake_sound();
break;
case miss_melee:
_local2 = new miss_melee_sound();
break;
case miss_ranged:
_local2 = new miss_ranged_sound();
break;
case miss_thrown:
_local2 = new miss_thrown_sound();
break;
case miss_magic:
_local2 = new miss_magic_sound();
break;
};
return (_local2);
}
public function getSoundForSkill(_arg1:Skill, _arg2:Character):int{
var _local3:*;
_local3 = -1;
if (_arg1.hidesTarget){
return (hideSound);
};
if (_arg1.curse){
return (curse);
};
if (_arg1.unarmedAttack){
return (punch);
};
if ((_arg1 is sBasiliskPetrify)){
return (basilisk);
};
if ((_arg1 is sPoisonDrakeAE)){
return (poisonDrake);
};
if ((_arg1 is sPoisonDrakeShot)){
return (poisonDrake);
};
switch (_arg1.specialAnimation){
};
return (_local3);
}
public function getMissSound(_arg1:Skill, _arg2:Character):int{
var _local3:*;
var _local4:int;
var _local5:*;
_local3 = -1;
if (_arg1.hidesTarget){
return (hideSound);
};
_local4 = _arg1.specialAnimation;
if ((((_arg2 is PlayerCharacter)) && (_arg1.showWeaponAnimation))){
_local5 = PlayerCharacter(_arg2).gear[Equipment.weapon];
if ((_local5 is MeleeWeapon)){
_local4 = PortraitAnimation.playerSlash;
} else {
if ((_local5 is MageWeapon)){
_local4 = PortraitAnimation.mageAttack;
} else {
if ((_local5 is RangedWeapon)){
_local4 = PortraitAnimation.playerArrow;
};
};
};
};
if (_arg1.unarmedAttack){
_local4 = PortraitAnimation.playerSlash;
};
switch (_local4){
case PortraitAnimation.creatureSlash:
case PortraitAnimation.creatureSpear:
case PortraitAnimation.creatureWeapon:
case PortraitAnimation.playerSlash:
case PortraitAnimation.playerMultiSlash:
case PortraitAnimation.playerPowerSlash:
_local3 = miss_melee;
break;
case PortraitAnimation.monsterThrown:
_local3 = miss_thrown;
break;
case PortraitAnimation.playerArrow:
case PortraitAnimation.monsterArrow:
case PortraitAnimation.cultistArrow:
_local3 = miss_ranged;
break;
};
if (_local3 == -1){
_local3 = miss_magic;
};
return (_local3);
}
private function idCheck(_arg1:int):Boolean{
var _local2:*;
if (_arg1 == playerSlash){
return (true);
};
if (_arg1 == monsterSlash){
return (true);
};
if (_arg1 == playerArrow){
return (true);
};
if (_arg1 == monsterArrow){
return (true);
};
_local2 = 0;
while (_local2 < channels.length) {
if (channel_ids[_local2] == _arg1){
if (channels[_local2].position < 0.5){
return (false);
};
};
_local2++;
};
return (true);
}
public function play(_arg1:int, _arg2:Number=1, _arg3:Boolean=false):void{
playSound(soundFromConstant(_arg1), _arg2, _arg1, _arg3);
}
public function playSound(_arg1:Sound, _arg2:Number=1, _arg3:int=-1, _arg4:Boolean=false):void{
var _local5:SoundChannel;
if (_arg1 == null){
return;
};
if (((!(_arg4)) && (!(idCheck(_arg3))))){
return;
};
_arg2 = (_arg2 * volumeSetting);
_local5 = _arg1.play(0, 1);
_local5.soundTransform = new SoundTransform(_arg2);
_local5.addEventListener(Event.SOUND_COMPLETE, finishedSound);
channels.push(_local5);
channel_ids.push(_arg3);
}
function finishedSound(_arg1:Event):void{
var _local2:*;
_local2 = 0;
while (_local2 < channels.length) {
if (channels[_local2] == _arg1.target){
channels[_local2].removeEventListener(Event.SOUND_COMPLETE, finishedSound);
channels.splice(_local2, 1);
channel_ids.splice(_local2, 1);
};
_local2++;
};
}
public function playMissSound(_arg1:Skill, _arg2:Character, _arg3:Boolean=false):void{
this.play(getMissSound(_arg1, _arg2), 1, _arg3);
}
}
}//package
Section 423
//SoundIcon (SoundIcon)
package {
import flash.display.*;
public dynamic class SoundIcon extends MovieClip {
}
}//package
Section 424
//sPassTurn (sPassTurn)
package {
public class sPassTurn extends Skill {
public function sPassTurn(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
iconFrame = 24;
skillname = "Pass Turn";
}
override public function description():String{
return ("This character takes no action this turn. Power regeneration rate is increased for this round.\n\n[Shortcut: space bar]");
}
}
}//package
Section 425
//sPoisonDrakeAE (sPoisonDrakeAE)
package {
public class sPoisonDrakeAE extends Skill {
public function sPoisonDrakeAE(_arg1:Character){
char_ref = _arg1;
skillname = "Venomous Cloud";
hitsAllMeleeRange = true;
power_cost = 55;
damage = Math.round((_arg1.damage * 0.5));
poisonDamage = Math.round((_arg1.damage * 0.5));
damageAccuracy = 25;
verbage = ("sprays a " + skillname);
specialAnimation = PortraitAnimation.poison;
}
}
}//package
Section 426
//sPoisonDrakeShot (sPoisonDrakeShot)
package {
public class sPoisonDrakeShot extends Skill {
public function sPoisonDrakeShot(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
power_cost = 30;
damage = Math.round((_arg1.damage * 0.7));
poisonDamage = Math.round((_arg1.damage * 0.5));
skillname = "Venom";
verbage = ("spits " + skillname);
specialAnimation = PortraitAnimation.poison;
}
}
}//package
Section 427
//sRangedAttack (sRangedAttack)
package {
public class sRangedAttack extends Skill {
public function sRangedAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
unlocked = true;
damage = 0;
power_cost = 0;
addWeaponDamage = true;
rangedAttack = true;
requiresRanged = true;
iconFrame = 15;
skillname = "Ranged Attack";
verbage = "shoots";
specialAnimation = PortraitAnimation.playerArrow;
}
override public function description():String{
return ((("Ranged attack with equipped weapon. Causes " + getDamage()) + " damage.\n\n[Skill cannot be removed]"));
}
}
}//package
Section 428
//sRangerAE (sRangerAE)
package {
public class sRangerAE extends Skill {
public function sRangerAE(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
aiCastLimit = 0;
damage = 0;
power_cost = 60;
rangedAttack = true;
requiresRanged = true;
hitsAllEnemies = true;
addWeaponDamage = true;
scaleWeaponDamage = 0.5;
attacksMultipleTimes = 2;
attacksWithAccuracyMod = 0.7;
iconFrame = 29;
skillname = "Hail of Arrows";
verbage = "unleashes a hail of arrows";
specialAnimation = PortraitAnimation.playerArrow;
}
override public function description():String{
return ((((((("Perform two ranged attacks for " + Math.round((scaleWeaponDamage * 100))) + "% weapon damage each (") + getDamage()) + " damage) on every enemy. Attacks are made at ") + Math.round((attacksWithAccuracyMod * 100))) + "% of user's current accuracy."));
}
}
}//package
Section 429
//sRangerFocus (sRangerFocus)
package {
public class sRangerFocus extends Skill {
public function sRangerFocus(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
targetsSelf = true;
power_cost = 0;
powerRestore = 25;
iconFrame = 46;
skillname = "Focus";
verbage = "finds inner focus";
specialAnimation = PortraitAnimation.gainPower;
}
override public function description():String{
return ((("Recover " + powerRestore) + " power."));
}
}
}//package
Section 430
//sRangerHaste (sRangerHaste)
package {
public class sRangerHaste extends Skill {
public function sRangerHaste(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
aiCastLimit = 1;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
alwaysHits = true;
buff_quickness = 20;
power_cost = 30;
iconFrame = 57;
skillname = "Swiftness";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.quicknessBuff;
}
override public function description():String{
return ((("All members of the party gain +" + buff_quickness) + " to Quickness for the remainder of the battle."));
}
}
}//package
Section 431
//sRangerHeal (sRangerHeal)
package {
public class sRangerHeal extends Skill {
public function sRangerHeal(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
nonCombat = true;
targetsFriendlies = true;
rangedAttack = true;
removesPoison = true;
healing = 20;
power_cost = 30;
iconFrame = 9;
skillname = "Healing Lore";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.heal;
}
override public function description():String{
return ((("Restore " + scaleHeal(healing)) + " health to one member of your party. Cures poison."));
}
}
}//package
Section 432
//sRangerHunt (sRangerHunt)
package {
public class sRangerHunt extends Skill {
public function sRangerHunt(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.weapon;
addWeaponDamage = true;
usesWeaponRange = true;
requiresWeapon = true;
damage = 0;
scaleWeaponDamage = 1.1;
damageBonusVsCreatureType = MonsterCharacter.creature;
damageBonusVsCreatureModifier = 2;
lethality = 10;
power_cost = 30;
iconFrame = 34;
skillname = "Hunter's Prowess";
verbage = ("uses " + skillname);
showWeaponAnimation = true;
}
override public function description():String{
return ((("Weapon attack for slightly increased (" + getDamage()) + ") damage, with +10% chance to kill target outright. Deals double damage to creatures."));
}
}
}//package
Section 433
//sRangerMultiMelee (sRangerMultiMelee)
package {
public class sRangerMultiMelee extends Skill {
public function sRangerMultiMelee(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.weapon;
damage = 0;
power_cost = 55;
iconFrame = 4;
requiresMelee = true;
addWeaponDamage = true;
scaleWeaponDamage = 1;
attacksMultipleTimes = 3;
attacksWithAccuracyMod = 0.6;
ignoresArmor = true;
skillname = "Force of Nature";
verbage = ("is a " + skillname);
specialAnimation = PortraitAnimation.playerMultiSlash;
}
override public function description():String{
return ((((((("Three melee weapon attacks on a single target at " + Math.round((attacksWithAccuracyMod * 100))) + "% of user's current accuracy. (") + getDamage()) + "x") + attacksMultipleTimes) + " damage.) Ignores armor."));
}
}
}//package
Section 434
//sRangerPenetrate (sRangerPenetrate)
package {
public class sRangerPenetrate extends Skill {
public function sRangerPenetrate(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.weapon;
damage = 0;
power_cost = 30;
scaleWeaponDamage = 1;
addWeaponDamage = true;
rangedAttack = true;
requiresRanged = true;
piercesColumn = true;
iconFrame = 33;
skillname = "Pierce";
verbage = "fires a piercing shot";
showWeaponAnimation = true;
}
override public function description():String{
return ((((("Ranged attack for " + (scaleWeaponDamage * 100)) + "% weapon damage (") + getDamage()) + "). Hits up to two targets in a vertical line."));
}
}
}//package
Section 435
//sRangerPoison (sRangerPoison)
package {
public class sRangerPoison extends Skill {
public function sRangerPoison(_arg1:Character){
char_ref = _arg1;
increasesWith = intellect;
increaseRate = 0.5;
damage = 0;
power_cost = 30;
poisonDamage = 4;
requiresRanged = true;
addWeaponDamage = true;
rangedAttack = true;
iconFrame = 3;
skillname = "Envenomed Arrow";
verbage = ("fires an " + skillname);
showWeaponAnimation = true;
specialAnimation = PortraitAnimation.poison;
}
override public function description():String{
return ((((("Ranged weapon attack (" + getDamage()) + " damage). Applies ") + scalePoison()) + " poison damage."));
}
}
}//package
Section 436
//sRangerRegen (sRangerRegen)
package {
public class sRangerRegen extends Skill {
public function sRangerRegen(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
targetsFriendlies = true;
rangedAttack = true;
removesPoison = true;
buff_resistPoison = 100;
buff_healthRegen = 10;
power_cost = 35;
iconFrame = 50;
skillname = "Nature's Balm";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.regenBuff;
}
override public function description():String{
return ((("Grant target immunity to poison and +" + scaleHeal(buff_healthRegen)) + " health regeneration per turn for the remainder of the battle."));
}
}
}//package
Section 437
//sRangerStun (sRangerStun)
package {
public class sRangerStun extends Skill {
public function sRangerStun(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
rangedAttack = true;
requiresRanged = true;
damage = 0;
addWeaponDamage = true;
scaleWeaponDamage = 0.75;
stun_percent = 100;
power_cost = 40;
iconFrame = 30;
skillname = "Pin";
verbage = "pins the enemy";
showWeaponAnimation = true;
}
override public function description():String{
return ((((("Ranged attack for " + (scaleWeaponDamage * 100)) + "% weapon damage (") + getDamage()) + ") which stuns the target."));
}
}
}//package
Section 438
//sRetreat (sRetreat)
package {
public class sRetreat extends Skill {
public function sRetreat(_arg1:Character){
char_ref = _arg1;
iconFrame = 23;
skillname = "Retreat";
}
override public function description():String{
return ("Retreat this character from the battle. Takes one full turn.\n\n[Shortcut: r]");
}
}
}//package
Section 439
//sRetreatAll (sRetreatAll)
package {
public class sRetreatAll extends Skill {
public function sRetreatAll(_arg1:Character){
char_ref = _arg1;
iconFrame = 25;
skillname = "Full Retreat";
}
override public function description():String{
return ("Retreat all characters from the battle. Takes one full turn.");
}
}
}//package
Section 440
//sRogueBlind (sRogueBlind)
package {
public class sRogueBlind extends Skill {
public function sRogueBlind(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
damage = 0;
power_cost = 40;
damageAccuracy = 50;
stun_percent = 50;
alwaysHits = true;
iconFrame = 11;
skillname = "Flash Powder";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.blind;
}
override public function description():String{
return ((((("Reduce target in melee range's accuracy by " + damageAccuracy) + "% for the remainder of the battle. ") + stun_percent) + "% chance to cause stun. Does not miss."));
}
}
}//package
Section 441
//sRogueCripple (sRogueCripple)
package {
public class sRogueCripple extends Skill {
public function sRogueCripple(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
power_cost = 25;
crippling = 100;
iconFrame = 53;
addWeaponDamage = true;
usesWeaponRange = true;
requiresWeapon = true;
nonLethal = true;
scaleWeaponDamage = 0.5;
skillname = "Cripple";
verbage = "launches a crippling attack";
showWeaponAnimation = true;
specialAnimation = PortraitAnimation.debuff;
}
override public function description():String{
return ((((("Special weapon attack for a maximum of " + (scaleWeaponDamage * 100)) + "% weapon damage (") + getDamage()) + "). This attack will not kill the target. If the attack hits, it reduces the target's Quickness to zero for the remainder of the battle, forcing them to act last in the turn order."));
}
}
}//package
Section 442
//sRogueCritical (sRogueCritical)
package {
public class sRogueCritical extends Skill {
public function sRogueCritical(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
power_cost = 30;
addWeaponDamage = true;
usesWeaponRange = true;
requiresWeapon = true;
ignoresArmor = true;
scaleWeaponDamage = 1.1;
iconFrame = 12;
skillname = "Pierce Defenses";
verbage = "finds a weak spot";
showWeaponAnimation = true;
}
override public function description():String{
return ((((("Weapon attack for " + Math.round((scaleWeaponDamage * 100))) + "% weapon damage (") + getDamage()) + "). Ignores target's armor."));
}
}
}//package
Section 443
//sRogueFinisher (sRogueFinisher)
package {
public class sRogueFinisher extends Skill {
public function sRogueFinisher(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
damage = 1;
requiresWeapon = true;
targetsStunned = true;
usesWeaponRange = true;
lethality = 100;
power_cost = 30;
iconFrame = 14;
skillname = "Coup de Grâce";
verbage = ("delivers the " + skillname);
showWeaponAnimation = true;
}
override public function description():String{
return ("Instantly kill a stunned enemy. Target must be in weapon range.");
}
}
}//package
Section 444
//sRogueHide (sRogueHide)
package {
public class sRogueHide extends Skill {
public function sRogueHide(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
aiCastLimit = 0;
damage = 0;
power_cost = 20;
targetsSelf = true;
hidesTarget = true;
targetDamageMod = 2;
iconFrame = 16;
skillname = "Hide";
verbage = "hides";
}
override public function description():String{
return ((((("User may not be target of attacks until " + char_ref.genderPossessive()) + " next turn.\n\nIn addition, user will inflict ") + Math.round((targetDamageMod * 100))) + "% of normal damage on their next attack."));
}
}
}//package
Section 445
//sRogueLuck (sRogueLuck)
package {
public class sRogueLuck extends Skill {
public function sRogueLuck(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
alwaysHits = true;
buff_accuracy = 30;
power_cost = 20;
iconFrame = 22;
skillname = "Thief's Luck";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.buff;
}
override public function description():String{
return ((("All members of the party gain +" + buff_accuracy) + " to accuracy for the remainder of the battle."));
}
}
}//package
Section 446
//sRogueOpening (sRogueOpening)
package {
public class sRogueOpening extends Skill {
public function sRogueOpening(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
aiCastLimit = 0;
damage = 0;
power_cost = 40;
iconFrame = 51;
requiresMelee = true;
addWeaponDamage = true;
scaleWeaponDamage = 0.75;
allyBonusAttack = true;
skillname = "Create Opening";
verbage = "creates an opening";
showWeaponAnimation = true;
}
override public function description():String{
return ((("Melee attack for 75% weapon damage (" + getDamage()) + "). If it hits, a random ally performs a bonus weapon attack on the target."));
}
}
}//package
Section 447
//sRoguePoison (sRoguePoison)
package {
public class sRoguePoison extends Skill {
public function sRoguePoison(_arg1:Character){
char_ref = _arg1;
increasesWith = intellect;
increaseRate = 0.5;
damage = 0;
power_cost = 20;
poisonDamage = 4;
iconFrame = 3;
requiresWeapon = true;
addWeaponDamage = true;
usesWeaponRange = true;
skillname = "Poison";
verbage = ("applies " + skillname);
showWeaponAnimation = true;
}
override public function description():String{
return ((((("Weapon attack (" + getDamage()) + " damage). Applies ") + scalePoison()) + " poison damage."));
}
}
}//package
Section 448
//sRogueSap (sRogueSap)
package {
public class sRogueSap extends Skill {
public function sRogueSap(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
power_cost = 40;
addWeaponDamage = true;
requiresMelee = true;
scaleWeaponDamage = 0.5;
powerDamage = 75;
iconFrame = 52;
skillname = "Sap Strength";
verbage = "saps the enemy's strength";
showWeaponAnimation = true;
specialAnimation = PortraitAnimation.powerDrain;
}
override public function description():String{
return ((((((("Melee attack for " + (scaleWeaponDamage * 100)) + "% weapon damage (") + getDamage()) + "). Reduces enemy power by ") + powerDamage) + "."));
}
}
}//package
Section 449
//sRogueSneakAttack (sRogueSneakAttack)
package {
public class sRogueSneakAttack extends Skill {
public function sRogueSneakAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
power_cost = 30;
iconFrame = 8;
requiresMelee = true;
addWeaponDamage = true;
rangedAttack = true;
scaleWeaponDamage = 1.2;
skillname = "Sneak Attack";
verbage = ("performs a " + skillname);
specialAnimation = PortraitAnimation.playerSlash;
}
override public function description():String{
return ((((("Melee weapon attack on any target for " + (scaleWeaponDamage * 100)) + "% weapon damage (") + getDamage()) + ")."));
}
}
}//package
Section 450
//sSummonVoidstalker (sSummonVoidstalker)
package {
public class sSummonVoidstalker extends Skill {
public function sSummonVoidstalker(_arg1:Character){
char_ref = _arg1;
aiTopPriority = true;
targetsEmpty = true;
summonsCreatureClass = new mVoidstalker(char_ref.level);
power_cost = 60;
skillname = "Void Portal";
verbage = ("casts " + skillname);
}
}
}//package
Section 451
//StairsGlow (StairsGlow)
package {
import flash.display.*;
public dynamic class StairsGlow extends MovieClip {
}
}//package
Section 452
//StatIncreaseButton (StatIncreaseButton)
package {
import flash.events.*;
import flash.display.*;
public class StatIncreaseButton extends MovieClip {
public function StatIncreaseButton(){
addEventListener(MouseEvent.MOUSE_OVER, mouseOverTarget);
addEventListener(MouseEvent.MOUSE_OUT, mouseOutTarget);
this.gotoAndStop(2);
}
function mouseOverTarget(_arg1:MouseEvent):void{
if (this.currentFrame == 1){
this.gotoAndStop(3);
};
}
function mouseOutTarget(_arg1:MouseEvent):void{
if (this.currentFrame == 3){
this.gotoAndStop(1);
};
}
public function cleanup():void{
removeEventListener(MouseEvent.MOUSE_OVER, mouseOverTarget);
removeEventListener(MouseEvent.MOUSE_OUT, mouseOutTarget);
}
}
}//package
Section 453
//StatNumber (StatNumber)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
import flash.geom.*;
public class StatNumber extends Sprite {
var tooltip:Tooltip;
public var nlabel:TextField;
var tt_text:String;
var tt_title:String;
public function StatNumber(){
nlabel.addEventListener(MouseEvent.MOUSE_OVER, mouseOverTarget);
nlabel.addEventListener(MouseEvent.MOUSE_MOVE, mouseOverTarget);
nlabel.addEventListener(MouseEvent.MOUSE_OUT, mouseOutTarget);
}
function mouseOverTarget(_arg1:MouseEvent):void{
var _local2:Point;
var _local3:*;
var _local4:*;
var _local5 = ??pushnamespace
;
if (_arg1.buttonDown){
return;
};
if (tooltip == null){
if (!newTooltip()){
return;
};
};
_local2 = _arg1.target.localToGlobal(new Point(_arg1.target.mouseX, _arg1.target.mouseY));
_local3 = _local2.x;
_local4 = _local2.y;
_local5 = 0;
if (((_local2.x + tooltip.width) + _local5) > DungeonMain.APP_WIDTH){
_local3 = (_local3 + (DungeonMain.APP_WIDTH - ((_local2.x + tooltip.width) + _local5)));
};
if (((_local2.y + tooltip.height) + _local5) > DungeonMain.APP_HEIGHT){
_local4 = (_local4 + (DungeonMain.APP_HEIGHT - ((_local2.y + tooltip.height) + _local5)));
};
tooltip.x = _local3;
tooltip.y = _local4;
_arg1.updateAfterEvent();
}
private function newTooltip():Boolean{
tooltip = new Tooltip(tt_title, tt_text);
tooltip.mouseEnabled = false;
tooltip.mouseChildren = false;
tooltip.name = "tooltip_stats";
stage.addChild(tooltip);
return (true);
}
function mouseOutTarget(_arg1:MouseEvent):void{
if (((!((tooltip == null))) && (!((stage == null))))){
stage.removeChild(tooltip);
tooltip = null;
};
}
public function cleanup():void{
nlabel.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverTarget);
nlabel.removeEventListener(MouseEvent.MOUSE_MOVE, mouseOverTarget);
nlabel.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutTarget);
mouseOutTarget(null);
}
}
}//package
Section 454
//StatusStatScroller (StatusStatScroller)
package {
import flash.text.*;
import flash.display.*;
public dynamic class StatusStatScroller extends MovieClip {
public var explore_rate:TextField;
public var party_defeats:TextField;
public var leaders:TextField;
public var clear_rate:TextField;
public var shrines_used:TextField;
public var member_deaths:TextField;
public function StatusStatScroller(){
addFrameScript(179, frame180);
}
function frame180(){
this.gotoAndPlay(1);
}
}
}//package
Section 455
//SteelEdgedWeapon (SteelEdgedWeapon)
package {
public class SteelEdgedWeapon extends MeleeWeapon {
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
if (prefixes[_local1][0] == "Sharp"){
base_damage_mod = 10;
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Sharp", 1.1]);
}
}
}//package
Section 456
//sTransformAetherguard (sTransformAetherguard)
package {
public class sTransformAetherguard extends Skill {
public function sTransformAetherguard(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
aiTopPriority = true;
aiAllowSuicide = true;
damage = _arg1.health_max;
targetsSelf = true;
transformCreatureClass = new mAetherguard(char_ref.level);
power_cost = 100;
skillname = "Breach Aether";
verbage = ("casts " + skillname);
}
}
}//package
Section 457
//sTrollHowl (sTrollHowl)
package {
public class sTrollHowl extends Skill {
public function sTrollHowl(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
hitsAllEnemies = true;
rangedAttack = true;
power_cost = 50;
alwaysHits = true;
powerDamage = 25;
stun_percent = 50;
skillname = "Howl of Rage";
verbage = ("lets loose a " + skillname);
specialAnimation = PortraitAnimation.powerDrain;
}
override public function description():String{
return ("");
}
}
}//package
Section 458
//summon_effect (summon_effect)
package {
import flash.display.*;
public dynamic class summon_effect extends MovieClip {
public function summon_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.summon);
}
function frame45(){
this.stop();
}
}
}//package
Section 459
//summon1_sound (summon1_sound)
package {
import flash.media.*;
public dynamic class summon1_sound extends Sound {
}
}//package
Section 460
//summon2_sound (summon2_sound)
package {
import flash.media.*;
public dynamic class summon2_sound extends Sound {
}
}//package
Section 461
//sUnarmedAttack (sUnarmedAttack)
package {
public class sUnarmedAttack extends Skill {
public function sUnarmedAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = strength;
unlocked = true;
unarmedAttack = true;
damage = 0;
power_cost = 0;
iconFrame = 18;
skillname = "Unarmed Attack";
verbage = "attacks";
specialAnimation = PortraitAnimation.playerUnarmed;
}
override public function description():String{
return ((("Unarmed melee attack. Inflicts " + PlayerCharacter(char_ref).getUnarmedDamage()) + " damage.\n\n[Skill cannot be removed]"));
}
}
}//package
Section 462
//sVampireAttack (sVampireAttack)
package {
public class sVampireAttack extends Skill {
public function sVampireAttack(_arg1:Character){
char_ref = _arg1;
damage = _arg1.damage;
rangedAttack = true;
power_cost = 30;
hasPortraitAnimation = true;
portraitAnimationFrame = 5;
skillname = "Vampire Bite";
verbage = "strikes from the shadows";
specialAnimation = PortraitAnimation.creatureSlash;
}
}
}//package
Section 463
//sWarlordBuff (sWarlordBuff)
package {
public class sWarlordBuff extends Skill {
public function sWarlordBuff(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
power_cost = 25;
buff_quickness = 20;
buff_damageResist = 10;
skillname = "Battle Plan";
verbage = ("implements " + skillname);
specialAnimation = PortraitAnimation.buff;
}
override public function description():String{
return ("");
}
}
}//package
Section 464
//sWarlordFocus (sWarlordFocus)
package {
public class sWarlordFocus extends Skill {
public function sWarlordFocus(_arg1:Character){
char_ref = _arg1;
aiNotUnlessLowPower = true;
aiCastLimit = 1;
targetsSelf = true;
power_cost = 0;
powerRestore = 75;
skillname = "Survey";
verbage = "surveys the battlefield";
specialAnimation = PortraitAnimation.gainPower;
}
override public function description():String{
return ((("Recover " + powerRestore) + " power."));
}
}
}//package
Section 465
//sWarlordRevive (sWarlordRevive)
package {
public class sWarlordRevive extends Skill {
public function sWarlordRevive(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 2;
targetsFriendlies = true;
rangedAttack = true;
healing = char_ref.health_max;
power_cost = 70;
removesPoison = true;
resurrects = true;
skillname = "Reinforce";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.revive;
}
override public function description():String{
return ((("Revives fallen party member with " + scaleHeal(healing)) + " health."));
}
}
}//package
Section 466
//sWarriorAdrenaline (sWarriorAdrenaline)
package {
public class sWarriorAdrenaline extends Skill {
public function sWarriorAdrenaline(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
aiCastLimit = 1;
targetsSelf = true;
power_cost = 25;
buff_resistStun = 100;
buff_damage = 1.3;
iconFrame = 48;
skillname = "Adrenaline";
verbage = "feels a burst of adrenaline";
specialAnimation = PortraitAnimation.buff;
}
override public function description():String{
return ((("User gains immunity to Stun effects and " + Math.round(((buff_damage - 1) * 100))) + "% bonus damage for the remainder of the battle."));
}
}
}//package
Section 467
//sWarriorAE (sWarriorAE)
package {
public class sWarriorAE extends Skill {
public function sWarriorAE(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
addWeaponDamage = true;
requiresMelee = true;
scaleWeaponDamage = 1;
power_cost = 60;
hitsAllMeleeRange = true;
iconFrame = 5;
skillname = "Cleave";
verbage = "cleaves through the enemy";
specialAnimation = PortraitAnimation.playerSlash;
}
override public function description():String{
return ((("Perform a melee weapon attack (" + getDamage()) + " damage) on all targets in melee range."));
}
}
}//package
Section 468
//sWarriorBloodlust (sWarriorBloodlust)
package {
public class sWarriorBloodlust extends Skill {
public function sWarriorBloodlust(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
addWeaponDamage = true;
scaleWeaponDamage = 1.1;
power_cost = 30;
requiresMelee = true;
gainPowerFromKill = 50;
iconFrame = 36;
skillname = "Bloodlust";
verbage = ("is filled with " + skillname);
showWeaponAnimation = true;
}
override public function description():String{
return ((((((("Melee attack for " + Math.round((scaleWeaponDamage * 100))) + "% weapon damage (") + getDamage()) + "). If this attack kills the target, the attacker gains ") + gainPowerFromKill) + " power."));
}
}
}//package
Section 469
//sWarriorDefiance (sWarriorDefiance)
package {
public class sWarriorDefiance extends Skill {
public function sWarriorDefiance(_arg1:Character){
char_ref = _arg1;
increasesWith = endurance;
aiCastLimit = 0;
damage = 0;
power_cost = 30;
targetsSelf = true;
cannotDie = 1;
iconFrame = 6;
skillname = "Defiance";
verbage = "shouts in defiance!";
specialAnimation = PortraitAnimation.defiance;
}
override public function description():String{
return ((((("User may not be reduced below " + getDefianceHealth()) + " health until ") + char_ref.genderPossessive()) + " next turn."));
}
}
}//package
Section 470
//sWarriorExecute (sWarriorExecute)
package {
public class sWarriorExecute extends Skill {
public function sWarriorExecute(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
aiCastLimit = 0;
damage = 0;
addWeaponDamage = true;
requiresMelee = true;
costsRemainingPower = true;
addsPowerToLethality = true;
power_cost = 0;
iconFrame = 14;
skillname = "Execute";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.playerPowerSlash;
}
override public function description():String{
return ((("Melee weapon attack (" + getDamage()) + " damage). The character's remaining power is added as percentage chance of killing the target outright."));
}
}
}//package
Section 471
//sWarriorHeal (sWarriorHeal)
package {
public class sWarriorHeal extends Skill {
public function sWarriorHeal(_arg1:Character){
char_ref = _arg1;
increasesWith = endurance;
increaseRate = 1.5;
nonCombat = true;
targetsSelf = true;
removesPoison = false;
healing = 20;
power_cost = 40;
iconFrame = 9;
skillname = "Resolve";
verbage = "finds the strength to continue";
specialAnimation = PortraitAnimation.heal;
}
override public function description():String{
return ((("Character recovers " + scaleHeal(healing)) + " health."));
}
}
}//package
Section 472
//sWarriorInspire (sWarriorInspire)
package {
public class sWarriorInspire extends Skill {
public function sWarriorInspire(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
aiCastLimit = 1;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
power_cost = 15;
buff_damage = 1.2;
iconFrame = 27;
skillname = "Inspire";
verbage = "inspires the party";
specialAnimation = PortraitAnimation.buff;
}
override public function description():String{
return ((("All party members' damage is increased by " + Math.round(((buff_damage - 1) * 100))) + "% for the remainder of the battle."));
}
}
}//package
Section 473
//sWarriorPowerAttack (sWarriorPowerAttack)
package {
public class sWarriorPowerAttack extends Skill {
public function sWarriorPowerAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
addWeaponDamage = true;
scaleWeaponDamage = 1.3;
power_cost = 40;
requiresMelee = true;
iconFrame = 4;
skillname = "Power Attack";
verbage = ("performs a " + skillname);
specialAnimation = PortraitAnimation.playerPowerSlash;
}
override public function description():String{
return ((("Melee attack for 130% weapon damage (" + getDamage()) + ")"));
}
}
}//package
Section 474
//sWarriorShield (sWarriorShield)
package {
public class sWarriorShield extends Skill {
public function sWarriorShield(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
damage = 0;
power_cost = 60;
targetsSelf = true;
requiresShield = true;
targetsFriendlyFrontRow = true;
makeDamageSponge = true;
tempDamageResistance = 25;
iconFrame = 19;
skillname = "Shield Wall";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.protectAllies;
}
override public function description():String{
return ((("User receives +" + tempDamageResistance) + "% damage resistance and is sole target of enemy attacks until his next turn. Other party members may still take damage from area attacks. Can only be used in the front row of the party formation."));
}
}
}//package
Section 475
//sWarriorSpeedAttack (sWarriorSpeedAttack)
package {
public class sWarriorSpeedAttack extends Skill {
public function sWarriorSpeedAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
aiCastLimit = 0;
damage = 0;
addWeaponDamage = true;
power_cost = 75;
requiresMelee = true;
extraSpeedAttacks = 2;
iconFrame = 49;
skillname = "Overwhelm";
verbage = "overwhelms the enemy";
specialAnimation = PortraitAnimation.playerMultiSlash;
}
override public function description():String{
return ((("Melee weapon attack (" + getDamage()) + " damage). If the warrior has higher Quickness than the target, warrior performs two bonus weapon attacks on the same target."));
}
}
}//package
Section 476
//sWeaponAttack (sWeaponAttack)
package {
public class sWeaponAttack extends Skill {
public function sWeaponAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
unlocked = true;
damage = 0;
addWeaponDamage = true;
power_cost = 0;
skillname = "Melee Attack";
requiresMelee = true;
verbage = "attacks";
iconFrame = 17;
specialAnimation = PortraitAnimation.playerSlash;
}
override public function description():String{
return ((("Melee attack with equipped weapon. Inflicts " + getDamage()) + " damage. \n\n[Skill cannot be removed]"));
}
}
}//package
Section 477
//sVoidCannon (sVoidCannon)
package {
public class sVoidCannon extends Skill {
public function sVoidCannon(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = Math.round((_arg1.damage * 1));
power_cost = 75;
ignoresArmor = true;
piercesColumn = true;
skillname = "Void Cannon";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.disintegrate;
}
}
}//package
Section 478
//sZombieAE (sZombieAE)
package {
public class sZombieAE extends Skill {
public function sZombieAE(_arg1:Character){
char_ref = _arg1;
skillname = "Noxious Cloud";
hitsAllMeleeRange = true;
power_cost = 65;
damage = Math.round((_arg1.damage / 4));
poisonDamage = Math.round((_arg1.damage / 4));
damageAccuracy = 25;
verbage = ("emits a " + skillname);
specialAnimation = PortraitAnimation.poison;
}
}
}//package
Section 479
//sZombieAttack (sZombieAttack)
package {
public class sZombieAttack extends Skill {
public function sZombieAttack(_arg1:Character){
char_ref = _arg1;
damage = _arg1.damage;
powerDamage = 10;
power_cost = 0;
skillname = "Attack";
verbage = "attacks";
specialAnimation = PortraitAnimation.creatureSlash;
}
}
}//package
Section 480
//tab_flash (tab_flash)
package {
import flash.display.*;
public dynamic class tab_flash extends MovieClip {
}
}//package
Section 481
//TakeButton (TakeButton)
package {
import flash.display.*;
public dynamic class TakeButton extends MovieClip {
}
}//package
Section 482
//ThinButtonBG (ThinButtonBG)
package {
import flash.events.*;
import flash.display.*;
public class ThinButtonBG extends MovieClip {
public function ThinButtonBG(){
this.gotoAndStop(1);
this.addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true);
this.addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true);
}
function added(_arg1:Event):void{
this.addEventListener(MouseEvent.MOUSE_OVER, mouseOn);
this.addEventListener(MouseEvent.MOUSE_MOVE, mouseOn);
this.addEventListener(MouseEvent.MOUSE_OUT, mouseOff);
}
function mouseOn(_arg1:MouseEvent):void{
this.gotoAndStop(2);
}
function mouseOff(_arg1:MouseEvent):void{
this.gotoAndStop(1);
}
function removed(_arg1:Event):void{
this.removeEventListener(MouseEvent.MOUSE_OVER, mouseOn);
this.removeEventListener(MouseEvent.MOUSE_MOVE, mouseOn);
this.removeEventListener(MouseEvent.MOUSE_OUT, mouseOff);
}
}
}//package
Section 483
//thrown_sound (thrown_sound)
package {
import flash.media.*;
public dynamic class thrown_sound extends Sound {
}
}//package
Section 484
//title_music (title_music)
package {
import flash.media.*;
public dynamic class title_music extends Sound {
}
}//package
Section 485
//TitleMusic (TitleMusic)
package {
public class TitleMusic extends Music {
public function TitleMusic(_arg1:Boolean=false):void{
var _local2:*;
super();
active = true;
_local2 = new title_music();
channel = _local2.play(0, 99999);
if (_arg1){
this.fadeIn(750);
} else {
this.setVolume(volumeSetting);
};
}
}
}//package
Section 486
//TitleScreen (TitleScreen)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class TitleScreen extends MovieClip {
public var biclops_logo:SimpleButton;
public var options_button:SimpleButton;
public var versionLabel:TextField;
public var credits_button:SimpleButton;
public var continue_button:SimpleButton;
public var maxgames_logo:SimpleButton;
public function TitleScreen():void{
var _local1:*;
super();
continue_button.addEventListener(MouseEvent.MOUSE_DOWN, continueClick);
credits_button.addEventListener(MouseEvent.MOUSE_DOWN, creditsClick);
options_button.addEventListener(MouseEvent.MOUSE_DOWN, optionsClick);
biclops_logo.addEventListener(MouseEvent.MOUSE_DOWN, biclopsClick);
maxgames_logo.addEventListener(MouseEvent.MOUSE_DOWN, maxgamesClick);
_local1 = ("v" + String(DungeonMain.GAME_VERSION));
if (DungeonMain.KONGREGATE){
_local1 = (_local1 + "k");
};
if (DungeonMain.MEEZ){
_local1 = (_local1 + "m");
};
versionLabel.text = _local1;
dmf.embolden(versionLabel);
if (DungeonMain.MEEZ){
removeChild(maxgames_logo);
};
}
function creditsClick(_arg1:MouseEvent):void{
addChild(new CreditsScreen());
}
public function continueClick(_arg1:MouseEvent):void{
cleanup();
DungeonMain(parent).loadGameMenu();
parent.removeChild(this);
}
function optionsClick(_arg1:MouseEvent):void{
addChild(new OptionsScreen());
}
private function cleanup():void{
continue_button.removeEventListener(MouseEvent.MOUSE_DOWN, continueClick);
credits_button.removeEventListener(MouseEvent.MOUSE_DOWN, creditsClick);
options_button.removeEventListener(MouseEvent.MOUSE_DOWN, optionsClick);
biclops_logo.removeEventListener(MouseEvent.MOUSE_DOWN, biclopsClick);
maxgames_logo.removeEventListener(MouseEvent.MOUSE_DOWN, maxgamesClick);
}
public function maxgamesClick(_arg1:MouseEvent):void{
dm.link("http://www.maxgames.com");
}
public function biclopsClick(_arg1:MouseEvent):void{
dm.link("http://www.biclopsgames.com");
}
}
}//package
Section 487
//Tooltip (Tooltip)
package {
import flash.text.*;
import flash.display.*;
public class Tooltip extends Sprite {
const red_text = 0xCC0000;
const white_text = 0xFFFFFF;
const grey_text = 0xCCCCCC;
const purple_text = 0x9900FF;
const green_text = 0x66FF00;
const blue_text = 26367;
public var tooltip_bg:ItemTooltipBg;
public var text_label:TextField;
public var title_label:TextField;
public function Tooltip(_arg1:String="", _arg2:String=""){
var _local3:*;
super();
if (_arg1 == null){
_arg1 = "Blank";
};
if (_arg2 == null){
_arg2 = "Tooltip contents failed to load.";
};
title_label.autoSize = TextFieldAutoSize.CENTER;
title_label.text = _arg1;
dm.embolden(title_label);
_local3 = title_label.height;
title_label.autoSize = TextFieldAutoSize.NONE;
if (_local3 == 16){
title_label.height = (_local3 + 6);
} else {
title_label.height = (_local3 + 4);
};
text_label.y = (title_label.y + title_label.height);
text_label.text = _arg2;
text_label.autoSize = TextFieldAutoSize.CENTER;
tooltip_bg.height = ((text_label.y + text_label.height) + 12);
}
}
}//package
Section 488
//transform_effect (transform_effect)
package {
import flash.display.*;
public dynamic class transform_effect extends MovieClip {
public function transform_effect(){
addFrameScript(0, frame1, 14, frame15, 44, frame45);
}
function frame15(){
if (((!((this.parent == null))) && ((this.parent is CharacterPortrait)))){
CharacterPortrait(this.parent).update();
};
}
function frame1(){
dm.sound.play(SoundControl.summon);
}
function frame45(){
this.stop();
}
}
}//package
Section 489
//TreasureCategoryTake (TreasureCategoryTake)
package {
import flash.events.*;
import flash.display.*;
public class TreasureCategoryTake extends MovieClip {
public var take:Boolean;
public function TreasureCategoryTake():void{
take = true;
addEventListener(MouseEvent.MOUSE_DOWN, clicked);
}
function clicked(_arg1:MouseEvent):void{
take = !(take);
if (take){
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
};
TreasureReport(parent).takeSettingsChange(TreasureCategoryTake(_arg1.currentTarget));
}
public function cleanup():void{
removeEventListener(MouseEvent.MOUSE_DOWN, clicked);
}
}
}//package
Section 490
//TreasureChest (TreasureChest)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
import flash.utils.*;
public class TreasureChest extends MovieClip {
var looted:Boolean;// = false
var loot:Array;
var chest_level;// = 1
var hordeLoot:Boolean;// = false
static const POTION_CHANCE = 20;
public function TreasureChest(_arg1:Party=null, _arg2:int=1, _arg3:int=0, _arg4=false, _arg5:Boolean=false){
var _local6:Boolean;
var _local7:Item;
loot = new Array();
chest_level = 1;
looted = false;
hordeLoot = false;
super();
addFrameScript(59, frame60, 74, frame75);
chest_level = _arg2;
hordeLoot = _arg5;
if (_arg4){
_local6 = false;
while (((!(_local6)) && (!((_arg1 == null))))) {
_local7 = getItem(_arg2, Item.purple);
if (testItemSuitable(_local7, _arg1)){
loot.push(_local7);
_local6 = true;
};
};
};
GenerateItems(_arg1, _arg3);
}
function frame75(){
this.stop();
}
private function GenerateItems(_arg1:Party, _arg2:int){
var _local3:*;
var _local4:*;
var _local5:Item;
var _local6:*;
_local3 = 0;
_local4 = 0;
_local5 = null;
if (!_arg2){
_arg2 = DungeonMain.RandomNum(2, 5);
};
if (dm.party != null){
if (dm.party.extreme){
_local6 = Math.round((_arg2 / 2));
_arg2 = _local6;
};
};
while (loot.length < _arg2) {
_local5 = getItem(chest_level, -1, false, hordeLoot);
if (testItemSuitable(_local5, _arg1)){
loot.push(_local5);
};
};
}
function onFadeComplete(_arg1:TimerEvent):void{
if (parent != null){
parent.removeChild(this);
};
}
public function fade():void{
var _local1:Timer;
looted = true;
this.gotoAndPlay(61);
_local1 = new Timer(500, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, onFadeComplete);
_local1.start();
}
function frame60(){
this.gotoAndPlay(1);
}
public static function getItem(_arg1:int=-1, _arg2:int=-1, _arg3:Boolean=false, _arg4:Boolean=false):Item{
var _local5:Array;
var _local6:*;
_local5 = GetItemTypes(_arg1, _arg2, _arg3);
_local6 = DungeonMain.RandomNum(0, _local5.length);
return (_local5[_local6]);
}
public static function testItemSuitable(_arg1:Item, _arg2:Party):Boolean{
var _local3:int;
var _local4:*;
if (_arg1 == null){
return (false);
};
if (_arg2 != null){
_local3 = 0;
_local4 = 0;
while (_local4 < _arg2.members.length) {
if (_arg2.members[_local4].itemUsable(_arg1)){
_local3++;
};
_local4++;
};
if (_local3 > 0){
return (true);
};
return (false);
};
return (false);
}
private static function GetItemTypes(_arg1:int, _arg2:int=0, _arg3:Boolean=false, _arg4:Boolean=false):Array{
var _local5:Array;
var _local6:*;
_local5 = new Array();
if (((_arg3) || ((((_arg2 == -1)) && ((dm.randomNum(0, 100) < POTION_CHANCE)))))){
_local5.push(new PotionHealthSmall(_arg1));
_local5.push(new PotionHealthSmall(_arg1));
_local5.push(new PotionHealthSmall(_arg1));
_local5.push(new PotionPowerSmall(_arg1));
_local5.push(new PotionPowerSmall(_arg1));
_local5.push(new PotionPowerSmall(_arg1));
_local5.push(new PotionRejuveSmall(_arg1));
_local5.push(new PotionRejuveSmall(_arg1));
_local5.push(new PotionReviveWeak(_arg1));
_local5.push(new PotionReviveWeak(_arg1));
_local5.push(new PotionHealth(_arg1));
_local5.push(new PotionHealth(_arg1));
_local5.push(new PotionPower(_arg1));
_local5.push(new PotionPower(_arg1));
_local5.push(new PotionRejuve(_arg1));
_local5.push(new PotionRevive(_arg1));
_local5.push(new PotionPoisonResist(_arg1));
_local5.push(new PotionShield(_arg1));
_local5.push(new PotionQuickness(_arg1));
if (_arg4){
_local5.push(new SneakyScroll());
_local5.push(new SneakyScroll());
};
return (_local5);
};
_local5.push(new iDagger(_arg1, _arg2));
_local5.push(new iDagger(_arg1, _arg2));
_local5.push(new iSword(_arg1, _arg2));
_local5.push(new iSword(_arg1, _arg2));
_local5.push(new iAxe(_arg1, _arg2));
_local5.push(new iSpear(_arg1, _arg2));
_local5.push(new iMace(_arg1, _arg2));
_local5.push(new iMace(_arg1, _arg2));
_local5.push(new iStaff(_arg1, _arg2));
_local5.push(new iStaff(_arg1, _arg2));
_local5.push(new iBow(_arg1, _arg2));
_local5.push(new iBow(_arg1, _arg2));
_local5.push(new iCrossbow(_arg1, _arg2));
_local5.push(new iPlateHelmet(_arg1, _arg2));
_local5.push(new iPlateGloves(_arg1, _arg2));
_local5.push(new iPlateGreaves(_arg1, _arg2));
_local5.push(new iPlateBoots(_arg1, _arg2));
_local5.push(new iPlateBreastplate(_arg1, _arg2));
_local5.push(new iLeatherHat(_arg1, _arg2));
_local5.push(new iLeatherGloves(_arg1, _arg2));
_local5.push(new iLeatherLegs(_arg1, _arg2));
_local5.push(new iLeatherBoots(_arg1, _arg2));
_local5.push(new iLeatherChest(_arg1, _arg2));
_local5.push(new iClothHat(_arg1, _arg2));
_local5.push(new iClothGloves(_arg1, _arg2));
_local5.push(new iClothLegs(_arg1, _arg2));
_local5.push(new iClothShoes(_arg1, _arg2));
_local5.push(new iClothRobe(_arg1, _arg2));
_local6 = 0;
while (_local6 < 2) {
_local5.push(new iRing(_arg1, _arg2));
_local5.push(new iCloak(_arg1, _arg2));
_local6++;
};
_local5.push(new iQuiver(_arg1, _arg2));
_local5.push(new iParryingDagger(_arg1, _arg2));
_local5.push(new iShieldBuckler(_arg1, _arg2));
_local5.push(new iShieldTower(_arg1, _arg2));
_local5.push(new iCenser(_arg1, _arg2));
return (_local5);
}
}
}//package
Section 491
//TreasureReport (TreasureReport)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class TreasureReport extends MovieClip {
const icon_gap = 4;
var chest:TreasureChest;
var icons:Array;
public var bg:MovieClip;
public var discard_btn:DiscardButton;
public var selected_count_label:TextField;
public var weapons_lbl:TextField;
public var consumables_lbl:TextField;
public var take_btn:TakeButton;
public var armor_lbl:TextField;
var tooltipController:ItemTooltipController;
public function TreasureReport(_arg1:String="chest"){
icons = new Array();
super();
tooltipController = new ItemTooltipController();
this.addEventListener(Event.ADDED_TO_STAGE, added);
this.gotoAndStop(_arg1);
}
function added(_arg1:Event):void{
this.removeEventListener(Event.ADDED_TO_STAGE, added);
if (stage != null){
tooltipController.stage = stage;
};
}
private function updateSelectedCount():void{
var _local1:int;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < icons.length) {
if (icons[_local2].taking){
_local1++;
};
_local2++;
};
selected_count_label.text = ((("SELECTED: " + String(_local1)) + "/") + String(icons.length));
}
public function takeSettingsChange(_arg1:TreasureCategoryTake):void{
}
public function drawIcons():void{
var _local1:Array;
var _local2:Array;
var _local3:Array;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7 = ??pushnamespace
;
var _local8 = ??pushnamespace
;
var _local9:*;
var _local10:*;
_local1 = new Array();
_local2 = new Array();
_local3 = new Array();
_local4 = 0;
while (_local4 < icons.length) {
if (icons[_local4] == null){
} else {
if (icons[_local4].item_ref == null){
} else {
if ((icons[_local4].item_ref is Consumable)){
_local1.push(icons[_local4]);
} else {
if ((icons[_local4].item_ref is Weapon)){
_local2.push(icons[_local4]);
} else {
if ((icons[_local4].item_ref is Equipment)){
_local3.push(icons[_local4]);
};
};
};
icons[_local4].addEventListener(MouseEvent.MOUSE_DOWN, clickedIcon);
};
};
_local4++;
};
_local5 = 0;
_local6 = 0;
_local7 = 18;
_local8 = 54;
_local9 = (consumables_lbl.y + _local7);
_local10 = (bg.x + 30);
removeChild(consumables_lbl);
removeChild(weapons_lbl);
removeChild(armor_lbl);
_local4 = 0;
while (_local4 < _local1.length) {
_local5 = Math.floor((_local4 / 12));
_local6 = (_local4 % 12);
_local1[_local4].x = (_local10 + (_local6 * (_local1[_local4].width + icon_gap)));
_local1[_local4].y = (_local9 + (_local5 * (_local1[_local4].height + icon_gap)));
addChild(_local1[_local4]);
_local4++;
};
if (_local1.length){
_local9 = (_local9 + _local8);
addChild(consumables_lbl);
};
weapons_lbl.y = (_local9 - _local7);
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = Math.floor((_local4 / 12));
_local6 = (_local4 % 12);
_local2[_local4].x = (_local10 + (_local6 * (_local2[_local4].width + icon_gap)));
_local2[_local4].y = (_local9 + (_local5 * (_local2[_local4].height + icon_gap)));
addChild(_local2[_local4]);
_local4++;
};
if (_local2.length){
_local9 = (_local9 + _local8);
addChild(weapons_lbl);
};
armor_lbl.y = (_local9 - _local7);
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = Math.floor((_local4 / 12));
_local6 = (_local4 % 12);
_local3[_local4].x = (_local10 + (_local6 * (_local3[_local4].width + icon_gap)));
_local3[_local4].y = (_local9 + (_local5 * (_local3[_local4].height + icon_gap)));
addChild(_local3[_local4]);
_local4++;
};
if (_local3.length){
addChild(armor_lbl);
};
updateSelectedCount();
}
public function addItemRef(_arg1:Item):int{
var _local2:*;
var _local3:*;
var _local4:*;
if (_arg1 == null){
return (-1);
};
_local2 = 0;
_local3 = 0;
while (_local3 < Party.MAX_OVERFLOW) {
if (icons[_local3] == null){
_local4 = new InventoryIcon(_arg1, tooltipController);
icons.push(_local4);
return (_local3);
};
_local3++;
};
return (-1);
}
public function cleanup():void{
var _local1:*;
_local1 = 0;
while (_local1 < icons.length) {
icons[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, clickedIcon);
icons[_local1].cleanup();
_local1++;
};
}
function clickedIcon(_arg1:MouseEvent):void{
var _local2:InventoryIcon;
_local2 = InventoryIcon(_arg1.currentTarget);
_local2.taking = !(_local2.taking);
if (_local2.taking){
_local2.alpha = 1;
} else {
_local2.alpha = 0.3;
};
updateSelectedCount();
}
}
}//package
Section 492
//TypeButton (TypeButton)
package {
import flash.display.*;
public dynamic class TypeButton extends MovieClip {
}
}//package
Section 493
//UndoChangesButton (UndoChangesButton)
package {
import flash.display.*;
public dynamic class UndoChangesButton extends SimpleButton {
}
}//package
Section 494
//WarningDialog (WarningDialog)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class WarningDialog extends MovieClip {
public var yes_btn:ContinueButton;
public var dlg_text:TextField;
public function WarningDialog(_arg1:String=""){
if (_arg1.length){
setText(_arg1);
};
yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
}
private function cleanup():void{
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
}
public function setText(_arg1:String):void{
dlg_text.text = _arg1;
}
function clickOkay(_arg1:MouseEvent):void{
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
if (parent != null){
parent.removeChild(this);
cleanup();
} else {
if (((!((stage == null))) && (stage.contains(this)))){
stage.removeChild(this);
cleanup();
};
};
}
}
}//package
Section 495
//Weapon (Weapon)
package {
public class Weapon extends Equipment {
const spear_base_damage = 20;
const sword_base_damage = 15;
const dagger_base_damage = 14;
const bow_base_damage = 14;
const crossbow_base_damage = 16;
const mace_base_damage = 14;
const axe_base_damage = 22;
private var _twoHanded:Boolean;// = false
var base_damage_mod:int;// = 0
var base_damage:int;
private var _damage:int;
static const staff_base_damage = 14;
public function Weapon(){
_twoHanded = false;
base_damage_mod = 0;
super();
item_name = "Weapon";
slot = weapon;
grey_name = "Damaged";
}
public function scaleWeaponDamageForLevelNew(_arg1:int):int{
var _local2:int;
var _local3 = ??pushnamespace
;
var _local4:Number;
var _local5:Number;
var _local6:*;
_local2 = MonsterCharacter.getHealthMax(item_level, false);
_local3 = 5;
_local4 = (_local2 / _local3);
_local5 = (_arg1 / sword_base_damage);
_local6 = Math.round((_local4 * _local5));
return (_local6);
}
override public function generateItem(_arg1:int):void{
var _local2:*;
var _local3:*;
_local2 = false;
_local3 = false;
if (item_rarity == Item.green){
if (DungeonMain.RandomNum(0, 100) >= 50){
_local3 = true;
} else {
_local2 = true;
};
};
getItemModifiers();
if ((((item_rarity == Item.blue)) || (_local3))){
prefix = rollForPrefix(item_rarity);
};
if ((((item_rarity == Item.blue)) || (_local2))){
suffix = rollForSuffix(item_rarity);
};
if (prefix >= 0){
applyPrefix();
};
if (suffix >= 0){
applySuffix();
};
damage = scaleWeaponDamageForLevel((base_damage * (1 + (base_damage_mod / 100))));
material = rollForMaterial(item_rarity, materials);
scaleDamageForMaterial(material);
if (material >= 0){
item_name = ((materials[material] + " ") + item_name);
};
if (prefix >= 0){
item_name = ((prefixes[prefix][0] + " ") + item_name);
};
if (suffix >= 0){
item_name = ((item_name + " of ") + suffixes[suffix][0]);
};
if (item_rarity == Item.grey){
item_name = ((grey_name + " ") + item_name);
};
}
override public function getItemTypeString(){
return ("Weapon");
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
public function get damage():int{
return (this._damage);
}
public function set twoHanded(_arg1:Boolean):void{
this._twoHanded = _arg1;
}
override public function itemStatsString(_arg1:String):String{
_arg1 = (_arg1 + (String(damage) + " damage\n"));
return (super.itemStatsString(_arg1));
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
public function scaleWeaponDamageForLevel(_arg1:int):int{
return (scaleWeaponDamageForLevelNew(_arg1));
}
public function get twoHanded():Boolean{
return (this._twoHanded);
}
public function set damage(_arg1:int):void{
this._damage = _arg1;
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Staggering", 10]);
prefixes.push(["Unerring", base_accuracy_bonus]);
prefixes.push(["Venomous", 5]);
prefixes.push(["Blinding", 10]);
prefixes.push(["Vampiric", 10]);
suffixes.push(["Lethality", 1]);
}
public function scaleDamageForMaterial(_arg1:int){
var _local2:*;
_local2 = (1 + ((_arg1 + 1) * 0.05));
damage = Math.round((damage * _local2));
}
}
}//package
Section 496
//web_effect (web_effect)
package {
import flash.display.*;
public dynamic class web_effect extends MovieClip {
public function web_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.web);
}
function frame45(){
this.stop();
}
}
}//package
Section 497
//web_squirt_sound (web_squirt_sound)
package {
import flash.media.*;
public dynamic class web_squirt_sound extends Sound {
}
}//package
Section 498
//VolumeControl (VolumeControl)
package {
import flash.events.*;
import flash.display.*;
public class VolumeControl extends MovieClip {
var soundButton:SoundButton;
public var sfx_selector:VolumeSelector;
public var volCloseButton:SimpleButton;
public var global_selector:VolumeSelector;
public var music_selector:VolumeSelector;
public function VolumeControl(_arg1:SoundButton=null):void{
init(_arg1);
if (volCloseButton != null){
volCloseButton.addEventListener(MouseEvent.MOUSE_DOWN, clickedClose);
};
}
public function init(_arg1:SoundButton=null):void{
if (_arg1 != null){
soundButton = _arg1;
};
global_selector.setFrameFromVolume(GlobalVolume.volumeSetting);
sfx_selector.setFrameFromVolume(SoundControl.volumeSetting);
music_selector.setFrameFromVolume(Music.volumeSetting);
}
function clickedClose(_arg1:MouseEvent):void{
volCloseButton.removeEventListener(MouseEvent.MOUSE_DOWN, clickedClose);
if (soundButton != null){
soundButton.removeControl();
} else {
if (stage != null){
this.cleanup();
stage.removeChild(this);
};
};
}
public function adjustVolume(_arg1:VolumeSelector, _arg2:Number):void{
if (_arg1 == global_selector){
GlobalVolume.setVolume(_arg2);
dm.main.saveInterface();
} else {
if (_arg1 == music_selector){
dm.main.setMusicVolume(_arg2);
dm.main.saveInterface();
} else {
if (_arg1 == sfx_selector){
SoundControl.volumeSetting = _arg2;
dm.main.saveInterface();
};
};
};
}
public function cleanup():void{
global_selector.cleanup();
sfx_selector.cleanup();
music_selector.cleanup();
}
}
}//package
Section 499
//VolumeControlMenu (VolumeControlMenu)
package {
public dynamic class VolumeControlMenu extends VolumeControl {
}
}//package
Section 500
//VolumeSelector (VolumeSelector)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class VolumeSelector extends MovieClip {
const vol_mid = 2;
const vol_off = 0;
const vol_full = 3;
const vol_low = 1;
public var mid:TextField;
public var low:TextField;
public var off:TextField;
public var full:TextField;
public function VolumeSelector():void{
full.addEventListener(MouseEvent.MOUSE_DOWN, clickFull);
mid.addEventListener(MouseEvent.MOUSE_DOWN, clickMid);
low.addEventListener(MouseEvent.MOUSE_DOWN, clickLow);
off.addEventListener(MouseEvent.MOUSE_DOWN, clickOff);
}
private function setFrame(_arg1:int):void{
if (_arg1 == vol_off){
this.gotoAndStop("off");
} else {
if (_arg1 == vol_low){
this.gotoAndStop("low");
} else {
if (_arg1 == vol_mid){
this.gotoAndStop("mid");
} else {
if (_arg1 == vol_full){
this.gotoAndStop("full");
};
};
};
};
}
function clickFull(_arg1:MouseEvent):void{
var _local2:*;
_local2 = GlobalVolume.volumeFull;
setFrame(vol_full);
if (parent != null){
VolumeControl(parent).adjustVolume(this, _local2);
};
}
function clickLow(_arg1:MouseEvent):void{
var _local2:*;
_local2 = GlobalVolume.volumeLow;
setFrame(vol_low);
if (parent != null){
VolumeControl(parent).adjustVolume(this, _local2);
};
}
function clickMid(_arg1:MouseEvent):void{
var _local2:*;
_local2 = GlobalVolume.volumeMid;
setFrame(vol_mid);
if (parent != null){
VolumeControl(parent).adjustVolume(this, _local2);
};
}
public function cleanup():void{
full.removeEventListener(MouseEvent.MOUSE_DOWN, clickFull);
mid.removeEventListener(MouseEvent.MOUSE_DOWN, clickMid);
low.removeEventListener(MouseEvent.MOUSE_DOWN, clickLow);
off.removeEventListener(MouseEvent.MOUSE_DOWN, clickOff);
}
function clickOff(_arg1:MouseEvent):void{
var _local2:*;
_local2 = GlobalVolume.volumeOff;
setFrame(vol_off);
if (parent != null){
VolumeControl(parent).adjustVolume(this, _local2);
};
}
public function setFrameFromVolume(_arg1:Number):void{
if (_arg1 == GlobalVolume.volumeOff){
setFrame(vol_off);
} else {
if (_arg1 == GlobalVolume.volumeLow){
setFrame(vol_low);
} else {
if (_arg1 == GlobalVolume.volumeMid){
setFrame(vol_mid);
} else {
if (_arg1 == GlobalVolume.volumeFull){
setFrame(vol_full);
};
};
};
};
}
}
}//package
Section 501
//VolumeSelectorMenu (VolumeSelectorMenu)
package {
public dynamic class VolumeSelectorMenu extends VolumeSelector {
}
}//package
Section 502
//writing_sound (writing_sound)
package {
import flash.media.*;
public dynamic class writing_sound extends Sound {
}
}//package
Section 503
//YesButton (YesButton)
package {
import flash.display.*;
public dynamic class YesButton extends MovieClip {
}
}//package