// Generated by dart2js (, csp, intern-composite-values), the Dart to JavaScript compiler version: 3.10.3. // The code supports the following hooks: // dartPrint(message): // if this function is defined it is called instead of the Dart [print] // method. // // dartMainRunner(main, args): // if this function is defined, the Dart [main] method will not be invoked // directly. Instead, a closure that will invoke [main], and its arguments // [args] is passed to [dartMainRunner]. // // dartDeferredLibraryLoader(uri, successCallback, errorCallback, loadId, loadPriority): // if this function is defined, it will be called when a deferred library // is loaded. It should load and eval the javascript of `uri`, and call // successCallback. If it fails to do so, it should call errorCallback with // an error. The loadId argument is the deferred import that resulted in // this uri being loaded. The loadPriority argument is an arbitrary argument // string forwarded from the 'dart2js:load-priority' pragma option. // dartDeferredLibraryMultiLoader(uris, successCallback, errorCallback, loadId, loadPriority): // if this function is defined, it will be called when a deferred library // is loaded. It should load and eval the javascript of every URI in `uris`, // and call successCallback. If it fails to do so, it should call // errorCallback with an error. The loadId argument is the deferred import // that resulted in this uri being loaded. The loadPriority argument is an // arbitrary argument string forwarded from the 'dart2js:load-priority' // pragma option. // // dartCallInstrumentation(id, qualifiedName): // if this function is defined, it will be called at each entry of a // method or constructor. Used only when compiling programs with // --experiment-call-instrumentation. (function dartProgram() { function copyProperties(from, to) { var keys = Object.keys(from); for (var i = 0; i < keys.length; i++) { var key = keys[i]; to[key] = from[key]; } } function mixinPropertiesHard(from, to) { var keys = Object.keys(from); for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!to.hasOwnProperty(key)) { to[key] = from[key]; } } } function mixinPropertiesEasy(from, to) { Object.assign(to, from); } var supportsDirectProtoAccess = function() { var cls = function() { }; cls.prototype = {p: {}}; var object = new cls(); if (!(Object.getPrototypeOf(object) && Object.getPrototypeOf(object).p === cls.prototype.p)) return false; try { if (typeof navigator != "undefined" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Chrome/") >= 0) return true; if (typeof version == "function" && version.length == 0) { var v = version(); if (/^\d+\.\d+\.\d+\.\d+$/.test(v)) return true; } } catch (_) { } return false; }(); function inherit(cls, sup) { cls.prototype.constructor = cls; cls.prototype["$is" + cls.name] = cls; if (sup != null) { if (supportsDirectProtoAccess) { Object.setPrototypeOf(cls.prototype, sup.prototype); return; } var clsPrototype = Object.create(sup.prototype); copyProperties(cls.prototype, clsPrototype); cls.prototype = clsPrototype; } } function inheritMany(sup, classes) { for (var i = 0; i < classes.length; i++) { inherit(classes[i], sup); } } function mixinEasy(cls, mixin) { mixinPropertiesEasy(mixin.prototype, cls.prototype); cls.prototype.constructor = cls; } function mixinHard(cls, mixin) { mixinPropertiesHard(mixin.prototype, cls.prototype); cls.prototype.constructor = cls; } function lazy(holder, name, getterName, initializer) { var uninitializedSentinel = holder; holder[name] = uninitializedSentinel; holder[getterName] = function() { if (holder[name] === uninitializedSentinel) { holder[name] = initializer(); } holder[getterName] = function() { return this[name]; }; return holder[name]; }; } function lazyFinal(holder, name, getterName, initializer) { var uninitializedSentinel = holder; holder[name] = uninitializedSentinel; holder[getterName] = function() { if (holder[name] === uninitializedSentinel) { var value = initializer(); if (holder[name] !== uninitializedSentinel) { A.throwLateFieldADI(name); } holder[name] = value; } var finalValue = holder[name]; holder[getterName] = function() { return finalValue; }; return finalValue; }; } function makeConstList(list, rti) { if (rti != null) A._setArrayType(list, rti); list.$flags = 7; return list; } function convertToFastObject(properties) { function t() { } t.prototype = properties; new t(); return properties; } function convertAllToFastObject(arrayOfObjects) { for (var i = 0; i < arrayOfObjects.length; ++i) { convertToFastObject(arrayOfObjects[i]); } } var functionCounter = 0; function instanceTearOffGetter(isIntercepted, parameters) { var cache = null; return isIntercepted ? function(receiver) { if (cache === null) cache = A.closureFromTearOff(parameters); return new cache(receiver, this); } : function() { if (cache === null) cache = A.closureFromTearOff(parameters); return new cache(this, null); }; } function staticTearOffGetter(parameters) { var cache = null; return function() { if (cache === null) cache = A.closureFromTearOff(parameters).prototype; return cache; }; } var typesOffset = 0; function tearOffParameters(container, isStatic, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, needsDirectAccess) { if (typeof funType == "number") { funType += typesOffset; } return {co: container, iS: isStatic, iI: isIntercepted, rC: requiredParameterCount, dV: optionalParameterDefaultValues, cs: callNames, fs: funsOrNames, fT: funType, aI: applyIndex || 0, nDA: needsDirectAccess}; } function installStaticTearOff(holder, getterName, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex) { var parameters = tearOffParameters(holder, true, false, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, false); var getterFunction = staticTearOffGetter(parameters); holder[getterName] = getterFunction; } function installInstanceTearOff(prototype, getterName, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, needsDirectAccess) { isIntercepted = !!isIntercepted; var parameters = tearOffParameters(prototype, false, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, !!needsDirectAccess); var getterFunction = instanceTearOffGetter(isIntercepted, parameters); prototype[getterName] = getterFunction; } function setOrUpdateInterceptorsByTag(newTags) { var tags = init.interceptorsByTag; if (!tags) { init.interceptorsByTag = newTags; return; } copyProperties(newTags, tags); } function setOrUpdateLeafTags(newTags) { var tags = init.leafTags; if (!tags) { init.leafTags = newTags; return; } copyProperties(newTags, tags); } function updateTypes(newTypes) { var types = init.types; var length = types.length; types.push.apply(types, newTypes); return length; } function updateHolder(holder, newHolder) { copyProperties(newHolder, holder); return holder; } var hunkHelpers = function() { var mkInstance = function(isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, applyIndex) { return function(container, getterName, name, funType) { return installInstanceTearOff(container, getterName, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, [name], funType, applyIndex, false); }; }, mkStatic = function(requiredParameterCount, optionalParameterDefaultValues, callNames, applyIndex) { return function(container, getterName, name, funType) { return installStaticTearOff(container, getterName, requiredParameterCount, optionalParameterDefaultValues, callNames, [name], funType, applyIndex); }; }; return {inherit: inherit, inheritMany: inheritMany, mixin: mixinEasy, mixinHard: mixinHard, installStaticTearOff: installStaticTearOff, installInstanceTearOff: installInstanceTearOff, _instance_0u: mkInstance(0, 0, null, ["call$0"], 0), _instance_1u: mkInstance(0, 1, null, ["call$1"], 0), _instance_2u: mkInstance(0, 2, null, ["call$2"], 0), _instance_0i: mkInstance(1, 0, null, ["call$0"], 0), _instance_1i: mkInstance(1, 1, null, ["call$1"], 0), _instance_2i: mkInstance(1, 2, null, ["call$2"], 0), _static_0: mkStatic(0, null, ["call$0"], 0), _static_1: mkStatic(1, null, ["call$1"], 0), _static_2: mkStatic(2, null, ["call$2"], 0), makeConstList: makeConstList, lazy: lazy, lazyFinal: lazyFinal, updateHolder: updateHolder, convertToFastObject: convertToFastObject, updateTypes: updateTypes, setOrUpdateInterceptorsByTag: setOrUpdateInterceptorsByTag, setOrUpdateLeafTags: setOrUpdateLeafTags}; }(); function initializeDeferredHunk(hunk) { typesOffset = init.types.length; hunk(hunkHelpers, init, holders, $); } var J = { makeDispatchRecord(interceptor, proto, extension, indexability) { return {i: interceptor, p: proto, e: extension, x: indexability}; }, getNativeInterceptor(object) { var proto, objectProto, $constructor, interceptor, t1, record = object[init.dispatchPropertyName]; if (record == null) if ($.initNativeDispatchFlag == null) { A.initNativeDispatch(); record = object[init.dispatchPropertyName]; } if (record != null) { proto = record.p; if (false === proto) return record.i; if (true === proto) return object; objectProto = Object.getPrototypeOf(object); if (proto === objectProto) return record.i; if (record.e === objectProto) throw A.wrapException(A.UnimplementedError$("Return interceptor for " + A.S(proto(object, record)))); } $constructor = object.constructor; if ($constructor == null) interceptor = null; else { t1 = $._JS_INTEROP_INTERCEPTOR_TAG; if (t1 == null) t1 = $._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag("_$dart_js"); interceptor = $constructor[t1]; } if (interceptor != null) return interceptor; interceptor = A.lookupAndCacheInterceptor(object); if (interceptor != null) return interceptor; if (typeof object == "function") return B.JavaScriptFunction_methods; proto = Object.getPrototypeOf(object); if (proto == null) return B.PlainJavaScriptObject_methods; if (proto === Object.prototype) return B.PlainJavaScriptObject_methods; if (typeof $constructor == "function") { t1 = $._JS_INTEROP_INTERCEPTOR_TAG; if (t1 == null) t1 = $._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag("_$dart_js"); Object.defineProperty($constructor, t1, {value: B.UnknownJavaScriptObject_methods, enumerable: false, writable: true, configurable: true}); return B.UnknownJavaScriptObject_methods; } return B.UnknownJavaScriptObject_methods; }, JSArray_JSArray$fixed($length, $E) { if ($length < 0 || $length > 4294967295) throw A.wrapException(A.RangeError$range($length, 0, 4294967295, "length", null)); return J.JSArray_JSArray$markFixed(new Array($length), $E); }, JSArray_JSArray$growable($length, $E) { if ($length < 0) throw A.wrapException(A.ArgumentError$("Length must be a non-negative integer: " + $length, null)); return A._setArrayType(new Array($length), $E._eval$1("JSArray<0>")); }, JSArray_JSArray$allocateGrowable($length, $E) { if ($length < 0) throw A.wrapException(A.ArgumentError$("Length must be a non-negative integer: " + $length, null)); return A._setArrayType(new Array($length), $E._eval$1("JSArray<0>")); }, JSArray_JSArray$markFixed(allocation, $E) { var t1 = A._setArrayType(allocation, $E._eval$1("JSArray<0>")); t1.$flags = 1; return t1; }, JSArray__compareAny(a, b) { var t1 = type$.Comparable_dynamic; return J.compareTo$1$ns(t1._as(a), t1._as(b)); }, JSString__isWhitespace(codeUnit) { if (codeUnit < 256) switch (codeUnit) { case 9: case 10: case 11: case 12: case 13: case 32: case 133: case 160: return true; default: return false; } switch (codeUnit) { case 5760: case 8192: case 8193: case 8194: case 8195: case 8196: case 8197: case 8198: case 8199: case 8200: case 8201: case 8202: case 8232: case 8233: case 8239: case 8287: case 12288: case 65279: return true; default: return false; } }, JSString__skipLeadingWhitespace(string, index) { var t1, codeUnit; for (t1 = string.length; index < t1;) { codeUnit = string.charCodeAt(index); if (codeUnit !== 32 && codeUnit !== 13 && !J.JSString__isWhitespace(codeUnit)) break; ++index; } return index; }, JSString__skipTrailingWhitespace(string, index) { var t1, index0, codeUnit; for (t1 = string.length; index > 0; index = index0) { index0 = index - 1; if (!(index0 < t1)) return A.ioore(string, index0); codeUnit = string.charCodeAt(index0); if (codeUnit !== 32 && codeUnit !== 13 && !J.JSString__isWhitespace(codeUnit)) break; } return index; }, getInterceptor$(receiver) { if (typeof receiver == "number") { if (Math.floor(receiver) == receiver) return J.JSInt.prototype; return J.JSNumNotInt.prototype; } if (typeof receiver == "string") return J.JSString.prototype; if (receiver == null) return J.JSNull.prototype; if (typeof receiver == "boolean") return J.JSBool.prototype; if (Array.isArray(receiver)) return J.JSArray.prototype; if (typeof receiver != "object") { if (typeof receiver == "function") return J.JavaScriptFunction.prototype; if (typeof receiver == "symbol") return J.JavaScriptSymbol.prototype; if (typeof receiver == "bigint") return J.JavaScriptBigInt.prototype; return receiver; } if (receiver instanceof A.Object) return receiver; return J.getNativeInterceptor(receiver); }, getInterceptor$asx(receiver) { if (typeof receiver == "string") return J.JSString.prototype; if (receiver == null) return receiver; if (Array.isArray(receiver)) return J.JSArray.prototype; if (typeof receiver != "object") { if (typeof receiver == "function") return J.JavaScriptFunction.prototype; if (typeof receiver == "symbol") return J.JavaScriptSymbol.prototype; if (typeof receiver == "bigint") return J.JavaScriptBigInt.prototype; return receiver; } if (receiver instanceof A.Object) return receiver; return J.getNativeInterceptor(receiver); }, getInterceptor$ax(receiver) { if (receiver == null) return receiver; if (Array.isArray(receiver)) return J.JSArray.prototype; if (typeof receiver != "object") { if (typeof receiver == "function") return J.JavaScriptFunction.prototype; if (typeof receiver == "symbol") return J.JavaScriptSymbol.prototype; if (typeof receiver == "bigint") return J.JavaScriptBigInt.prototype; return receiver; } if (receiver instanceof A.Object) return receiver; return J.getNativeInterceptor(receiver); }, getInterceptor$n(receiver) { if (typeof receiver == "number") return J.JSNumber.prototype; if (receiver == null) return receiver; if (!(receiver instanceof A.Object)) return J.UnknownJavaScriptObject.prototype; return receiver; }, getInterceptor$ns(receiver) { if (typeof receiver == "number") return J.JSNumber.prototype; if (typeof receiver == "string") return J.JSString.prototype; if (receiver == null) return receiver; if (!(receiver instanceof A.Object)) return J.UnknownJavaScriptObject.prototype; return receiver; }, getInterceptor$s(receiver) { if (typeof receiver == "string") return J.JSString.prototype; if (receiver == null) return receiver; if (!(receiver instanceof A.Object)) return J.UnknownJavaScriptObject.prototype; return receiver; }, get$hashCode$(receiver) { return J.getInterceptor$(receiver).get$hashCode(receiver); }, get$iterator$ax(receiver) { return J.getInterceptor$ax(receiver).get$iterator(receiver); }, get$length$asx(receiver) { return J.getInterceptor$asx(receiver).get$length(receiver); }, get$runtimeType$(receiver) { return J.getInterceptor$(receiver).get$runtimeType(receiver); }, $eq$(receiver, a0) { if (receiver == null) return a0 == null; if (typeof receiver != "object") return a0 != null && receiver === a0; return J.getInterceptor$(receiver).$eq(receiver, a0); }, $index$asx(receiver, a0) { if (typeof a0 === "number") if (Array.isArray(receiver) || typeof receiver == "string" || A.isJsIndexable(receiver, receiver[init.dispatchPropertyName])) if (a0 >>> 0 === a0 && a0 < receiver.length) return receiver[a0]; return J.getInterceptor$asx(receiver).$index(receiver, a0); }, $indexSet$ax(receiver, a0, a1) { return J.getInterceptor$ax(receiver).$indexSet(receiver, a0, a1); }, add$1$ax(receiver, a0) { return J.getInterceptor$ax(receiver).add$1(receiver, a0); }, allMatches$1$s(receiver, a0) { return J.getInterceptor$s(receiver).allMatches$1(receiver, a0); }, clamp$2$n(receiver, a0, a1) { return J.getInterceptor$n(receiver).clamp$2(receiver, a0, a1); }, compareTo$1$ns(receiver, a0) { return J.getInterceptor$ns(receiver).compareTo$1(receiver, a0); }, elementAt$1$ax(receiver, a0) { return J.getInterceptor$ax(receiver).elementAt$1(receiver, a0); }, toList$0$ax(receiver) { return J.getInterceptor$ax(receiver).toList$0(receiver); }, toString$0$(receiver) { return J.getInterceptor$(receiver).toString$0(receiver); }, toStringAsFixed$1$n(receiver, a0) { return J.getInterceptor$n(receiver).toStringAsFixed$1(receiver, a0); }, where$1$ax(receiver, a0) { return J.getInterceptor$ax(receiver).where$1(receiver, a0); }, Interceptor: function Interceptor() { }, JSBool: function JSBool() { }, JSNull: function JSNull() { }, JavaScriptObject: function JavaScriptObject() { }, LegacyJavaScriptObject: function LegacyJavaScriptObject() { }, PlainJavaScriptObject: function PlainJavaScriptObject() { }, UnknownJavaScriptObject: function UnknownJavaScriptObject() { }, JavaScriptFunction: function JavaScriptFunction() { }, JavaScriptBigInt: function JavaScriptBigInt() { }, JavaScriptSymbol: function JavaScriptSymbol() { }, JSArray: function JSArray(t0) { this.$ti = t0; }, JSArraySafeToStringHook: function JSArraySafeToStringHook() { }, JSUnmodifiableArray: function JSUnmodifiableArray(t0) { this.$ti = t0; }, ArrayIterator: function ArrayIterator(t0, t1, t2) { var _ = this; _.__interceptors$_iterable = t0; _.__interceptors$_length = t1; _.__interceptors$_index = 0; _.__interceptors$_current = null; _.$ti = t2; }, JSNumber: function JSNumber() { }, JSInt: function JSInt() { }, JSNumNotInt: function JSNumNotInt() { }, JSString: function JSString() { } }, A = {JS_CONST: function JS_CONST() { }, LateError$fieldADI(fieldName) { return new A.LateError("Field '" + fieldName + "' has been assigned during initialization."); }, LateError$fieldNI(fieldName) { return new A.LateError("Field '" + fieldName + "' has not been initialized."); }, LateError$localNI(localName) { return new A.LateError("Local '" + localName + "' has not been initialized."); }, LateError$fieldAI(fieldName) { return new A.LateError("Field '" + fieldName + "' has already been initialized."); }, SystemHash_combine(hash, value) { hash = hash + value & 536870911; hash = hash + ((hash & 524287) << 10) & 536870911; return hash ^ hash >>> 6; }, SystemHash_finish(hash) { hash = hash + ((hash & 67108863) << 3) & 536870911; hash ^= hash >>> 11; return hash + ((hash & 16383) << 15) & 536870911; }, checkNotNullable(value, $name, $T) { return value; }, isToStringVisiting(object) { var t1, i; for (t1 = $.toStringVisiting.length, i = 0; i < t1; ++i) if (object === $.toStringVisiting[i]) return true; return false; }, SubListIterable$(_iterable, _start, _endOrLength, $E) { A.RangeError_checkNotNegative(_start, "start"); if (_endOrLength != null) { A.RangeError_checkNotNegative(_endOrLength, "end"); if (_start > _endOrLength) A.throwExpression(A.RangeError$range(_start, 0, _endOrLength, "start", null)); } return new A.SubListIterable(_iterable, _start, _endOrLength, $E._eval$1("SubListIterable<0>")); }, MappedIterable_MappedIterable(iterable, $function, $S, $T) { if (type$.EfficientLengthIterable_dynamic._is(iterable)) return new A.EfficientLengthMappedIterable(iterable, $function, $S._eval$1("@<0>")._bind$1($T)._eval$1("EfficientLengthMappedIterable<1,2>")); return new A.MappedIterable(iterable, $function, $S._eval$1("@<0>")._bind$1($T)._eval$1("MappedIterable<1,2>")); }, TakeIterable_TakeIterable(iterable, takeCount, $E) { var _s9_ = "takeCount"; A.ArgumentError_checkNotNull(takeCount, _s9_, type$.int); A.RangeError_checkNotNegative(takeCount, _s9_); if (type$.EfficientLengthIterable_dynamic._is(iterable)) return new A.EfficientLengthTakeIterable(iterable, takeCount, $E._eval$1("EfficientLengthTakeIterable<0>")); return new A.TakeIterable(iterable, takeCount, $E._eval$1("TakeIterable<0>")); }, IterableElementError_noElement() { return new A.StateError("No element"); }, IterableElementError_tooMany() { return new A.StateError("Too many elements"); }, IterableElementError_tooFew() { return new A.StateError("Too few elements"); }, LateError: function LateError(t0) { this._message = t0; }, CodeUnits: function CodeUnits(t0) { this._string = t0; }, SentinelValue: function SentinelValue() { }, EfficientLengthIterable: function EfficientLengthIterable() { }, ListIterable: function ListIterable() { }, SubListIterable: function SubListIterable(t0, t1, t2, t3) { var _ = this; _._iterable = t0; _.__internal$_start = t1; _._endOrLength = t2; _.$ti = t3; }, ListIterator: function ListIterator(t0, t1, t2) { var _ = this; _._iterable = t0; _._length = t1; _._index = 0; _._current = null; _.$ti = t2; }, MappedIterable: function MappedIterable(t0, t1, t2) { this._iterable = t0; this._f = t1; this.$ti = t2; }, EfficientLengthMappedIterable: function EfficientLengthMappedIterable(t0, t1, t2) { this._iterable = t0; this._f = t1; this.$ti = t2; }, MappedIterator: function MappedIterator(t0, t1, t2) { var _ = this; _._current = null; _._iterator = t0; _._f = t1; _.$ti = t2; }, MappedListIterable: function MappedListIterable(t0, t1, t2) { this._source = t0; this._f = t1; this.$ti = t2; }, WhereIterable: function WhereIterable(t0, t1, t2) { this._iterable = t0; this._f = t1; this.$ti = t2; }, WhereIterator: function WhereIterator(t0, t1, t2) { this._iterator = t0; this._f = t1; this.$ti = t2; }, TakeIterable: function TakeIterable(t0, t1, t2) { this._iterable = t0; this._takeCount = t1; this.$ti = t2; }, EfficientLengthTakeIterable: function EfficientLengthTakeIterable(t0, t1, t2) { this._iterable = t0; this._takeCount = t1; this.$ti = t2; }, TakeIterator: function TakeIterator(t0, t1, t2) { this._iterator = t0; this._remaining = t1; this.$ti = t2; }, TakeWhileIterable: function TakeWhileIterable(t0, t1, t2) { this._iterable = t0; this._f = t1; this.$ti = t2; }, TakeWhileIterator: function TakeWhileIterator(t0, t1, t2) { var _ = this; _._iterator = t0; _._f = t1; _._isFinished = false; _.$ti = t2; }, WhereTypeIterable: function WhereTypeIterable(t0, t1) { this._source = t0; this.$ti = t1; }, WhereTypeIterator: function WhereTypeIterator(t0, t1) { this._source = t0; this.$ti = t1; }, FixedLengthListMixin: function FixedLengthListMixin() { }, UnmodifiableListMixin: function UnmodifiableListMixin() { }, UnmodifiableListBase: function UnmodifiableListBase() { }, ReversedListIterable: function ReversedListIterable(t0, t1) { this._source = t0; this.$ti = t1; }, unminifyOrTag(rawClassName) { var preserved = init.mangledGlobalNames[rawClassName]; if (preserved != null) return preserved; return rawClassName; }, isJsIndexable(object, record) { var result; if (record != null) { result = record.x; if (result != null) return result; } return type$.JavaScriptIndexingBehavior_dynamic._is(object); }, S(value) { var result; if (typeof value == "string") return value; if (typeof value == "number") { if (value !== 0) return "" + value; } else if (true === value) return "true"; else if (false === value) return "false"; else if (value == null) return "null"; result = J.toString$0$(value); return result; }, Primitives_objectHashCode(object) { var hash, property = $.Primitives__identityHashCodeProperty; if (property == null) property = $.Primitives__identityHashCodeProperty = Symbol("identityHashCode"); hash = object[property]; if (hash == null) { hash = Math.random() * 0x3fffffff | 0; object[property] = hash; } return hash; }, Primitives_objectTypeName(object) { var interceptor, dispatchName, $constructor, constructorName; if (object instanceof A.Object) return A._rtiToString(A.instanceType(object), null); interceptor = J.getInterceptor$(object); if (interceptor === B.Interceptor_methods || interceptor === B.JavaScriptObject_methods || type$.UnknownJavaScriptObject._is(object)) { dispatchName = B.C_JS_CONST(object); if (dispatchName !== "Object" && dispatchName !== "") return dispatchName; $constructor = object.constructor; if (typeof $constructor == "function") { constructorName = $constructor.name; if (typeof constructorName == "string" && constructorName !== "Object" && constructorName !== "") return constructorName; } } return A._rtiToString(A.instanceType(object), null); }, Primitives_safeToString(object) { var hooks, i, hookResult; if (object == null || typeof object == "number" || A._isBool(object)) return J.toString$0$(object); if (typeof object == "string") return JSON.stringify(object); if (object instanceof A.Closure) return object.toString$0(0); if (object instanceof A._Record) return object._toString$1(true); hooks = $.$get$_safeToStringHooks(); for (i = 0; i < 1; ++i) { hookResult = hooks[i].tryFormat$1(object); if (hookResult != null) return hookResult; } return "Instance of '" + A.Primitives_objectTypeName(object) + "'"; }, Primitives_dateNow() { return Date.now(); }, Primitives_initTicker() { var $window, performance; if ($.Primitives_timerFrequency !== 0) return; $.Primitives_timerFrequency = 1000; if (typeof window == "undefined") return; $window = window; if ($window == null) return; if (!!$window.dartUseDateNowForTicks) return; performance = $window.performance; if (performance == null) return; if (typeof performance.now != "function") return; $.Primitives_timerFrequency = 1000000; $.Primitives_timerTicks = new A.Primitives_initTicker_closure(performance); }, Primitives__fromCharCodeApply(array) { var result, i, i0, chunkEnd, end = array.length; if (end <= 500) return String.fromCharCode.apply(null, array); for (result = "", i = 0; i < end; i = i0) { i0 = i + 500; chunkEnd = i0 < end ? i0 : end; result += String.fromCharCode.apply(null, array.slice(i, chunkEnd)); } return result; }, Primitives_stringFromCodePoints(codePoints) { var t1, _i, i, a = A._setArrayType([], type$.JSArray_int); for (t1 = codePoints.length, _i = 0; _i < codePoints.length; codePoints.length === t1 || (0, A.throwConcurrentModificationError)(codePoints), ++_i) { i = codePoints[_i]; if (!A._isInt(i)) throw A.wrapException(A.argumentErrorValue(i)); if (i <= 65535) B.JSArray_methods.add$1(a, i); else if (i <= 1114111) { B.JSArray_methods.add$1(a, 55296 + (B.JSInt_methods._shrOtherPositive$1(i - 65536, 10) & 1023)); B.JSArray_methods.add$1(a, 56320 + (i & 1023)); } else throw A.wrapException(A.argumentErrorValue(i)); } return A.Primitives__fromCharCodeApply(a); }, Primitives_stringFromCharCodes(charCodes) { var t1, _i, i; for (t1 = charCodes.length, _i = 0; _i < t1; ++_i) { i = charCodes[_i]; if (!A._isInt(i)) throw A.wrapException(A.argumentErrorValue(i)); if (i < 0) throw A.wrapException(A.argumentErrorValue(i)); if (i > 65535) return A.Primitives_stringFromCodePoints(charCodes); } return A.Primitives__fromCharCodeApply(charCodes); }, Primitives_stringFromCharCode(charCode) { var bits; if (0 <= charCode) { if (charCode <= 65535) return String.fromCharCode(charCode); if (charCode <= 1114111) { bits = charCode - 65536; return String.fromCharCode((B.JSInt_methods._shrOtherPositive$1(bits, 10) | 55296) >>> 0, bits & 1023 | 56320); } } throw A.wrapException(A.RangeError$range(charCode, 0, 1114111, null, null)); }, Primitives_lazyAsJsDate(receiver) { if (receiver.date === void 0) receiver.date = new Date(receiver._core$_value); return receiver.date; }, Primitives_getYear(receiver) { var t1 = A.Primitives_lazyAsJsDate(receiver).getFullYear() + 0; return t1; }, Primitives_getMonth(receiver) { var t1 = A.Primitives_lazyAsJsDate(receiver).getMonth() + 1; return t1; }, Primitives_getDay(receiver) { var t1 = A.Primitives_lazyAsJsDate(receiver).getDate() + 0; return t1; }, Primitives_getHours(receiver) { var t1 = A.Primitives_lazyAsJsDate(receiver).getHours() + 0; return t1; }, Primitives_getMinutes(receiver) { var t1 = A.Primitives_lazyAsJsDate(receiver).getMinutes() + 0; return t1; }, Primitives_getSeconds(receiver) { var t1 = A.Primitives_lazyAsJsDate(receiver).getSeconds() + 0; return t1; }, Primitives_getMilliseconds(receiver) { var t1 = A.Primitives_lazyAsJsDate(receiver).getMilliseconds() + 0; return t1; }, Primitives_extractStackTrace(error) { var jsError = error.$thrownJsError; if (jsError == null) return null; return A.getTraceFromException(jsError); }, iae(argument) { throw A.wrapException(A.argumentErrorValue(argument)); }, ioore(receiver, index) { if (receiver == null) J.get$length$asx(receiver); throw A.wrapException(A.diagnoseIndexError(receiver, index)); }, diagnoseIndexError(indexable, index) { var $length, _s5_ = "index"; if (!A._isInt(index)) return new A.ArgumentError(true, index, _s5_, null); $length = A._asInt(J.get$length$asx(indexable)); if (index < 0 || index >= $length) return A.IndexError$withLength(index, $length, indexable, null, _s5_); return A.RangeError$value(index, _s5_); }, argumentErrorValue(object) { return new A.ArgumentError(true, object, null, null); }, wrapException(ex) { return A.initializeExceptionWrapper(ex, new Error()); }, initializeExceptionWrapper(ex, wrapper) { var t1; if (ex == null) ex = new A.TypeError(); wrapper.dartException = ex; t1 = A.toStringWrapper; if ("defineProperty" in Object) { Object.defineProperty(wrapper, "message", {get: t1}); wrapper.name = ""; } else wrapper.toString = t1; return wrapper; }, toStringWrapper() { return J.toString$0$(this.dartException); }, throwExpression(ex, wrapper) { throw A.initializeExceptionWrapper(ex, wrapper == null ? new Error() : wrapper); }, throwUnsupportedOperation(o, operation, verb) { var wrapper; if (operation == null) operation = 0; if (verb == null) verb = 0; wrapper = Error(); A.throwExpression(A._diagnoseUnsupportedOperation(o, operation, verb), wrapper); }, _diagnoseUnsupportedOperation(o, encodedOperation, encodedVerb) { var operation, table, tableLength, index, verb, object, flags, article, adjective; if (typeof encodedOperation == "string") operation = encodedOperation; else { table = "[]=;add;removeWhere;retainWhere;removeRange;setRange;setInt8;setInt16;setInt32;setUint8;setUint16;setUint32;setFloat32;setFloat64".split(";"); tableLength = table.length; index = encodedOperation; if (index > tableLength) { encodedVerb = index / tableLength | 0; index %= tableLength; } operation = table[index]; } verb = typeof encodedVerb == "string" ? encodedVerb : "modify;remove from;add to".split(";")[encodedVerb]; object = type$.List_dynamic._is(o) ? "list" : "ByteData"; flags = o.$flags | 0; article = "a "; if ((flags & 4) !== 0) adjective = "constant "; else if ((flags & 2) !== 0) { adjective = "unmodifiable "; article = "an "; } else adjective = (flags & 1) !== 0 ? "fixed-length " : ""; return new A.UnsupportedError("'" + operation + "': Cannot " + verb + " " + article + adjective + object); }, throwConcurrentModificationError(collection) { throw A.wrapException(A.ConcurrentModificationError$(collection)); }, TypeErrorDecoder_extractPattern(message) { var match, $arguments, argumentsExpr, expr, method, receiver; message = A.quoteStringForRegExp(message.replace(String({}), "$receiver$")); match = message.match(/\\\$[a-zA-Z]+\\\$/g); if (match == null) match = A._setArrayType([], type$.JSArray_String); $arguments = match.indexOf("\\$arguments\\$"); argumentsExpr = match.indexOf("\\$argumentsExpr\\$"); expr = match.indexOf("\\$expr\\$"); method = match.indexOf("\\$method\\$"); receiver = match.indexOf("\\$receiver\\$"); return new A.TypeErrorDecoder(message.replace(new RegExp("\\\\\\$arguments\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$argumentsExpr\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$expr\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$method\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$receiver\\\\\\$", "g"), "((?:x|[^x])*)"), $arguments, argumentsExpr, expr, method, receiver); }, TypeErrorDecoder_provokeCallErrorOn(expression) { return function($expr$) { var $argumentsExpr$ = "$arguments$"; try { $expr$.$method$($argumentsExpr$); } catch (e) { return e.message; } }(expression); }, TypeErrorDecoder_provokePropertyErrorOn(expression) { return function($expr$) { try { $expr$.$method$; } catch (e) { return e.message; } }(expression); }, JsNoSuchMethodError$(_message, match) { var t1 = match == null, t2 = t1 ? null : match.method; return new A.JsNoSuchMethodError(_message, t2, t1 ? null : match.receiver); }, unwrapException(ex) { if (ex == null) return new A.NullThrownFromJavaScriptException(ex); if (typeof ex !== "object") return ex; if ("dartException" in ex) return A.saveStackTrace(ex, ex.dartException); return A._unwrapNonDartException(ex); }, saveStackTrace(ex, error) { if (type$.Error._is(error)) if (error.$thrownJsError == null) error.$thrownJsError = ex; return error; }, _unwrapNonDartException(ex) { var message, number, ieErrorCode, nsme, notClosure, nullCall, nullLiteralCall, undefCall, undefLiteralCall, nullProperty, undefProperty, undefLiteralProperty, match; if (!("message" in ex)) return ex; message = ex.message; if ("number" in ex && typeof ex.number == "number") { number = ex.number; ieErrorCode = number & 65535; if ((B.JSInt_methods._shrOtherPositive$1(number, 16) & 8191) === 10) switch (ieErrorCode) { case 438: return A.saveStackTrace(ex, A.JsNoSuchMethodError$(A.S(message) + " (Error " + ieErrorCode + ")", null)); case 445: case 5007: A.S(message); return A.saveStackTrace(ex, new A.NullError()); } } if (ex instanceof TypeError) { nsme = $.$get$TypeErrorDecoder_noSuchMethodPattern(); notClosure = $.$get$TypeErrorDecoder_notClosurePattern(); nullCall = $.$get$TypeErrorDecoder_nullCallPattern(); nullLiteralCall = $.$get$TypeErrorDecoder_nullLiteralCallPattern(); undefCall = $.$get$TypeErrorDecoder_undefinedCallPattern(); undefLiteralCall = $.$get$TypeErrorDecoder_undefinedLiteralCallPattern(); nullProperty = $.$get$TypeErrorDecoder_nullPropertyPattern(); $.$get$TypeErrorDecoder_nullLiteralPropertyPattern(); undefProperty = $.$get$TypeErrorDecoder_undefinedPropertyPattern(); undefLiteralProperty = $.$get$TypeErrorDecoder_undefinedLiteralPropertyPattern(); match = nsme.matchTypeError$1(message); if (match != null) return A.saveStackTrace(ex, A.JsNoSuchMethodError$(A._asString(message), match)); else { match = notClosure.matchTypeError$1(message); if (match != null) { match.method = "call"; return A.saveStackTrace(ex, A.JsNoSuchMethodError$(A._asString(message), match)); } else if (nullCall.matchTypeError$1(message) != null || nullLiteralCall.matchTypeError$1(message) != null || undefCall.matchTypeError$1(message) != null || undefLiteralCall.matchTypeError$1(message) != null || nullProperty.matchTypeError$1(message) != null || nullLiteralCall.matchTypeError$1(message) != null || undefProperty.matchTypeError$1(message) != null || undefLiteralProperty.matchTypeError$1(message) != null) { A._asString(message); return A.saveStackTrace(ex, new A.NullError()); } } return A.saveStackTrace(ex, new A.UnknownJsTypeError(typeof message == "string" ? message : "")); } if (ex instanceof RangeError) { if (typeof message == "string" && message.indexOf("call stack") !== -1) return new A.StackOverflowError(); message = function(ex) { try { return String(ex); } catch (e) { } return null; }(ex); return A.saveStackTrace(ex, new A.ArgumentError(false, null, null, typeof message == "string" ? message.replace(/^RangeError:\s*/, "") : message)); } if (typeof InternalError == "function" && ex instanceof InternalError) if (typeof message == "string" && message === "too much recursion") return new A.StackOverflowError(); return ex; }, getTraceFromException(exception) { var trace; if (exception == null) return new A._StackTrace(exception); trace = exception.$cachedTrace; if (trace != null) return trace; trace = new A._StackTrace(exception); if (typeof exception === "object") exception.$cachedTrace = trace; return trace; }, objectHashCode(object) { if (object == null) return J.get$hashCode$(object); if (typeof object == "object") return A.Primitives_objectHashCode(object); return J.get$hashCode$(object); }, constantHashCode(key) { if (typeof key == "number") return B.JSNumber_methods.get$hashCode(key); if (key instanceof A._Type) return A.Primitives_objectHashCode(key); if (key instanceof A._Record) return key.get$hashCode(key); return A.objectHashCode(key); }, fillLiteralMap(keyValuePairs, result) { var index, index0, index1, $length = keyValuePairs.length; for (index = 0; index < $length; index = index1) { index0 = index + 1; index1 = index0 + 1; result.$indexSet(0, keyValuePairs[index], keyValuePairs[index0]); } return result; }, _invokeClosure(closure, numberOfArguments, arg1, arg2, arg3, arg4) { type$.Function._as(closure); switch (A._asInt(numberOfArguments)) { case 0: return closure.call$0(); case 1: return closure.call$1(arg1); case 2: return closure.call$2(arg1, arg2); case 3: return closure.call$3(arg1, arg2, arg3); case 4: return closure.call$4(arg1, arg2, arg3, arg4); } throw A.wrapException(new A._Exception("Unsupported number of arguments for wrapped closure")); }, convertDartClosureToJS(closure, arity) { var $function = closure.$identity; if (!!$function) return $function; $function = A.convertDartClosureToJSUncached(closure, arity); closure.$identity = $function; return $function; }, convertDartClosureToJSUncached(closure, arity) { var entry; switch (arity) { case 0: entry = closure.call$0; break; case 1: entry = closure.call$1; break; case 2: entry = closure.call$2; break; case 3: entry = closure.call$3; break; case 4: entry = closure.call$4; break; default: entry = null; } if (entry != null) return entry.bind(closure); return function(closure, arity, invoke) { return function(a1, a2, a3, a4) { return invoke(closure, arity, a1, a2, a3, a4); }; }(closure, arity, A._invokeClosure); }, Closure_fromTearOff(parameters) { var $prototype, $constructor, t2, trampoline, applyTrampoline, i, stub, stub0, stubName, stubCallName, container = parameters.co, isStatic = parameters.iS, isIntercepted = parameters.iI, needsDirectAccess = parameters.nDA, applyTrampolineIndex = parameters.aI, funsOrNames = parameters.fs, callNames = parameters.cs, $name = funsOrNames[0], callName = callNames[0], $function = container[$name], t1 = parameters.fT; t1.toString; $prototype = isStatic ? Object.create(new A.StaticClosure().constructor.prototype) : Object.create(new A.BoundClosure(null, null).constructor.prototype); $prototype.$initialize = $prototype.constructor; $constructor = isStatic ? function static_tear_off() { this.$initialize(); } : function tear_off(a, b) { this.$initialize(a, b); }; $prototype.constructor = $constructor; $constructor.prototype = $prototype; $prototype.$_name = $name; $prototype.$_target = $function; t2 = !isStatic; if (t2) trampoline = A.Closure_forwardCallTo($name, $function, isIntercepted, needsDirectAccess); else { $prototype.$static_name = $name; trampoline = $function; } $prototype.$signature = A.Closure__computeSignatureFunction(t1, isStatic, isIntercepted); $prototype[callName] = trampoline; for (applyTrampoline = trampoline, i = 1; i < funsOrNames.length; ++i) { stub = funsOrNames[i]; if (typeof stub == "string") { stub0 = container[stub]; stubName = stub; stub = stub0; } else stubName = ""; stubCallName = callNames[i]; if (stubCallName != null) { if (t2) stub = A.Closure_forwardCallTo(stubName, stub, isIntercepted, needsDirectAccess); $prototype[stubCallName] = stub; } if (i === applyTrampolineIndex) applyTrampoline = stub; } $prototype["call*"] = applyTrampoline; $prototype.$requiredArgCount = parameters.rC; $prototype.$defaultValues = parameters.dV; return $constructor; }, Closure__computeSignatureFunction(functionType, isStatic, isIntercepted) { if (typeof functionType == "number") return functionType; if (typeof functionType == "string") { if (isStatic) throw A.wrapException("Cannot compute signature for static tearoff."); return function(recipe, evalOnReceiver) { return function() { return evalOnReceiver(this, recipe); }; }(functionType, A.BoundClosure_evalRecipe); } throw A.wrapException("Error in functionType of tearoff"); }, Closure_cspForwardCall(arity, needsDirectAccess, stubName, $function) { var getReceiver = A.BoundClosure_receiverOf; switch (needsDirectAccess ? -1 : arity) { case 0: return function(entry, receiverOf) { return function() { return receiverOf(this)[entry](); }; }(stubName, getReceiver); case 1: return function(entry, receiverOf) { return function(a) { return receiverOf(this)[entry](a); }; }(stubName, getReceiver); case 2: return function(entry, receiverOf) { return function(a, b) { return receiverOf(this)[entry](a, b); }; }(stubName, getReceiver); case 3: return function(entry, receiverOf) { return function(a, b, c) { return receiverOf(this)[entry](a, b, c); }; }(stubName, getReceiver); case 4: return function(entry, receiverOf) { return function(a, b, c, d) { return receiverOf(this)[entry](a, b, c, d); }; }(stubName, getReceiver); case 5: return function(entry, receiverOf) { return function(a, b, c, d, e) { return receiverOf(this)[entry](a, b, c, d, e); }; }(stubName, getReceiver); default: return function(f, receiverOf) { return function() { return f.apply(receiverOf(this), arguments); }; }($function, getReceiver); } }, Closure_forwardCallTo(stubName, $function, isIntercepted, needsDirectAccess) { if (isIntercepted) return A.Closure_forwardInterceptedCallTo(stubName, $function, needsDirectAccess); return A.Closure_cspForwardCall($function.length, needsDirectAccess, stubName, $function); }, Closure_cspForwardInterceptedCall(arity, needsDirectAccess, stubName, $function) { var getReceiver = A.BoundClosure_receiverOf, getInterceptor = A.BoundClosure_interceptorOf; switch (needsDirectAccess ? -1 : arity) { case 0: throw A.wrapException(new A.RuntimeError("Intercepted function with no arguments.")); case 1: return function(entry, interceptorOf, receiverOf) { return function() { return interceptorOf(this)[entry](receiverOf(this)); }; }(stubName, getInterceptor, getReceiver); case 2: return function(entry, interceptorOf, receiverOf) { return function(a) { return interceptorOf(this)[entry](receiverOf(this), a); }; }(stubName, getInterceptor, getReceiver); case 3: return function(entry, interceptorOf, receiverOf) { return function(a, b) { return interceptorOf(this)[entry](receiverOf(this), a, b); }; }(stubName, getInterceptor, getReceiver); case 4: return function(entry, interceptorOf, receiverOf) { return function(a, b, c) { return interceptorOf(this)[entry](receiverOf(this), a, b, c); }; }(stubName, getInterceptor, getReceiver); case 5: return function(entry, interceptorOf, receiverOf) { return function(a, b, c, d) { return interceptorOf(this)[entry](receiverOf(this), a, b, c, d); }; }(stubName, getInterceptor, getReceiver); case 6: return function(entry, interceptorOf, receiverOf) { return function(a, b, c, d, e) { return interceptorOf(this)[entry](receiverOf(this), a, b, c, d, e); }; }(stubName, getInterceptor, getReceiver); default: return function(f, interceptorOf, receiverOf) { return function() { var a = [receiverOf(this)]; Array.prototype.push.apply(a, arguments); return f.apply(interceptorOf(this), a); }; }($function, getInterceptor, getReceiver); } }, Closure_forwardInterceptedCallTo(stubName, $function, needsDirectAccess) { var arity, t1; if ($.BoundClosure__interceptorFieldNameCache == null) $.BoundClosure__interceptorFieldNameCache = A.BoundClosure__computeFieldNamed("interceptor"); if ($.BoundClosure__receiverFieldNameCache == null) $.BoundClosure__receiverFieldNameCache = A.BoundClosure__computeFieldNamed("receiver"); arity = $function.length; t1 = A.Closure_cspForwardInterceptedCall(arity, needsDirectAccess, stubName, $function); return t1; }, closureFromTearOff(parameters) { return A.Closure_fromTearOff(parameters); }, BoundClosure_evalRecipe(closure, recipe) { return A._Universe_evalInEnvironment(init.typeUniverse, A.instanceType(closure._receiver), recipe); }, BoundClosure_receiverOf(closure) { return closure._receiver; }, BoundClosure_interceptorOf(closure) { return closure._interceptor; }, BoundClosure__computeFieldNamed(fieldName) { var names, i, $name, template = new A.BoundClosure("receiver", "interceptor"), t1 = Object.getOwnPropertyNames(template); t1.$flags = 1; names = t1; for (t1 = names.length, i = 0; i < t1; ++i) { $name = names[i]; if (template[$name] === fieldName) return $name; } throw A.wrapException(A.ArgumentError$("Field name " + fieldName + " not found.", null)); }, getIsolateAffinityTag($name) { return init.getIsolateTag($name); }, lookupAndCacheInterceptor(obj) { var interceptor, interceptorClass, altTag, mark, t1, tag = A._asString($.getTagFunction.call$1(obj)), record = $.dispatchRecordsForInstanceTags[tag]; if (record != null) { Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); return record.i; } interceptor = $.interceptorsForUncacheableTags[tag]; if (interceptor != null) return interceptor; interceptorClass = init.interceptorsByTag[tag]; if (interceptorClass == null) { altTag = A._asStringQ($.alternateTagFunction.call$2(obj, tag)); if (altTag != null) { record = $.dispatchRecordsForInstanceTags[altTag]; if (record != null) { Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); return record.i; } interceptor = $.interceptorsForUncacheableTags[altTag]; if (interceptor != null) return interceptor; interceptorClass = init.interceptorsByTag[altTag]; tag = altTag; } } if (interceptorClass == null) return null; interceptor = interceptorClass.prototype; mark = tag[0]; if (mark === "!") { record = A.makeLeafDispatchRecord(interceptor); $.dispatchRecordsForInstanceTags[tag] = record; Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); return record.i; } if (mark === "~") { $.interceptorsForUncacheableTags[tag] = interceptor; return interceptor; } if (mark === "-") { t1 = A.makeLeafDispatchRecord(interceptor); Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true}); return t1.i; } if (mark === "+") return A.patchInteriorProto(obj, interceptor); if (mark === "*") throw A.wrapException(A.UnimplementedError$(tag)); if (init.leafTags[tag] === true) { t1 = A.makeLeafDispatchRecord(interceptor); Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true}); return t1.i; } else return A.patchInteriorProto(obj, interceptor); }, patchInteriorProto(obj, interceptor) { var proto = Object.getPrototypeOf(obj); Object.defineProperty(proto, init.dispatchPropertyName, {value: J.makeDispatchRecord(interceptor, proto, null, null), enumerable: false, writable: true, configurable: true}); return interceptor; }, makeLeafDispatchRecord(interceptor) { return J.makeDispatchRecord(interceptor, false, null, !!interceptor.$isJavaScriptIndexingBehavior); }, makeDefaultDispatchRecord(tag, interceptorClass, proto) { var interceptor = interceptorClass.prototype; if (init.leafTags[tag] === true) return A.makeLeafDispatchRecord(interceptor); else return J.makeDispatchRecord(interceptor, proto, null, null); }, initNativeDispatch() { if (true === $.initNativeDispatchFlag) return; $.initNativeDispatchFlag = true; A.initNativeDispatchContinue(); }, initNativeDispatchContinue() { var map, tags, fun, i, tag, proto, record, interceptorClass; $.dispatchRecordsForInstanceTags = Object.create(null); $.interceptorsForUncacheableTags = Object.create(null); A.initHooks(); map = init.interceptorsByTag; tags = Object.getOwnPropertyNames(map); if (typeof window != "undefined") { window; fun = function() { }; for (i = 0; i < tags.length; ++i) { tag = tags[i]; proto = $.prototypeForTagFunction.call$1(tag); if (proto != null) { record = A.makeDefaultDispatchRecord(tag, map[tag], proto); if (record != null) { Object.defineProperty(proto, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); fun.prototype = proto; } } } } for (i = 0; i < tags.length; ++i) { tag = tags[i]; if (/^[A-Za-z_]/.test(tag)) { interceptorClass = map[tag]; map["!" + tag] = interceptorClass; map["~" + tag] = interceptorClass; map["-" + tag] = interceptorClass; map["+" + tag] = interceptorClass; map["*" + tag] = interceptorClass; } } }, initHooks() { var transformers, i, transformer, getTag, getUnknownTag, prototypeForTag, hooks = B.C_JS_CONST0(); hooks = A.applyHooksTransformer(B.C_JS_CONST1, A.applyHooksTransformer(B.C_JS_CONST2, A.applyHooksTransformer(B.C_JS_CONST3, A.applyHooksTransformer(B.C_JS_CONST3, A.applyHooksTransformer(B.C_JS_CONST4, A.applyHooksTransformer(B.C_JS_CONST5, A.applyHooksTransformer(B.C_JS_CONST6(B.C_JS_CONST), hooks))))))); if (typeof dartNativeDispatchHooksTransformer != "undefined") { transformers = dartNativeDispatchHooksTransformer; if (typeof transformers == "function") transformers = [transformers]; if (Array.isArray(transformers)) for (i = 0; i < transformers.length; ++i) { transformer = transformers[i]; if (typeof transformer == "function") hooks = transformer(hooks) || hooks; } } getTag = hooks.getTag; getUnknownTag = hooks.getUnknownTag; prototypeForTag = hooks.prototypeForTag; $.getTagFunction = new A.initHooks_closure(getTag); $.alternateTagFunction = new A.initHooks_closure0(getUnknownTag); $.prototypeForTagFunction = new A.initHooks_closure1(prototypeForTag); }, applyHooksTransformer(transformer, hooks) { return transformer(hooks) || hooks; }, _RecordN__equalValues(a, b) { var i, t1; for (i = 0; i < a.length; ++i) { t1 = a[i]; if (!(i < b.length)) return A.ioore(b, i); if (!J.$eq$(t1, b[i])) return false; } return true; }, createRecordTypePredicate(shape, fieldRtis) { var $length = fieldRtis.length, $function = init.rttc["" + $length + ";" + shape]; if ($function == null) return null; if ($length === 0) return $function; if ($length === $function.length) return $function.apply(null, fieldRtis); return $function(fieldRtis); }, JSSyntaxRegExp_makeNative(source, multiLine, caseSensitive, unicode, dotAll, extraFlags) { var m = multiLine ? "m" : "", i = caseSensitive ? "" : "i", u = unicode ? "u" : "", s = dotAll ? "s" : "", regexp = function(source, modifiers) { try { return new RegExp(source, modifiers); } catch (e) { return e; } }(source, m + i + u + s + extraFlags); if (regexp instanceof RegExp) return regexp; throw A.wrapException(A.FormatException$("Illegal RegExp pattern (" + String(regexp) + ")", source)); }, stringContainsUnchecked(receiver, other, startIndex) { var t1 = receiver.indexOf(other, startIndex); return t1 >= 0; }, escapeReplacement(replacement) { if (replacement.indexOf("$", 0) >= 0) return replacement.replace(/\$/g, "$$$$"); return replacement; }, quoteStringForRegExp(string) { if (/[[\]{}()*+?.\\^$|]/.test(string)) return string.replace(/[[\]{}()*+?.\\^$|]/g, "\\$&"); return string; }, stringReplaceAllUnchecked(receiver, pattern, replacement) { var nativeRegexp; if (typeof pattern == "string") return A.stringReplaceAllUncheckedString(receiver, pattern, replacement); if (pattern instanceof A.JSSyntaxRegExp) { nativeRegexp = pattern.get$_nativeGlobalVersion(); nativeRegexp.lastIndex = 0; return receiver.replace(nativeRegexp, A.escapeReplacement(replacement)); } return A.stringReplaceAllGeneral(receiver, pattern, replacement); }, stringReplaceAllGeneral(receiver, pattern, replacement) { var t1, startIndex, t2, match; for (t1 = J.allMatches$1$s(pattern, receiver), t1 = t1.get$iterator(t1), startIndex = 0, t2 = ""; t1.moveNext$0();) { match = t1.get$current(); t2 = t2 + receiver.substring(startIndex, match.get$start()) + replacement; startIndex = match.get$end(); } t1 = t2 + receiver.substring(startIndex); return t1.charCodeAt(0) == 0 ? t1 : t1; }, stringReplaceAllUncheckedString(receiver, pattern, replacement) { var $length, t1, i; if (pattern === "") { if (receiver === "") return replacement; $length = receiver.length; for (t1 = replacement, i = 0; i < $length; ++i) t1 = t1 + receiver[i] + replacement; return t1.charCodeAt(0) == 0 ? t1 : t1; } if (receiver.indexOf(pattern, 0) < 0) return receiver; if (receiver.length < 500 || replacement.indexOf("$", 0) >= 0) return receiver.split(pattern).join(replacement); return receiver.replace(new RegExp(A.quoteStringForRegExp(pattern), "g"), A.escapeReplacement(replacement)); }, _Record_2: function _Record_2(t0, t1) { this._0 = t0; this._1 = t1; }, _Record_4: function _Record_4(t0) { this._values = t0; }, ConstantMap: function ConstantMap() { }, ConstantStringMap: function ConstantStringMap(t0, t1, t2) { this._jsIndex = t0; this._values = t1; this.$ti = t2; }, _KeysOrValues: function _KeysOrValues(t0, t1) { this.__js_helper$_elements = t0; this.$ti = t1; }, _KeysOrValuesOrElementsIterator: function _KeysOrValuesOrElementsIterator(t0, t1, t2) { var _ = this; _.__js_helper$_elements = t0; _.__js_helper$_length = t1; _.__js_helper$_index = 0; _.__js_helper$_current = null; _.$ti = t2; }, GeneralConstantMap: function GeneralConstantMap(t0, t1) { this._jsData = t0; this.$ti = t1; }, Primitives_initTicker_closure: function Primitives_initTicker_closure(t0) { this.performance = t0; }, SafeToStringHook: function SafeToStringHook() { }, TypeErrorDecoder: function TypeErrorDecoder(t0, t1, t2, t3, t4, t5) { var _ = this; _._pattern = t0; _._arguments = t1; _._argumentsExpr = t2; _._expr = t3; _._method = t4; _._receiver = t5; }, NullError: function NullError() { }, JsNoSuchMethodError: function JsNoSuchMethodError(t0, t1, t2) { this.__js_helper$_message = t0; this._method = t1; this._receiver = t2; }, UnknownJsTypeError: function UnknownJsTypeError(t0) { this.__js_helper$_message = t0; }, NullThrownFromJavaScriptException: function NullThrownFromJavaScriptException(t0) { this._irritant = t0; }, _StackTrace: function _StackTrace(t0) { this._exception = t0; this._trace = null; }, Closure: function Closure() { }, Closure0Args: function Closure0Args() { }, Closure2Args: function Closure2Args() { }, TearOffClosure: function TearOffClosure() { }, StaticClosure: function StaticClosure() { }, BoundClosure: function BoundClosure(t0, t1) { this._receiver = t0; this._interceptor = t1; }, RuntimeError: function RuntimeError(t0) { this.message = t0; }, JsLinkedHashMap: function JsLinkedHashMap(t0) { var _ = this; _.__js_helper$_length = 0; _._last = _._first = _.__js_helper$_rest = _._nums = _._strings = null; _._modifications = 0; _.$ti = t0; }, JsLinkedHashMap_addAll_closure: function JsLinkedHashMap_addAll_closure(t0) { this.$this = t0; }, LinkedHashMapCell: function LinkedHashMapCell(t0, t1) { var _ = this; _.hashMapCellKey = t0; _.hashMapCellValue = t1; _._previous = _._next = null; }, LinkedHashMapKeysIterable: function LinkedHashMapKeysIterable(t0, t1) { this._map = t0; this.$ti = t1; }, LinkedHashMapKeyIterator: function LinkedHashMapKeyIterator(t0, t1, t2, t3) { var _ = this; _._map = t0; _._modifications = t1; _._cell = t2; _.__js_helper$_current = null; _.$ti = t3; }, LinkedHashMapValuesIterable: function LinkedHashMapValuesIterable(t0, t1) { this._map = t0; this.$ti = t1; }, LinkedHashMapValueIterator: function LinkedHashMapValueIterator(t0, t1, t2, t3) { var _ = this; _._map = t0; _._modifications = t1; _._cell = t2; _.__js_helper$_current = null; _.$ti = t3; }, LinkedHashMapEntriesIterable: function LinkedHashMapEntriesIterable(t0, t1) { this._map = t0; this.$ti = t1; }, LinkedHashMapEntryIterator: function LinkedHashMapEntryIterator(t0, t1, t2, t3) { var _ = this; _._map = t0; _._modifications = t1; _._cell = t2; _.__js_helper$_current = null; _.$ti = t3; }, JsConstantLinkedHashMap: function JsConstantLinkedHashMap(t0) { var _ = this; _.__js_helper$_length = 0; _._last = _._first = _.__js_helper$_rest = _._nums = _._strings = null; _._modifications = 0; _.$ti = t0; }, initHooks_closure: function initHooks_closure(t0) { this.getTag = t0; }, initHooks_closure0: function initHooks_closure0(t0) { this.getUnknownTag = t0; }, initHooks_closure1: function initHooks_closure1(t0) { this.prototypeForTag = t0; }, _Record: function _Record() { }, _Record2: function _Record2() { }, _RecordN: function _RecordN() { }, JSSyntaxRegExp: function JSSyntaxRegExp(t0, t1) { var _ = this; _.pattern = t0; _._nativeRegExp = t1; _._hasCapturesCache = _._nativeAnchoredRegExp = _._nativeGlobalRegExp = null; }, _MatchImplementation: function _MatchImplementation(t0) { this._match = t0; }, _AllMatchesIterable: function _AllMatchesIterable(t0, t1, t2) { this._re = t0; this.__js_helper$_string = t1; this.__js_helper$_start = t2; }, _AllMatchesIterator: function _AllMatchesIterator(t0, t1, t2) { var _ = this; _._regExp = t0; _.__js_helper$_string = t1; _._nextIndex = t2; _.__js_helper$_current = null; }, StringMatch: function StringMatch(t0, t1) { this.start = t0; this.pattern = t1; }, _StringAllMatchesIterable: function _StringAllMatchesIterable(t0, t1, t2) { this._input = t0; this._pattern = t1; this.__js_helper$_index = t2; }, _StringAllMatchesIterator: function _StringAllMatchesIterator(t0, t1, t2) { var _ = this; _._input = t0; _._pattern = t1; _.__js_helper$_index = t2; _.__js_helper$_current = null; }, throwLateFieldNI(fieldName) { throw A.initializeExceptionWrapper(A.LateError$fieldNI(fieldName), new Error()); }, throwLateFieldAI(fieldName) { throw A.initializeExceptionWrapper(A.LateError$fieldAI(fieldName), new Error()); }, throwLateFieldADI(fieldName) { throw A.initializeExceptionWrapper(A.LateError$fieldADI(fieldName), new Error()); }, _Cell$named(_name) { var t1 = new A._Cell(_name); return t1._value = t1; }, _Cell: function _Cell(t0) { this._name = t0; this._value = null; }, _checkValidIndex(index, list, $length) { if (index >>> 0 !== index || index >= $length) throw A.wrapException(A.diagnoseIndexError(list, index)); }, NativeByteBuffer: function NativeByteBuffer() { }, NativeTypedData: function NativeTypedData() { }, NativeByteData: function NativeByteData() { }, NativeTypedArray: function NativeTypedArray() { }, NativeTypedArrayOfDouble: function NativeTypedArrayOfDouble() { }, NativeTypedArrayOfInt: function NativeTypedArrayOfInt() { }, NativeFloat32List: function NativeFloat32List() { }, NativeFloat64List: function NativeFloat64List() { }, NativeInt16List: function NativeInt16List() { }, NativeInt32List: function NativeInt32List() { }, NativeInt8List: function NativeInt8List() { }, NativeUint16List: function NativeUint16List() { }, NativeUint32List: function NativeUint32List() { }, NativeUint8ClampedList: function NativeUint8ClampedList() { }, NativeUint8List: function NativeUint8List() { }, _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin: function _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin() { }, _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin: function _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin() { }, _NativeTypedArrayOfInt_NativeTypedArray_ListMixin: function _NativeTypedArrayOfInt_NativeTypedArray_ListMixin() { }, _NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin: function _NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin() { }, Rti__getFutureFromFutureOr(universe, rti) { var future = rti._precomputed1; return future == null ? rti._precomputed1 = A._Universe__lookupInterfaceRti(universe, "Future", [rti._primary]) : future; }, Rti__isUnionOfFunctionType(rti) { var kind = rti._kind; if (kind === 6 || kind === 7) return A.Rti__isUnionOfFunctionType(rti._primary); return kind === 11 || kind === 12; }, Rti__getCanonicalRecipe(rti) { return rti._canonicalRecipe; }, pairwiseIsTest(fieldRtis, values) { var i, $length = values.length; for (i = 0; i < $length; ++i) if (!fieldRtis[i]._is(values[i])) return false; return true; }, findType(recipe) { return A._Universe_eval(init.typeUniverse, recipe, false); }, _substitute(universe, rti, typeArguments, depth) { var baseType, substitutedBaseType, interfaceTypeArguments, substitutedInterfaceTypeArguments, base, substitutedBase, $arguments, substitutedArguments, t1, fields, substitutedFields, returnType, substitutedReturnType, functionParameters, substitutedFunctionParameters, bounds, substitutedBounds, index, argument, kind = rti._kind; switch (kind) { case 5: case 1: case 2: case 3: case 4: return rti; case 6: baseType = rti._primary; substitutedBaseType = A._substitute(universe, baseType, typeArguments, depth); if (substitutedBaseType === baseType) return rti; return A._Universe__lookupQuestionRti(universe, substitutedBaseType, true); case 7: baseType = rti._primary; substitutedBaseType = A._substitute(universe, baseType, typeArguments, depth); if (substitutedBaseType === baseType) return rti; return A._Universe__lookupFutureOrRti(universe, substitutedBaseType, true); case 8: interfaceTypeArguments = rti._rest; substitutedInterfaceTypeArguments = A._substituteArray(universe, interfaceTypeArguments, typeArguments, depth); if (substitutedInterfaceTypeArguments === interfaceTypeArguments) return rti; return A._Universe__lookupInterfaceRti(universe, rti._primary, substitutedInterfaceTypeArguments); case 9: base = rti._primary; substitutedBase = A._substitute(universe, base, typeArguments, depth); $arguments = rti._rest; substitutedArguments = A._substituteArray(universe, $arguments, typeArguments, depth); if (substitutedBase === base && substitutedArguments === $arguments) return rti; return A._Universe__lookupBindingRti(universe, substitutedBase, substitutedArguments); case 10: t1 = rti._primary; fields = rti._rest; substitutedFields = A._substituteArray(universe, fields, typeArguments, depth); if (substitutedFields === fields) return rti; return A._Universe__lookupRecordRti(universe, t1, substitutedFields); case 11: returnType = rti._primary; substitutedReturnType = A._substitute(universe, returnType, typeArguments, depth); functionParameters = rti._rest; substitutedFunctionParameters = A._substituteFunctionParameters(universe, functionParameters, typeArguments, depth); if (substitutedReturnType === returnType && substitutedFunctionParameters === functionParameters) return rti; return A._Universe__lookupFunctionRti(universe, substitutedReturnType, substitutedFunctionParameters); case 12: bounds = rti._rest; depth += bounds.length; substitutedBounds = A._substituteArray(universe, bounds, typeArguments, depth); base = rti._primary; substitutedBase = A._substitute(universe, base, typeArguments, depth); if (substitutedBounds === bounds && substitutedBase === base) return rti; return A._Universe__lookupGenericFunctionRti(universe, substitutedBase, substitutedBounds, true); case 13: index = rti._primary; if (index < depth) return rti; argument = typeArguments[index - depth]; if (argument == null) return rti; return argument; default: throw A.wrapException(A.AssertionError$("Attempted to substitute unexpected RTI kind " + kind)); } }, _substituteArray(universe, rtiArray, typeArguments, depth) { var changed, i, rti, substitutedRti, $length = rtiArray.length, result = A._Utils_newArrayOrEmpty($length); for (changed = false, i = 0; i < $length; ++i) { rti = rtiArray[i]; substitutedRti = A._substitute(universe, rti, typeArguments, depth); if (substitutedRti !== rti) changed = true; result[i] = substitutedRti; } return changed ? result : rtiArray; }, _substituteNamed(universe, namedArray, typeArguments, depth) { var changed, i, t1, t2, rti, substitutedRti, $length = namedArray.length, result = A._Utils_newArrayOrEmpty($length); for (changed = false, i = 0; i < $length; i += 3) { t1 = namedArray[i]; t2 = namedArray[i + 1]; rti = namedArray[i + 2]; substitutedRti = A._substitute(universe, rti, typeArguments, depth); if (substitutedRti !== rti) changed = true; result.splice(i, 3, t1, t2, substitutedRti); } return changed ? result : namedArray; }, _substituteFunctionParameters(universe, functionParameters, typeArguments, depth) { var result, requiredPositional = functionParameters._requiredPositional, substitutedRequiredPositional = A._substituteArray(universe, requiredPositional, typeArguments, depth), optionalPositional = functionParameters._optionalPositional, substitutedOptionalPositional = A._substituteArray(universe, optionalPositional, typeArguments, depth), named = functionParameters._named, substitutedNamed = A._substituteNamed(universe, named, typeArguments, depth); if (substitutedRequiredPositional === requiredPositional && substitutedOptionalPositional === optionalPositional && substitutedNamed === named) return functionParameters; result = new A._FunctionParameters(); result._requiredPositional = substitutedRequiredPositional; result._optionalPositional = substitutedOptionalPositional; result._named = substitutedNamed; return result; }, _setArrayType(target, rti) { target[init.arrayRti] = rti; return target; }, closureFunctionType(closure) { var signature = closure.$signature; if (signature != null) { if (typeof signature == "number") return A.getTypeFromTypesTable(signature); return closure.$signature(); } return null; }, instanceOrFunctionType(object, testRti) { var rti; if (A.Rti__isUnionOfFunctionType(testRti)) if (object instanceof A.Closure) { rti = A.closureFunctionType(object); if (rti != null) return rti; } return A.instanceType(object); }, instanceType(object) { if (object instanceof A.Object) return A._instanceType(object); if (Array.isArray(object)) return A._arrayInstanceType(object); return A._instanceTypeFromConstructor(J.getInterceptor$(object)); }, _arrayInstanceType(object) { var rti = object[init.arrayRti], defaultRti = type$.JSArray_dynamic; if (rti == null) return defaultRti; if (rti.constructor !== defaultRti.constructor) return defaultRti; return rti; }, _instanceType(object) { var rti = object.$ti; return rti != null ? rti : A._instanceTypeFromConstructor(object); }, _instanceTypeFromConstructor(instance) { var $constructor = instance.constructor, probe = $constructor.$ccache; if (probe != null) return probe; return A._instanceTypeFromConstructorMiss(instance, $constructor); }, _instanceTypeFromConstructorMiss(instance, $constructor) { var effectiveConstructor = instance instanceof A.Closure ? Object.getPrototypeOf(Object.getPrototypeOf(instance)).constructor : $constructor, rti = A._Universe_findErasedType(init.typeUniverse, effectiveConstructor.name); $constructor.$ccache = rti; return rti; }, getTypeFromTypesTable(index) { var rti, table = init.types, type = table[index]; if (typeof type == "string") { rti = A._Universe_eval(init.typeUniverse, type, false); table[index] = rti; return rti; } return type; }, getRuntimeTypeOfDartObject(object) { return A.createRuntimeType(A._instanceType(object)); }, _structuralTypeOf(object) { var functionRti; if (object instanceof A._Record) return A.evaluateRtiForRecord(object.$recipe, object._getFieldValues$0()); functionRti = object instanceof A.Closure ? A.closureFunctionType(object) : null; if (functionRti != null) return functionRti; if (type$.TrustedGetRuntimeType._is(object)) return J.get$runtimeType$(object)._rti; if (Array.isArray(object)) return A._arrayInstanceType(object); return A.instanceType(object); }, createRuntimeType(rti) { var t1 = rti._cachedRuntimeType; return t1 == null ? rti._cachedRuntimeType = new A._Type(rti) : t1; }, evaluateRtiForRecord(recordRecipe, valuesList) { var bindings, i, values = valuesList, $length = values.length; if ($length === 0) return type$.Record_0; if (0 >= $length) return A.ioore(values, 0); bindings = A._Universe_evalInEnvironment(init.typeUniverse, A._structuralTypeOf(values[0]), "@<0>"); for (i = 1; i < $length; ++i) { if (!(i < values.length)) return A.ioore(values, i); bindings = A._Universe_bind(init.typeUniverse, bindings, A._structuralTypeOf(values[i])); } return A._Universe_evalInEnvironment(init.typeUniverse, bindings, recordRecipe); }, typeLiteral(recipe) { return A.createRuntimeType(A._Universe_eval(init.typeUniverse, recipe, false)); }, _installSpecializedIsTest(object) { var testRti = this; testRti._is = A._specializedIsTest(testRti); return testRti._is(object); }, _specializedIsTest(testRti) { var kind, simpleIsFn, $name, predicate, t1; if (testRti === type$.Object) return A._isObject; if (A.isTopType(testRti)) return A._isTop; kind = testRti._kind; if (kind === 6) return A._generalNullableIsTestImplementation; if (kind === 1) return A._isNever; if (kind === 7) return A._isFutureOr; simpleIsFn = A._simpleSpecializedIsTest(testRti); if (simpleIsFn != null) return simpleIsFn; if (kind === 8) { $name = testRti._primary; if (testRti._rest.every(A.isTopType)) { testRti._specializedTestResource = "$is" + $name; if ($name === "List") return A._isListTestViaProperty; if (testRti === type$.JSObject) return A._isJSObject; return A._isTestViaProperty; } } else if (kind === 10) { predicate = A.createRecordTypePredicate(testRti._primary, testRti._rest); t1 = predicate == null ? A._isNever : predicate; return t1 == null ? A._asObject(t1) : t1; } return A._generalIsTestImplementation; }, _simpleSpecializedIsTest(testRti) { if (testRti._kind === 8) { if (testRti === type$.int) return A._isInt; if (testRti === type$.double || testRti === type$.num) return A._isNum; if (testRti === type$.String) return A._isString; if (testRti === type$.bool) return A._isBool; } return null; }, _installSpecializedAsCheck(object) { var testRti = this, asFn = A._generalAsCheckImplementation; if (A.isTopType(testRti)) asFn = A._asTop; else if (testRti === type$.Object) asFn = A._asObject; else if (A.isNullable(testRti)) { asFn = A._generalNullableAsCheckImplementation; if (testRti === type$.nullable_int) asFn = A._asIntQ; else if (testRti === type$.nullable_String) asFn = A._asStringQ; else if (testRti === type$.nullable_bool) asFn = A._asBoolQ; else if (testRti === type$.nullable_num) asFn = A._asNumQ; else if (testRti === type$.nullable_double) asFn = A._asDoubleQ; else if (testRti === type$.nullable_JSObject) asFn = A._asJSObjectQ; } else if (testRti === type$.int) asFn = A._asInt; else if (testRti === type$.String) asFn = A._asString; else if (testRti === type$.bool) asFn = A._asBool; else if (testRti === type$.num) asFn = A._asNum; else if (testRti === type$.double) asFn = A._asDouble; else if (testRti === type$.JSObject) asFn = A._asJSObject; testRti._as = asFn; return testRti._as(object); }, _generalIsTestImplementation(object) { var testRti = this; if (object == null) return A.isNullable(testRti); return A.isSubtype(init.typeUniverse, A.instanceOrFunctionType(object, testRti), testRti); }, _generalNullableIsTestImplementation(object) { if (object == null) return true; return this._primary._is(object); }, _isTestViaProperty(object) { var tag, testRti = this; if (object == null) return A.isNullable(testRti); tag = testRti._specializedTestResource; if (object instanceof A.Object) return !!object[tag]; return !!J.getInterceptor$(object)[tag]; }, _isListTestViaProperty(object) { var tag, testRti = this; if (object == null) return A.isNullable(testRti); if (typeof object != "object") return false; if (Array.isArray(object)) return true; tag = testRti._specializedTestResource; if (object instanceof A.Object) return !!object[tag]; return !!J.getInterceptor$(object)[tag]; }, _isJSObject(object) { var t1 = this; if (object == null) return false; if (typeof object == "object") { if (object instanceof A.Object) return !!object[t1._specializedTestResource]; return true; } if (typeof object == "function") return true; return false; }, _isJSObjectStandalone(object) { if (typeof object == "object") { if (object instanceof A.Object) return type$.JSObject._is(object); return true; } if (typeof object == "function") return true; return false; }, _generalAsCheckImplementation(object) { var testRti = this; if (object == null) { if (A.isNullable(testRti)) return object; } else if (testRti._is(object)) return object; throw A.initializeExceptionWrapper(A._errorForAsCheck(object, testRti), new Error()); }, _generalNullableAsCheckImplementation(object) { var testRti = this; if (object == null || testRti._is(object)) return object; throw A.initializeExceptionWrapper(A._errorForAsCheck(object, testRti), new Error()); }, _errorForAsCheck(object, testRti) { return new A._TypeError("TypeError: " + A._Error_compose(object, A._rtiToString(testRti, null))); }, _Error_compose(object, checkedTypeDescription) { return A.Error_safeToString(object) + ": type '" + A._rtiToString(A._structuralTypeOf(object), null) + "' is not a subtype of type '" + checkedTypeDescription + "'"; }, _TypeError__TypeError$forType(object, type) { return new A._TypeError("TypeError: " + A._Error_compose(object, type)); }, _isFutureOr(object) { var testRti = this; return testRti._primary._is(object) || A.Rti__getFutureFromFutureOr(init.typeUniverse, testRti)._is(object); }, _isObject(object) { return object != null; }, _asObject(object) { if (object != null) return object; throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "Object"), new Error()); }, _isTop(object) { return true; }, _asTop(object) { return object; }, _isNever(object) { return false; }, _isBool(object) { return true === object || false === object; }, _asBool(object) { if (true === object) return true; if (false === object) return false; throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "bool"), new Error()); }, _asBoolQ(object) { if (true === object) return true; if (false === object) return false; if (object == null) return object; throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "bool?"), new Error()); }, _asDouble(object) { if (typeof object == "number") return object; throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "double"), new Error()); }, _asDoubleQ(object) { if (typeof object == "number") return object; if (object == null) return object; throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "double?"), new Error()); }, _isInt(object) { return typeof object == "number" && Math.floor(object) === object; }, _asInt(object) { if (typeof object == "number" && Math.floor(object) === object) return object; throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "int"), new Error()); }, _asIntQ(object) { if (typeof object == "number" && Math.floor(object) === object) return object; if (object == null) return object; throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "int?"), new Error()); }, _isNum(object) { return typeof object == "number"; }, _asNum(object) { if (typeof object == "number") return object; throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "num"), new Error()); }, _asNumQ(object) { if (typeof object == "number") return object; if (object == null) return object; throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "num?"), new Error()); }, _isString(object) { return typeof object == "string"; }, _asString(object) { if (typeof object == "string") return object; throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "String"), new Error()); }, _asStringQ(object) { if (typeof object == "string") return object; if (object == null) return object; throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "String?"), new Error()); }, _asJSObject(object) { if (A._isJSObjectStandalone(object)) return object; throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "JSObject"), new Error()); }, _asJSObjectQ(object) { if (object == null) return object; if (A._isJSObjectStandalone(object)) return object; throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "JSObject?"), new Error()); }, _rtiArrayToString(array, genericContext) { var s, sep, i; for (s = "", sep = "", i = 0; i < array.length; ++i, sep = ", ") s += sep + A._rtiToString(array[i], genericContext); return s; }, _recordRtiToString(recordType, genericContext) { var fieldCount, names, namesIndex, s, comma, i, partialShape = recordType._primary, fields = recordType._rest; if ("" === partialShape) return "(" + A._rtiArrayToString(fields, genericContext) + ")"; fieldCount = fields.length; names = partialShape.split(","); namesIndex = names.length - fieldCount; for (s = "(", comma = "", i = 0; i < fieldCount; ++i, comma = ", ") { s += comma; if (namesIndex === 0) s += "{"; s += A._rtiToString(fields[i], genericContext); if (namesIndex >= 0) s += " " + names[namesIndex]; ++namesIndex; } return s + "})"; }, _functionRtiToString(functionType, genericContext, bounds) { var boundsLength, offset, i, t1, typeParametersText, typeSep, t2, t3, boundRti, kind, parameters, requiredPositional, requiredPositionalLength, optionalPositional, optionalPositionalLength, named, namedLength, returnTypeText, argumentsText, sep, _s2_ = ", ", outerContextLength = null; if (bounds != null) { boundsLength = bounds.length; if (genericContext == null) genericContext = A._setArrayType([], type$.JSArray_String); else outerContextLength = genericContext.length; offset = genericContext.length; for (i = boundsLength; i > 0; --i) B.JSArray_methods.add$1(genericContext, "T" + (offset + i)); for (t1 = type$.nullable_Object, typeParametersText = "<", typeSep = "", i = 0; i < boundsLength; ++i, typeSep = _s2_) { t2 = genericContext.length; t3 = t2 - 1 - i; if (!(t3 >= 0)) return A.ioore(genericContext, t3); typeParametersText = typeParametersText + typeSep + genericContext[t3]; boundRti = bounds[i]; kind = boundRti._kind; if (!(kind === 2 || kind === 3 || kind === 4 || kind === 5 || boundRti === t1)) typeParametersText += " extends " + A._rtiToString(boundRti, genericContext); } typeParametersText += ">"; } else typeParametersText = ""; t1 = functionType._primary; parameters = functionType._rest; requiredPositional = parameters._requiredPositional; requiredPositionalLength = requiredPositional.length; optionalPositional = parameters._optionalPositional; optionalPositionalLength = optionalPositional.length; named = parameters._named; namedLength = named.length; returnTypeText = A._rtiToString(t1, genericContext); for (argumentsText = "", sep = "", i = 0; i < requiredPositionalLength; ++i, sep = _s2_) argumentsText += sep + A._rtiToString(requiredPositional[i], genericContext); if (optionalPositionalLength > 0) { argumentsText += sep + "["; for (sep = "", i = 0; i < optionalPositionalLength; ++i, sep = _s2_) argumentsText += sep + A._rtiToString(optionalPositional[i], genericContext); argumentsText += "]"; } if (namedLength > 0) { argumentsText += sep + "{"; for (sep = "", i = 0; i < namedLength; i += 3, sep = _s2_) { argumentsText += sep; if (named[i + 1]) argumentsText += "required "; argumentsText += A._rtiToString(named[i + 2], genericContext) + " " + named[i]; } argumentsText += "}"; } if (outerContextLength != null) { genericContext.toString; genericContext.length = outerContextLength; } return typeParametersText + "(" + argumentsText + ") => " + returnTypeText; }, _rtiToString(rti, genericContext) { var questionArgument, s, argumentKind, $name, $arguments, t1, t2, kind = rti._kind; if (kind === 5) return "erased"; if (kind === 2) return "dynamic"; if (kind === 3) return "void"; if (kind === 1) return "Never"; if (kind === 4) return "any"; if (kind === 6) { questionArgument = rti._primary; s = A._rtiToString(questionArgument, genericContext); argumentKind = questionArgument._kind; return (argumentKind === 11 || argumentKind === 12 ? "(" + s + ")" : s) + "?"; } if (kind === 7) return "FutureOr<" + A._rtiToString(rti._primary, genericContext) + ">"; if (kind === 8) { $name = A._unminifyOrTag(rti._primary); $arguments = rti._rest; return $arguments.length > 0 ? $name + ("<" + A._rtiArrayToString($arguments, genericContext) + ">") : $name; } if (kind === 10) return A._recordRtiToString(rti, genericContext); if (kind === 11) return A._functionRtiToString(rti, genericContext, null); if (kind === 12) return A._functionRtiToString(rti._primary, genericContext, rti._rest); if (kind === 13) { t1 = rti._primary; t2 = genericContext.length; t1 = t2 - 1 - t1; if (!(t1 >= 0 && t1 < t2)) return A.ioore(genericContext, t1); return genericContext[t1]; } return "?"; }, _unminifyOrTag(rawClassName) { var preserved = init.mangledGlobalNames[rawClassName]; if (preserved != null) return preserved; return rawClassName; }, _Universe_findRule(universe, targetType) { var rule = universe.tR[targetType]; while (typeof rule == "string") rule = universe.tR[rule]; return rule; }, _Universe_findErasedType(universe, cls) { var $length, erased, $arguments, i, $interface, metadata = universe.eT, probe = metadata[cls]; if (probe == null) return A._Universe_eval(universe, cls, false); else if (typeof probe == "number") { $length = probe; erased = A._Universe__lookupTerminalRti(universe, 5, "#"); $arguments = A._Utils_newArrayOrEmpty($length); for (i = 0; i < $length; ++i) $arguments[i] = erased; $interface = A._Universe__lookupInterfaceRti(universe, cls, $arguments); metadata[cls] = $interface; return $interface; } else return probe; }, _Universe_addRules(universe, rules) { return A._Utils_objectAssign(universe.tR, rules); }, _Universe_addErasedTypes(universe, types) { return A._Utils_objectAssign(universe.eT, types); }, _Universe_eval(universe, recipe, normalize) { var rti, cache = universe.eC, probe = cache.get(recipe); if (probe != null) return probe; rti = A._Parser_parse(A._Parser_create(universe, null, recipe, false)); cache.set(recipe, rti); return rti; }, _Universe_evalInEnvironment(universe, environment, recipe) { var probe, rti, cache = environment._evalCache; if (cache == null) cache = environment._evalCache = new Map(); probe = cache.get(recipe); if (probe != null) return probe; rti = A._Parser_parse(A._Parser_create(universe, environment, recipe, true)); cache.set(recipe, rti); return rti; }, _Universe_bind(universe, environment, argumentsRti) { var argumentsRecipe, probe, rti, cache = environment._bindCache; if (cache == null) cache = environment._bindCache = new Map(); argumentsRecipe = argumentsRti._canonicalRecipe; probe = cache.get(argumentsRecipe); if (probe != null) return probe; rti = A._Universe__lookupBindingRti(universe, environment, argumentsRti._kind === 9 ? argumentsRti._rest : [argumentsRti]); cache.set(argumentsRecipe, rti); return rti; }, _Universe__installTypeTests(universe, rti) { rti._as = A._installSpecializedAsCheck; rti._is = A._installSpecializedIsTest; return rti; }, _Universe__lookupTerminalRti(universe, kind, key) { var rti, t1, probe = universe.eC.get(key); if (probe != null) return probe; rti = new A.Rti(null, null); rti._kind = kind; rti._canonicalRecipe = key; t1 = A._Universe__installTypeTests(universe, rti); universe.eC.set(key, t1); return t1; }, _Universe__lookupQuestionRti(universe, baseType, normalize) { var t1, key = baseType._canonicalRecipe + "?", probe = universe.eC.get(key); if (probe != null) return probe; t1 = A._Universe__createQuestionRti(universe, baseType, key, normalize); universe.eC.set(key, t1); return t1; }, _Universe__createQuestionRti(universe, baseType, key, normalize) { var baseKind, t1, rti; if (normalize) { baseKind = baseType._kind; t1 = true; if (!A.isTopType(baseType)) if (!(baseType === type$.Null || baseType === type$.JSNull)) if (baseKind !== 6) t1 = baseKind === 7 && A.isNullable(baseType._primary); if (t1) return baseType; else if (baseKind === 1) return type$.Null; } rti = new A.Rti(null, null); rti._kind = 6; rti._primary = baseType; rti._canonicalRecipe = key; return A._Universe__installTypeTests(universe, rti); }, _Universe__lookupFutureOrRti(universe, baseType, normalize) { var t1, key = baseType._canonicalRecipe + "/", probe = universe.eC.get(key); if (probe != null) return probe; t1 = A._Universe__createFutureOrRti(universe, baseType, key, normalize); universe.eC.set(key, t1); return t1; }, _Universe__createFutureOrRti(universe, baseType, key, normalize) { var t1, rti; if (normalize) { t1 = baseType._kind; if (A.isTopType(baseType) || baseType === type$.Object) return baseType; else if (t1 === 1) return A._Universe__lookupInterfaceRti(universe, "Future", [baseType]); else if (baseType === type$.Null || baseType === type$.JSNull) return type$.nullable_Future_Null; } rti = new A.Rti(null, null); rti._kind = 7; rti._primary = baseType; rti._canonicalRecipe = key; return A._Universe__installTypeTests(universe, rti); }, _Universe__lookupGenericFunctionParameterRti(universe, index) { var rti, t1, key = "" + index + "^", probe = universe.eC.get(key); if (probe != null) return probe; rti = new A.Rti(null, null); rti._kind = 13; rti._primary = index; rti._canonicalRecipe = key; t1 = A._Universe__installTypeTests(universe, rti); universe.eC.set(key, t1); return t1; }, _Universe__canonicalRecipeJoin($arguments) { var s, sep, i, $length = $arguments.length; for (s = "", sep = "", i = 0; i < $length; ++i, sep = ",") s += sep + $arguments[i]._canonicalRecipe; return s; }, _Universe__canonicalRecipeJoinNamed($arguments) { var s, sep, i, t1, nameSep, $length = $arguments.length; for (s = "", sep = "", i = 0; i < $length; i += 3, sep = ",") { t1 = $arguments[i]; nameSep = $arguments[i + 1] ? "!" : ":"; s += sep + t1 + nameSep + $arguments[i + 2]._canonicalRecipe; } return s; }, _Universe__lookupInterfaceRti(universe, $name, $arguments) { var probe, rti, t1, s = $name; if ($arguments.length > 0) s += "<" + A._Universe__canonicalRecipeJoin($arguments) + ">"; probe = universe.eC.get(s); if (probe != null) return probe; rti = new A.Rti(null, null); rti._kind = 8; rti._primary = $name; rti._rest = $arguments; if ($arguments.length > 0) rti._precomputed1 = $arguments[0]; rti._canonicalRecipe = s; t1 = A._Universe__installTypeTests(universe, rti); universe.eC.set(s, t1); return t1; }, _Universe__lookupBindingRti(universe, base, $arguments) { var newBase, newArguments, key, probe, rti, t1; if (base._kind === 9) { newBase = base._primary; newArguments = base._rest.concat($arguments); } else { newArguments = $arguments; newBase = base; } key = newBase._canonicalRecipe + (";<" + A._Universe__canonicalRecipeJoin(newArguments) + ">"); probe = universe.eC.get(key); if (probe != null) return probe; rti = new A.Rti(null, null); rti._kind = 9; rti._primary = newBase; rti._rest = newArguments; rti._canonicalRecipe = key; t1 = A._Universe__installTypeTests(universe, rti); universe.eC.set(key, t1); return t1; }, _Universe__lookupRecordRti(universe, partialShapeTag, fields) { var rti, t1, key = "+" + (partialShapeTag + "(" + A._Universe__canonicalRecipeJoin(fields) + ")"), probe = universe.eC.get(key); if (probe != null) return probe; rti = new A.Rti(null, null); rti._kind = 10; rti._primary = partialShapeTag; rti._rest = fields; rti._canonicalRecipe = key; t1 = A._Universe__installTypeTests(universe, rti); universe.eC.set(key, t1); return t1; }, _Universe__lookupFunctionRti(universe, returnType, parameters) { var sep, key, probe, rti, t1, s = returnType._canonicalRecipe, requiredPositional = parameters._requiredPositional, requiredPositionalLength = requiredPositional.length, optionalPositional = parameters._optionalPositional, optionalPositionalLength = optionalPositional.length, named = parameters._named, namedLength = named.length, recipe = "(" + A._Universe__canonicalRecipeJoin(requiredPositional); if (optionalPositionalLength > 0) { sep = requiredPositionalLength > 0 ? "," : ""; recipe += sep + "[" + A._Universe__canonicalRecipeJoin(optionalPositional) + "]"; } if (namedLength > 0) { sep = requiredPositionalLength > 0 ? "," : ""; recipe += sep + "{" + A._Universe__canonicalRecipeJoinNamed(named) + "}"; } key = s + (recipe + ")"); probe = universe.eC.get(key); if (probe != null) return probe; rti = new A.Rti(null, null); rti._kind = 11; rti._primary = returnType; rti._rest = parameters; rti._canonicalRecipe = key; t1 = A._Universe__installTypeTests(universe, rti); universe.eC.set(key, t1); return t1; }, _Universe__lookupGenericFunctionRti(universe, baseFunctionType, bounds, normalize) { var t1, key = baseFunctionType._canonicalRecipe + ("<" + A._Universe__canonicalRecipeJoin(bounds) + ">"), probe = universe.eC.get(key); if (probe != null) return probe; t1 = A._Universe__createGenericFunctionRti(universe, baseFunctionType, bounds, key, normalize); universe.eC.set(key, t1); return t1; }, _Universe__createGenericFunctionRti(universe, baseFunctionType, bounds, key, normalize) { var $length, typeArguments, count, i, bound, substitutedBase, substitutedBounds, rti; if (normalize) { $length = bounds.length; typeArguments = A._Utils_newArrayOrEmpty($length); for (count = 0, i = 0; i < $length; ++i) { bound = bounds[i]; if (bound._kind === 1) { typeArguments[i] = bound; ++count; } } if (count > 0) { substitutedBase = A._substitute(universe, baseFunctionType, typeArguments, 0); substitutedBounds = A._substituteArray(universe, bounds, typeArguments, 0); return A._Universe__lookupGenericFunctionRti(universe, substitutedBase, substitutedBounds, bounds !== substitutedBounds); } } rti = new A.Rti(null, null); rti._kind = 12; rti._primary = baseFunctionType; rti._rest = bounds; rti._canonicalRecipe = key; return A._Universe__installTypeTests(universe, rti); }, _Parser_create(universe, environment, recipe, normalize) { return {u: universe, e: environment, r: recipe, s: [], p: 0, n: normalize}; }, _Parser_parse(parser) { var t1, i, ch, u, array, end, item, source = parser.r, stack = parser.s; for (t1 = source.length, i = 0; i < t1;) { ch = source.charCodeAt(i); if (ch >= 48 && ch <= 57) i = A._Parser_handleDigit(i + 1, ch, source, stack); else if ((((ch | 32) >>> 0) - 97 & 65535) < 26 || ch === 95 || ch === 36 || ch === 124) i = A._Parser_handleIdentifier(parser, i, source, stack, false); else if (ch === 46) i = A._Parser_handleIdentifier(parser, i, source, stack, true); else { ++i; switch (ch) { case 44: break; case 58: stack.push(false); break; case 33: stack.push(true); break; case 59: stack.push(A._Parser_toType(parser.u, parser.e, stack.pop())); break; case 94: stack.push(A._Universe__lookupGenericFunctionParameterRti(parser.u, stack.pop())); break; case 35: stack.push(A._Universe__lookupTerminalRti(parser.u, 5, "#")); break; case 64: stack.push(A._Universe__lookupTerminalRti(parser.u, 2, "@")); break; case 126: stack.push(A._Universe__lookupTerminalRti(parser.u, 3, "~")); break; case 60: stack.push(parser.p); parser.p = stack.length; break; case 62: A._Parser_handleTypeArguments(parser, stack); break; case 38: A._Parser_handleExtendedOperations(parser, stack); break; case 63: u = parser.u; stack.push(A._Universe__lookupQuestionRti(u, A._Parser_toType(u, parser.e, stack.pop()), parser.n)); break; case 47: u = parser.u; stack.push(A._Universe__lookupFutureOrRti(u, A._Parser_toType(u, parser.e, stack.pop()), parser.n)); break; case 40: stack.push(-3); stack.push(parser.p); parser.p = stack.length; break; case 41: A._Parser_handleArguments(parser, stack); break; case 91: stack.push(parser.p); parser.p = stack.length; break; case 93: array = stack.splice(parser.p); A._Parser_toTypes(parser.u, parser.e, array); parser.p = stack.pop(); stack.push(array); stack.push(-1); break; case 123: stack.push(parser.p); parser.p = stack.length; break; case 125: array = stack.splice(parser.p); A._Parser_toTypesNamed(parser.u, parser.e, array); parser.p = stack.pop(); stack.push(array); stack.push(-2); break; case 43: end = source.indexOf("(", i); stack.push(source.substring(i, end)); stack.push(-4); stack.push(parser.p); parser.p = stack.length; i = end + 1; break; default: throw "Bad character " + ch; } } } item = stack.pop(); return A._Parser_toType(parser.u, parser.e, item); }, _Parser_handleDigit(i, digit, source, stack) { var t1, ch, value = digit - 48; for (t1 = source.length; i < t1; ++i) { ch = source.charCodeAt(i); if (!(ch >= 48 && ch <= 57)) break; value = value * 10 + (ch - 48); } stack.push(value); return i; }, _Parser_handleIdentifier(parser, start, source, stack, hasPeriod) { var t1, ch, t2, string, environment, recipe, i = start + 1; for (t1 = source.length; i < t1; ++i) { ch = source.charCodeAt(i); if (ch === 46) { if (hasPeriod) break; hasPeriod = true; } else { if (!((((ch | 32) >>> 0) - 97 & 65535) < 26 || ch === 95 || ch === 36 || ch === 124)) t2 = ch >= 48 && ch <= 57; else t2 = true; if (!t2) break; } } string = source.substring(start, i); if (hasPeriod) { t1 = parser.u; environment = parser.e; if (environment._kind === 9) environment = environment._primary; recipe = A._Universe_findRule(t1, environment._primary)[string]; if (recipe == null) A.throwExpression('No "' + string + '" in "' + A.Rti__getCanonicalRecipe(environment) + '"'); stack.push(A._Universe_evalInEnvironment(t1, environment, recipe)); } else stack.push(string); return i; }, _Parser_handleTypeArguments(parser, stack) { var base, universe = parser.u, $arguments = A._Parser_collectArray(parser, stack), head = stack.pop(); if (typeof head == "string") stack.push(A._Universe__lookupInterfaceRti(universe, head, $arguments)); else { base = A._Parser_toType(universe, parser.e, head); switch (base._kind) { case 11: stack.push(A._Universe__lookupGenericFunctionRti(universe, base, $arguments, parser.n)); break; default: stack.push(A._Universe__lookupBindingRti(universe, base, $arguments)); break; } } }, _Parser_handleArguments(parser, stack) { var requiredPositional, returnType, parameters, universe = parser.u, head = stack.pop(), optionalPositional = null, named = null; if (typeof head == "number") switch (head) { case -1: optionalPositional = stack.pop(); break; case -2: named = stack.pop(); break; default: stack.push(head); break; } else stack.push(head); requiredPositional = A._Parser_collectArray(parser, stack); head = stack.pop(); switch (head) { case -3: head = stack.pop(); if (optionalPositional == null) optionalPositional = universe.sEA; if (named == null) named = universe.sEA; returnType = A._Parser_toType(universe, parser.e, head); parameters = new A._FunctionParameters(); parameters._requiredPositional = requiredPositional; parameters._optionalPositional = optionalPositional; parameters._named = named; stack.push(A._Universe__lookupFunctionRti(universe, returnType, parameters)); return; case -4: stack.push(A._Universe__lookupRecordRti(universe, stack.pop(), requiredPositional)); return; default: throw A.wrapException(A.AssertionError$("Unexpected state under `()`: " + A.S(head))); } }, _Parser_handleExtendedOperations(parser, stack) { var $top = stack.pop(); if (0 === $top) { stack.push(A._Universe__lookupTerminalRti(parser.u, 1, "0&")); return; } if (1 === $top) { stack.push(A._Universe__lookupTerminalRti(parser.u, 4, "1&")); return; } throw A.wrapException(A.AssertionError$("Unexpected extended operation " + A.S($top))); }, _Parser_collectArray(parser, stack) { var array = stack.splice(parser.p); A._Parser_toTypes(parser.u, parser.e, array); parser.p = stack.pop(); return array; }, _Parser_toType(universe, environment, item) { if (typeof item == "string") return A._Universe__lookupInterfaceRti(universe, item, universe.sEA); else if (typeof item == "number") { environment.toString; return A._Parser_indexToType(universe, environment, item); } else return item; }, _Parser_toTypes(universe, environment, items) { var i, $length = items.length; for (i = 0; i < $length; ++i) items[i] = A._Parser_toType(universe, environment, items[i]); }, _Parser_toTypesNamed(universe, environment, items) { var i, $length = items.length; for (i = 2; i < $length; i += 3) items[i] = A._Parser_toType(universe, environment, items[i]); }, _Parser_indexToType(universe, environment, index) { var typeArguments, len, kind = environment._kind; if (kind === 9) { if (index === 0) return environment._primary; typeArguments = environment._rest; len = typeArguments.length; if (index <= len) return typeArguments[index - 1]; index -= len; environment = environment._primary; kind = environment._kind; } else if (index === 0) return environment; if (kind !== 8) throw A.wrapException(A.AssertionError$("Indexed base must be an interface type")); typeArguments = environment._rest; if (index <= typeArguments.length) return typeArguments[index - 1]; throw A.wrapException(A.AssertionError$("Bad index " + index + " for " + environment.toString$0(0))); }, isSubtype(universe, s, t) { var result, sCache = s._isSubtypeCache; if (sCache == null) sCache = s._isSubtypeCache = new Map(); result = sCache.get(t); if (result == null) { result = A._isSubtype(universe, s, null, t, null); sCache.set(t, result); } return result; }, _isSubtype(universe, s, sEnv, t, tEnv) { var sKind, leftTypeVariable, tKind, t1, t2, sBounds, tBounds, sLength, i, sBound, tBound; if (s === t) return true; if (A.isTopType(t)) return true; sKind = s._kind; if (sKind === 4) return true; if (A.isTopType(s)) return false; if (s._kind === 1) return true; leftTypeVariable = sKind === 13; if (leftTypeVariable) if (A._isSubtype(universe, sEnv[s._primary], sEnv, t, tEnv)) return true; tKind = t._kind; t1 = type$.Null; if (s === t1 || s === type$.JSNull) { if (tKind === 7) return A._isSubtype(universe, s, sEnv, t._primary, tEnv); return t === t1 || t === type$.JSNull || tKind === 6; } if (t === type$.Object) { if (sKind === 7) return A._isSubtype(universe, s._primary, sEnv, t, tEnv); return sKind !== 6; } if (sKind === 7) { if (!A._isSubtype(universe, s._primary, sEnv, t, tEnv)) return false; return A._isSubtype(universe, A.Rti__getFutureFromFutureOr(universe, s), sEnv, t, tEnv); } if (sKind === 6) return A._isSubtype(universe, t1, sEnv, t, tEnv) && A._isSubtype(universe, s._primary, sEnv, t, tEnv); if (tKind === 7) { if (A._isSubtype(universe, s, sEnv, t._primary, tEnv)) return true; return A._isSubtype(universe, s, sEnv, A.Rti__getFutureFromFutureOr(universe, t), tEnv); } if (tKind === 6) return A._isSubtype(universe, s, sEnv, t1, tEnv) || A._isSubtype(universe, s, sEnv, t._primary, tEnv); if (leftTypeVariable) return false; t1 = sKind !== 11; if ((!t1 || sKind === 12) && t === type$.Function) return true; t2 = sKind === 10; if (t2 && t === type$.Record) return true; if (tKind === 12) { if (s === type$.JavaScriptFunction) return true; if (sKind !== 12) return false; sBounds = s._rest; tBounds = t._rest; sLength = sBounds.length; if (sLength !== tBounds.length) return false; sEnv = sEnv == null ? sBounds : sBounds.concat(sEnv); tEnv = tEnv == null ? tBounds : tBounds.concat(tEnv); for (i = 0; i < sLength; ++i) { sBound = sBounds[i]; tBound = tBounds[i]; if (!A._isSubtype(universe, sBound, sEnv, tBound, tEnv) || !A._isSubtype(universe, tBound, tEnv, sBound, sEnv)) return false; } return A._isFunctionSubtype(universe, s._primary, sEnv, t._primary, tEnv); } if (tKind === 11) { if (s === type$.JavaScriptFunction) return true; if (t1) return false; return A._isFunctionSubtype(universe, s, sEnv, t, tEnv); } if (sKind === 8) { if (tKind !== 8) return false; return A._isInterfaceSubtype(universe, s, sEnv, t, tEnv); } if (t2 && tKind === 10) return A._isRecordSubtype(universe, s, sEnv, t, tEnv); return false; }, _isFunctionSubtype(universe, s, sEnv, t, tEnv) { var sParameters, tParameters, sRequiredPositional, tRequiredPositional, sRequiredPositionalLength, tRequiredPositionalLength, requiredPositionalDelta, sOptionalPositional, tOptionalPositional, sOptionalPositionalLength, tOptionalPositionalLength, i, t1, sNamed, tNamed, sNamedLength, tNamedLength, sIndex, tIndex, tName, sName, sIsRequired; if (!A._isSubtype(universe, s._primary, sEnv, t._primary, tEnv)) return false; sParameters = s._rest; tParameters = t._rest; sRequiredPositional = sParameters._requiredPositional; tRequiredPositional = tParameters._requiredPositional; sRequiredPositionalLength = sRequiredPositional.length; tRequiredPositionalLength = tRequiredPositional.length; if (sRequiredPositionalLength > tRequiredPositionalLength) return false; requiredPositionalDelta = tRequiredPositionalLength - sRequiredPositionalLength; sOptionalPositional = sParameters._optionalPositional; tOptionalPositional = tParameters._optionalPositional; sOptionalPositionalLength = sOptionalPositional.length; tOptionalPositionalLength = tOptionalPositional.length; if (sRequiredPositionalLength + sOptionalPositionalLength < tRequiredPositionalLength + tOptionalPositionalLength) return false; for (i = 0; i < sRequiredPositionalLength; ++i) { t1 = sRequiredPositional[i]; if (!A._isSubtype(universe, tRequiredPositional[i], tEnv, t1, sEnv)) return false; } for (i = 0; i < requiredPositionalDelta; ++i) { t1 = sOptionalPositional[i]; if (!A._isSubtype(universe, tRequiredPositional[sRequiredPositionalLength + i], tEnv, t1, sEnv)) return false; } for (i = 0; i < tOptionalPositionalLength; ++i) { t1 = sOptionalPositional[requiredPositionalDelta + i]; if (!A._isSubtype(universe, tOptionalPositional[i], tEnv, t1, sEnv)) return false; } sNamed = sParameters._named; tNamed = tParameters._named; sNamedLength = sNamed.length; tNamedLength = tNamed.length; for (sIndex = 0, tIndex = 0; tIndex < tNamedLength; tIndex += 3) { tName = tNamed[tIndex]; for (;;) { if (sIndex >= sNamedLength) return false; sName = sNamed[sIndex]; sIndex += 3; if (tName < sName) return false; sIsRequired = sNamed[sIndex - 2]; if (sName < tName) { if (sIsRequired) return false; continue; } t1 = tNamed[tIndex + 1]; if (sIsRequired && !t1) return false; t1 = sNamed[sIndex - 1]; if (!A._isSubtype(universe, tNamed[tIndex + 2], tEnv, t1, sEnv)) return false; break; } } while (sIndex < sNamedLength) { if (sNamed[sIndex + 1]) return false; sIndex += 3; } return true; }, _isInterfaceSubtype(universe, s, sEnv, t, tEnv) { var rule, recipes, $length, supertypeArgs, i, sName = s._primary, tName = t._primary; while (sName !== tName) { rule = universe.tR[sName]; if (rule == null) return false; if (typeof rule == "string") { sName = rule; continue; } recipes = rule[tName]; if (recipes == null) return false; $length = recipes.length; supertypeArgs = $length > 0 ? new Array($length) : init.typeUniverse.sEA; for (i = 0; i < $length; ++i) supertypeArgs[i] = A._Universe_evalInEnvironment(universe, s, recipes[i]); return A._areArgumentsSubtypes(universe, supertypeArgs, null, sEnv, t._rest, tEnv); } return A._areArgumentsSubtypes(universe, s._rest, null, sEnv, t._rest, tEnv); }, _areArgumentsSubtypes(universe, sArgs, sVariances, sEnv, tArgs, tEnv) { var i, $length = sArgs.length; for (i = 0; i < $length; ++i) if (!A._isSubtype(universe, sArgs[i], sEnv, tArgs[i], tEnv)) return false; return true; }, _isRecordSubtype(universe, s, sEnv, t, tEnv) { var i, sFields = s._rest, tFields = t._rest, sCount = sFields.length; if (sCount !== tFields.length) return false; if (s._primary !== t._primary) return false; for (i = 0; i < sCount; ++i) if (!A._isSubtype(universe, sFields[i], sEnv, tFields[i], tEnv)) return false; return true; }, isNullable(t) { var kind = t._kind, t1 = true; if (!(t === type$.Null || t === type$.JSNull)) if (!A.isTopType(t)) if (kind !== 6) t1 = kind === 7 && A.isNullable(t._primary); return t1; }, isTopType(t) { var kind = t._kind; return kind === 2 || kind === 3 || kind === 4 || kind === 5 || t === type$.nullable_Object; }, _Utils_objectAssign(o, other) { var i, key, keys = Object.keys(other), $length = keys.length; for (i = 0; i < $length; ++i) { key = keys[i]; o[key] = other[key]; } }, _Utils_newArrayOrEmpty($length) { return $length > 0 ? new Array($length) : init.typeUniverse.sEA; }, Rti: function Rti(t0, t1) { var _ = this; _._as = t0; _._is = t1; _._cachedRuntimeType = _._specializedTestResource = _._isSubtypeCache = _._precomputed1 = null; _._kind = 0; _._canonicalRecipe = _._bindCache = _._evalCache = _._rest = _._primary = null; }, _FunctionParameters: function _FunctionParameters() { this._named = this._optionalPositional = this._requiredPositional = null; }, _Type: function _Type(t0) { this._rti = t0; }, _Error: function _Error() { }, _TypeError: function _TypeError(t0) { this.__rti$_message = t0; }, _AsyncRun__initializeScheduleImmediate() { var t1, div, span; if (self.scheduleImmediate != null) return A.async__AsyncRun__scheduleImmediateJsOverride$closure(); if (self.MutationObserver != null && self.document != null) { t1 = {}; div = self.document.createElement("div"); span = self.document.createElement("span"); t1.storedCallback = null; new self.MutationObserver(A.convertDartClosureToJS(new A._AsyncRun__initializeScheduleImmediate_internalCallback(t1), 1)).observe(div, {childList: true}); return new A._AsyncRun__initializeScheduleImmediate_closure(t1, div, span); } else if (self.setImmediate != null) return A.async__AsyncRun__scheduleImmediateWithSetImmediate$closure(); return A.async__AsyncRun__scheduleImmediateWithTimer$closure(); }, _AsyncRun__scheduleImmediateJsOverride(callback) { self.scheduleImmediate(A.convertDartClosureToJS(new A._AsyncRun__scheduleImmediateJsOverride_internalCallback(type$.void_Function._as(callback)), 0)); }, _AsyncRun__scheduleImmediateWithSetImmediate(callback) { self.setImmediate(A.convertDartClosureToJS(new A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback(type$.void_Function._as(callback)), 0)); }, _AsyncRun__scheduleImmediateWithTimer(callback) { type$.void_Function._as(callback); A._TimerImpl$(0, callback); }, _TimerImpl$(milliseconds, callback) { var t1 = new A._TimerImpl(); t1._TimerImpl$2(milliseconds, callback); return t1; }, _SyncStarIterator__terminatedBody(_1, _2, _3) { return 0; }, AsyncError_defaultStackTrace(error) { var stackTrace; if (type$.Error._is(error)) { stackTrace = error.get$stackTrace(); if (stackTrace != null) return stackTrace; } return B.C__StringStackTrace; }, _Future__chainCoreFuture(source, target, sync) { var t2, t3, ignoreError, listeners, _box_0 = {}, t1 = _box_0.source = source; for (t2 = type$._Future_dynamic; t3 = t1._state, (t3 & 4) !== 0; t1 = source) { source = t2._as(t1._resultOrListeners); _box_0.source = source; } if (t1 === target) { t2 = A.StackTrace_current(); target._asyncCompleteErrorObject$1(new A.AsyncError(new A.ArgumentError(true, t1, null, "Cannot complete a future with itself"), t2)); return; } ignoreError = target._state & 1; t2 = t1._state = t3 | ignoreError; if ((t2 & 24) === 0) { listeners = type$.nullable__FutureListener_dynamic_dynamic._as(target._resultOrListeners); target._state = target._state & 1 | 4; target._resultOrListeners = t1; t1._prependListeners$1(listeners); return; } if (!sync) if (target._resultOrListeners == null) t1 = (t2 & 16) === 0 || ignoreError !== 0; else t1 = false; else t1 = true; if (t1) { listeners = target._removeListeners$0(); target._cloneResult$1(_box_0.source); A._Future__propagateToListeners(target, listeners); return; } target._state ^= 2; A._rootScheduleMicrotask(null, null, target._zone, type$.void_Function._as(new A._Future__chainCoreFuture_closure(_box_0, target))); }, _Future__propagateToListeners(source, listeners) { var t2, t3, _box_0, t4, t5, hasError, asyncError, nextListener, nextListener0, sourceResult, t6, zone, oldZone, result, current, _box_1 = {}, t1 = _box_1.source = source; for (t2 = type$.AsyncError, t3 = type$.nullable__FutureListener_dynamic_dynamic;;) { _box_0 = {}; t4 = t1._state; t5 = (t4 & 16) === 0; hasError = !t5; if (listeners == null) { if (hasError && (t4 & 1) === 0) { asyncError = t2._as(t1._resultOrListeners); A._rootHandleError(asyncError.error, asyncError.stackTrace); } return; } _box_0.listener = listeners; nextListener = listeners._nextListener; for (t1 = listeners; nextListener != null; t1 = nextListener, nextListener = nextListener0) { t1._nextListener = null; A._Future__propagateToListeners(_box_1.source, t1); _box_0.listener = nextListener; nextListener0 = nextListener._nextListener; } t4 = _box_1.source; sourceResult = t4._resultOrListeners; _box_0.listenerHasError = hasError; _box_0.listenerValueOrError = sourceResult; if (t5) { t6 = t1.state; t6 = (t6 & 1) !== 0 || (t6 & 15) === 8; } else t6 = true; if (t6) { zone = t1.result._zone; if (hasError) { t4 = t4._zone === zone; t4 = !(t4 || t4); } else t4 = false; if (t4) { t2._as(sourceResult); A._rootHandleError(sourceResult.error, sourceResult.stackTrace); return; } oldZone = $.Zone__current; if (oldZone !== zone) $.Zone__current = zone; else oldZone = null; t1 = t1.state; if ((t1 & 15) === 8) new A._Future__propagateToListeners_handleWhenCompleteCallback(_box_0, _box_1, hasError).call$0(); else if (t5) { if ((t1 & 1) !== 0) new A._Future__propagateToListeners_handleValueCallback(_box_0, sourceResult).call$0(); } else if ((t1 & 2) !== 0) new A._Future__propagateToListeners_handleError(_box_1, _box_0).call$0(); if (oldZone != null) $.Zone__current = oldZone; t1 = _box_0.listenerValueOrError; if (t1 instanceof A._Future) { t4 = _box_0.listener.$ti; t4 = t4._eval$1("Future<2>")._is(t1) || !t4._rest[1]._is(t1); } else t4 = false; if (t4) { result = _box_0.listener.result; if ((t1._state & 24) !== 0) { current = t3._as(result._resultOrListeners); result._resultOrListeners = null; listeners = result._reverseListeners$1(current); result._state = t1._state & 30 | result._state & 1; result._resultOrListeners = t1._resultOrListeners; _box_1.source = t1; continue; } else A._Future__chainCoreFuture(t1, result, true); return; } } result = _box_0.listener.result; current = t3._as(result._resultOrListeners); result._resultOrListeners = null; listeners = result._reverseListeners$1(current); t1 = _box_0.listenerHasError; t4 = _box_0.listenerValueOrError; if (!t1) { result.$ti._precomputed1._as(t4); result._state = 8; result._resultOrListeners = t4; } else { t2._as(t4); result._state = result._state & 1 | 16; result._resultOrListeners = t4; } _box_1.source = result; t1 = result; } }, _registerErrorHandler(errorHandler, zone) { var t1 = type$.dynamic_Function_Object_StackTrace; if (t1._is(errorHandler)) return t1._as(errorHandler); t1 = type$.dynamic_Function_Object; if (t1._is(errorHandler)) return t1._as(errorHandler); throw A.wrapException(A.ArgumentError$value(errorHandler, "onError", string$.Error_)); }, _microtaskLoop() { var entry, next; for (entry = $._nextCallback; entry != null; entry = $._nextCallback) { $._lastPriorityCallback = null; next = entry.next; $._nextCallback = next; if (next == null) $._lastCallback = null; entry.callback.call$0(); } }, _startMicrotaskLoop() { $._isInCallbackLoop = true; try { A._microtaskLoop(); } finally { $._lastPriorityCallback = null; $._isInCallbackLoop = false; if ($._nextCallback != null) $.$get$_AsyncRun__scheduleImmediateClosure().call$1(A.async___startMicrotaskLoop$closure()); } }, _scheduleAsyncCallback(callback) { var newEntry = new A._AsyncCallbackEntry(callback), lastCallback = $._lastCallback; if (lastCallback == null) { $._nextCallback = $._lastCallback = newEntry; if (!$._isInCallbackLoop) $.$get$_AsyncRun__scheduleImmediateClosure().call$1(A.async___startMicrotaskLoop$closure()); } else $._lastCallback = lastCallback.next = newEntry; }, _schedulePriorityAsyncCallback(callback) { var entry, lastPriorityCallback, next, t1 = $._nextCallback; if (t1 == null) { A._scheduleAsyncCallback(callback); $._lastPriorityCallback = $._lastCallback; return; } entry = new A._AsyncCallbackEntry(callback); lastPriorityCallback = $._lastPriorityCallback; if (lastPriorityCallback == null) { entry.next = t1; $._nextCallback = $._lastPriorityCallback = entry; } else { next = lastPriorityCallback.next; entry.next = next; $._lastPriorityCallback = lastPriorityCallback.next = entry; if (next == null) $._lastCallback = entry; } }, _rootHandleError(error, stackTrace) { A._schedulePriorityAsyncCallback(new A._rootHandleError_closure(error, stackTrace)); }, _rootRun($self, $parent, zone, f, $R) { var old, t1 = $.Zone__current; if (t1 === zone) return f.call$0(); $.Zone__current = zone; old = t1; try { t1 = f.call$0(); return t1; } finally { $.Zone__current = old; } }, _rootRunUnary($self, $parent, zone, f, arg, $R, $T) { var old, t1 = $.Zone__current; if (t1 === zone) return f.call$1(arg); $.Zone__current = zone; old = t1; try { t1 = f.call$1(arg); return t1; } finally { $.Zone__current = old; } }, _rootRunBinary($self, $parent, zone, f, arg1, arg2, $R, $T1, $T2) { var old, t1 = $.Zone__current; if (t1 === zone) return f.call$2(arg1, arg2); $.Zone__current = zone; old = t1; try { t1 = f.call$2(arg1, arg2); return t1; } finally { $.Zone__current = old; } }, _rootScheduleMicrotask($self, $parent, zone, f) { type$.void_Function._as(f); if (B.C__RootZone !== zone) { f = zone.bindCallbackGuarded$1(f); f = f; } A._scheduleAsyncCallback(f); }, _AsyncRun__initializeScheduleImmediate_internalCallback: function _AsyncRun__initializeScheduleImmediate_internalCallback(t0) { this._box_0 = t0; }, _AsyncRun__initializeScheduleImmediate_closure: function _AsyncRun__initializeScheduleImmediate_closure(t0, t1, t2) { this._box_0 = t0; this.div = t1; this.span = t2; }, _AsyncRun__scheduleImmediateJsOverride_internalCallback: function _AsyncRun__scheduleImmediateJsOverride_internalCallback(t0) { this.callback = t0; }, _AsyncRun__scheduleImmediateWithSetImmediate_internalCallback: function _AsyncRun__scheduleImmediateWithSetImmediate_internalCallback(t0) { this.callback = t0; }, _TimerImpl: function _TimerImpl() { }, _TimerImpl_internalCallback: function _TimerImpl_internalCallback(t0, t1) { this.$this = t0; this.callback = t1; }, _SyncStarIterator: function _SyncStarIterator(t0, t1) { var _ = this; _._async$_body = t0; _._suspendedBodies = _._nestedIterator = _._datum = _._async$_current = null; _.$ti = t1; }, _SyncStarIterable: function _SyncStarIterable(t0, t1) { this._outerHelper = t0; this.$ti = t1; }, AsyncError: function AsyncError(t0, t1) { this.error = t0; this.stackTrace = t1; }, _FutureListener: function _FutureListener(t0, t1, t2, t3, t4) { var _ = this; _._nextListener = null; _.result = t0; _.state = t1; _.callback = t2; _.errorCallback = t3; _.$ti = t4; }, _Future: function _Future(t0, t1) { var _ = this; _._state = 0; _._zone = t0; _._resultOrListeners = null; _.$ti = t1; }, _Future__addListener_closure: function _Future__addListener_closure(t0, t1) { this.$this = t0; this.listener = t1; }, _Future__prependListeners_closure: function _Future__prependListeners_closure(t0, t1) { this._box_0 = t0; this.$this = t1; }, _Future__chainCoreFuture_closure: function _Future__chainCoreFuture_closure(t0, t1) { this._box_0 = t0; this.target = t1; }, _Future__asyncCompleteErrorObject_closure: function _Future__asyncCompleteErrorObject_closure(t0, t1) { this.$this = t0; this.error = t1; }, _Future__propagateToListeners_handleWhenCompleteCallback: function _Future__propagateToListeners_handleWhenCompleteCallback(t0, t1, t2) { this._box_0 = t0; this._box_1 = t1; this.hasError = t2; }, _Future__propagateToListeners_handleWhenCompleteCallback_closure: function _Future__propagateToListeners_handleWhenCompleteCallback_closure(t0, t1) { this.joinedResult = t0; this.originalSource = t1; }, _Future__propagateToListeners_handleWhenCompleteCallback_closure0: function _Future__propagateToListeners_handleWhenCompleteCallback_closure0(t0) { this.joinedResult = t0; }, _Future__propagateToListeners_handleValueCallback: function _Future__propagateToListeners_handleValueCallback(t0, t1) { this._box_0 = t0; this.sourceResult = t1; }, _Future__propagateToListeners_handleError: function _Future__propagateToListeners_handleError(t0, t1) { this._box_1 = t0; this._box_0 = t1; }, _AsyncCallbackEntry: function _AsyncCallbackEntry(t0) { this.callback = t0; this.next = null; }, Stream: function Stream() { }, Stream_length_closure: function Stream_length_closure(t0, t1) { this._box_0 = t0; this.$this = t1; }, Stream_length_closure0: function Stream_length_closure0(t0, t1) { this._box_0 = t0; this.future = t1; }, _Zone: function _Zone() { }, _rootHandleError_closure: function _rootHandleError_closure(t0, t1) { this.error = t0; this.stackTrace = t1; }, _RootZone: function _RootZone() { }, _RootZone_bindCallbackGuarded_closure: function _RootZone_bindCallbackGuarded_closure(t0, t1) { this.$this = t0; this.f = t1; }, _RootZone_bindUnaryCallbackGuarded_closure: function _RootZone_bindUnaryCallbackGuarded_closure(t0, t1, t2) { this.$this = t0; this.f = t1; this.T = t2; }, LinkedHashMap_LinkedHashMap($K, $V) { return new A.JsLinkedHashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("JsLinkedHashMap<1,2>")); }, LinkedHashMap_LinkedHashMap$_literal(keyValuePairs, $K, $V) { return $K._eval$1("@<0>")._bind$1($V)._eval$1("LinkedHashMap<1,2>")._as(A.fillLiteralMap(keyValuePairs, new A.JsLinkedHashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("JsLinkedHashMap<1,2>")))); }, LinkedHashMap_LinkedHashMap$_empty($K, $V) { return new A.JsLinkedHashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("JsLinkedHashMap<1,2>")); }, LinkedHashSet_LinkedHashSet($E) { return new A._LinkedHashSet($E._eval$1("_LinkedHashSet<0>")); }, LinkedHashSet_LinkedHashSet$_empty($E) { return new A._LinkedHashSet($E._eval$1("_LinkedHashSet<0>")); }, _LinkedHashSet__newHashTable() { var table = Object.create(null); table[""] = table; delete table[""]; return table; }, _LinkedHashSetIterator$(_set, _modifications, $E) { var t1 = new A._LinkedHashSetIterator(_set, _modifications, $E._eval$1("_LinkedHashSetIterator<0>")); t1._collection$_cell = _set._collection$_first; return t1; }, LinkedHashMap_LinkedHashMap$from(other, $K, $V) { var result = A.LinkedHashMap_LinkedHashMap($K, $V); other.forEach$1(0, new A.LinkedHashMap_LinkedHashMap$from_closure(result, $K, $V)); return result; }, LinkedHashMap_LinkedHashMap$of(other, $K, $V) { var t1 = A.LinkedHashMap_LinkedHashMap($K, $V); t1.addAll$1(0, other); return t1; }, LinkedHashSet_LinkedHashSet$from(elements, $E) { var t1, _i, result = A.LinkedHashSet_LinkedHashSet($E); for (t1 = elements.length, _i = 0; _i < elements.length; elements.length === t1 || (0, A.throwConcurrentModificationError)(elements), ++_i) result.add$1(0, $E._as(elements[_i])); return result; }, LinkedHashSet_LinkedHashSet$of(elements, $E) { var t1 = A.LinkedHashSet_LinkedHashSet($E); t1.addAll$1(0, elements); return t1; }, MapBase_mapToString(m) { var result, t1; if (A.isToStringVisiting(m)) return "{...}"; result = new A.StringBuffer(""); try { t1 = {}; B.JSArray_methods.add$1($.toStringVisiting, m); result._contents += "{"; t1.first = true; m.forEach$1(0, new A.MapBase_mapToString_closure(t1, result)); result._contents += "}"; } finally { if (0 >= $.toStringVisiting.length) return A.ioore($.toStringVisiting, -1); $.toStringVisiting.pop(); } t1 = result._contents; return t1.charCodeAt(0) == 0 ? t1 : t1; }, ListQueue$($E) { return new A.ListQueue(A.List_List$filled(A.ListQueue__calculateCapacity(null), null, false, $E._eval$1("0?")), $E._eval$1("ListQueue<0>")); }, ListQueue__calculateCapacity(initialCapacity) { return 8; }, _LinkedHashSet: function _LinkedHashSet(t0) { var _ = this; _._collection$_length = 0; _._collection$_last = _._collection$_first = _._collection$_rest = _._collection$_nums = _._collection$_strings = null; _._collection$_modifications = 0; _.$ti = t0; }, _LinkedHashSetCell: function _LinkedHashSetCell(t0) { this._element = t0; this._collection$_previous = this._collection$_next = null; }, _LinkedHashSetIterator: function _LinkedHashSetIterator(t0, t1, t2) { var _ = this; _._set = t0; _._collection$_modifications = t1; _._collection$_current = _._collection$_cell = null; _.$ti = t2; }, LinkedHashMap_LinkedHashMap$from_closure: function LinkedHashMap_LinkedHashMap$from_closure(t0, t1, t2) { this.result = t0; this.K = t1; this.V = t2; }, ListBase: function ListBase() { }, MapBase: function MapBase() { }, MapBase_mapToString_closure: function MapBase_mapToString_closure(t0, t1) { this._box_0 = t0; this.result = t1; }, ListQueue: function ListQueue(t0, t1) { var _ = this; _._table = t0; _._modificationCount = _._tail = _._head = 0; _.$ti = t1; }, _ListQueueIterator: function _ListQueueIterator(t0, t1, t2, t3, t4) { var _ = this; _._collection$_queue = t0; _._end = t1; _._modificationCount = t2; _._position = t3; _._collection$_current = null; _.$ti = t4; }, SetBase: function SetBase() { }, _SetBase: function _SetBase() { }, _parseJson(source, reviver) { var e, exception, t1, parsed = null; try { parsed = JSON.parse(source); } catch (exception) { e = A.unwrapException(exception); t1 = A.FormatException$(String(e), null); throw A.wrapException(t1); } t1 = A._convertJsonToDartLazy(parsed); return t1; }, _convertJsonToDartLazy(object) { var i; if (object == null) return null; if (typeof object != "object") return object; if (!Array.isArray(object)) return new A._JsonMap(object, Object.create(null)); for (i = 0; i < object.length; ++i) object[i] = A._convertJsonToDartLazy(object[i]); return object; }, JsonUnsupportedObjectError$(unsupportedObject, cause, partialResult) { return new A.JsonUnsupportedObjectError(unsupportedObject, cause); }, _defaultToEncodable(object) { return object.toJson$0(); }, _JsonStringStringifier$(_sink, _toEncodable) { return new A._JsonStringStringifier(_sink, [], A.convert___defaultToEncodable$closure()); }, _JsonStringStringifier_stringify(object, toEncodable, indent) { var t1, output = new A.StringBuffer(""), stringifier = A._JsonStringStringifier$(output, toEncodable); stringifier.writeObject$1(object); t1 = output._contents; return t1.charCodeAt(0) == 0 ? t1 : t1; }, _JsonMap: function _JsonMap(t0, t1) { this._original = t0; this._processed = t1; this._data = null; }, _JsonMapKeyIterable: function _JsonMapKeyIterable(t0) { this._convert$_parent = t0; }, Codec: function Codec() { }, Converter: function Converter() { }, JsonUnsupportedObjectError: function JsonUnsupportedObjectError(t0, t1) { this.unsupportedObject = t0; this.cause = t1; }, JsonCyclicError: function JsonCyclicError(t0, t1) { this.unsupportedObject = t0; this.cause = t1; }, JsonCodec: function JsonCodec() { }, JsonEncoder: function JsonEncoder(t0) { this._toEncodable = t0; }, JsonDecoder: function JsonDecoder(t0) { this._reviver = t0; }, _JsonStringifier: function _JsonStringifier() { }, _JsonStringifier_writeMap_closure: function _JsonStringifier_writeMap_closure(t0, t1) { this._box_0 = t0; this.keyValueList = t1; }, _JsonStringStringifier: function _JsonStringStringifier(t0, t1, t2) { this._sink = t0; this._seen = t1; this._toEncodable = t2; }, Error__throw(error, stackTrace) { error = A.initializeExceptionWrapper(error, new Error()); if (error == null) error = A._asObject(error); error.stack = stackTrace.toString$0(0); throw error; }, List_List$filled($length, fill, growable, $E) { var i, result = growable ? J.JSArray_JSArray$growable($length, $E) : J.JSArray_JSArray$fixed($length, $E); if ($length !== 0 && fill != null) for (i = 0; i < result.length; ++i) result[i] = fill; return result; }, List_List$from(elements, growable, $E) { var t1, _i, list = A._setArrayType([], $E._eval$1("JSArray<0>")); for (t1 = elements.length, _i = 0; _i < elements.length; elements.length === t1 || (0, A.throwConcurrentModificationError)(elements), ++_i) B.JSArray_methods.add$1(list, $E._as(elements[_i])); list.$flags = 1; return list; }, List_List$of(elements, growable, $E) { var t1 = A.List_List$_of(elements, $E); return t1; }, List_List$_of(elements, $E) { var list, t1; if (Array.isArray(elements)) return A._setArrayType(elements.slice(0), $E._eval$1("JSArray<0>")); list = A._setArrayType([], $E._eval$1("JSArray<0>")); for (t1 = J.get$iterator$ax(elements); t1.moveNext$0();) B.JSArray_methods.add$1(list, t1.get$current()); return list; }, String_String$fromCharCodes(charCodes) { var array, len, t1; A.RangeError_checkNotNegative(0, "start"); if (Array.isArray(charCodes)) { array = charCodes; len = array.length; return A.Primitives_stringFromCharCodes(len < len ? array.slice(0, len) : array); } t1 = A.List_List$_of(charCodes, type$.int); return A.Primitives_stringFromCharCodes(t1); }, RegExp_RegExp(source) { return new A.JSSyntaxRegExp(source, A.JSSyntaxRegExp_makeNative(source, false, true, false, false, "")); }, StringBuffer__writeAll(string, objects, separator) { var iterator = J.get$iterator$ax(objects); if (!iterator.moveNext$0()) return string; if (separator.length === 0) { do string += A.S(iterator.get$current()); while (iterator.moveNext$0()); } else { string += A.S(iterator.get$current()); while (iterator.moveNext$0()) string = string + separator + A.S(iterator.get$current()); } return string; }, StackTrace_current() { return A.getTraceFromException(new Error()); }, DateTime__fourDigits(n) { var absN = Math.abs(n), sign = n < 0 ? "-" : ""; if (absN >= 1000) return "" + n; if (absN >= 100) return sign + "0" + absN; if (absN >= 10) return sign + "00" + absN; return sign + "000" + absN; }, DateTime__threeDigits(n) { if (n >= 100) return "" + n; if (n >= 10) return "0" + n; return "00" + n; }, DateTime__twoDigits(n) { if (n >= 10) return "" + n; return "0" + n; }, Error_safeToString(object) { if (typeof object == "number" || A._isBool(object) || object == null) return J.toString$0$(object); if (typeof object == "string") return JSON.stringify(object); return A.Primitives_safeToString(object); }, Error_throwWithStackTrace(error, stackTrace) { A.checkNotNullable(error, "error", type$.Object); A.checkNotNullable(stackTrace, "stackTrace", type$.StackTrace); A.Error__throw(error, stackTrace); }, AssertionError$(message) { return new A.AssertionError(message); }, ArgumentError$(message, $name) { return new A.ArgumentError(false, null, $name, message); }, ArgumentError$value(value, $name, message) { return new A.ArgumentError(true, value, $name, message); }, ArgumentError_checkNotNull(argument, $name, $T) { return argument; }, RangeError$(message) { var _null = null; return new A.RangeError(_null, _null, false, _null, _null, message); }, RangeError$value(value, $name) { return new A.RangeError(null, null, true, value, $name, "Value not in range"); }, RangeError$range(invalidValue, minValue, maxValue, $name, message) { return new A.RangeError(minValue, maxValue, true, invalidValue, $name, "Invalid value"); }, RangeError_checkValidRange(start, end, $length) { if (0 > start || start > $length) throw A.wrapException(A.RangeError$range(start, 0, $length, "start", null)); if (end != null) { if (start > end || end > $length) throw A.wrapException(A.RangeError$range(end, start, $length, "end", null)); return end; } return $length; }, RangeError_checkNotNegative(value, $name) { if (value < 0) throw A.wrapException(A.RangeError$range(value, 0, null, $name, null)); return value; }, IndexError$withLength(invalidValue, $length, indexable, message, $name) { return new A.IndexError($length, true, invalidValue, $name, "Index out of range"); }, UnsupportedError$(message) { return new A.UnsupportedError(message); }, UnimplementedError$(message) { return new A.UnimplementedError(message); }, StateError$(message) { return new A.StateError(message); }, ConcurrentModificationError$(modifiedObject) { return new A.ConcurrentModificationError(modifiedObject); }, FormatException$(message, source) { return new A.FormatException(message, source); }, Iterable_iterableToShortString(iterable, leftDelimiter, rightDelimiter) { var parts, t1; if (A.isToStringVisiting(iterable)) { if (leftDelimiter === "(" && rightDelimiter === ")") return "(...)"; return leftDelimiter + "..." + rightDelimiter; } parts = A._setArrayType([], type$.JSArray_String); B.JSArray_methods.add$1($.toStringVisiting, iterable); try { A._iterablePartsToStrings(iterable, parts); } finally { if (0 >= $.toStringVisiting.length) return A.ioore($.toStringVisiting, -1); $.toStringVisiting.pop(); } t1 = A.StringBuffer__writeAll(leftDelimiter, type$.Iterable_dynamic._as(parts), ", ") + rightDelimiter; return t1.charCodeAt(0) == 0 ? t1 : t1; }, Iterable_iterableToFullString(iterable, leftDelimiter, rightDelimiter) { var buffer, t1; if (A.isToStringVisiting(iterable)) return leftDelimiter + "..." + rightDelimiter; buffer = new A.StringBuffer(leftDelimiter); B.JSArray_methods.add$1($.toStringVisiting, iterable); try { t1 = buffer; t1._contents = A.StringBuffer__writeAll(t1._contents, iterable, ", "); } finally { if (0 >= $.toStringVisiting.length) return A.ioore($.toStringVisiting, -1); $.toStringVisiting.pop(); } buffer._contents += rightDelimiter; t1 = buffer._contents; return t1.charCodeAt(0) == 0 ? t1 : t1; }, _iterablePartsToStrings(iterable, parts) { var next, ultimateString, penultimateString, penultimate, ultimate, ultimate0, elision, it = iterable.get$iterator(iterable), $length = 0, count = 0; for (;;) { if (!($length < 80 || count < 3)) break; if (!it.moveNext$0()) return; next = A.S(it.get$current()); B.JSArray_methods.add$1(parts, next); $length += next.length + 2; ++count; } if (!it.moveNext$0()) { if (count <= 5) return; if (0 >= parts.length) return A.ioore(parts, -1); ultimateString = parts.pop(); if (0 >= parts.length) return A.ioore(parts, -1); penultimateString = parts.pop(); } else { penultimate = it.get$current(); ++count; if (!it.moveNext$0()) { if (count <= 4) { B.JSArray_methods.add$1(parts, A.S(penultimate)); return; } ultimateString = A.S(penultimate); if (0 >= parts.length) return A.ioore(parts, -1); penultimateString = parts.pop(); $length += ultimateString.length + 2; } else { ultimate = it.get$current(); ++count; for (; it.moveNext$0(); penultimate = ultimate, ultimate = ultimate0) { ultimate0 = it.get$current(); ++count; if (count > 100) { for (;;) { if (!($length > 75 && count > 3)) break; if (0 >= parts.length) return A.ioore(parts, -1); $length -= parts.pop().length + 2; --count; } B.JSArray_methods.add$1(parts, "..."); return; } } penultimateString = A.S(penultimate); ultimateString = A.S(ultimate); $length += ultimateString.length + penultimateString.length + 4; } } if (count > parts.length + 2) { $length += 5; elision = "..."; } else elision = null; for (;;) { if (!($length > 80 && parts.length > 3)) break; if (0 >= parts.length) return A.ioore(parts, -1); $length -= parts.pop().length + 2; if (elision == null) { $length += 5; elision = "..."; } } if (elision != null) B.JSArray_methods.add$1(parts, elision); B.JSArray_methods.add$1(parts, penultimateString); B.JSArray_methods.add$1(parts, ultimateString); }, Object_hash(object1, object2, object3, object4) { var t1; if (B.C_SentinelValue === object3) { t1 = B.JSInt_methods.get$hashCode(object1); object2 = J.get$hashCode$(object2); return A.SystemHash_finish(A.SystemHash_combine(A.SystemHash_combine($.$get$_hashSeed(), t1), object2)); } if (B.C_SentinelValue === object4) { t1 = B.JSInt_methods.get$hashCode(object1); object2 = J.get$hashCode$(object2); object3 = J.get$hashCode$(object3); return A.SystemHash_finish(A.SystemHash_combine(A.SystemHash_combine(A.SystemHash_combine($.$get$_hashSeed(), t1), object2), object3)); } t1 = B.JSInt_methods.get$hashCode(object1); object2 = J.get$hashCode$(object2); object3 = J.get$hashCode$(object3); object4 = J.get$hashCode$(object4); object4 = A.SystemHash_finish(A.SystemHash_combine(A.SystemHash_combine(A.SystemHash_combine(A.SystemHash_combine($.$get$_hashSeed(), t1), object2), object3), object4)); return object4; }, Object_hashAll(objects) { var t1, _i, hash = $.$get$_hashSeed(); for (t1 = objects.length, _i = 0; _i < objects.length; objects.length === t1 || (0, A.throwConcurrentModificationError)(objects), ++_i) hash = A.SystemHash_combine(hash, J.get$hashCode$(objects[_i])); return A.SystemHash_finish(hash); }, print(object) { A.printString(object); }, DateTime: function DateTime(t0, t1, t2) { this._core$_value = t0; this._microsecond = t1; this.isUtc = t2; }, _Enum: function _Enum() { }, Error: function Error() { }, AssertionError: function AssertionError(t0) { this.message = t0; }, TypeError: function TypeError() { }, ArgumentError: function ArgumentError(t0, t1, t2, t3) { var _ = this; _._hasValue = t0; _.invalidValue = t1; _.name = t2; _.message = t3; }, RangeError: function RangeError(t0, t1, t2, t3, t4, t5) { var _ = this; _.start = t0; _.end = t1; _._hasValue = t2; _.invalidValue = t3; _.name = t4; _.message = t5; }, IndexError: function IndexError(t0, t1, t2, t3, t4) { var _ = this; _.length = t0; _._hasValue = t1; _.invalidValue = t2; _.name = t3; _.message = t4; }, UnsupportedError: function UnsupportedError(t0) { this.message = t0; }, UnimplementedError: function UnimplementedError(t0) { this.message = t0; }, StateError: function StateError(t0) { this.message = t0; }, ConcurrentModificationError: function ConcurrentModificationError(t0) { this.modifiedObject = t0; }, OutOfMemoryError: function OutOfMemoryError() { }, StackOverflowError: function StackOverflowError() { }, _Exception: function _Exception(t0) { this.message = t0; }, FormatException: function FormatException(t0, t1) { this.message = t0; this.source = t1; }, Iterable: function Iterable() { }, MapEntry: function MapEntry(t0, t1, t2) { this.key = t0; this.value = t1; this.$ti = t2; }, Null: function Null() { }, Object: function Object() { }, _StringStackTrace: function _StringStackTrace() { }, Stopwatch: function Stopwatch() { this._stop = this._core$_start = 0; }, StringBuffer: function StringBuffer(t0) { this._contents = t0; }, Random_Random(seed) { var t1; if (seed == null) t1 = B.C__JSRandom; else { t1 = new A._Random(); t1._Random$1(seed); } return t1; }, _JSRandom: function _JSRandom() { }, _Random: function _Random() { this._hi = this._lo = 0; }, GameContent: function GameContent() { }, GameContent_startingItems_closure: function GameContent_startingItems_closure(t0, t1) { this.hero = t0; this.items = t1; }, GameContent__tryToIgniteTile_neighbor: function GameContent__tryToIgniteTile_neighbor(t0, t1, t2) { this._box_0 = t0; this.stage = t1; this.pos = t2; }, GameContent__spreadPoison_neighbor: function GameContent__spreadPoison_neighbor(t0, t1, t2) { this._box_0 = t0; this.stage = t1; this.pos = t2; }, BarrierAction: function BarrierAction(t0, t1, t2, t3, t4) { var _ = this; _._center = t0; _._h = t1; _._v = t2; _._barrier$_hit = t3; _._hitTiles = t4; _._distance = 0; _._goingNegative = _._goingPositive = true; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, BarrierAction_onPerform_tryDirection: function BarrierAction_onPerform_tryDirection(t0, t1) { this._box_0 = t0; this.$this = t1; }, BarrierAction_onPerform_tryDirection_tryOffset: function BarrierAction_onPerform_tryDirection_tryOffset(t0, t1, t2) { this._box_0 = t0; this.$this = t1; this.sign = t2; }, _BarrierAction_Action_ElementActionMixin: function _BarrierAction_Action_ElementActionMixin() { }, BoltAction$(target, _hit, canMiss, range) { return new A.BoltAction(_hit, canMiss, range, target); }, BoltAction: function BoltAction(t0, t1, t2, t3) { var _ = this; _._bolt$_hit = t0; _._canMiss = t1; _._bolt$_range = t2; _._los$_target = t3; _.__LosAction__los_FI = _.__LosAction__lastPos_A = $; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, HasteAction$(_speed, _duration) { return new A.HasteAction(_speed, _duration); }, ConditionAction: function ConditionAction() { }, HasteAction: function HasteAction(t0, t1) { var _ = this; _._condition0$_speed = t0; _._condition0$_duration = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, FreezeActorAction: function FreezeActorAction(t0) { var _ = this; _._condition0$_damage = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, PoisonAction: function PoisonAction(t0) { var _ = this; _._condition0$_damage = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, BlindAction: function BlindAction(t0) { var _ = this; _._condition0$_damage = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, DazzleAction: function DazzleAction(t0) { var _ = this; _._condition0$_damage = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, ResistAction: function ResistAction(t0, t1) { var _ = this; _._condition0$_duration = t0; _._condition0$_element = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, _FreezeActorAction_ConditionAction_DestroyActionMixin: function _FreezeActorAction_ConditionAction_DestroyActionMixin() { }, DetectAction$(types, _maxDistance) { return new A.DetectAction(A.LinkedHashSet_LinkedHashSet$from(types, A._arrayInstanceType(types)._precomputed1), _maxDistance); }, DetectType: function DetectType(t0, t1) { this.index = t0; this._core$_name = t1; }, DetectAction: function DetectAction(t0, t1) { var _ = this; _._types = t0; _._maxDistance = t1; _.__DetectAction__tilesByDistance_FI = $; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, DetectAction__findTiles_addTile: function DetectAction__findTiles_addTile(t0, t1) { this.$this = t0; this.distanceMap = t1; }, DetectAction__findTiles_addTile_closure: function DetectAction__findTiles_addTile_closure() { }, DetectAction__findTiles_closure: function DetectAction__findTiles_closure(t0, t1, t2) { this._box_0 = t0; this.$this = t1; this.addTile = t2; }, DetectAction__findTiles_closure0: function DetectAction__findTiles_closure0() { }, DetectAction__findTiles_closure1: function DetectAction__findTiles_closure1(t0) { this.distanceMap = t0; }, EatAction: function EatAction(t0) { var _ = this; _._eat$_amount = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, ElementActionMixin: function ElementActionMixin() { }, BurnActorAction: function BurnActorAction() { var _ = this; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, BurnFloorAction: function BurnFloorAction(t0, t1, t2) { var _ = this; _._element$_pos = t0; _._element$_damage = t1; _._element$_fuel = t2; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, BurningFloorAction: function BurningFloorAction(t0) { var _ = this; _._element$_pos = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, FreezeFloorAction: function FreezeFloorAction(t0) { var _ = this; _._element$_pos = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, PoisonFloorAction: function PoisonFloorAction(t0, t1) { var _ = this; _._element$_pos = t0; _._element$_damage = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, PoisonedFloorAction: function PoisonedFloorAction(t0, t1) { var _ = this; _._element$_pos = t0; _._element$_damage = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, WindAction: function WindAction() { var _ = this; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, WindAction_onPerform_closure: function WindAction_onPerform_closure(t0) { this.$this = t0; }, LightFloorAction: function LightFloorAction(t0, t1) { var _ = this; _._element$_pos = t0; _._element$_emanation = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, _BurnActorAction_Action_DestroyActionMixin: function _BurnActorAction_Action_DestroyActionMixin() { }, _BurnFloorAction_Action_DestroyActionMixin: function _BurnFloorAction_Action_DestroyActionMixin() { }, _BurningFloorAction_Action_DestroyActionMixin: function _BurningFloorAction_Action_DestroyActionMixin() { }, _FreezeFloorAction_Action_DestroyActionMixin: function _FreezeFloorAction_Action_DestroyActionMixin() { }, _PoisonFloorAction_Action_DestroyActionMixin: function _PoisonFloorAction_Action_DestroyActionMixin() { }, _PoisonedFloorAction_Action_DestroyActionMixin: function _PoisonedFloorAction_Action_DestroyActionMixin() { }, FlowAction$(_from, _hit, _motility, slowness) { return new A.FlowAction(_from, _hit, _motility, slowness == null ? 1 : slowness); }, FlowAction: function FlowAction(t0, t1, t2, t3) { var _ = this; _._from = t0; _._hit = t1; _.__FlowAction__flow_F = $; _._tiles = null; _._flow$_motility = t2; _._slowness = t3; _._frame = 0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, FlowAction_onPerform_closure: function FlowAction_onPerform_closure(t0) { this.$this = t0; }, FlowSelfAction: function FlowSelfAction(t0, t1) { var _ = this; _._flow$_attack = t0; _._flow$_motility = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, FlowFromAction: function FlowFromAction(t0, t1, t2) { var _ = this; _._flow$_attack = t0; _._flow$_pos = t1; _._flow$_motility = t2; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, _FlowAction_Action_ElementActionMixin: function _FlowAction_Action_ElementActionMixin() { }, HealAction$(amount, curePoison) { return new A.HealAction(amount, curePoison); }, HealAction: function HealAction(t0, t1) { var _ = this; _.amount = t0; _.curePoison = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, HowlAction: function HowlAction(t0, t1) { var _ = this; _._howl0$_range = t0; _._howl0$_verb = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, IlluminateAction: function IlluminateAction(t0, t1, t2, t3, t4) { var _ = this; _.range = t0; _._ray$_from = t1; _._to = t2; _._ray$_hitTiles = t3; _._radius = 1; _._rays = t4; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, IlluminateSelfAction: function IlluminateSelfAction(t0) { var _ = this; _._illuminate$_range = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, MappingAction: function MappingAction(t0, t1) { var _ = this; _._mapping$_maxDistance = t0; _._illuminate = t1; _._currentDistance = 0; _.__MappingAction__tilesByDistance_FI = $; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, MappingFlow: function MappingFlow(t0, t1, t2, t3, t4) { var _ = this; _._mapping$_maxDistance = t0; _.stage = t1; _._start = t2; _.__Flow__offset_F = _.__Flow__costs_F = $; _._open = t3; _._found = t4; }, Missive: function Missive(t0, t1) { this.index = t0; this._core$_name = t1; }, MissiveAction: function MissiveAction(t0, t1) { var _ = this; _.target = t0; _.missive = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, PerceiveAction: function PerceiveAction(t0, t1) { var _ = this; _._perception$_duration = t0; _._perception$_distance = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, PolymorphAction: function PolymorphAction(t0) { var _ = this; _._polymorph$_breed = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, AmputateAction: function AmputateAction(t0, t1, t2) { var _ = this; _._bodyBreed = t0; _._partBreed = t1; _._polymorph$_message = t2; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, RayAction$_(_hit, from, to, fraction) { var t1 = new A.RayAction(_hit, from, to, A.LinkedHashSet_LinkedHashSet$_empty(type$.Vec), A._setArrayType([], type$.JSArray_double)); t1.RayActionBase$3(from, to, fraction); return t1; }, RayActionBase: function RayActionBase() { }, RayActionBase_onPerform_closure: function RayActionBase_onPerform_closure(t0) { this.$this = t0; }, RayAction: function RayAction(t0, t1, t2, t3, t4) { var _ = this; _._ray$_hit = t0; _._ray$_from = t1; _._to = t2; _._ray$_hitTiles = t3; _._radius = 1; _._rays = t4; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, RingSelfAction: function RingSelfAction(t0) { var _ = this; _._ray$_attack = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, RingFromAction: function RingFromAction(t0, t1) { var _ = this; _._ray$_attack = t0; _._ray$_pos = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, _RayAction_RayActionBase_ElementActionMixin: function _RayAction_RayActionBase_ElementActionMixin() { }, SpawnAction: function SpawnAction(t0, t1) { var _ = this; _._spawn$_pos = t0; _._spawn$_breed = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, TeleportAction$(distance) { return new A.TeleportAction(distance); }, TeleportAction: function TeleportAction(t0) { var _ = this; _.distance = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, _OpenTileAction: function _OpenTileAction() { }, OpenBarrelAction: function OpenBarrelAction(t0) { var _ = this; _._tile$_pos = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, OpenChestAction: function OpenChestAction(t0) { var _ = this; _._tile$_pos = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, Decor_choose(depth, theme) { var t1 = $.$get$Decor_all(); if (!t1._tags.containsKey$1(theme)) return null; return t1.tryChoose$2$tag(depth, theme); }, Decor: function Decor() { }, Cell$(apply, motility, require, requireAny) { var t1 = A._setArrayType([], type$.JSArray_TileType); if (require != null) B.JSArray_methods.add$1(t1, require); if (requireAny != null) B.JSArray_methods.addAll$1(t1, requireAny); return new A.Cell(apply, motility, t1); }, Furnishing: function Furnishing(t0) { this._cells = t0; }, Cell: function Cell(t0, t1, t2) { this._apply = t0; this._furnishing$_motility = t1; this._require = t2; }, furnishing(frequency, symmetry, template) { var t1, t2, lines, mirrorLines, i, t3, rotateLines, x, y; $._furnishingFrequency = frequency; if (symmetry == null) symmetry = B.Symmetry_0; t1 = type$.JSArray_String; t2 = type$.MappedListIterable_String_String; lines = A.List_List$_of(new A.MappedListIterable(A._setArrayType(template.split("\n"), t1), type$.String_Function_String._as(new A.furnishing_closure()), t2), t2._eval$1("ListIterable.E")); A._singleFurnishing(lines); if (symmetry === B.Symmetry_1 || symmetry === B.Symmetry_3) { mirrorLines = A._setArrayType(lines.slice(0), A._arrayInstanceType(lines)); for (t2 = type$.CodeUnits._eval$1("ReversedListIterable"), i = 0; i < lines.length; ++i) B.JSArray_methods.$indexSet(mirrorLines, i, A._mapString(A.String_String$fromCharCodes(new A.ReversedListIterable(new A.CodeUnits(lines[i]), t2)), A.furnishing_builder___mirrorCharHorizontal$closure())); A._singleFurnishing(mirrorLines); } if (symmetry === B.Symmetry_2 || symmetry === B.Symmetry_3) { mirrorLines = A._setArrayType(lines.slice(0), A._arrayInstanceType(lines)); for (i = 0; t2 = lines.length, i < t2; ++i) B.JSArray_methods.$indexSet(mirrorLines, t2 - i - 1, A._mapString(lines[i], A.furnishing_builder___mirrorCharVertical$closure())); A._singleFurnishing(mirrorLines); } if (symmetry === B.Symmetry_3 || symmetry === B.Symmetry_5 || symmetry === B.Symmetry_4) { mirrorLines = A._setArrayType(lines.slice(0), A._arrayInstanceType(lines)); for (t2 = type$.CodeUnits._eval$1("ReversedListIterable"), i = 0; t3 = lines.length, i < t3; ++i) B.JSArray_methods.$indexSet(mirrorLines, t3 - i - 1, A._mapString(A.String_String$fromCharCodes(new A.ReversedListIterable(new A.CodeUnits(lines[i]), t2)), A.furnishing_builder___mirrorCharBoth$closure())); A._singleFurnishing(mirrorLines); } if (symmetry === B.Symmetry_4) { rotateLines = A._setArrayType([], t1); x = 0; for (;;) { if (0 >= lines.length) return A.ioore(lines, 0); if (!(x < lines[0].length)) break; for (y = 0, t2 = ""; y < lines.length; ++y, t2 = t3) { t3 = lines[y]; if (!(x < t3.length)) return A.ioore(t3, x); t3 = t2 + A._rotateChar90(t3[x]); } B.JSArray_methods.add$1(rotateLines, t2.charCodeAt(0) == 0 ? t2 : t2); ++x; } A._singleFurnishing(rotateLines); mirrorLines = A._setArrayType(rotateLines.slice(0), t1); for (t1 = type$.CodeUnits._eval$1("ReversedListIterable"), i = 0; t2 = rotateLines.length, i < t2; ++i) B.JSArray_methods.$indexSet(mirrorLines, t2 - i - 1, A._mapString(A.String_String$fromCharCodes(new A.ReversedListIterable(new A.CodeUnits(rotateLines[i]), t1)), A.furnishing_builder___mirrorCharBoth$closure())); A._singleFurnishing(mirrorLines); } }, _mapString(input, map) { var t1, i, t2; for (t1 = input.length, i = 0, t2 = ""; i < t1; ++i) t2 += A.S(map.call$1(input[i])); return t2.charCodeAt(0) == 0 ? t2 : t2; }, _mirrorCharBoth(input) { return A._mirrorCharHorizontal(A._mirrorCharVertical(input)); }, _mirrorCharHorizontal(input) { var _i, mirror, index, t1; A._asString(input); for (_i = 0; _i < 3; ++_i) { mirror = $._mirrorHorizontal[_i]; index = B.JSString_methods.indexOf$1(mirror, input); if (index !== -1) { t1 = 1 - index; if (!(t1 >= 0 && t1 < mirror.length)) return A.ioore(mirror, t1); return mirror[t1]; } } return input; }, _mirrorCharVertical(input) { var _i, mirror, index, t1; A._asString(input); for (_i = 0; _i < 3; ++_i) { mirror = $._mirrorVertical[_i]; index = B.JSString_methods.indexOf$1(mirror, input); if (index !== -1) { t1 = 1 - index; if (!(t1 >= 0 && t1 < mirror.length)) return A.ioore(mirror, t1); return mirror[t1]; } } return input; }, _rotateChar90(input) { var _i, rotate, index, t1; for (_i = 0; _i < 2; ++_i) { rotate = $._rotate[_i]; index = B.JSString_methods.indexOf$1(rotate, input); if (index !== -1) { t1 = B.JSInt_methods.$mod(index + 1, 4); if (!(t1 < rotate.length)) return A.ioore(rotate, t1); return rotate[t1]; } } return input; }, _singleFurnishing(lines) { var y, x, t4, char, cell, t1 = B.JSArray_methods.get$first(lines).length, t2 = lines.length, t3 = A.List_List$filled(t1 * t2, $.$get$Cell_uninitialized(), false, type$.Cell), cells = new A.Array2D(t3, new A.Rect(new A.Vec(0, 0), new A.Vec(t1, t2)), type$.Array2D_Cell); for (y = 0; y < lines.length; ++y) for (t2 = y * t1, x = 0; x < B.JSArray_methods.get$first(lines).length; ++x) { if (!(y < lines.length)) return A.ioore(lines, y); t4 = lines[y]; if (!(x < t4.length)) return A.ioore(t4, x); char = t4[x]; t4 = $._categoryCells; if (t4 != null && t4.containsKey$1(char)) { t4 = $._categoryCells.$index(0, char); t4.toString; cell = t4; } else { t4 = $.$get$_applyCells(); if (t4.containsKey$1(char)) { t4 = t4.$index(0, char); t4.toString; cell = t4; } else { t4 = $.$get$_requireCells().$index(0, char); t4.toString; cell = t4; } } cells._checkBounds$2(x, y); B.JSArray_methods.$indexSet(t3, t2 + x, cell); } t1 = $.$get$Decor_all(); t2 = $._categoryFrequency; if (t2 == null) t2 = $._furnishingFrequency; if (t2 == null) t2 = 1; t3 = $.___themes._readField$0(); t1._resource$_add$7(t1.$ti._precomputed1._as(new A.Furnishing(cells)), null, null, null, t2, t2, t3); }, Symmetry: function Symmetry(t0, t1) { this.index = t0; this._core$_name = t1; }, furnishing_closure: function furnishing_closure() { }, Elements_air_closure: function Elements_air_closure() { }, Elements_fire_closure: function Elements_fire_closure() { }, Elements_fire_closure0: function Elements_fire_closure0() { }, Elements_cold_closure: function Elements_cold_closure() { }, Elements_cold_closure0: function Elements_cold_closure0() { }, Elements_poison_closure: function Elements_poison_closure() { }, Elements_poison_closure0: function Elements_poison_closure0() { }, Elements_dark_closure: function Elements_dark_closure() { }, Elements_light_closure: function Elements_light_closure() { }, Elements_light_closure0: function Elements_light_closure0() { }, category(glyph, stack, verb) { A.finishItem(); $.___category._value = new A.CategoryBuilder(glyph, verb, A._setArrayType([], type$.JSArray_Skill), A.LinkedHashMap_LinkedHashMap$_empty(type$.Element, type$.int)); $.___category._readField$0()._maxStack = stack; return $.___category._readField$0(); }, affix(nameTemplate, frequency) { A.finishAffix(); return $._affixBuilder = A.AffixBuilder$(nameTemplate, B.JSString_methods.endsWith$1(nameTemplate, " _") ? $.$get$Affixes_prefixes() : $.$get$Affixes_suffixes(), frequency); }, ItemBuilder$(_name, _color, _price) { return new A.ItemBuilder(_name, _color, _price, A._setArrayType([], type$.JSArray_Skill), A.LinkedHashMap_LinkedHashMap$_empty(type$.Element, type$.int)); }, AffixBuilder$(_nameTemplate, _affixSet, _frequency) { var t1 = type$.int_Function_int; return new A.AffixBuilder(_nameTemplate, _affixSet, _frequency, A.LinkedHashMap_LinkedHashMap$_empty(type$.Element, t1), A.LinkedHashMap_LinkedHashMap$_empty(type$.Stat, t1)); }, fixed(value, $T) { return new A.fixed_closure(value, $T); }, _intIdentity(value) { return A._asInt(value); }, scaleParam() { return new A.scaleParam_closure(1, 0.1); }, finishItem() { var appearance, tossDamage, t1, t2, verb, range, element, use, breakage, toss, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23, t24, t25, t26, builder = $._itemBuilder; if (builder == null) return; appearance = A.Glyph$fromCharCode($.___category._readField$0()._builder$_glyph, builder._color, null); tossDamage = builder._tossDamage; if (tossDamage == null) tossDamage = $.___category._readField$0()._tossDamage; if (tossDamage != null) { t1 = builder._builder$_name; if ($.___category._readField$0()._builder$_verb != null) { t2 = $.___category._readField$0()._builder$_verb; t2.toString; verb = A.Log__categorize(t2, false, false); } else verb = "hits"; range = builder._tossRange; if (range == null) range = $.___category._readField$0()._tossRange; t2 = builder._tossElement; element = t2 == null ? $.___category._readField$0()._tossElement : t2; if (element == null) element = $.$get$Element_none(); use = builder._tossUse; if (use == null) use = $.___category._readField$0()._tossUse; t2 = $.___category._readField$0()._breakage; breakage = t2 == null ? builder._breakage : t2; if (breakage == null) breakage = 0; toss = new A.Toss(breakage, A.Attack$(new A.Noun("the " + t1.toLowerCase()), verb, tossDamage, range, element), use); } else toss = null; t1 = builder._builder$_name; t2 = builder.__ItemBuilder__minDepth_F; t2 === $ && A.throwLateFieldNI("_minDepth"); t3 = $.ItemBuilder__sortIndex; $.ItemBuilder__sortIndex = t3 + 1; t4 = $.___category._readField$0()._equipSlot; t5 = $.___category._readField$0()._weaponType; t6 = builder._use; t7 = builder._builder$_attack; t8 = builder._defense; t9 = builder._armor; if (t9 == null) t9 = 0; t10 = builder._price; t11 = builder._maxStack; if (t11 == null) t11 = $.___category._readField$0()._maxStack; if (t11 == null) t11 = 1; t12 = builder._instrinsicAffix; t13 = builder._weight; if (t13 == null) t13 = 0; t14 = builder._heft; if (t14 == null) t14 = 0; t15 = builder._builder$_emanation; if (t15 == null) t15 = $.___category._readField$0()._builder$_emanation; t16 = builder._fuel; if (t16 == null) t16 = $.___category._readField$0()._fuel; t17 = $.___category._readField$0()._isTreasure; t18 = $.___category._readField$0()._isTwoHanded; if (t18 == null) t18 = builder._isTwoHanded; t19 = builder._isArtifact; t20 = A.LinkedHashMap_LinkedHashMap$_empty(type$.Element, type$.int); t21 = A._setArrayType([], type$.JSArray_Skill); if (t15 == null) t15 = 0; if (t16 == null) t16 = 0; t20.addAll$1(0, $.___category._readField$0()._destroyChance); t20.addAll$1(0, builder._destroyChance); B.JSArray_methods.addAll$1(t21, $.___category._readField$0()._skills); B.JSArray_methods.addAll$1(t21, builder._skills); t22 = $.$get$Items_types(); t23 = A.Log__categorize(t1, false, true); t24 = builder.__ItemBuilder__maxDepth_F; t24 === $ && A.throwLateFieldNI("_maxDepth"); t25 = builder._frequency; if (t25 == null) t25 = $.___category._readField$0()._frequency; if (t25 == null) t25 = 1; t26 = $.___category._readField$0().__CategoryBuilder__tag_F; t26 === $ && A.throwLateFieldNI("_tag"); t22._resource$_add$7(t22.$ti._precomputed1._as(new A.ItemType(t1, appearance, t2, t3, t4, t18 === true, t5, t6, t7, toss, t8, t9, t10, t13, t14, t15, t17, t11, t20, t16, t21, t12, t19)), t23, t2, t24, t25, null, t26); $._itemBuilder = null; }, finishAffix() { var affix, t1, t2, t3, t4, t5, builder = $._affixBuilder; if (builder == null) return; affix = builder._build$0(); t1 = builder._affixSet; t1.toString; t2 = builder._minDepth; t3 = builder._maxDepth; t4 = builder._frequency; t5 = $._affixTag; t1._resource$_add$7(t1.$ti._precomputed1._as(affix), affix.id, t2, t3, t4, null, t5); $._affixBuilder = null; }, _BaseBuilder: function _BaseBuilder() { }, CategoryBuilder: function CategoryBuilder(t0, t1, t2, t3) { var _ = this; _._builder$_glyph = t0; _._builder$_verb = t1; _._weaponType = _._equipSlot = null; _.__CategoryBuilder__tag_F = $; _._isTreasure = false; _._skills = t2; _._destroyChance = t3; _._breakage = _._isTwoHanded = _._frequency = _._fuel = _._builder$_emanation = _._tossUse = _._tossRange = _._tossDamage = _._tossElement = _._maxStack = null; }, ItemBuilder: function ItemBuilder(t0, t1, t2, t3, t4) { var _ = this; _._builder$_name = t0; _._color = t1; _._price = t2; _._armor = _._heft = _._weight = _._defense = _._builder$_attack = _._use = null; _._isArtifact = false; _._instrinsicAffix = null; _.__ItemBuilder__maxDepth_F = _.__ItemBuilder__minDepth_F = $; _._skills = t3; _._destroyChance = t4; _._breakage = _._isTwoHanded = _._frequency = _._fuel = _._builder$_emanation = _._tossUse = _._tossRange = _._tossDamage = _._tossElement = _._maxStack = null; }, ItemBuilder_food_closure: function ItemBuilder_food_closure(t0) { this.amount = t0; }, ItemBuilder_detection_closure: function ItemBuilder_detection_closure(t0, t1) { this.types = t0; this.range = t1; }, ItemBuilder_perception_closure: function ItemBuilder_perception_closure(t0, t1) { this.duration = t0; this.distance = t1; }, ItemBuilder_resistSalve_closure: function ItemBuilder_resistSalve_closure(t0) { this.element = t0; }, ItemBuilder_mapping_closure: function ItemBuilder_mapping_closure(t0, t1) { this.distance = t0; this.illuminate = t1; }, ItemBuilder_haste_closure: function ItemBuilder_haste_closure(t0, t1) { this.amount = t0; this.duration = t1; }, ItemBuilder_teleport_closure: function ItemBuilder_teleport_closure(t0) { this.distance = t0; }, ItemBuilder_heal_closure: function ItemBuilder_heal_closure(t0, t1) { this.amount = t0; this.curePoison = t1; }, ItemBuilder_ball_closure: function ItemBuilder_ball_closure(t0) { this.attack = t0; }, ItemBuilder_ball_closure0: function ItemBuilder_ball_closure0(t0) { this.attack = t0; }, ItemBuilder_flow_closure: function ItemBuilder_flow_closure(t0, t1) { this._box_0 = t0; this.attack = t1; }, ItemBuilder_flow_closure0: function ItemBuilder_flow_closure0(t0, t1) { this._box_0 = t0; this.attack = t1; }, ItemBuilder_lightSource_closure: function ItemBuilder_lightSource_closure(t0) { this.range = t0; }, AffixBuilder: function AffixBuilder(t0, t1, t2, t3, t4) { var _ = this; _._builder$_nameTemplate = t0; _._affixSet = t1; _._maxDepth = _._minDepth = null; _._frequency = t2; _._builder$_priceScale = _._builder$_priceBonus = _._armorBonus = _._builder$_brand = _._builder$_damageBonus = _._builder$_damageScale = _._builder$_weightBonus = _._builder$_heftScale = _._rollParameter = null; _._builder$_resists = t3; _._statBonuses = t4; }, AffixBuilder_price_closure: function AffixBuilder_price_closure(t0) { this.bonus = t0; }, AffixBuilder_price_closure0: function AffixBuilder_price_closure0(t0) { this.scale = t0; }, AffixBuilder_parameter_closure: function AffixBuilder_parameter_closure(t0, t1, t2) { this._box_0 = t0; this.min = t1; this.boostOneIn = t2; }, AffixBuilder_heft_closure: function AffixBuilder_heft_closure(t0) { this.scale = t0; }, AffixBuilder_weight_closure: function AffixBuilder_weight_closure(t0) { this.bonus = t0; }, AffixBuilder_brand_closure: function AffixBuilder_brand_closure(t0) { this.resist = t0; }, AffixBuilder_resist_closure: function AffixBuilder_resist_closure() { }, fixed_closure: function fixed_closure(t0, t1) { this.value = t0; this.T = t1; }, scaleParam_closure: function scaleParam_closure(t0, t1) { this.base = t0; this.scale = t1; }, parseDrop($name, depth, quality) { var itemType = $.$get$Items_types().tryFind$1($name); if (itemType != null) return new A._ItemDrop(itemType, depth, quality == null ? B.ItemQuality_0 : quality); return new A._TagDrop($name, depth, quality == null ? B.ItemQuality_0 : quality); }, repeatDrop(count, drop) { return new A._RepeatDrop(count, drop); }, _OneOfDrop$(drops) { var t1 = new A._OneOfDrop(A.ResourceSet$(type$.Drop)); t1._OneOfDrop$1(drops); return t1; }, ItemQuality: function ItemQuality(t0, t1) { this.index = t0; this._core$_name = t1; }, _BaseDrop: function _BaseDrop() { }, _ItemDrop: function _ItemDrop(t0, t1, t2) { this._type = t0; this._drops$_depth = t1; this._quality = t2; }, _TagDrop: function _TagDrop(t0, t1, t2) { this._drops$_tag = t0; this._drops$_depth = t1; this._quality = t2; }, _PercentDrop: function _PercentDrop(t0, t1) { this._chance = t0; this._drops$_drop = t1; }, _AllOfDrop: function _AllOfDrop(t0) { this._drops$_drops = t0; }, _OneOfDrop: function _OneOfDrop(t0) { this._drops$_drop = t0; }, _OneOfDrop_closure: function _OneOfDrop_closure(t0) { this.$this = t0; }, _RepeatDrop: function _RepeatDrop(t0, t1) { this._drops$_count = t0; this._drops$_drop = t1; }, floorDrop(drop, endFrequency, $location, startFrequency) { var t1 = $.$get$_floorDrops(); t1._resource$_add$7(t1.$ti._precomputed1._as(new A.FloorDrop(drop)), null, 1, 100, startFrequency, endFrequency, null); }, FloorDrop: function FloorDrop(t0) { this.drop = t0; }, rings() { A.category(239, null, null).tag$1("magic/ring"); A.finishItem(); var t1 = $._itemBuilder = A.ItemBuilder$("Ring[s] of Wisdom", B.Color_21_87_194, 1000); t1.depth$1(20); t1._frequency = 0.05; t1.instrinsicAffix$1(new A.rings_closure()); }, rings_closure: function rings_closure() { }, shop($name, itemTypes) { var drops = A.LinkedHashMap_LinkedHashMap$_empty(type$.Drop, type$.double); itemTypes.forEach$1(0, new A.shop_closure(drops)); $.Shops_all.$indexSet(0, $name, new A.Shop(A._OneOfDrop$(drops), $name)); }, shop_closure: function shop_closure(t0) { this.drops = t0; }, weapons() { var t2, t3, _s6_ = "hit[s]", _null = null, _s8_ = "bash[es]", _s7_ = "stab[s]", _s13_ = "Spear Mastery", _s9_ = "the arrow", _s9_0 = "pierce[s]", t1 = A.category(225, _null, _s6_); t1.tag$1("equipment/weapon/club"); t1._frequency = 0.5; B.JSArray_methods.add$1(t1._skills, A.Skills_find("Club Mastery")); t1.toss$2$breakage$range(25, 5); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Stick", B.Color_142_82_55, 0); t1.depth$2$to(1, 20); t1.weapon$2$heft(4, 6); t1.toss$1$damage(3); t2 = $.$get$Elements_fire(); t1._destroyChance.$indexSet(0, t2, 10); t1._fuel = 10; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Cudgel", B.Color_116_146_181, 20); t1.depth$2$to(6, 60); t1.weapon$2$heft(9, 8); t1.toss$1$damage(4); t1._destroyChance.$indexSet(0, t2, 5); t1._fuel = 10; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Club", B.Color_77_29_21, 40); t1.depth$1(14); t1.weapon$2$heft(12, 11); t1.toss$1$damage(5); t1._destroyChance.$indexSet(0, t2, 2); t1._fuel = 10; t1 = A.category(237, _null, _s6_); t1.tag$1("equipment/weapon/staff"); t1._frequency = 0.5; t1._isTwoHanded = true; t1.toss$2$breakage$range(35, 4); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Walking Stick", B.Color_142_82_55, 10); t1.depth$2$to(2, 40); t1.weapon$2$heft(9, 10); t1.toss$1$damage(3); t1._destroyChance.$indexSet(0, t2, 5); t1._fuel = 15; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Sta[ff|aves]", B.Color_77_29_21, 50); t1.depth$1(7); t1.weapon$2$heft(13, 14); t1.toss$1$damage(5); t1._destroyChance.$indexSet(0, t2, 2); t1._fuel = 15; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Quartersta[ff|aves]", B.Color_116_146_181, 80); t1.depth$1(24); t1.weapon$2$heft(20, 22); t1.toss$1$damage(8); t1._destroyChance.$indexSet(0, t2, 2); t1._fuel = 15; t1 = A.category(243, _null, _s8_); t1.tag$1("equipment/weapon/hammer"); t1._frequency = 0.5; t1.toss$2$breakage$range(15, 5); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Hammer", B.Color_142_82_55, 120); t1.depth$1(40); t1.weapon$2$heft(28, 22); t1.toss$1$damage(12); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Mattock", B.Color_77_29_21, 240); t1.depth$1(46); t1.weapon$2$heft(36, 29); t1.toss$1$damage(16); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("War Hammer", B.Color_116_146_181, 400); t1.depth$1(52); t1.weapon$2$heft(44, 38); t1.toss$1$damage(20); t1 = A.category(250, _null, _s8_); t1.tag$1("equipment/weapon/mace"); t1._frequency = 0.5; t1.toss$2$breakage$range(15, 4); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Morningstar", B.Color_116_146_181, 130); t1.depth$1(24); t1.weapon$2$heft(25, 21); t1.toss$1$damage(11); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Mace", B.Color_63_75_115, 310); t1.depth$1(33); t1.weapon$2$heft(36, 32); t1.toss$1$damage(16); t1 = A.category(241, _null, "whip[s]"); t1.tag$1("equipment/weapon/whip"); t1._frequency = 0.5; t1.toss$2$breakage$range(25, 4); B.JSArray_methods.add$1(t1._skills, A.Skills_find("Whip Mastery")); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Whip", B.Color_142_82_55, 40); t1.depth$1(4); t1.weapon$2$heft(9, 7); t1.toss$1$damage(1); t1._destroyChance.$indexSet(0, t2, 10); t1._fuel = 5; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Chain Whip", B.Color_116_146_181, 230); t1.depth$1(15); t1.weapon$2$heft(18, 17); t1.toss$1$damage(2); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Flail", B.Color_63_75_115, 350); t1.depth$1(27); t1.weapon$2$heft(28, 24); t1.toss$1$damage(4); t1 = A.category(209, _null, _s7_); t1.tag$1("equipment/weapon/dagger"); t1._frequency = 0.5; t1.toss$2$breakage$range(2, 8); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Kni[fe|ves]", B.Color_132_126_135, 20); t1.depth$2$to(3, 20); t1.weapon$2$heft(6, 5); t1.toss$1$damage(6); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Dirk", B.Color_116_146_181, 30); t1.depth$2$to(4, 40); t1.weapon$2$heft(8, 6); t1.toss$1$damage(8); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Dagger", B.Color_64_163_229, 50); t1.depth$2$to(6, 70); t1.weapon$2$heft(9, 7); t1.toss$1$damage(9); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Stiletto[es]", B.Color_63_75_115, 80); t1.depth$1(10); t1.weapon$2$heft(11, 8); t1.toss$1$damage(11); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Rondel", B.Color_129_231_235, 130); t1.depth$1(20); t1.weapon$2$heft(13, 9); t1.toss$1$damage(13); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Baselard", B.Color_222_156_33, 200); t1.depth$1(30); t1.weapon$2$heft(15, 11); t1.toss$1$damage(15); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Mercygiver", B.Color_86_30_138, 2000); t1.depth$2$to(20, 50); t1._frequency = 0.2; t1.weapon$2$heft(12, 6); t3 = type$.nullable_void_Function_AffixBuilder._as(new A.weapons_closure()); t1._isArtifact = true; t1.instrinsicAffix$1(t3); t1 = A.category(170, _null, "slash[es]"); t1.tag$1("equipment/weapon/sword"); t1._frequency = 0.5; t1.toss$2$breakage$range(20, 5); B.JSArray_methods.add$1(t1._skills, A.Skills_find("Swordfighting")); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Rapier", B.Color_72_64_74, 140); t1.depth$1(13); t1.weapon$2$heft(13, 13); t1.toss$1$damage(4); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Shortsword", B.Color_63_75_115, 230); t1.depth$1(17); t1.weapon$2$heft(15, 15); t1.toss$1$damage(6); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Scimitar", B.Color_116_146_181, 370); t1.depth$1(18); t1.weapon$2$heft(24, 18); t1.toss$1$damage(9); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Cutlass[es]", B.Color_255_238_168, 520); t1.depth$1(20); t1.weapon$2$heft(26, 22); t1.toss$1$damage(11); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Falchion", B.Color_129_231_235, 750); t1.depth$1(34); t1.weapon$2$heft(28, 25); t1.toss$1$damage(15); t1 = A.category(186, _null, _s7_); t1.tag$1("equipment/weapon/spear"); t1._frequency = 0.5; t1.toss$1$range(9); B.JSArray_methods.add$1(t1._skills, A.Skills_find(_s13_)); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Pointed Stick", B.Color_77_29_21, 10); t1.depth$2$to(2, 30); t1.weapon$2$heft(7, 9); t1.toss$1$damage(6); t1._destroyChance.$indexSet(0, t2, 7); t1._fuel = 12; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Spear", B.Color_142_82_55, 160); t1.depth$2$to(13, 60); t1.weapon$2$heft(16, 13); t1.toss$1$damage(15); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Angon", B.Color_116_146_181, 340); t1.depth$1(21); t1.weapon$2$heft(20, 19); t1.toss$1$damage(20); t1 = A.category(186, _null, _s7_); t1.tag$1("equipment/weapon/polearm"); t1._frequency = 0.5; t1._isTwoHanded = true; t1.toss$1$range(4); B.JSArray_methods.add$1(t1._skills, A.Skills_find(_s13_)); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Lance", B.Color_64_163_229, 550); t1.depth$1(28); t1.weapon$2$heft(22, 23); t1.toss$1$damage(20); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Partisan", B.Color_63_75_115, 850); t1.depth$1(35); t1.weapon$2$heft(26, 25); t1.toss$1$damage(26); t1 = A.category(191, _null, "chop[s]"); t1.tag$1("equipment/weapon/axe"); t1._frequency = 0.5; B.JSArray_methods.add$1(t1._skills, A.Skills_find("Axe Mastery")); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Hatchet", B.Color_63_75_115, 90); t1.depth$2$to(6, 50); t1.weapon$2$heft(12, 10); t1.toss$2$damage$range(20, 8); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Axe", B.Color_142_82_55, 210); t1.depth$2$to(12, 70); t1.weapon$2$heft(15, 14); t1.toss$2$damage$range(24, 7); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Valaska", B.Color_116_146_181, 330); t1.depth$1(24); t1.weapon$2$heft(19, 19); t1.toss$2$damage$range(26, 5); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Battleaxe", B.Color_72_64_74, 550); t1.depth$1(40); t1._isTwoHanded = true; t1.weapon$2$heft(25, 30); t1.toss$2$damage$range(28, 4); t1 = A.category(8976, _null, _s6_); t1.tag$1("equipment/weapon/bow"); t1._frequency = 0.3; t1._isTwoHanded = true; t1.toss$2$breakage$range(50, 5); B.JSArray_methods.add$1(t1._skills, A.Skills_find("Archery")); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Short Bow", B.Color_142_82_55, 120); t1.depth$2$to(6, 60); t1._builder$_attack = A.Attack$(new A.Noun(_s9_), _s9_0, 5, 8, _null); t1._heft = 12; t1.toss$1$damage(2); t1._destroyChance.$indexSet(0, t2, 15); t1._fuel = 10; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Longbow", B.Color_77_29_21, 250); t1.depth$1(13); t1._builder$_attack = A.Attack$(new A.Noun(_s9_), _s9_0, 9, 12, _null); t1._heft = 18; t1.toss$1$damage(3); t1._destroyChance.$indexSet(0, t2, 7); t1._fuel = 13; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Crossbow", B.Color_116_146_181, 600); t1.depth$1(28); t1._builder$_attack = A.Attack$(new A.Noun("the bolt"), _s9_0, 14, 16, _null); t1._heft = 24; t1.toss$1$damage(4); t1._destroyChance.$indexSet(0, t2, 4); t1._fuel = 14; }, weapons_closure: function weapons_closure() { }, family(character, groupPath, dodge, flags, frequency, speed, tracking) { var t1; A.finishBreed(); $.$get$Monsters_breeds().defineTags$1("monster/" + groupPath); t1 = type$.JSArray_String; $.___family._value = new A.FamilyBuilder(character, B.JSArray_methods.get$last(groupPath.split("/")), frequency, $.$get$Motility_walk(), A._setArrayType([], type$.JSArray_Defense), A._setArrayType([], t1)); $.___family._readField$0()._speed = speed; $.___family._readField$0()._dodge = dodge; $.___family._readField$0()._tracking = tracking; if (flags != null) B.JSArray_methods.addAll$1($.___family._readField$0()._flags, A._setArrayType(flags.split(" "), t1)); return $.___family._readField$0(); }, finishBreed() { var t1, tags, t2, dodge, t3, t4, minions, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23, names, t24, t25, t26, t27, t28, t29, t30, t31, t32, t33, t34, t35, _s8_ = "immobile", builder = $._builder; if (builder == null) return; t1 = type$.JSArray_String; tags = A._setArrayType([$.___family._readField$0()._group], t1); if (tags.length === 0) B.JSArray_methods.add$1(tags, "monster"); t2 = A.LinkedHashSet_LinkedHashSet$of($.___family._readField$0()._flags, type$.String); t2.addAll$1(0, builder._flags); dodge = builder._dodge; if (dodge == null) dodge = $.___family._readField$0()._dodge; if (t2.contains$1(0, _s8_)) dodge = 0; t3 = builder._minions; t4 = t3.length; if (t4 === 1) { if (0 >= t4) return A.ioore(t3, 0); minions = t3[0]; } else minions = t4 > 1 ? new A._AllOfSpawn(t3) : null; t3 = builder._builder0$_name; t4 = builder._pronoun; if (t4 == null) t4 = B.Pronoun_it_it_its; t5 = builder._hasProperName; t6 = builder._appearance; t7 = builder._attacks; t8 = builder._moves; t9 = builder._drops; if (builder._location == null) $.___family._readField$0(); t10 = $.___family._readField$0()._motility; t11 = builder._motility; t12 = builder._depth; t13 = builder._builder0$_health; t14 = builder._tracking; if (t14 == null) t14 = 0; t15 = $.___family._readField$0()._tracking; if (t15 == null) t15 = 10; t16 = builder._vision; if (t16 == null) t16 = $.___family._readField$0()._vision; t17 = builder._hearing; if (t17 == null) t17 = $.___family._readField$0()._hearing; t18 = builder._meander; if (t18 == null) t18 = $.___family._readField$0()._meander; if (t18 == null) t18 = 0; t19 = builder._speed; if (t19 == null) t19 = 0; t20 = $.___family._readField$0()._speed; if (t20 == null) t20 = 0; t21 = $.___family._readField$0()._emanationLevel; if (t21 == null) t21 = builder._emanationLevel; t22 = builder._countMin; if (t22 == null) t22 = $.___family._readField$0()._countMin; t23 = builder._countMax; if (t23 == null) t23 = $.___family._readField$0()._countMax; if (builder._stain == null) $.___family._readField$0(); names = t2._newSet$0(); names.addAll$1(0, t2); t2 = names.remove$1(0, "berzerk"); t24 = names.remove$1(0, "cowardly"); t25 = names.remove$1(0, "fearless"); t26 = names.remove$1(0, _s8_); t27 = names.remove$1(0, "protective"); t28 = names.remove$1(0, "unique"); if (names._collection$_length !== 0) A.throwExpression(A.ArgumentError$('Unknown flags "' + names.join$1(0, ", ") + '"', null)); t29 = builder._description; t30 = A._setArrayType([], type$.JSArray_Defense); t1 = A._setArrayType([], t1); if (t16 == null) t16 = 8; if (t17 == null) t17 = 10; t31 = dodge == null ? 20 : dodge; if (t21 == null) t21 = 0; if (t22 == null) t22 = 1; if (t23 == null) t23 = 1; if (t29 == null) t29 = "Indescribable."; B.JSArray_methods.addAll$1(t30, $.___family._readField$0()._defenses); B.JSArray_methods.addAll$1(t30, builder._defenses); B.JSArray_methods.add$1(t1, $.___family._readField$0()._group); t32 = $.$get$Monsters_breeds(); t33 = A.Log__categorize(t3, false, true); t34 = builder._builder0$_frequency; if (t34 == null) t34 = $.___family._readField$0()._builder0$_frequency; t35 = B.JSArray_methods.join$1(tags, " "); t32._resource$_add$7(t32.$ti._precomputed1._as(new A.Breed(t4, t5, t6, t12, t7, t8, t13, t14 + t15, t16, t17, t18, t19 + t20, new A._AllOfDrop(t9), new A.Motility(t10._bitMask | t11._bitMask), new A.BreedFlags(t2, t24, t25, t26, t27, t28), t31, t21, t30, t22, t23, minions, t3, t1, t29)), t33, t12, t12, t34, t34, t35); $._builder = null; }, breed($name, depth, color, health, dodge, frequency, speed) { var builder; A.finishBreed(); builder = new A.BreedBuilder($name, depth, A.Glyph$($.___family._readField$0()._character, color, null), health, A._setArrayType([], type$.JSArray_Attack), A._setArrayType([], type$.JSArray_Move), A._setArrayType([], type$.JSArray_Drop), A._setArrayType([], type$.JSArray_Spawn), frequency, $.$get$Motility_walk(), A._setArrayType([], type$.JSArray_Defense), A._setArrayType([], type$.JSArray_String)); builder._speed = speed; builder._dodge = dodge; return $._builder = builder; }, BreedBuilder$(_name, _depth, frequency, _appearance, _health) { return new A.BreedBuilder(_name, _depth, _appearance, _health, A._setArrayType([], type$.JSArray_Attack), A._setArrayType([], type$.JSArray_Move), A._setArrayType([], type$.JSArray_Drop), A._setArrayType([], type$.JSArray_Spawn), frequency, $.$get$Motility_walk(), A._setArrayType([], type$.JSArray_Defense), A._setArrayType([], type$.JSArray_String)); }, _BaseBuilder0: function _BaseBuilder0() { }, FamilyBuilder: function FamilyBuilder(t0, t1, t2, t3, t4, t5) { var _ = this; _._character = t0; _._group = t1; _._builder0$_frequency = t2; _._tracking = null; _._motility = t3; _._dodge = _._meander = _._speed = _._location = null; _._defenses = t4; _._flags = t5; _._hearing = _._vision = _._emanationLevel = _._stain = _._countMax = _._countMin = null; }, BreedBuilder: function BreedBuilder(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) { var _ = this; _._builder0$_name = t0; _._hasProperName = false; _._depth = t1; _._appearance = t2; _._builder0$_health = t3; _._attacks = t4; _._moves = t5; _._drops = t6; _._minions = t7; _._description = _._pronoun = null; _._builder0$_frequency = t8; _._tracking = null; _._motility = t9; _._dodge = _._meander = _._speed = _._location = null; _._defenses = t10; _._flags = t11; _._hearing = _._vision = _._emanationLevel = _._stain = _._countMax = _._countMin = null; }, _BreedSpawn: function _BreedSpawn(t0) { this._spawns$_breed = t0; }, _TagSpawn: function _TagSpawn(t0) { this._tag = t0; }, _RepeatSpawn: function _RepeatSpawn(t0, t1, t2) { this._minCount = t0; this._spawns$_maxCount = t1; this._spawn = t2; }, _AllOfSpawn: function _AllOfSpawn(t0) { this._spawns = t0; }, AmputateMove: function AmputateMove(t0, t1, t2, t3) { var _ = this; _._body = t0; _._part = t1; _._amputate$_message = t2; _.rate = t3; }, BoltMove: function BoltMove(t0, t1) { this.attack = t0; this.rate = t1; }, ConeMove: function ConeMove(t0, t1) { this.attack = t0; this.rate = t1; }, HasteMove: function HasteMove(t0, t1, t2) { this._duration = t0; this._haste$_speed = t1; this.rate = t2; }, HealMove: function HealMove(t0, t1) { this._amount = t0; this.rate = t1; }, HowlMove: function HowlMove(t0, t1, t2) { this._howl$_range = t0; this._howl$_verb = t1; this.rate = t2; }, MissiveMove: function MissiveMove(t0, t1) { this._missive = t0; this.rate = t1; }, SpawnMove: function SpawnMove(t0, t1) { this._preferStraight = t0; this.rate = t1; }, SpawnMove_onGetAction_checkNeighbor: function SpawnMove_onGetAction_checkNeighbor(t0, t1, t2) { this.game = t0; this.monster = t1; this.dir = t2; }, TeleportMove: function TeleportMove(t0, t1) { this._range = t0; this.rate = t1; }, Archery: function Archery(t0) { this._sortOrder = t0; }, Archery__hasBow_closure: function Archery__hasBow_closure() { }, ArrowAction: function ArrowAction(t0, t1, t2, t3, t4) { var _ = this; _._skill = t0; _._bolt$_hit = t1; _._canMiss = t2; _._bolt$_range = t3; _._los$_target = t4; _.__LosAction__los_FI = _.__LosAction__lastPos_A = $; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, _Archery_Discipline_UsableSkill: function _Archery_Discipline_UsableSkill() { }, _Archery_Discipline_UsableSkill_TargetSkill: function _Archery_Discipline_UsableSkill_TargetSkill() { }, AxeMastery: function AxeMastery(t0) { this._sortOrder = t0; }, SweepAction: function SweepAction(t0, t1, t2) { var _ = this; _._axe$_dir = t0; _.GeneratorActionMixin___GeneratorActionMixin__iterator_FI = t1; _.damageScale = t2; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, _AxeMastery_UsableMasteryDiscipline_DirectionSkill: function _AxeMastery_UsableMasteryDiscipline_DirectionSkill() { }, _SweepAction_MasteryAction_GeneratorActionMixin: function _SweepAction_MasteryAction_GeneratorActionMixin() { }, BattleHardening: function BattleHardening(t0) { this._sortOrder = t0; }, ClubMastery: function ClubMastery(t0) { this._sortOrder = t0; }, BashAction: function BashAction(t0, t1) { var _ = this; _._club$_dir = t0; _._damage = _._step = 0; _.damageScale = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, _ClubMastery_UsableMasteryDiscipline_DirectionSkill: function _ClubMastery_UsableMasteryDiscipline_DirectionSkill() { }, Discipline: function Discipline() { }, DualWield: function DualWield(t0) { this._sortOrder = t0; }, MasteryDiscipline: function MasteryDiscipline() { }, MasteryDiscipline__hasWeapon_closure: function MasteryDiscipline__hasWeapon_closure(t0) { this.$this = t0; }, UsableMasteryDiscipline: function UsableMasteryDiscipline() { }, MasteryAction: function MasteryAction() { }, _UsableMasteryDiscipline_MasteryDiscipline_UsableSkill: function _UsableMasteryDiscipline_MasteryDiscipline_UsableSkill() { }, SlayDiscipline$(_displayName, _breedGroup) { var t1 = $.Skill__nextSortOrder; $.Skill__nextSortOrder = t1 + 1; return new A.SlayDiscipline(_displayName, _breedGroup, t1); }, SlayDiscipline: function SlayDiscipline(t0, t1, t2) { this._displayName = t0; this._breedGroup = t1; this._sortOrder = t2; }, SpearMastery: function SpearMastery(t0) { this._sortOrder = t0; }, SpearAction: function SpearAction(t0, t1, t2) { var _ = this; _._dir = t0; _.GeneratorActionMixin___GeneratorActionMixin__iterator_FI = t1; _.damageScale = t2; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, _SpearAction_MasteryAction_GeneratorActionMixin: function _SpearAction_MasteryAction_GeneratorActionMixin() { }, _SpearMastery_UsableMasteryDiscipline_DirectionSkill: function _SpearMastery_UsableMasteryDiscipline_DirectionSkill() { }, Swordfighting: function Swordfighting(t0) { this._sortOrder = t0; }, Swordfighting_getDefense_closure: function Swordfighting_getDefense_closure() { }, WhipMastery: function WhipMastery(t0) { this._sortOrder = t0; }, _WhipMastery_UsableMasteryDiscipline_TargetSkill: function _WhipMastery_UsableMasteryDiscipline_TargetSkill() { }, conjuringSpells() { return A._setArrayType([A.ActionSpell$("Flee", new A.conjuringSpells_closure(), 10, 0, "Teleports the hero a short distance away.", 16, 8), A.ActionSpell$("Escape", new A.conjuringSpells_closure0(), 15, 0, "Teleports the hero away.", 25, 16), A.ActionSpell$("Disappear", new A.conjuringSpells_closure1(), 30, 0, "Moves the hero across the dungeon.", 50, 100)], type$.JSArray_Spell); }, conjuringSpells_closure: function conjuringSpells_closure() { }, conjuringSpells_closure0: function conjuringSpells_closure0() { }, conjuringSpells_closure1: function conjuringSpells_closure1() { }, divinationSpells() { return A._setArrayType([A.ActionSpell$("Sense Items", new A.divinationSpells_closure(), 17, 0, "Detect nearby items.", 40, 20)], type$.JSArray_Spell); }, divinationSpells_closure: function divinationSpells_closure() { }, sorcerySpells() { return A._setArrayType([A.TargetSpell$("Icicle", new A.sorcerySpells_closure(), 10, 8, "Launches a spear-like icicle.", 12, 8), A.TargetSpell$("Brilliant Beam", new A.sorcerySpells_closure0(), 14, 10, "Emits a blinding beam of radiance.", 24, 12), A.ActionSpell$("Windstorm", new A.sorcerySpells_closure1(), 18, 10, "Summons a blast of air, spreading out from the sorceror.", 36, 6), A.TargetSpell$("Fire Barrier", new A.sorcerySpells_closure2(), 30, 10, "Creates a wall of fire.", 45, 8), A.ActionSpell$("Tidal Wave", new A.sorcerySpells_closure3(), 40, 50, "Summons a giant tidal wave.", 70, 15)], type$.JSArray_Spell); }, sorcerySpells_closure: function sorcerySpells_closure() { }, sorcerySpells_closure0: function sorcerySpells_closure0() { }, sorcerySpells_closure1: function sorcerySpells_closure1() { }, sorcerySpells_closure2: function sorcerySpells_closure2() { }, sorcerySpells_closure3: function sorcerySpells_closure3() { }, ActionSpell$($name, _getAction, complexity, damage, description, $focus, range) { var t1 = $.Skill__nextSortOrder; $.Skill__nextSortOrder = t1 + 1; return new A.ActionSpell($name, description, complexity, $focus, damage, range, _getAction, t1); }, TargetSpell$($name, _getAction, complexity, damage, description, $focus, range) { var t1 = $.Skill__nextSortOrder; $.Skill__nextSortOrder = t1 + 1; return new A.TargetSpell($name, description, complexity, $focus, damage, range, _getAction, t1); }, Spell: function Spell() { }, ActionSpell: function ActionSpell(t0, t1, t2, t3, t4, t5, t6, t7) { var _ = this; _.name = t0; _.description = t1; _.baseComplexity = t2; _.baseFocusCost = t3; _.damage = t4; _.range = t5; _._getAction = t6; _._sortOrder = t7; }, TargetSpell: function TargetSpell(t0, t1, t2, t3, t4, t5, t6, t7) { var _ = this; _.name = t0; _.description = t1; _.baseComplexity = t2; _.baseFocusCost = t3; _.damage = t4; _.range = t5; _._getAction = t6; _._sortOrder = t7; }, _ActionSpell_Spell_ActionSkill: function _ActionSpell_Spell_ActionSkill() { }, _Spell_Skill_UsableSkill: function _Spell_Skill_UsableSkill() { }, _TargetSpell_Spell_TargetSkill: function _TargetSpell_Spell_TargetSkill() { }, Region: function Region(t0, t1, t2) { this.name = t0; this.index = t1; this._core$_name = t2; }, Architect: function Architect(t0, t1, t2, t3) { var _ = this; _.lore = t0; _.stage = t1; _.depth = t2; _._owners = t3; _._carvedTiles = 0; }, _Path: function _Path(t0, t1) { this.pos = t0; this.dir = t1; }, Architecture: function Architecture() { }, _LengthPathfinder: function _LengthPathfinder(t0, t1, t2, t3) { var _ = this; _._maxLength = t0; _.stage = t1; _.start = t2; _.end = t3; }, ArchitecturalStyle_pick(depth) { var style, result = A._setArrayType([], type$.JSArray_ArchitecturalStyle), count = Math.min($.$get$rng().taper$2(1, 10), 5), hasFillable = false; for (;;) { if (!(!hasFillable || result.length < count)) break; style = $.$get$ArchitecturalStyle_styles().tryChoose$1(depth); if (style.canFill) hasFillable = true; if (!B.JSArray_methods.contains$1(result, style)) B.JSArray_methods.add$1(result, style); } return result; }, ArchitecturalStyle: function ArchitecturalStyle(t0, t1, t2, t3, t4, t5, t6, t7) { var _ = this; _.name = t0; _.decorTheme = t1; _.decorDensity = t2; _.monsterGroups = t3; _.monsterDensity = t4; _.itemDensity = t5; _._factory = t6; _.canFill = t7; }, _addStyle($name, canFill, create, decor, decorDensity, end, endFrequency, itemDensity, monsterDensity, monsters, start, startFrequency) { var t1 = A._setArrayType((monsters == null ? "monster" : monsters).split(" "), type$.JSArray_String), t2 = monsterDensity == null ? 1 : monsterDensity, t3 = itemDensity == null ? 1 : itemDensity, t4 = $.$get$ArchitecturalStyle_styles(); t4._resource$_add$7(t4.$ti._precomputed1._as(new A.ArchitecturalStyle($name, decor, decorDensity, t1, t2, t3, create, canFill !== false)), null, start, end, startFrequency, endFrequency, null); }, dungeon(shapes, frequency) { var _null = null; A._addStyle("dungeon", _null, new A.dungeon_closure(shapes), "dungeon", 0.09, 100, _null, _null, _null, _null, 1, frequency); }, catacomb(monsters, endFrequency, startFrequency) { var _s8_ = "catacomb"; A._addStyle(_s8_, null, new A.catacomb_closure(), _s8_, 0.02, 100, endFrequency, null, null, monsters, 1, startFrequency); }, cavern(monsters, endFrequency, startFrequency) { A._addStyle("cavern", null, new A.cavern_closure(), "glowing-moss", 0.1, 100, endFrequency, null, null, monsters, 1, startFrequency); }, lake(monsters, end, start) { A._addStyle("lake", false, new A.lake_closure(), "water", 0.01, end, null, null, 0, monsters, start, null); }, river(monsters, end, start) { A._addStyle("river", false, new A.river_closure(), "water", 0.01, end, null, null, 0, monsters, start, null); }, keep(monsters, end, start) { A._addStyle(monsters + " keep", false, new A.keep_closure(), "keep", 0.07, end, null, 1.5, 0, monsters, start, 2); }, pit(monsterGroup, end, start) { var _null = null; A._addStyle(monsterGroup + " pit", false, new A.pit_closure(monsterGroup), "glowing-moss", 0.05, end, _null, _null, _null, _null, start, 0.2); }, dungeon_closure: function dungeon_closure(t0) { this.shapes = t0; }, catacomb_closure: function catacomb_closure() { }, cavern_closure: function cavern_closure() { }, lake_closure: function lake_closure() { }, river_closure: function river_closure() { }, keep_closure: function keep_closure() { }, pit_closure: function pit_closure(t0) { this.monsterGroup = t0; }, Catacomb: function Catacomb(t0, t1, t2) { var _ = this; _._catacomb$_density = t0; _._catacomb$_minSize = t1; _._catacomb$_maxSize = t2; _.__Architecture__region_F = _.__Architecture__style_F = _.__Architecture__architect_F = $; }, Cavern: function Cavern() { this.__Architecture__region_F = this.__Architecture__style_F = this.__Architecture__architect_F = $; }, Decorator: function Decorator(t0, t1, t2) { var _ = this; _._architect = t0; _.__Decorator__heroPos_F = $; _._tilesByArchitecture = t1; _._spawnedUniques = t2; }, Decorator_decorate_closure: function Decorator_decorate_closure() { }, Decorator__spawnMonster_spawn: function Decorator__spawnMonster_spawn(t0, t1, t2, t3) { var _ = this; _._box_0 = t0; _.$this = t1; _.isCorpse = t2; _.density = t3; }, Decorator__spawnMonster_closure: function Decorator__spawnMonster_closure() { }, Decorator__spawnMonster_closure0: function Decorator__spawnMonster_closure0() { }, DensityMap: function DensityMap(t0) { this._density = t0; this._possibleTiles = this._total = 0; }, Dungeon: function Dungeon(t0) { var _ = this; _._shapes = t0; _.__Architecture__region_F = _.__Architecture__style_F = _.__Architecture__architect_F = $; }, Keep_Keep(maxRooms) { var t1 = A.Keep$_($.$get$rng().triangleInt$2(maxRooms, maxRooms / 2 | 0), B.TakeFrom_1); return t1; }, Keep$_(_maxRooms, takeFrom) { return new A.Keep(new A.JunctionSet(takeFrom, A.LinkedHashMap_LinkedHashMap$_empty(type$.Vec, type$.Junction), A._setArrayType([], type$.JSArray_Junction)), _maxRooms); }, Keep: function Keep(t0, t1) { var _ = this; _._junctions = t0; _._placedRooms = 0; _._maxRooms = t1; _.__Architecture__region_F = _.__Architecture__style_F = _.__Architecture__architect_F = $; }, Keep_spawnMonsters_closure: function Keep_spawnMonsters_closure(t0) { this.painter = t0; }, Keep__regionContains_diagonal: function Keep__regionContains_diagonal(t0) { this.$this = t0; }, Keep__tryAttachRoom_closure: function Keep__tryAttachRoom_closure(t0, t1) { this.room = t0; this.direction = t1; }, Junction: function Junction(t0, t1) { this.position = t0; this.direction = t1; this.tries = 0; }, TakeFrom: function TakeFrom(t0, t1) { this.index = t0; this._core$_name = t1; }, JunctionSet: function JunctionSet(t0, t1, t2) { this._takeFrom = t0; this._byPosition = t1; this._junctions = t2; }, Lake: function Lake() { this.__Architecture__region_F = this.__Architecture__style_F = this.__Architecture__architect_F = $; }, PaintStyle$(closedDoor, floor, openDoor, wall) { return new A.PaintStyle(floor, wall, closedDoor, openDoor); }, Painter: function Painter(t0, t1, t2) { var _ = this; _._decorator = t0; _._painter$_architect = t1; _._architecture = t2; _._painted = 0; }, PaintStyle: function PaintStyle(t0, t1, t2, t3) { var _ = this; _._floor = t0; _._wall = t1; _._closedDoor = t2; _._openDoor = t3; }, Pit: function Pit(t0, t1, t2, t3) { var _ = this; _._monsterGroup = t0; _._minSize = t1; _._maxSize = t2; _._monsterTiles = t3; _.__Architecture__region_F = _.__Architecture__style_F = _.__Architecture__architect_F = $; }, Reachability: function Reachability(t0, t1, t2, t3, t4) { var _ = this; _.stage = t0; _._reachability$_start = t1; _._distances = t2; _._affected = t3; _._reachedOpenCount = 0; _._beforeFill = t4; }, _FillStep: function _FillStep(t0, t1) { this.pos = t0; this.distance = t1; }, _RiverPoint$(x, y, shoreRadius, waterRadius) { var t1 = shoreRadius == null ? $.$get$rng().float$2(1, 3) : shoreRadius; return new A._RiverPoint(x, y, t1, waterRadius == null ? $.$get$rng().float$2(1, 3) : waterRadius); }, River: function River() { this.__Architecture__region_F = this.__Architecture__style_F = this.__Architecture__architect_F = $; }, River_build_northish: function River_build_northish(t0) { this.$this = t0; }, River_build_southish: function River_build_southish(t0) { this.$this = t0; }, River_build_eastish: function River_build_eastish(t0) { this.$this = t0; }, River_build_westish: function River_build_westish(t0) { this.$this = t0; }, River_build_northSouth: function River_build_northSouth(t0) { this.$this = t0; }, River_build_eastWest: function River_build_eastWest(t0) { this.$this = t0; }, _RiverPoint: function _RiverPoint(t0, t1, t2, t3) { var _ = this; _.x = t0; _.y = t1; _.shoreRadius = t2; _.waterRadius = t3; }, Room_create(depth, shapes) { var _0_0, t1; switch (shapes.index) { case 0: return $.$get$rng().range$1(3) === 0 ? A.Room__angled(depth) : A.Room__rectangle(depth); case 1: return $.$get$rng().range$1(3) === 0 ? A.Room__diamond(depth) : A.Room__octagon(depth); case 2: _0_0 = $.$get$rng().range$1(10); $label0$1: { if (0 === _0_0) { t1 = A.Room__diamond(depth); break $label0$1; } if (1 === _0_0) { t1 = A.Room__octagon(depth); break $label0$1; } if (2 === _0_0 || 3 === _0_0) { t1 = A.Room__angled(depth); break $label0$1; } t1 = A.Room__rectangle(depth); break $label0$1; } return t1; } }, Room__roomSize() { var t1 = $.$get$rng(); if (t1.range$1(4) !== 0) return B.RoomSize_0; if (t1.range$1(4) !== 0) return B.RoomSize_1; return B.RoomSize_2; }, Room__rectangle(depth) { var t2, short, long, t0, horizontal, width, height, t3, tiles, y, x, t4, lights, i, t5, t1 = $.$get$rng(); switch (t1.range$1(10) === 0) { case true: t2 = new A._Record_2(t1.inclusive$2(11, 18), t1.inclusive$2(11, 18)); break; case false: t2 = new A._Record_2(t1.inclusive$2(3, 10), t1.inclusive$2(3, 10)); break; default: t2 = null; } short = t2._0; long = t2._1; if (short > long) { t0 = long; long = short; short = t0; } horizontal = t1.range$1(2) === 0; width = horizontal ? long : short; height = horizontal ? short : long; t1 = width + 2; t2 = height + 2; t3 = A.List_List$filled(t1 * t2, $.$get$RoomTile_unused(), false, type$.RoomTile); tiles = new A.Array2D(t3, new A.Rect(new A.Vec(0, 0), new A.Vec(t1, t2)), type$.Array2D_RoomTile); for (y = 0; y < height;) for (++y, t2 = y * t1, x = 0; x < width;) { ++x; t4 = $.$get$RoomTile_floor(); tiles._checkBounds$2(x, y); B.JSArray_methods.$indexSet(t3, t2 + x, t4); } lights = A._setArrayType([], type$.JSArray_List_Vec); if (short <= 9 && (width & 1) === 1 && (height & 1) === 1) B.JSArray_methods.add$1(lights, A._setArrayType([new A.Vec(B.JSInt_methods._tdivFast$1(width, 2) + 1, B.JSInt_methods._tdivFast$1(height, 2) + 1)], type$.JSArray_Vec)); if (long >= 5) for (t1 = B.JSInt_methods._tdivFast$1(short - 1, 2), t2 = type$.JSArray_Vec, i = 0; i < t1; ++i) { t3 = 1 + i; t4 = width - i; t5 = height - i; B.JSArray_methods.add$1(lights, A._setArrayType([new A.Vec(t3, t3), new A.Vec(t4, t3), new A.Vec(t3, t5), new A.Vec(t4, t5)], t2)); } A.Room__addLights(depth, tiles, lights); A.Room__calculateEdges(tiles); return tiles; }, Room__angled(depth) { var t1, min, max, short, long, horizontal, width, height, cutWidth, cutHeight, isTop, isLeft, t2, t3, tiles, y, x, t4, xMin, xMax, yMin, yMax, lights, t5, t6, t7, t8, i, cornerLights, t9, t10; switch (A.Room__roomSize().index) { case 0: t1 = B.Record2_5_8; break; case 1: t1 = B.Record2_9_12; break; case 2: t1 = B.Record2_13_18; break; default: t1 = null; } min = t1._0; max = t1._1; t1 = $.$get$rng(); short = t1.inclusive$2(min, max); long = t1.inclusive$2(short, B.JSNumber_methods.ceil$0(short * 1.5)); horizontal = t1.range$1(2) === 0; width = horizontal ? long : short; height = horizontal ? short : long; cutWidth = t1.inclusive$2(2, width - 3); cutHeight = t1.inclusive$2(2, height - 3); isTop = t1.range$1(2) === 0; isLeft = t1.range$1(2) === 0; t1 = width + 2; t2 = height + 2; t3 = A.List_List$filled(t1 * t2, $.$get$RoomTile_unused(), false, type$.RoomTile); tiles = new A.Array2D(t3, new A.Rect(new A.Vec(0, 0), new A.Vec(t1, t2)), type$.Array2D_RoomTile); for (y = 0; y < height;) for (++y, t2 = y * t1, x = 0; x < width;) { ++x; t4 = $.$get$RoomTile_floor(); tiles._checkBounds$2(x, y); B.JSArray_methods.$indexSet(t3, t2 + x, t4); } xMin = isLeft ? 0 : width - cutWidth; xMax = isLeft ? cutWidth : width; yMin = isTop ? 0 : height - cutHeight; yMax = isTop ? cutHeight : height; for (y = yMin; y < yMax;) for (++y, t2 = y * t1, x = xMin; x < xMax;) { ++x; t4 = $.$get$RoomTile_unused(); tiles._checkBounds$2(x, y); B.JSArray_methods.$indexSet(t3, t2 + x, t4); } lights = A._setArrayType([], type$.JSArray_List_Vec); t1 = width - cutWidth; t2 = height - cutHeight; for (t3 = B.JSInt_methods._tdivFast$1(Math.min(t1, t2) - 1, 2), t4 = !isTop, t5 = type$.JSArray_Vec, t6 = !isLeft, t7 = cutWidth + 1, t8 = cutHeight + 1, i = 0; i < t3; ++i) { cornerLights = A._setArrayType([], t5); B.JSArray_methods.add$1(lights, cornerLights); if (!isTop || t6) { t9 = 1 + i; B.JSArray_methods.add$1(cornerLights, new A.Vec(t9, t9)); } if (!isTop || isLeft) B.JSArray_methods.add$1(cornerLights, new A.Vec(width - i, 1 + i)); if (!t4 || t6) B.JSArray_methods.add$1(cornerLights, new A.Vec(1 + i, height - i)); if (!t4 || isLeft) B.JSArray_methods.add$1(cornerLights, new A.Vec(width - i, height - i)); if (isTop) { t9 = 1 + i; t10 = t8 + i; if (isLeft) { B.JSArray_methods.add$1(cornerLights, new A.Vec(t7 + i, t9)); B.JSArray_methods.add$1(cornerLights, new A.Vec(t9, t10)); } else { B.JSArray_methods.add$1(cornerLights, new A.Vec(t1 - i, t9)); B.JSArray_methods.add$1(cornerLights, new A.Vec(width - i, t10)); } } else { t9 = height - i; t10 = t2 - i; if (isLeft) { B.JSArray_methods.add$1(cornerLights, new A.Vec(t7 + i, t9)); B.JSArray_methods.add$1(cornerLights, new A.Vec(1 + i, t10)); } else { B.JSArray_methods.add$1(cornerLights, new A.Vec(width - i, t10)); B.JSArray_methods.add$1(cornerLights, new A.Vec(t1 - i, t9)); } } } A.Room__addLights(depth, tiles, lights); A.Room__calculateEdges(tiles); return tiles; }, Room__diamond(depth) { var t1, min, max, size; switch (A.Room__roomSize().index) { case 0: t1 = B.Record2_5_9; break; case 1: t1 = B.Record2_10_17; break; case 2: t1 = B.Record2_18_27; break; default: t1 = null; } min = t1._0; max = t1._1; size = $.$get$rng().inclusive$2(min, max); return A.Room__angledCorners(size, B.JSInt_methods._tdivFast$1(size - 1, 2), depth); }, Room__octagon(depth) { var t1, min, max, size; switch (A.Room__roomSize().index) { case 0: t1 = B.Record2_6_9; break; case 1: t1 = B.Record2_10_16; break; case 2: t1 = B.Record2_17_24; break; default: t1 = null; } min = t1._0; max = t1._1; t1 = $.$get$rng(); size = t1.inclusive$2(min, max); return A.Room__angledCorners(size, t1.inclusive$2(2, B.JSInt_methods._tdivFast$1(size, 2) - 1), depth); }, Room__angledCorners(size, corner, depth) { var y, y0, t3, x, t4, t5, lights, i, t6, maxSquare, t1 = size + 2, t2 = A.List_List$filled(t1 * t1, $.$get$RoomTile_unused(), false, type$.RoomTile), tiles = new A.Array2D(t2, new A.Rect(new A.Vec(0, 0), new A.Vec(t1, t1)), type$.Array2D_RoomTile); for (y = 0; y < size; y = y0) for (y0 = y + 1, t3 = y0 * t1, x = 0; x < size; ++x) { if (x + y < corner) continue; t4 = size - x - 1; if (t4 + y < corner) continue; if (x + size - y - 1 < corner) continue; if (t4 + size - y - 1 < corner) continue; t4 = x + 1; t5 = $.$get$RoomTile_floor(); tiles._checkBounds$2(t4, y0); B.JSArray_methods.$indexSet(t2, t3 + t4, t5); } lights = A._setArrayType([], type$.JSArray_List_Vec); if (size <= 9 && (size & 1) === 1) { t1 = B.JSInt_methods._tdivFast$1(size, 2) + 1; B.JSArray_methods.add$1(lights, A._setArrayType([new A.Vec(t1, t1)], type$.JSArray_Vec)); } if ((size & 1) === 1) for (t1 = B.JSInt_methods._tdivFast$1(size, 2), t2 = t1 - 1, t3 = type$.JSArray_Vec, i = 2; i < t2; ++i) { t4 = t1 + 1; t5 = t4 - i; t6 = t4 + i; B.JSArray_methods.add$1(lights, A._setArrayType([new A.Vec(t4, t5), new A.Vec(t6, t4), new A.Vec(t4, t6), new A.Vec(t5, t4)], t3)); } maxSquare = B.JSInt_methods._tdivFast$1(size + 1, 2) - B.JSInt_methods._tdivFast$1(corner + 1, 2) - 3; for (t1 = size - 1, t2 = size + 4, t3 = type$.JSArray_Vec, i = 0; i <= maxSquare; ++i) { t4 = B.JSInt_methods._tdivFast$1(t1, 2) - i; t5 = B.JSInt_methods._tdivFast$1(t2, 2) + i; B.JSArray_methods.add$1(lights, A._setArrayType([new A.Vec(t4, t4), new A.Vec(t5, t4), new A.Vec(t4, t5), new A.Vec(t5, t5)], t3)); } A.Room__addLights(depth, tiles, lights); A.Room__calculateEdges(tiles); return tiles; }, Room__calculateEdges(room) { var t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, cardinalFloors, hasCornerFloor; for (t1 = room.bounds, t2 = A.RectIterator$(t1), t3 = type$.bool_Function_Direction, t4 = type$.WhereIterable_Direction, t5 = t4._eval$1("Iterable.E"), t6 = room._elements, t1 = t1.size.x, t7 = t6.length, t8 = room.$ti._precomputed1; t2.moveNext$0();) { t9 = t2._x; t10 = t2._y; room._checkBounds$2(t9, t10); t11 = t10 * t1 + t9; if (!(t11 >= 0 && t11 < t7)) return A.ioore(t6, t11); t12 = t6[t11]; if (!(t12.tile == null && t12.direction === B.Direction_0_0_0_none)) continue; t12 = new A.Room__calculateEdges_isFloor(new A.Vec(t9, t10), room); cardinalFloors = A.List_List$_of(new A.WhereIterable(B.List_iHk, t3._as(t12), t4), t5); hasCornerFloor = B.JSArray_methods.any$1(B.List_d2u, t12); t12 = cardinalFloors.length; if (t12 === 1) { t12 = t8._as(new A.RoomTile(null, B.JSArray_methods.get$single(cardinalFloors).get$rotate180())); room._checkBounds$2(t9, t10); B.JSArray_methods.$indexSet(t6, t11, t12); } else if (t12 <= 1) if (hasCornerFloor) { t12 = t8._as($.$get$RoomTile_wall()); room._checkBounds$2(t9, t10); B.JSArray_methods.$indexSet(t6, t11, t12); } } }, Room__addLights(depth, room, lights) { var t1, t2, t3, t4, t5, t6, t7, t8, max, t9; if (lights.length === 0) return; t1 = $.$get$rng(); t2 = B.JSNumber_methods.round$0(A.lerpDouble(depth, 1, 100, 90, 20)); if (t1.range$1(100) >= t2) return; type$.List_List_Vec._as(lights); t2 = t1.range$1(lights.length); if (!(t2 >= 0 && t2 < lights.length)) return A.ioore(lights, t2); t2 = B.JSArray_methods.get$iterator(lights[t2]); t3 = room.$ti._precomputed1; t4 = room._elements; t5 = room.bounds.size.x; t6 = type$.List_nullable_TileType; while (t2.moveNext$0()) { t7 = t2.get$current(); t8 = t6._as($.$get$Tiles_braziers()); max = t8.length; t9 = t1._random.nextInt$1(max); if (!(t9 >= 0 && t9 < t8.length)) return A.ioore(t8, t9); t9 = t3._as(new A.RoomTile(t8[t9], B.Direction_0_0_0_none)); t8 = t7.get$x(); t7 = t7.get$y(); room._checkBounds$2(t8, t7); B.JSArray_methods.$indexSet(t4, t7 * t5 + t8, t9); } }, RoomTile$junction(direction) { return new A.RoomTile(null, direction); }, RoomTile$tile(tile) { return new A.RoomTile(tile, B.Direction_0_0_0_none); }, RoomArchitecture: function RoomArchitecture() { }, RoomShapes: function RoomShapes(t0, t1) { this.index = t0; this._core$_name = t1; }, Room__calculateEdges_isFloor: function Room__calculateEdges_isFloor(t0, t1) { this.pos = t0; this.room = t1; }, RoomTile: function RoomTile(t0, t1) { this.tile = t0; this.direction = t1; }, RoomSize: function RoomSize(t0, t1) { this.index = t0; this._core$_name = t1; }, Town: function Town(t0) { this.stage = t0; }, _closeDoor(pos) { return A.CloseDoorAction$(pos, $.$get$Tiles_closedDoor()); }, _openDoor(pos) { return A.OpenDoorAction$(pos, $.$get$Tiles_openDoor()); }, _closeSquareDoor(pos) { return A.CloseDoorAction$(pos, $.$get$Tiles_closedSquareDoor()); }, _openSquareDoor(pos) { return A.OpenDoorAction$(pos, $.$get$Tiles_openSquareDoor()); }, _closeBarredDoor(pos) { return A.CloseDoorAction$(pos, $.$get$Tiles_closedBarredDoor()); }, _openBarredDoor(pos) { return A.OpenDoorAction$(pos, $.$get$Tiles_openBarredDoor()); }, Tiles_multi($name, char, fore, $back, count, generate) { var t1, t2, i, result = A._setArrayType([], type$.JSArray_TileType); for (t1 = type$.JSArray_Glyph, t2 = char.length, i = 0; i < count; ++i) { if (0 >= t2) return A.ioore(char, 0); B.JSArray_methods.add$1(result, generate.call$2(new A.TileBuilder($name, A._setArrayType([new A.Glyph(char.charCodeAt(0), fore, B.Color_20_19_31)], t1)), i)); } return result; }, Tiles_burnResult(tile) { var t1 = $.$get$Tiles__burnTypes(); if (t1.containsKey$1(tile)) { t1 = t1.$index(0, tile); t1.toString; return t1; } return A._setArrayType([$.$get$Tiles_burntFloor(), $.$get$Tiles_burntFloor2()], type$.JSArray_TileType); }, TileBuilder_TileBuilder($name, char, fore, $back) { if ($back == null) $back = B.Color_20_19_31; if (0 >= char.length) return A.ioore(char, 0); return new A.TileBuilder($name, A._setArrayType([A.Glyph$fromCharCode(char.charCodeAt(0), fore, $back)], type$.JSArray_Glyph)); }, Tiles_closedChest_closure: function Tiles_closedChest_closure() { }, Tiles_closedBarrel_closure: function Tiles_closedBarrel_closure() { }, Tiles_braziers_closure: function Tiles_braziers_closure() { }, TileBuilder: function TileBuilder(t0, t1) { var _ = this; _.name = t0; _.glyphs = t1; _._portal = _._onOperate = null; _._emanation = 0; }, Debug_monsterLog(monster, message) { var t1 = $.Debug__monsters.putIfAbsent$2(monster, new A.Debug_monsterLog_closure(monster)).log; t1._add$1(t1.$ti._precomputed1._as(message)); if (t1.get$length(0) > 10) t1.removeFirst$0(); }, Debug_monsterStat(monster, stat, value, reason) { var stats = $.Debug__monsters.putIfAbsent$2(monster, new A.Debug_monsterStat_closure(monster)).stats.putIfAbsent$2(stat, new A.Debug_monsterStat_closure0()); stats._add$1(stats.$ti._precomputed1._as(value)); if (stats.get$length(0) > 20) stats.removeFirst$0(); A.Debug_monsterReason(monster, stat, reason); }, Debug_monsterReason(monster, stat, reason) { $.Debug__monsters.putIfAbsent$2(monster, new A.Debug_monsterReason_closure(monster)).statReason.$indexSet(0, stat, reason); }, Debug_monsterInfo(monster) { var log, t1 = $.Debug__gameScreen; if (t1 == null) return null; log = $.Debug__monsters.$index(0, monster); if (log == null) return null; return log.toString$0(0); }, _MonsterLog$(monster) { var t1 = type$.String; return new A._MonsterLog(monster, A.ListQueue$(t1), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Queue_num), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.nullable_String)); }, Debug_monsterLog_closure: function Debug_monsterLog_closure(t0) { this.monster = t0; }, Debug_monsterStat_closure: function Debug_monsterStat_closure(t0) { this.monster = t0; }, Debug_monsterStat_closure0: function Debug_monsterStat_closure0() { }, Debug_monsterReason_closure: function Debug_monsterReason_closure(t0) { this.monster = t0; }, _MonsterLog: function _MonsterLog(t0, t1, t2, t3) { var _ = this; _.monster = t0; _.log = t1; _.stats = t2; _.statReason = t3; }, _MonsterLog_toString_closure: function _MonsterLog_toString_closure() { }, Action: function Action() { }, ActionResult: function ActionResult(t0, t1, t2) { this.alternative = t0; this.succeeded = t1; this.done = t2; }, FocusAction: function FocusAction(t0, t1) { var _ = this; _._action$_focus = t0; _._action = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, GeneratorActionMixin: function GeneratorActionMixin() { }, AttackAction: function AttackAction(t0) { var _ = this; _.defender = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, PickUpAction$(item) { return new A.PickUpAction(item); }, EquipAction$($location, item) { return new A.EquipAction($location, item); }, ItemAction: function ItemAction() { }, PickUpAction: function PickUpAction(t0) { var _ = this; _.item = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, DropAction: function DropAction(t0, t1, t2) { var _ = this; _._item$_count = t0; _.location = t1; _.item = t2; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, EquipAction: function EquipAction(t0, t1) { var _ = this; _.location = t0; _.item = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, UnequipAction: function UnequipAction(t0, t1) { var _ = this; _.location = t0; _.item = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, UseAction: function UseAction(t0, t1) { var _ = this; _.location = t0; _.item = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, DestroyActionMixin: function DestroyActionMixin() { }, DestroyActionMixin_destroyFloorItems_closure: function DestroyActionMixin_destroyFloorItems_closure(t0, t1) { this.$this = t0; this.pos = t1; }, DestroyActionMixin_destroyHeldItems_closure: function DestroyActionMixin_destroyHeldItems_closure(t0) { this.$this = t0; }, DestroyActionMixin_destroyHeldItems_closure0: function DestroyActionMixin_destroyHeldItems_closure0(t0, t1) { this._box_0 = t0; this.$this = t1; }, LosAction: function LosAction() { }, TossAction: function TossAction(t0, t1, t2, t3) { var _ = this; _._toss$_hit = t0; _._toss$_target = t1; _.location = t2; _.item = t3; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, TossLosAction: function TossLosAction(t0, t1, t2) { var _ = this; _._toss$_item = t0; _._toss$_hit = t1; _._missed = false; _._los$_target = t2; _.__LosAction__los_FI = _.__LosAction__lastPos_A = $; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, WalkAction$(_dir) { return new A.WalkAction(_dir); }, OpenDoorAction$(pos, openDoor) { return new A.OpenDoorAction(pos, openDoor); }, CloseDoorAction$(doorPos, closedDoor) { return new A.CloseDoorAction(doorPos, closedDoor); }, RestAction$() { return new A.RestAction(); }, WalkAction: function WalkAction(t0) { var _ = this; _._walk$_dir = t0; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, OpenDoorAction: function OpenDoorAction(t0, t1) { var _ = this; _.pos = t0; _.openDoor = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, CloseDoorAction: function CloseDoorAction(t0, t1) { var _ = this; _.doorPos = t0; _.closedDoor = t1; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, RestAction: function RestAction() { var _ = this; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, Actor: function Actor() { }, getArmorMultiplier(armor) { return 1 / (1 + Math.max(0, armor) / 40); }, Attack$(noun, verb, damage, range, element) { var t1 = range == null ? 0 : range; return new A.Attack(noun, verb, damage, t1, element == null ? $.$get$Element_none() : element); }, Hit$_(_attack) { var t1 = type$.JSArray_Scale, t2 = type$.JSArray_Bonus; return new A.Hit(_attack, A._setArrayType([], t1), A._setArrayType([], t2), A._setArrayType([], t1), A._setArrayType([], t2), $.$get$Element_none()); }, Attack: function Attack(t0, t1, t2, t3, t4) { var _ = this; _.noun = t0; _.verb = t1; _.damage = t2; _.range = t3; _.element = t4; }, HitType: function HitType(t0, t1) { this.index = t0; this._core$_name = t1; }, Bonus: function Bonus(t0) { this.amount = t0; }, Scale: function Scale(t0) { this.amount = t0; }, Hit: function Hit(t0, t1, t2, t3, t4, t5) { var _ = this; _._attack = t0; _._strikeScales = t1; _._strikeBonuses = t2; _._damageScales = t3; _._damageBonuses = t4; _._brand = t5; _._rangeScale = 1; }, Hit__strikeScale_closure: function Hit__strikeScale_closure() { }, Hit__strikeBonus_closure: function Hit__strikeBonus_closure() { }, Hit__damageScale_closure: function Hit__damageScale_closure() { }, Hit__damageBonus_closure: function Hit__damageBonus_closure() { }, Defense: function Defense(t0, t1) { this.amount = t0; this.message = t1; }, Condition: function Condition() { }, HasteCondition: function HasteCondition() { this._intensity = this._turnsRemaining = 0; }, ColdCondition: function ColdCondition() { this._intensity = this._turnsRemaining = 0; }, PoisonCondition: function PoisonCondition() { this._intensity = this._turnsRemaining = 0; }, BlindnessCondition: function BlindnessCondition() { this._intensity = this._turnsRemaining = 0; }, ResistCondition: function ResistCondition(t0) { this._condition$_element = t0; this._intensity = this._turnsRemaining = 0; }, PerceiveCondition: function PerceiveCondition() { this._intensity = this._turnsRemaining = 0; }, Element$($name, abbreviation, experience, attack, destroyMessage, emanates, floor) { var t1 = attack == null ? new A.Element_closure() : attack; return new A.Element($name, abbreviation, destroyMessage, emanates, experience, t1, floor == null ? new A.Element_closure0() : floor); }, Element: function Element(t0, t1, t2, t3, t4, t5, t6) { var _ = this; _.name = t0; _.abbreviation = t1; _.destroyMessage = t2; _.emanates = t3; _.experience = t4; _.attackAction = t5; _.floorAction = t6; }, Element_closure: function Element_closure() { }, Element_closure0: function Element_closure0() { }, Energy: function Energy() { this.energy = 0; }, Game$($content, depth, save, height, width) { var t1 = A.ListQueue$(type$.Action), t2 = A._setArrayType([], type$.JSArray_Action), t3 = A._setArrayType([], type$.JSArray_Event), t4 = A._setArrayType([], type$.JSArray_Vec), t5 = new A.Energy(), t6 = new A.Hero(save, A.LinkedHashSet_LinkedHashSet$_empty(type$.Monster), new A.Property(type$.Property_double), $.$get$Skills_all(), t5, new A.HasteCondition(), new A.ColdCondition(), new A.PoisonCondition(), new A.BlindnessCondition(), new A.BlindnessCondition(), new A.PerceiveCondition(), A.LinkedHashMap_LinkedHashMap$_empty(type$.Element, type$.ResistCondition), new A.Vec(0, 0)); t5.energy = 240; t6.refreshProperties$0(); t5 = save.vitality._stat$_value; t5.toString; t6._health = B.JSInt_methods.clamp$2(B.JSNumber_methods.toInt$0(Math.pow(t5, 1.458) + 9), 0, t6.get$maxHealth()); t5 = save.intellect._stat$_value; t5.toString; t6._focus = A.Intellect_maxFocusAt(t5); t3 = new A.Game($content, t1, t2, t3, new A.Energy(), t4, depth, t6); t1 = width == null ? 120 : width; t1 = A.Stage$(t1, height == null ? 80 : height, t3); t3.__Game__stage_F !== $ && A.throwLateFieldAI("_stage"); t3.__Game__stage_F = t1; t1.addActor$1(t6); B.JSArray_methods.addAll$1(t4, t1.tiles.bounds.inflate$1(-1)); t1 = $.$get$rng(); B.JSArray_methods.shuffle$1(type$.List_Vec._as(t4), t1._random); return t3; }, Game: function Game(t0, t1, t2, t3, t4, t5, t6, t7) { var _ = this; _.content = t0; _._actions = t1; _._reactions = t2; _._events = t3; _._substanceEnergy = t4; _._substanceUpdateOrder = t5; _._substanceIndex = null; _.depth = t6; _.__Game__stage_F = $; _.hero = t7; }, Game_generate_closure: function Game_generate_closure(t0) { this.heroPos = t0; }, GameResult: function GameResult(t0, t1) { this.events = t0; this.madeProgress = t1; }, Event: function Event(t0, t1, t2, t3, t4, t5) { var _ = this; _.type = t0; _.actor = t1; _.element = t2; _.other = t3; _.pos = t4; _.dir = t5; }, EventType: function EventType(t0) { this._game$_name = t0; }, Log_quantifyWithoutArticle(text, count) { if (count === 1) return A.Log__categorize(B.JSString_methods.startsWith$1(text, "(a) ") ? B.JSString_methods.substring$1(text, 4) : text, true, true); else return "" + count + " " + A.Log__categorize(text, true, false); }, Log_wordWrap(width, text) { var finishWord, finishLine, t1, i, _0_0, t2, wordLength, t3, _box_0 = {}, lines = A._setArrayType([], type$.JSArray_String); _box_0.line = ""; _box_0.wordStart = -1; finishWord = new A.Log_wordWrap_finishWord(_box_0, text); finishLine = new A.Log_wordWrap_finishLine(_box_0, lines); for (t1 = text.length, i = 0; i < t1; ++i) { _0_0 = text[i]; if (" " === _0_0) { finishWord.call$1(i); continue; } if ("\n" === _0_0) { finishWord.call$1(i); finishLine.call$0(); _box_0.wordStart = -1; continue; } t2 = _box_0.wordStart; if (t2 === -1) { _box_0.wordStart = i; t2 = i; } wordLength = i - t2 + 1; t2 = _box_0.line.length; t3 = t2 === 0; if (t3 && wordLength > width) { finishWord.call$1(i); finishLine.call$0(); _box_0.wordStart = i; } else if (!t3 && t2 + 1 + wordLength > width) finishLine.call$0(); } finishWord.call$1(t1); if (_box_0.line.length !== 0) finishLine.call$0(); return lines; }, Log__categorize(text, force, isFirst) { var match, t1, t2, before, after, optionalSuffix = A.RegExp_RegExp("\\[(\\w+?)\\]"), irregular = A.RegExp_RegExp("\\[([^|]+)\\|([^\\]]+)\\]"); if (force && !isFirst && !B.JSString_methods.contains$1(text, "[")) return text + "s"; for (;;) { match = optionalSuffix.firstMatch$1(text); if (match == null) break; t1 = match._match; t2 = t1.index; before = B.JSString_methods.substring$2(text, 0, t2); after = B.JSString_methods.substring$1(text, t2 + t1[0].length); if (isFirst) text = before + after; else { if (1 >= t1.length) return A.ioore(t1, 1); text = before + A.S(t1[1]) + after; } } for (;;) { match = irregular.firstMatch$1(text); if (match == null) break; t1 = match._match; t2 = t1.index; before = B.JSString_methods.substring$2(text, 0, t2); after = B.JSString_methods.substring$1(text, t2 + t1[0].length); t2 = t1.length; if (isFirst) { if (1 >= t2) return A.ioore(t1, 1); text = before + A.S(t1[1]) + after; } else { if (2 >= t2) return A.ioore(t1, 2); text = before + A.S(t1[2]) + after; } } return text; }, Log: function Log(t0) { this.messages = t0; }, Log_wordWrap_finishWord: function Log_wordWrap_finishWord(t0, t1) { this._box_0 = t0; this.text = t1; }, Log_wordWrap_finishLine: function Log_wordWrap_finishLine(t0, t1) { this._box_0 = t0; this.lines = t1; }, Noun: function Noun(t0) { this.nounText = t0; }, Pronoun: function Pronoun(t0, t1, t2) { this.subjective = t0; this.objective = t1; this.possessive = t2; }, LogType: function LogType(t0, t1) { this.index = t0; this._core$_name = t1; }, Message: function Message(t0, t1, t2) { this.type = t0; this.text = t1; this.count = t2; }, lerpDouble(value, min, max, outMin, outMax) { if (value <= min) return outMin; if (value >= max) return outMax; return outMin + (value - min) / (max - min) * (outMax - outMin); }, hashPoint(x, y) { var t1 = new A.hashPoint_hashInt(), t2 = t1.call$1(0); if (typeof t2 !== "number") return t2.$add(); t2 = t1.call$1(t2 + x); if (typeof t2 !== "number") return t2.$add(); t2 = t1.call$1(t2 + y); if (typeof t2 !== "number") return t2.$and(); return t2 >>> 0; }, hashPoint_hashInt: function hashPoint_hashInt() { }, ResourceSet$($T) { var t1 = type$.String; return new A.ResourceSet(A.LinkedHashMap_LinkedHashMap$_empty(t1, $T._eval$1("_Tag<0>")), A.LinkedHashMap_LinkedHashMap$_empty(t1, $T._eval$1("_Resource<0>")), A.LinkedHashMap_LinkedHashMap$_empty(type$._QueryKey, $T._eval$1("_ResourceQuery<0>")), $T._eval$1("ResourceSet<0>")); }, ResourceSet: function ResourceSet(t0, t1, t2, t3) { var _ = this; _._tags = t0; _._resources = t1; _._queries = t2; _.$ti = t3; }, ResourceSet_all_closure: function ResourceSet_all_closure(t0) { this.$this = t0; }, ResourceSet_hasTag_closure: function ResourceSet_hasTag_closure(t0, t1) { this.$this = t0; this.tag = t1; }, ResourceSet_getTags_closure: function ResourceSet_getTags_closure(t0) { this.$this = t0; }, ResourceSet_tryChoose_closure: function ResourceSet_tryChoose_closure(t0) { this.$this = t0; }, ResourceSet_tryChoose_closure0: function ResourceSet_tryChoose_closure0(t0, t1, t2) { this._box_0 = t0; this.$this = t1; this.goalTag = t2; }, ResourceSet_tryChooseMatching_closure: function ResourceSet_tryChooseMatching_closure(t0) { this.$this = t0; }, ResourceSet_tryChooseMatching_closure0: function ResourceSet_tryChooseMatching_closure0(t0, t1) { this.$this = t0; this.tagObjects = t1; }, ResourceSet_tryChooseMatching__closure: function ResourceSet_tryChooseMatching__closure(t0, t1) { this.$this = t0; this.resourceTag = t1; }, _Resource: function _Resource(t0, t1, t2, t3, t4, t5, t6) { var _ = this; _.object = t0; _.startDepth = t1; _.endDepth = t2; _.startFrequency = t3; _.endFrequency = t4; _._tags = t5; _.$ti = t6; }, _Tag: function _Tag(t0, t1, t2) { this.name = t0; this.parent = t1; this.$ti = t2; }, _QueryKey: function _QueryKey(t0, t1) { this.name = t0; this.depth = t1; }, _ResourceQuery: function _ResourceQuery(t0, t1, t2, t3) { var _ = this; _.resources = t0; _.chances = t1; _.totalChance = t2; _.$ti = t3; }, MapExtensions_get_pairs(_this, $K, $V) { var t1 = A._instanceType(_this)._eval$1("LinkedHashMapEntriesIterable<1,2>"), t2 = $K._eval$1("@<0>")._bind$1($V)._eval$1("+(1,2)"); return A.MappedIterable_MappedIterable(new A.LinkedHashMapEntriesIterable(_this, t1), t1._bind$1(t2)._eval$1("1(Iterable.E)")._as(new A.MapExtensions_get_pairs_closure($K, $V)), t1._eval$1("Iterable.E"), t2); }, MapExtensions_get_pairs_closure: function MapExtensions_get_pairs_closure(t0, t1) { this.K = t0; this.V = t1; }, VecSet: function VecSet(t0, t1, t2) { var _ = this; _._vec_set$_values = t0; _._sentinel = 0; _._xMin = t1; _._xMax = 0; _._yMin = t2; _._yMax = 0; }, Behavior: function Behavior() { }, ActionBehavior: function ActionBehavior(t0) { this.action = t0; }, RestBehavior: function RestBehavior() { }, RunBehavior: function RunBehavior(t0) { var _ = this; _.firstStep = true; _.openRight = _.openLeft = null; _.direction = t0; }, RunBehavior_canPerform_closure: function RunBehavior_canPerform_closure(t0, t1, t2) { this.$this = t0; this.game = t1; this.hero = t2; }, RunBehavior__shouldKeepRunning_actorAt: function RunBehavior__shouldKeepRunning_actorAt(t0) { this.stage = t0; }, Hero: function Hero(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) { var _ = this; _.save = t0; _._seenMonsters = t1; _._behavior = null; _._heftDamageScale = t2; _._stomach = 200; _._fury = _._focus = 0; _._turnsSinceGaveDamage = 100; _._lastNoise = 0; _._allSkills = t3; _.energy = t4; _.haste = t5; _.cold = t6; _.poison = t7; _.blindness = t8; _.dazzle = t9; _.perception = t10; _._resistances = t11; _._pos = t12; _._health = 0; }, Hero_createRangedHit_closure: function Hero_createRangedHit_closure() { }, Hero_refreshProperties_closure: function Hero_refreshProperties_closure(t0, t1, t2) { this.$this = t0; this.weapons = t1; this.heftScale = t2; }, HeroClass: function HeroClass(t0, t1, t2, t3) { var _ = this; _.name = t0; _.description = t1; _._proficiency = t2; _.startingItems = t3; }, HeroSave$($name, race, heroClass, permadeath, _inventory, _equipment, _home, _crucible, shops, experience, skills, log, lore, gold, maxDepth, agility, intellect, strength, vitality) { var t1, t2, t3, t4, _null = null; A.Inventory$(B.ItemLocation_Inventory, 24, _null); A.List_List$filled(9, _null, false, type$.nullable_Item); A.Inventory$(B.ItemLocation_Home, 26, _null); A.Inventory$(B.ItemLocation_Crucible, 8, _null); t1 = new A.Strength(); t2 = new A.Agility(); t3 = new A.Vitality(); t4 = new A.Intellect(); t1._baseValue = strength; t2._baseValue = agility; t3._baseValue = vitality; t4._baseValue = intellect; return new A.HeroSave($name, race, heroClass, permadeath, _inventory, _equipment, _home, _crucible, shops, experience, skills, gold, maxDepth, log, lore, t1, t2, t3, t4); }, HeroSave: function HeroSave(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18) { var _ = this; _.name = t0; _.race = t1; _.heroClass = t2; _.permadeath = t3; _._inventory = t4; _._equipment = t5; _._home = t6; _._crucible = t7; _.shops = t8; _.experience = t9; _.skills = t10; _.gold = t11; _.maxDepth = t12; _.log = t13; _.lore = t14; _.strength = t15; _.agility = t16; _.vitality = t17; _.intellect = t18; }, Lore: function Lore(t0, t1, t2, t3, t4, t5) { var _ = this; _._seenBreeds = t0; _._slainBreeds = t1; _._foundItems = t2; _._foundAffixes = t3; _._createdArtifacts = t4; _._usedItems = t5; }, Lore_allSlain_closure: function Lore_allSlain_closure() { }, Lore_seeBreed_closure: function Lore_seeBreed_closure() { }, Lore_slay_closure: function Lore_slay_closure() { }, Lore_findItem_closure: function Lore_findItem_closure() { }, Lore_findItem_closure0: function Lore_findItem_closure0() { }, Lore_useItem_closure: function Lore_useItem_closure() { }, Race: function Race(t0, t1, t2) { this.name = t0; this.description = t1; this._statScales = t2; }, Skill: function Skill() { }, UsableSkill: function UsableSkill() { }, ActionSkill: function ActionSkill() { }, TargetSkill: function TargetSkill() { }, DirectionSkill: function DirectionSkill() { }, SkillSet: function SkillSet(t0, t1) { this._levels = t0; this._points = t1; }, SkillSet_acquired_closure: function SkillSet_acquired_closure(t0) { this.$this = t0; }, Strength_maxFuryAt(strength) { if (strength < 10) return 0; return B.JSInt_methods._tdivFast$1(strength - 8, 2); }, Strength_tossRangeScaleAt(strength) { if (strength <= 20) return A.lerpDouble(strength, 1, 20, 0.1, 1); if (strength <= 30) return A.lerpDouble(strength, 20, 30, 1, 1.5); if (strength <= 40) return A.lerpDouble(strength, 30, 40, 1.5, 1.8); if (strength <= 50) return A.lerpDouble(strength, 40, 50, 1.8, 2); return A.lerpDouble(strength, 50, 60, 2, 2.1); }, Agility_dodgeBonusAt(value) { if (value <= 10) return B.JSNumber_methods.round$0(A.lerpDouble(value, 1, 10, -50, 0)); if (value <= 30) return B.JSNumber_methods.round$0(A.lerpDouble(value, 10, 30, 0, 20)); return B.JSNumber_methods.round$0(A.lerpDouble(value, 30, 60, 20, 60)); }, Agility_strikeBonusAt(value) { if (value <= 10) return B.JSNumber_methods.round$0(A.lerpDouble(value, 1, 10, -30, 0)); if (value <= 30) return B.JSNumber_methods.round$0(A.lerpDouble(value, 10, 30, 0, 20)); return B.JSNumber_methods.round$0(A.lerpDouble(value, 30, 60, 20, 50)); }, Intellect_maxFocusAt(value) { if (value <= 10) return B.JSNumber_methods.round$0(A.lerpDouble(value, 1, 10, 40, 100)); return B.JSNumber_methods.round$0(A.lerpDouble(value, 10, 60, 100, 200)); }, Property: function Property(t0) { this._stat$_value = null; this.$ti = t0; }, Stat: function Stat(t0, t1, t2) { this.name = t0; this.index = t1; this._core$_name = t2; }, StatBase: function StatBase() { }, StatBase_refresh_closure: function StatBase_refresh_closure(t0, t1, t2) { this.$this = t0; this.newValue = t1; this.hero = t2; }, Strength: function Strength() { this._baseValue = 0; this._stat$_value = null; }, Agility: function Agility() { this._baseValue = 0; this._stat$_value = null; }, Vitality: function Vitality() { this._baseValue = 0; this._stat$_value = null; }, Intellect: function Intellect() { this._baseValue = 0; this._stat$_value = null; }, _noScale(parameter) { A._asInt(parameter); return 1; }, _noBonus(parameter) { A._asInt(parameter); return 0; }, Affix: function Affix(t0, t1) { this.type = t0; this.parameter = t1; }, AffixType: function AffixType(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) { var _ = this; _.id = t0; _._nameTemplate = t1; _.sortIndex = t2; _._affix$_rollParameter = t3; _._heftScale = t4; _._weightBonus = t5; _._strikeBonus = t6; _._damageScale = t7; _._damageBonus = t8; _._affix$_armorBonus = t9; _.brand = t10; _._resists = t11; _._affix$_statBonuses = t12; _._priceBonus = t13; _._priceScale = t14; }, Equipment: function Equipment(t0) { this.slots = t0; }, Equipment_weapons_closure: function Equipment_weapons_closure() { }, Equipment_length_closure: function Equipment_length_closure() { }, Equipment_canEquip_closure: function Equipment_canEquip_closure(t0) { this.item = t0; }, _Equipment_IterableBase_ItemCollection: function _Equipment_IterableBase_ItemCollection() { }, Inventory$($location, _capacity, items) { var t1 = A._setArrayType([], type$.JSArray_Item); if (items != null) B.JSArray_methods.addAll$1(t1, items); return new A.Inventory($location, t1, _capacity); }, ItemLocation: function ItemLocation(t0) { this.name = t0; }, ItemCollection: function ItemCollection() { }, Inventory: function Inventory(t0, t1, t2) { var _ = this; _.location = t0; _._items = t1; _._capacity = t2; _._lastUnequipped = null; }, Inventory_clone_closure: function Inventory_clone_closure() { }, AddItemResult: function AddItemResult(t0, t1) { this.added = t0; this.remaining = t1; }, _Inventory_IterableMixin_ItemCollection: function _Inventory_IterableMixin_ItemCollection() { }, Item: function Item(t0, t1, t2, t3, t4) { var _ = this; _.type = t0; _.prefix = t1; _.suffix = t2; _.intrinsicAffix = t3; _._count = t4; }, Item_strikeBonus_closure: function Item_strikeBonus_closure() { }, Item_damageScale_closure: function Item_damageScale_closure() { }, Item_damageBonus_closure: function Item_damageBonus_closure() { }, Item_armorModifier_closure: function Item_armorModifier_closure() { }, Item_quantifiableName_closure: function Item_quantifiableName_closure() { }, Item_weight_closure: function Item_weight_closure() { }, Item_heft_closure: function Item_heft_closure() { }, Item_resistance_closure: function Item_resistance_closure(t0) { this.element = t0; }, ItemUse: function ItemUse(t0, t1) { this.description = t0; this.createAction = t1; }, Toss: function Toss(t0, t1, t2) { this.breakage = t0; this.attack = t1; this.use = t2; }, ItemType: function ItemType(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22) { var _ = this; _.quantifiableName = t0; _.appearance = t1; _.depth = t2; _.sortIndex = t3; _.equipSlot = t4; _.isTwoHanded = t5; _.weaponType = t6; _.use = t7; _.attack = t8; _.toss = t9; _.defense = t10; _.armor = t11; _.price = t12; _.weight = t13; _.heft = t14; _.emanationLevel = t15; _.isTreasure = t16; _.maxStack = t17; _.destroyChance = t18; _.fuel = t19; _.skills = t20; _.intrinsicAffix = t21; _.isArtifact = t22; }, Recipe: function Recipe(t0, t1, t2) { this.ingredients = t0; this.result = t1; this.produces = t2; }, Shop: function Shop(t0, t1) { this._drop = t0; this.name = t1; }, BreedRef_resolve(resolver) { var t1, t2, _i, ref, t3; for (t1 = $.BreedRef__unresolved.length, t2 = type$.Breed, _i = 0; _i < $.BreedRef__unresolved.length; $.BreedRef__unresolved.length === t1 || (0, A.throwConcurrentModificationError)($.BreedRef__unresolved), ++_i) { ref = $.BreedRef__unresolved[_i]; t3 = t2._as(resolver.call$1(ref._breed$_name)); ref.__BreedRef__breed_F !== $ && A.throwLateFieldAI("_breed"); ref.__BreedRef__breed_F = t3; } B.JSArray_methods.clear$0($.BreedRef__unresolved); }, BreedRef$(_name) { var t1 = new A.BreedRef(_name); B.JSArray_methods.add$1($.BreedRef__unresolved, t1); return t1; }, BreedRef: function BreedRef(t0) { this._breed$_name = t0; this.__BreedRef__breed_F = $; }, Breed: function Breed(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23) { var _ = this; _.pronoun = t0; _.hasProperName = t1; _.appearance = t2; _.depth = t3; _.attacks = t4; _.moves = t5; _.maxHealth = t6; _.tracking = t7; _.vision = t8; _.hearing = t9; _.meander = t10; _.speed = t11; _.drop = t12; _.motility = t13; _.flags = t14; _.dodge = t15; _.emanationLevel = t16; _.defenses = t17; _.countMin = t18; _.countMax = t19; _.minions = t20; _._breed$_name = t21; _.groups = t22; _.description = t23; }, SpawnLocation: function SpawnLocation(t0, t1) { this.index = t0; this._core$_name = t1; }, BreedFlags: function BreedFlags(t0, t1, t2, t3, t4, t5) { var _ = this; _.berzerk = t0; _.cowardly = t1; _.fearless = t2; _.immobile = t3; _.protective = t4; _.unique = t5; }, ChangeMonsterStateAction$(_message, _state, $event) { return new A.ChangeMonsterStateAction(_message, _state, $event); }, Monster: function Monster(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13) { var _ = this; _._breed = t0; _.generation = t1; _._monster$_state = t2; _._recharges = t3; _.wantsToMelee = true; _._fear = _._alertness = 0; _._frightenThreshold = t4; _.energy = t5; _.haste = t6; _.cold = t7; _.poison = t8; _.blindness = t9; _.dazzle = t10; _.perception = t11; _._resistances = t12; _._pos = t13; _._health = 0; }, Monster_onGiveDamage_closure: function Monster_onGiveDamage_closure(t0, t1) { this.action = t0; this.damage = t1; }, Monster_onTakeDamage_closure: function Monster_onTakeDamage_closure(t0, t1, t2) { this.$this = t0; this.action = t1; this.damage = t2; }, Monster_onTakeDamage_closure0: function Monster_onTakeDamage_closure0(t0, t1) { this.$this = t0; this.damage = t1; }, ChangeMonsterStateAction: function ChangeMonsterStateAction(t0, t1, t2) { var _ = this; _._monster$_message = t0; _._monster$_state = t1; _._event = t2; _._actor = null; _.__Action__consumesEnergy_F = _.__Action__game_F = _.__Action__pos_F = $; }, MonsterPathfinder: function MonsterPathfinder(t0, t1, t2, t3) { var _ = this; _._monster = t0; _._nearest = null; _.stage = t1; _.start = t2; _.end = t3; }, MonsterState: function MonsterState() { }, MonsterState__meander_closure: function MonsterState__meander_closure(t0, t1) { this.$this = t0; this.game = t1; }, AsleepState: function AsleepState() { this.__MonsterState__monster_F = $; }, AwakeState: function AwakeState() { this.__MonsterState__monster_F = $; }, AwakeState_getAction_closure: function AwakeState_getAction_closure(t0, t1) { this.$this = t0; this.game = t1; }, AwakeState__escapeSubstance_closure: function AwakeState__escapeSubstance_closure(t0) { this.game = t0; }, AwakeState__findRangedPath_isValidRangedPosition: function AwakeState__findRangedPath_isValidRangedPosition(t0, t1, t2) { this._box_0 = t0; this.$this = t1; this.game = t2; }, AfraidState: function AfraidState() { this.__MonsterState__monster_F = $; }, AfraidState_getAction_closure: function AfraidState_getAction_closure(t0) { this.game = t0; }, AfraidState_getAction_closure0: function AfraidState_getAction_closure0(t0, t1, t2) { this.$this = t0; this.game = t1; this.heroDistance = t2; }, Move: function Move() { }, RangedMove: function RangedMove() { }, BucketQueue: function BucketQueue(t0, t1) { this._buckets = t0; this._bucket = 0; this.$ti = t1; }, MotilityFlow$(stage, start, _motility, avoidActors, avoidSubstances, maxDistance) { var t1 = new A.MotilityFlow(_motility, avoidActors !== false, avoidSubstances === true, maxDistance, stage, start, new A.BucketQueue(A._setArrayType([], type$.JSArray_nullable_Queue_Vec), type$.BucketQueue_Vec), A._setArrayType([], type$.JSArray_Vec)); t1.Flow$3$maxDistance(stage, start, maxDistance); return t1; }, Flow: function Flow() { }, Flow__directionsTo_walkBack: function Flow__directionsTo_walkBack(t0, t1, t2) { this.$this = t0; this.walked = t1; this.directions = t2; }, Flow__processNext_processNeighbor: function Flow__processNext_processNeighbor(t0, t1, t2) { this.$this = t0; this.start = t1; this.parentCost = t2; }, MotilityFlow: function MotilityFlow(t0, t1, t2, t3, t4, t5, t6, t7) { var _ = this; _._flow0$_motility = t0; _._avoidActors = t1; _._avoidSubstances = t2; _._flow0$_maxDistance = t3; _.stage = t4; _._start = t5; _.__Flow__offset_F = _.__Flow__costs_F = $; _._open = t6; _._found = t7; }, Fov: function Fov(t0, t1) { this._fov$_stage = t0; this._shadows = t1; }, _Shadow: function _Shadow(t0, t1) { this.start = t0; this.end = t1; }, Lighting_emanationForLevel(level) { var t1; $label0$0: { if (1 === level) { t1 = 40; break $label0$0; } if (2 === level) { t1 = 56; break $label0$0; } if (3 === level) { t1 = 72; break $label0$0; } if (4 === level) { t1 = 96; break $label0$0; } if (5 === level) { t1 = 120; break $label0$0; } if (6 === level) { t1 = 160; break $label0$0; } if (7 === level) { t1 = 200; break $label0$0; } if (8 === level) { t1 = 240; break $label0$0; } if (level <= 0) { t1 = 0; break $label0$0; } t1 = 255; break $label0$0; } return t1; }, Lighting: function Lighting(t0, t1, t2, t3, t4) { var _ = this; _._stage = t0; _._floorLight = t1; _._actorLight = t2; _._fov = t3; _._queue = t4; _._visibilityDirty = _._actorLightDirty = _._floorLightDirty = true; }, Lighting__lightWalls_checkNeighbor: function Lighting__lightWalls_checkNeighbor(t0, t1, t2, t3) { var _ = this; _._box_0 = t0; _.$this = t1; _.x = t2; _.y = t3; }, Lighting__process_checkNeighbor: function Lighting__process_checkNeighbor(t0, t1, t2, t3, t4) { var _ = this; _.$this = t0; _.pos = t1; _.parentLight = t2; _.tiles = t3; _.attenuate = t4; }, Path: function Path(t0, t1, t2, t3) { var _ = this; _.startDirection = t0; _.pos = t1; _.length = t2; _.cost = t3; }, Pathfinder: function Pathfinder() { }, _tileCost(tile) { var t1 = tile.type.motility; if (t1.$eq(0, $.$get$Motility_door())) return 8; if ((t1._bitMask & $.$get$Motility_fly()._bitMask) === 0) return 10; return 1; }, Sound: function Sound(t0) { this._sound$_stage = t0; this._flow = null; }, _SoundFlow: function _SoundFlow(t0, t1, t2, t3) { var _ = this; _.stage = t0; _._start = t1; _.__Flow__offset_F = _.__Flow__costs_F = $; _._open = t2; _._found = t3; }, _SoundPathfinder: function _SoundPathfinder(t0, t1, t2) { this.stage = t0; this.start = t1; this.end = t2; }, Stage$(width, height, game) { var t5, t1 = A._setArrayType([], type$.JSArray_Actor), t2 = new A.Stage_closure(), t3 = type$.Tile, t4 = width * height; if (t4 > 0) t5 = A.List_List$filled(t4, t2.call$1(B.Vec_0_0), false, t3); else t5 = J.JSArray_JSArray$fixed(0, t3); t5 = new A.Array2D(t5, new A.Rect(new A.Vec(0, 0), new A.Vec(width, height)), type$.Array2D_Tile); t5.Array2D$generated$3(width, height, t2, t3); return new A.Stage(game, t1, t5, A.LinkedHashMap_LinkedHashMap$_empty(type$.Vec, type$.Inventory), new A.Array2D(A.List_List$filled(t4, null, false, type$.nullable_Actor), new A.Rect(new A.Vec(0, 0), new A.Vec(width, height)), type$.Array2D_nullable_Actor)); }, Stage: function Stage(t0, t1, t2, t3, t4) { var _ = this; _.game = t0; _._actors = t1; _.__Stage__sound_FI = _.__Stage__lighting_FI = $; _._currentActorIndex = 0; _.tiles = t2; _._itemsByTile = t3; _._actorsByTile = t4; }, Stage_closure: function Stage_closure() { }, Stage_placeDrops_closure: function Stage_placeDrops_closure(t0, t1, t2, t3) { var _ = this; _.$this = t0; _.items = t1; _.flow = t2; _.pos = t3; }, Stage_placeDrops__closure: function Stage_placeDrops__closure(t0) { this.$this = t0; }, Stage_addItem_closure: function Stage_addItem_closure() { }, Stage_forEachItem_closure: function Stage_forEachItem_closure(t0) { this.callback = t0; }, Motility$_(_bitMask) { return new A.Motility(_bitMask); }, TileType$($name, appearance, motility, emanation, onOperate, portal) { return new A.TileType($name, portal, emanation == null ? 0 : emanation, appearance, motility, onOperate); }, Motility: function Motility(t0) { this._bitMask = t0; }, TilePortal: function TilePortal(t0) { this.name = t0; }, TileType: function TileType(t0, t1, t2, t3, t4, t5) { var _ = this; _.name = t0; _.portal = t1; _.emanation = t2; _.appearance = t3; _.motility = t4; _.onOperate = t5; }, Tile: function Tile(t0, t1) { var _ = this; _.type = t0; _._isOccluded = false; _._appliedEmanation = _.actorIllumination = _.floorIllumination = _._fallOff = 0; _._isExplored = false; _.element = t1; _.substance = 0; }, ConfirmPopup: function ConfirmPopup(t0, t1) { this._confirm_popup$_message = t0; this._result = t1; this._ui = null; }, DirectionDialog: function DirectionDialog() { }, DirectionDialog_render_draw: function DirectionDialog_render_draw(t0, t1) { this.$this = t0; this.terminal = t1; }, SkillDirectionDialog: function SkillDirectionDialog(t0, t1) { var _ = this; _._onSelect = t0; _._gameScreen = t1; _._animateOffset = 0; _._ui = null; }, OperateDialog: function OperateDialog(t0) { this._gameScreen = t0; this._animateOffset = 0; this._ui = null; }, Draw_dialog(terminal, width, height, drawContents, helpKeys, label) { var dialogTerminal, _null = null, t1 = terminal._display._glyphs.bounds.size, t2 = t1.x; t1 = t1.y; terminal.fill$5(0, 0, t2, t1, B.Color_20_19_31); dialogTerminal = new A.PortTerminal(new A.Vec(width, height), B.JSInt_methods._tdivFast$1(t2 - width, 2), B.JSInt_methods._tdivFast$1(t1 - 2 - height, 2), terminal); A.Draw_frame(dialogTerminal, _null, _null, label, false, _null, _null, _null); drawContents.call$1(dialogTerminal.rect$4(1, 1, width - 2, height - 2)); A.Draw_helpKeys(terminal, helpKeys, _null); }, Draw_frame(terminal, color, height, label, labelSelected, width, x, y) { var t1, t2, t3; A.Draw__box(terminal, x, y, width, height, color, "\u2552", "\u2550", "\u2555", "\u2502", "\u2514", "\u2500", "\u2518"); if (label != null) { t1 = x == null ? 0 : x; t2 = y == null ? 0 : y; t3 = labelSelected ? B.Color_222_156_33 : B.Color_132_126_135; terminal.writeAt$4(t1 + 2, t2, " " + label + " ", t3); } }, Draw_text(terminal, text, width, x, y) { var t1, t2, _i; for (t1 = A.Log_wordWrap(width - x, text), t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { ++y; terminal.writeAt$4(x, y, t1[_i], B.Color_132_126_135); } }, Draw_hLine(terminal, x, y, width) { var t1 = B.JSString_methods.$mul("\u2500", width); terminal.writeAt$4(x, y, t1, B.Color_38_42_66); }, Draw_glyphFrame(terminal, x, y, width, height, glyph, label) { var t2, t1 = y + 1; A.Draw_frame(terminal, null, height - 1, null, false, width, x, t1); t2 = x + 1; terminal.writeAt$4(t2, y, "\u250c\u2500\u2510", B.Color_38_42_66); terminal.writeAt$4(t2, t1, "\u2561 \u255e", B.Color_38_42_66); terminal.writeAt$4(t2, y + 2, "\u2514\u2500\u2518", B.Color_38_42_66); terminal.drawGlyph$3(x + 2, t1, glyph); terminal.writeAt$4(x + 4, t1, label, B.Color_226_223_240); }, Draw_helpKeys(terminal, helpKeys, query) { var boxWidth, t2, t3, t4, x, t5, t6, t1 = {}; t1.helpTextLength = 0; helpKeys.forEach$1(0, new A.Draw_helpKeys_closure(t1)); boxWidth = t1.helpTextLength; t2 = query != null; if (t2) boxWidth = Math.max(boxWidth, query.length); t3 = terminal._display._glyphs.bounds.size; t4 = t3.x; x = B.JSInt_methods._tdivFast$1(t4 - boxWidth, 2); t1.x = x; t3 = t3.y; t5 = boxWidth + 4; t6 = x - 2; if (t2) { A.Draw__box(terminal, t6, t3 - 4, t5, 5, B.Color_132_126_135, "\u250c", "\u2500", "\u2510", "\u2502", "\u2514", "\u2500", "\u2518"); terminal.writeAt$4(B.JSInt_methods._tdivFast$1(t4 - query.length, 2), t3 - 3, query, B.Color_226_223_240); } else A.Draw__box(terminal, t6, t3 - 2, t5, 3, B.Color_132_126_135, "\u250c", "\u2500", "\u2510", "\u2502", "\u2514", "\u2500", "\u2518"); t1.first = true; t1.x = t1.x + B.JSInt_methods._tdivFast$1(boxWidth - t1.helpTextLength, 2); helpKeys.forEach$1(0, new A.Draw_helpKeys_closure0(t1, terminal)); }, Draw__box(terminal, x, y, width, height, color, topLeft, $top, topRight, vertical, bottomLeft, bottom, bottomRight) { var t1, bar, row, t2, t3; if (x == null) x = 0; if (y == null) y = 0; if (width == null) width = terminal.get$width(); if (height == null) height = terminal.get$height(); if (color == null) color = B.Color_38_42_66; t1 = width - 2; bar = vertical + B.JSString_methods.$mul(" ", t1) + vertical; for (row = y + 1, t2 = y + height - 1; row < t2; ++row) terminal.writeAt$4(x, row, bar, color); t3 = B.JSString_methods.$mul($top, t1); t1 = B.JSString_methods.$mul(bottom, t1); terminal.writeAt$4(x, y, topLeft + t3 + topRight, color); terminal.writeAt$4(x, t2, bottomLeft + t1 + bottomRight, color); }, Draw_meter(terminal, x, y, width, value, max, fore, $back) { var i, char, t1 = width * 2, barWidth = B.JSNumber_methods.round$0(t1 * value / max); if (barWidth === 0 && value > 0) barWidth = 1; if (barWidth === t1 && value < max) barWidth = t1 - 1; for (t1 = barWidth + 1, i = 0; i < width; ++i) { if (i < B.JSInt_methods._tdivFast$1(barWidth, 2)) char = 9608; else char = i < B.JSInt_methods._tdivFast$1(t1, 2) ? 9612 : 32; terminal.drawGlyph$3(x + i, y, new A.Glyph(char, fore, $back)); } }, Draw_thinMeter(terminal, x, y, width, value, max, fore, $back) { var barWidth, i, color; if (fore == null) fore = B.Color_204_35_57; if ($back == null) $back = B.Color_84_0_39; barWidth = B.JSNumber_methods.round$0(width * value / max); if (barWidth === 0 && value > 0) barWidth = 1; if (barWidth === width && value < max) barWidth = width - 1; for (i = 0; i < width; ++i) { color = i < barWidth ? fore : $back; terminal.drawGlyph$3(x + i, y, new A.Glyph(9604, color, B.Color_0_0_0)); } }, Draw_helpKeys_closure: function Draw_helpKeys_closure(t0) { this._box_0 = t0; }, Draw_helpKeys_closure0: function Draw_helpKeys_closure0(t0, t1) { this._box_0 = t0; this.terminal = t1; }, addEffects(effects, $event) { var t1, t2, i, t3, t4, theta, radius, t5, t6, numParticles, x, y, color; switch ($event.type) { case B.EventType_pause: break; case B.EventType_bolt: t1 = $event.element; t2 = $event.pos; if (t1 === $.$get$Element_none()) { t1 = B.Map_NgGHE.$index(0, $event.dir); t1.toString; t2.toString; B.JSArray_methods.add$1(effects, new A.FrameEffect(t2, t1, B.Color_189_144_108, 2)); } else { t2.toString; t1 = $.$get$_elementSequences().$index(0, t1); t1.toString; B.JSArray_methods.add$1(effects, new A.ElementEffect(t2, t1)); } break; case B.EventType_cone: t1 = $event.pos; t1.toString; t2 = $.$get$_elementSequences().$index(0, $event.element); t2.toString; B.JSArray_methods.add$1(effects, new A.ElementEffect(t1, t2)); break; case B.EventType_toss: t1 = $event.pos; t1.toString; B.JSArray_methods.add$1(effects, new A.ItemEffect(t1, type$.Item._as($event.other))); break; case B.EventType_hit: t1 = $event.actor; t1.toString; B.JSArray_methods.add$1(effects, new A.DamageEffect(t1, $event.element, B.JSNumber_methods.ceil$0(Math.sqrt(A._asInt($event.other) / 5)))); break; case B.EventType_die: for (t1 = $event.actor, i = 0; i < 10; ++i) { t2 = t1._pos.get$x(); t3 = t1._pos.get$y(); t4 = $.$get$rng(); t4 = t4._random; theta = t4.nextInt$1(628) / 100; radius = (t4.nextInt$1(10) + 30) / 100; t5 = Math.cos(theta); t6 = Math.sin(theta); B.JSArray_methods.add$1(effects, new A.ParticleEffect(t2, t3, t5 * radius, t6 * radius, t4.nextInt$1(8) + 7, B.Color_204_35_57)); } break; case B.EventType_heal: t1 = $event.actor; B.JSArray_methods.add$1(effects, new A.HealEffect(t1._pos.get$x(), t1._pos.get$y())); break; case B.EventType_detect: t1 = $event.pos; t1.toString; B.JSArray_methods.add$1(effects, new A.DetectEffect(t1)); break; case B.EventType_perceive: B.JSArray_methods.add$1(effects, new A.DetectEffect($event.actor._pos)); break; case B.EventType_map: t1 = $event.pos; t1.toString; t2 = $.$get$rng().range$2(10, 20); t1 = new A.MapEffect(t2, t1); t1.life = t2; B.JSArray_methods.add$1(effects, t1); break; case B.EventType_teleport: t1 = $event.actor; t2 = t1._pos; t3 = $event.pos; t3.toString; numParticles = t2.$sub(0, t3).get$kingLength() * 2; for (i = 0; i < numParticles; ++i) { t2 = t1._pos; x = t3.get$x(); y = t3.get$y(); t4 = $.$get$rng(); t4 = t4._random; theta = t4.nextInt$1(628) / 100; radius = (t4.nextInt$1(70) + 10) / 100; B.JSArray_methods.add$1(effects, new A.TeleportEffect(x, y, Math.cos(theta) * radius, Math.sin(theta) * radius, t2)); } break; case B.EventType_spawn: B.JSArray_methods.add$1(effects, new A.FrameEffect($event.actor._pos, "*", B.Color_226_223_240, 4)); break; case B.EventType_polymorph: B.JSArray_methods.add$1(effects, new A.FrameEffect($event.actor._pos, "*", B.Color_226_223_240, 4)); break; case B.EventType_howl: t1 = $event.actor; t1.toString; B.JSArray_methods.add$1(effects, new A.HowlEffect(t1)); break; case B.EventType_awaken: t1 = $event.actor; t1.toString; B.JSArray_methods.add$1(effects, new A.BlinkEffect(t1, A.Glyph$("!", B.Color_226_223_240, null), 1)); break; case B.EventType_frighten: t1 = $event.actor; t1.toString; B.JSArray_methods.add$1(effects, new A.BlinkEffect(t1, A.Glyph$("!", B.Color_222_156_33, null), 3)); break; case B.EventType_wind: break; case B.EventType_knockBack: t1 = $event.pos; t1.toString; B.JSArray_methods.add$1(effects, new A.FrameEffect(t1, "*", B.Color_255_238_168, 4)); break; case B.EventType_slash: case B.EventType_stab: t1 = $.$get$_directionLines().$index(0, $event.dir); t1.toString; t2 = $event.other; color = t2 != null ? type$.Glyph._as(t2).fore : B.Color_226_223_240; t2 = $event.pos; t2.toString; B.JSArray_methods.add$1(effects, new A.FrameEffect(t2, t1, color, 4)); break; case B.EventType_gold: t1 = $event.pos; t1.toString; t2 = type$.Item._as($event.other); B.JSArray_methods.add$1(effects, new A.TreasureEffect(t1.get$x(), t1.get$y(), t2)); break; case B.EventType_openBarrel: t1 = $event.pos; t1.toString; B.JSArray_methods.add$1(effects, new A.FrameEffect(t1, "*", B.Color_189_144_108, 4)); break; } }, _glyphs(chars, colors) { var t1, t2, t3, t4, _i, color, results = A._setArrayType([], type$.JSArray_Glyph); for (t1 = new A.CodeUnits(chars), t2 = type$.CodeUnits, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { t3 = t1._current; if (t3 == null) t3 = t2._as(t3); for (t4 = colors.length, _i = 0; _i < colors.length; colors.length === t4 || (0, A.throwConcurrentModificationError)(colors), ++_i) { color = colors[_i]; B.JSArray_methods.add$1(results, new A.Glyph(t3, color, B.Color_0_0_0)); } } return results; }, ElementEffect: function ElementEffect(t0, t1) { this._effect$_pos = t0; this._sequence = t1; this._age = 0; }, FrameEffect: function FrameEffect(t0, t1, t2, t3) { var _ = this; _.pos = t0; _.char = t1; _.color = t2; _.life = t3; }, ItemEffect: function ItemEffect(t0, t1) { this.pos = t0; this.item = t1; this._life = 2; }, DamageEffect: function DamageEffect(t0, t1, t2) { var _ = this; _.actor = t0; _.element = t1; _._blinks = t2; _._effect$_frame = 0; }, ParticleEffect: function ParticleEffect(t0, t1, t2, t3, t4, t5) { var _ = this; _.x = t0; _.y = t1; _.h = t2; _.v = t3; _.life = t4; _.color = t5; }, TeleportEffect: function TeleportEffect(t0, t1, t2, t3, t4) { var _ = this; _.x = t0; _.y = t1; _.h = t2; _.v = t3; _.age = 0; _.target = t4; }, HealEffect: function HealEffect(t0, t1) { this.x = t0; this.y = t1; this.frame = 0; }, DetectEffect: function DetectEffect(t0) { this.pos = t0; this.life = 20; }, MapEffect: function MapEffect(t0, t1) { this._maxLife = t0; this.pos = t1; this.life = -1; }, TreasureEffect: function TreasureEffect(t0, t1, t2) { var _ = this; _._effect$_x = t0; _._effect$_y = t1; _._effect$_item = t2; _._life = 8; }, HowlEffect: function HowlEffect(t0) { this._effect$_actor = t0; this._age = 0; }, BlinkEffect: function BlinkEffect(t0, t1, t2) { var _ = this; _._effect$_actor = t0; _._glyph = t1; _._blinks = t2; _._age = 0; }, ExitPopup$(_previous, _game) { var t1 = new A.ExitPopup(_previous, _game, A._setArrayType([], type$.JSArray__AnimatedValue)); t1.ExitPopup$2(_previous, _game, {}); return t1; }, ExitPopup: function ExitPopup(t0, t1, t2) { var _ = this; _._exit_popup$_previous = t0; _._exit_popup$_game = t1; _._exit_popup$_values = t2; _._ui = null; }, ExitPopup_add: function ExitPopup_add(t0, t1) { this._box_0 = t0; this.$this = t1; }, ExitPopup_closure: function ExitPopup_closure() { }, _AnimatedValue: function _AnimatedValue(t0, t1, t2, t3, t4) { var _ = this; _.y = t0; _.name = t1; _.value = t2; _.color = t3; _.total = t4; _.current = 0; }, ExperienceDialog: function ExperienceDialog(t0) { this._save = t0; this._selectedStatIndex = 0; this._ui = null; }, ExperienceDialog__drawStrengthPanel_closure: function ExperienceDialog__drawStrengthPanel_closure() { }, ExperienceDialog__drawAgilityPanel_closure: function ExperienceDialog__drawAgilityPanel_closure() { }, ExperienceDialog__drawVitalityPanel_closure: function ExperienceDialog__drawVitalityPanel_closure() { }, ExperienceDialog__drawIntellectPanel_closure: function ExperienceDialog__drawIntellectPanel_closure() { }, ForfeitPopup: function ForfeitPopup(t0) { this._isTown = t0; this._ui = null; }, GameOverScreen: function GameOverScreen(t0) { this._hero = t0; this._ui = null; }, GameOverScreen_render_closure: function GameOverScreen_render_closure(t0) { this.$this = t0; }, GameScreen$(_storage, game) { var t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t1 = game.hero.save, t2 = t1._inventory.clone$0(), t3 = t1._equipment.clone$0(), t4 = t1.experience, t5 = t1.skills, t6 = type$.Skill, t7 = type$.int, t8 = A.LinkedHashMap_LinkedHashMap$from(t5._levels, t6, t7); t6 = A.LinkedHashMap_LinkedHashMap$from(t5._points, t6, t7); t5 = t1.log; t9 = t1.lore; t10 = type$.Breed; t11 = A.LinkedHashMap_LinkedHashMap$of(t9._seenBreeds, t10, t7); t10 = A.LinkedHashMap_LinkedHashMap$of(t9._slainBreeds, t10, t7); t12 = type$.ItemType; t13 = A.LinkedHashMap_LinkedHashMap$of(t9._foundItems, t12, t7); t14 = A.LinkedHashMap_LinkedHashMap$of(t9._foundAffixes, type$.AffixType, t7); t15 = A.LinkedHashSet_LinkedHashSet$of(t9._createdArtifacts, t12); t7 = A.LinkedHashMap_LinkedHashMap$of(t9._usedItems, t12, t7); t12 = t1.gold; t9 = t1.maxDepth; t16 = t1.strength._baseValue; t17 = t1.agility._baseValue; t18 = t1.vitality._baseValue; t5 = new A.GameScreen(game, A.HeroSave$(t1.name, t1.race, t1.heroClass, t1.permadeath, t2, t3, t1._home, t1._crucible, t1.shops, t4, new A.SkillSet(t8, t6), t5, new A.Lore(t11, t10, t13, t14, t15, t7), t12, t9, t17, t1.intellect._baseValue, t16, t18), _storage, new A.LogPanel(t5), new A.ItemPanel(game)); t5.__GameScreen__sidebarPanel_F = new A.SidebarPanel(t5); t18 = A._setArrayType([], type$.JSArray_Effect); t16 = A._setArrayType([], type$.JSArray_Monster); t5.__GameScreen__stagePanel_F !== $ && A.throwLateFieldAI("_stagePanel"); t5.__GameScreen__stagePanel_F = new A.StagePanel(t5, t18, t16, B.Rect_yK0, B.Vec_0_0); $.Debug__gameScreen = t5; $.Debug__monsters.clear$0(0); return t5; }, GameScreen_GameScreen$town(storage, $content, save, newHero) { var t1, t2, t3, t4, t5, _i, item, game = A.Game$($content, 0, save, 34, 60); if (newHero) for (t1 = $content.startingItems$1(save), t2 = t1.length, t3 = game.hero, t4 = t3.save, t5 = t4._inventory, t4 = t4.lore, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { item = t1[_i]; t5.tryAdd$1(item); t4.findItem$1(item); t3._gainItemSkills$2(game, item); t3.refreshProperties$0(); } for (t1 = game.generate$0(), t2 = t1.$ti, t1 = new A._SyncStarIterator(t1._outerHelper(), t2._eval$1("_SyncStarIterator<1>")), t2 = t2._precomputed1; t1.moveNext$0();) { t3 = t1._async$_current; if (t3 == null) t2._as(t3); } return A.GameScreen$(storage, game); }, GameScreen: function GameScreen(t0, t1, t2, t3, t4) { var _ = this; _.game = t0; _._previousSave = t1; _._game_screen$_storage = t2; _._logPanel = t3; _.itemPanel = t4; _.__GameScreen__stagePanel_F = _.__GameScreen__sidebarPanel_F = $; _._pause = 0; _._ui = _._game_screen$_portal = _._lastSkill = _._game_screen$_target = _._targetActor = null; }, GameScreen_activate_closure: function GameScreen_activate_closure() { }, GameScreen_activate_closure0: function GameScreen_activate_closure0(t0, t1) { this.$this = t0; this.result = t1; }, GameScreen__openTargetDialog_closure: function GameScreen__openTargetDialog_closure(t0, t1) { this.$this = t0; this.skill = t1; }, HeroEquipmentDialog: function HeroEquipmentDialog(t0, t1) { this.content = t0; this.hero = t1; this._ui = null; }, HeroEquipmentDialog_render_writeLine: function HeroEquipmentDialog_render_writeLine(t0) { this.terminal = t0; }, HeroEquipmentDialog_render_writeScale: function HeroEquipmentDialog_render_writeScale(t0) { this.terminal = t0; }, HeroEquipmentDialog_render_writeBonus: function HeroEquipmentDialog_render_writeBonus(t0) { this.terminal = t0; }, HeroEquipmentDialog_render_closure: function HeroEquipmentDialog_render_closure(t0, t1, t2, t3) { var _ = this; _.writeLine = t0; _.terminal = t1; _.writeScale = t2; _.writeBonus = t3; }, HeroInfoDialog: function HeroInfoDialog() { }, HeroItemLoreDialog: function HeroItemLoreDialog(t0, t1, t2, t3) { var _ = this; _._hero_item_lore_dialog$_items = t0; _._sort = t1; _._hero_item_lore_dialog$_scroll = _._selection = 0; _.content = t2; _.hero = t3; _._ui = null; }, HeroItemLoreDialog_render_writeLine: function HeroItemLoreDialog_render_writeLine(t0) { this.terminal = t0; }, HeroItemLoreDialog__listItems_compareSort: function HeroItemLoreDialog__listItems_compareSort() { }, HeroItemLoreDialog__listItems_compareDepth: function HeroItemLoreDialog__listItems_compareDepth() { }, HeroItemLoreDialog__listItems_comparePrice: function HeroItemLoreDialog__listItems_comparePrice() { }, HeroItemLoreDialog__listItems_closure: function HeroItemLoreDialog__listItems_closure(t0) { this._box_0 = t0; }, _Sort: function _Sort(t0, t1) { this.description = t0; this.helpText = t1; }, HeroMonsterLoreDialog: function HeroMonsterLoreDialog(t0, t1, t2, t3) { var _ = this; _._breeds = t0; _._hero_monster_lore_dialog$_sort = t1; _._hero_monster_lore_dialog$_scroll = _._hero_monster_lore_dialog$_selection = 0; _.content = t2; _.hero = t3; _._ui = null; }, HeroMonsterLoreDialog_render_writeLine: function HeroMonsterLoreDialog_render_writeLine(t0) { this.terminal = t0; }, HeroMonsterLoreDialog__describeBreed_closure: function HeroMonsterLoreDialog__describeBreed_closure() { }, HeroMonsterLoreDialog__describeBreed_closure0: function HeroMonsterLoreDialog__describeBreed_closure0() { }, HeroMonsterLoreDialog__listBreeds_closure: function HeroMonsterLoreDialog__listBreeds_closure() { }, HeroMonsterLoreDialog__listBreeds_compareGlyph: function HeroMonsterLoreDialog__listBreeds_compareGlyph() { }, HeroMonsterLoreDialog__listBreeds_compareGlyph_isUpper: function HeroMonsterLoreDialog__listBreeds_compareGlyph_isUpper() { }, HeroMonsterLoreDialog__listBreeds_compareDepth: function HeroMonsterLoreDialog__listBreeds_compareDepth() { }, HeroMonsterLoreDialog__listBreeds_closure0: function HeroMonsterLoreDialog__listBreeds_closure0(t0) { this._box_0 = t0; }, _Sort0: function _Sort0(t0, t1) { this.description = t0; this.helpText = t1; }, HeroResistancesDialog: function HeroResistancesDialog(t0, t1) { this.content = t0; this.hero = t1; this._ui = null; }, HeroResistancesDialog_render_writeLine: function HeroResistancesDialog_render_writeLine(t0) { this.terminal = t0; }, HeroResistancesDialog_render_closure: function HeroResistancesDialog_render_closure(t0, t1, t2) { this.$this = t0; this.writeLine = t1; this.terminal = t2; }, Input: function Input(t0) { this.name = t0; }, DropDialog: function DropDialog(t0, t1) { var _ = this; _.gameScreen = t0; _._item_dialog$_location = t1; _._selectedItem = null; _._item_dialog$_count = -1; _._item_dialog$_shiftDown = false; _._ui = _._item_dialog$_inspected = null; }, EquipDialog: function EquipDialog(t0, t1) { var _ = this; _.gameScreen = t0; _._item_dialog$_location = t1; _._selectedItem = null; _._item_dialog$_count = -1; _._item_dialog$_shiftDown = false; _._ui = _._item_dialog$_inspected = null; }, ItemDialog: function ItemDialog() { }, ItemInspector$(hero, _item, wide) { var t3, t1 = new A.ItemInspector(_item, A.ItemInspector__description(_item, wide ? 78 : 34)), t2 = _item.type; if (t2.attack != null) t1._attackSection = new A._AttackSection(hero, _item); if (t2.armor + _item.get$armorModifier() !== 0 || t2.defense != null) t1._defenseSection = new A._DefenseSection(_item); if (t2.equipSlot != null) t1._resistancesSection = new A._ResistancesSection(_item); t2 = t2.use; if (t2 != null) { t3 = wide ? 78 : 34; t1._useSection = new A._TextSection(A.Log_wordWrap(t3, t2.description), "Use"); } return t1; }, ItemInspector__description(item, width) { var _i, stat, t1, t2, bonus, _i0, toss, t3, element, sentences = A._setArrayType([], type$.JSArray_String); for (_i = 0; _i < 4; ++_i) { stat = B.List_f5z[_i]; for (t1 = item.get$affixes(), t2 = t1.length, bonus = 0, _i0 = 0; _i0 < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i0) bonus += t1[_i0].statBonus$1(stat); if (bonus < 0) B.JSArray_methods.add$1(sentences, "It lowers your " + stat.name + " by " + -bonus + "."); else if (bonus > 0) B.JSArray_methods.add$1(sentences, "It raises your " + stat.name + " by " + bonus + "."); } t1 = item.type; toss = t1.toss; if (toss != null) { t2 = toss.attack; t3 = t2.element; element = t3 !== $.$get$Element_none() ? " " + t3.name : ""; B.JSArray_methods.add$1(sentences, "It can be thrown for " + t2.damage + element + " damage up to range " + t2.range + "."); t2 = toss.breakage; if (t2 !== 0) B.JSArray_methods.add$1(sentences, "It has a " + t2 + "% chance of breaking when thrown."); } t2 = t1.emanationLevel; if (t2 > 0) B.JSArray_methods.add$1(sentences, "It emanates " + t2 + " light."); for (t1 = t1.destroyChance, t1 = new A.LinkedHashMapKeyIterator(t1, t1._modifications, t1._first, A._instanceType(t1)._eval$1("LinkedHashMapKeyIterator<1>")); t1.moveNext$0();) B.JSArray_methods.add$1(sentences, "It can be destroyed by " + t1.__js_helper$_current.name.toLowerCase() + "."); return new A._TextSection(A.Log_wordWrap(width - 2, B.JSArray_methods.join$1(sentences, " ")), "Description"); }, ItemInspector: function ItemInspector(t0, t1) { var _ = this; _._item = t0; _._useSection = _._resistancesSection = _._defenseSection = _._attackSection = null; _.__ItemInspector__descriptionSection_F = t1; }, _Section: function _Section() { }, _AttackSection: function _AttackSection(t0, t1) { this._item_inspector$_hero = t0; this._item = t1; }, _DefenseSection: function _DefenseSection(t0) { this._item = t0; }, _ResistancesSection: function _ResistancesSection(t0) { this._item = t0; }, _TextSection: function _TextSection(t0, t1) { this._lines = t0; this.header = t1; }, renderItems(terminal, items, canSelect, canSelectAny, capitalize, getPrice, inspectedItem, inspectorOnRight, itemSlotCount, left, save, showLetters, showPrices, $top, width) { var letters, statRight, t2, price, t3, t4, t5, t6, t7, t8, t9, t10, t11, slot, letter, t12, _box_0, x, y, t13, t14, borderColor, letterColor, textColor, t15, priceLeft, t16, hit, $name, nameWidth, inspector, _box_1 = {}, t1 = canSelectAny ? B.Color_222_156_33 : B.Color_38_42_66; A.Draw_frame(terminal, t1, itemSlotCount + 2, items.get$location().name, canSelectAny, width, left, $top); letters = capitalize ? "ABCDEFGHIJKLMNOPQRSTUVWXYZ" : "abcdefghijklmnopqrstuvwxyz"; t1 = left + width; statRight = _box_1.statRight = t1 - 1; if (showPrices) for (t2 = items.get$iterator(items); t2.moveNext$0();) { price = getPrice.call$1(t2.get$current()); if (price != null) _box_1.statRight = Math.min(_box_1.statRight, t1 - A.formatMoney(price).length - 3); } for (t2 = J.get$iterator$ax(items.get$slots()), t3 = left + 1, t4 = letters.length, t5 = type$.JSArray_Scale, t6 = type$.JSArray_Bonus, t7 = left - 34, t8 = t1 + 34, t9 = width - 34, t10 = $top + itemSlotCount, t11 = t10 + 3, slot = 0, letter = 0; t2.moveNext$0();) { t12 = t2.get$current(); _box_0 = {}; x = left + (showLetters ? 3 : 1); y = $top + slot + 1; if (slot >= itemSlotCount) { t1 = items.get$length(items); t2 = canSelectAny ? B.Color_222_156_33 : B.Color_38_42_66; terminal.writeAt$4(x + 1, t10 + 1, " " + (t1 - itemSlotCount) + " more... ", t2); break; } if (t12 == null) { t12 = false; if (slot > 0) { t13 = items.get$slotTypes(); if (!(slot < t13.length)) return A.ioore(t13, slot); if (t13[slot] === "hand") { t13 = items.get$slotTypes(); t14 = slot - 1; if (!(t14 < t13.length)) return A.ioore(t13, t14); if (t13[t14] === "hand") { t12 = J.elementAt$1$ax(items.get$slots(), t14); t12 = t12 == null ? null : t12.type.isTwoHanded; t12 = t12 === true; } } } if (t12) terminal.writeAt$4(x, y, "\u2191 (two-handed)", B.Color_38_42_66); else { t12 = items.get$slotTypes(); if (!(slot < t12.length)) return A.ioore(t12, slot); terminal.writeAt$4(x + 2, y, "(" + t12[slot] + ")", B.Color_38_42_66); } ++letter; ++slot; continue; } _box_0.enabled = true; t13 = true; if (canSelectAny) if (canSelect.call$1(t12)) { borderColor = B.Color_38_42_66; letterColor = B.Color_222_156_33; textColor = B.Color_226_223_240; } else { _box_0.enabled = false; borderColor = B.Color_0_0_0; letterColor = B.Color_0_0_0; textColor = B.Color_38_42_66; t13 = false; } else { borderColor = B.Color_38_42_66; letterColor = B.Color_38_42_66; textColor = B.Color_226_223_240; } t14 = t12 === inspectedItem; if (t14) textColor = B.Color_222_156_33; if (showLetters) { terminal.writeAt$4(t3, y, " )", borderColor); if (!(letter < t4)) return A.ioore(letters, letter); terminal.writeAt$4(t3, y, letters[letter], letterColor); } ++letter; if (t13) terminal.drawGlyph$3(x, y, t12.type.appearance); _box_0.nameRight = statRight; if (showPrices && getPrice.call$1(t12) != null) { t15 = getPrice.call$1(t12); t15.toString; price = A.formatMoney(t15); priceLeft = statRight - price.length - 1; terminal.writeAt$4(priceLeft, y, "$", t13 ? B.Color_142_82_55 : B.Color_38_42_66); t13 = t13 ? B.Color_222_156_33 : B.Color_38_42_66; terminal.writeAt$4(priceLeft + 1, y, price, t13); _box_0.nameRight = priceLeft; } t13 = new A.renderItems_drawStat(_box_1, _box_0, terminal, y); t15 = t12.type; t16 = t15.attack; if (t16 != null) { hit = new A.Hit(t16, A._setArrayType([], t5), A._setArrayType([], t6), A._setArrayType([], t5), A._setArrayType([], t6), $.$get$Element_none()); t13.call$4(170, B.JSNumber_methods.toString$0(B.JSNumber_methods.toInt$0((t16.damage * hit.get$_combat$_damageScale() + hit.get$_combat$_damageBonus()) * 100) / 100), B.Color_179_74_4, B.Color_77_29_21); } else { t15 = t15.armor; if (t15 + t12.get$armorModifier() !== 0) t13.call$4(230, t15 + t12.get$armorModifier(), B.Color_22_117_38, B.Color_0_64_39); } $name = A.Log_quantifyWithoutArticle(t12.get$quantifiableName(), t12._count); t13 = x + 2; nameWidth = _box_0.nameRight - t13; terminal.writeAt$4(t13, y, $name.length > nameWidth ? B.JSString_methods.substring$2($name, 0, nameWidth) : $name, textColor); if (t14) { inspector = new A.ItemInspector(t12, A.ItemInspector__description(t12, 34)); inspector.ItemInspector$3$wide(save, t12, false); if (inspectorOnRight) if (t8 > terminal.get$width()) { terminal.writeAt$4(statRight, y, "\u25bc", B.Color_222_156_33); inspector.draw$3(left + B.JSInt_methods._tdivFast$1(t9, 2), t11, terminal); } else { terminal.writeAt$4(statRight, y, "\u25ba", B.Color_222_156_33); inspector.draw$3(t1, y, terminal); } else { terminal.writeAt$4(left, y, "\u25c4", B.Color_222_156_33); inspector.draw$3(t7, y, terminal); } } ++slot; } }, _defaultCanSelect(item) { return false; }, _defaultGetPrice(item) { return item.get$price(); }, formatMoney(price) { var t1, result = B.JSInt_methods.toString$0(price); if (price > 999999999) { t1 = result.length - 9; result = B.JSString_methods.substring$2(result, 0, t1) + "," + B.JSString_methods.substring$1(result, t1); } if (price > 999999) { t1 = result.length - 6; result = B.JSString_methods.substring$2(result, 0, t1) + "," + B.JSString_methods.substring$1(result, t1); } if (price > 999) { t1 = result.length - 3; result = B.JSString_methods.substring$2(result, 0, t1) + "," + B.JSString_methods.substring$1(result, t1); } return result; }, renderItems_drawStat: function renderItems_drawStat(t0, t1, t2, t3) { var _ = this; _._box_1 = t0; _._box_0 = t1; _.terminal = t2; _.y = t3; }, PickUpDialog: function PickUpDialog(t0, t1) { var _ = this; _.gameScreen = t0; _._item_dialog$_location = t1; _._selectedItem = null; _._item_dialog$_count = -1; _._item_dialog$_shiftDown = false; _._ui = _._item_dialog$_inspected = null; }, _PutDialog: function _PutDialog() { }, PutCrucibleDialog: function PutCrucibleDialog(t0, t1, t2) { var _ = this; _._onTransfer = t0; _.gameScreen = t1; _._item_dialog$_location = t2; _._selectedItem = null; _._item_dialog$_count = -1; _._item_dialog$_shiftDown = false; _._ui = _._item_dialog$_inspected = null; }, PutHomeDialog: function PutHomeDialog(t0, t1) { var _ = this; _.gameScreen = t0; _._item_dialog$_location = t1; _._selectedItem = null; _._item_dialog$_count = -1; _._item_dialog$_shiftDown = false; _._ui = _._item_dialog$_inspected = null; }, SellDialog: function SellDialog(t0, t1, t2) { var _ = this; _._sell_dialog$_shop = t0; _.gameScreen = t1; _._item_dialog$_location = t2; _._selectedItem = null; _._item_dialog$_count = -1; _._item_dialog$_shiftDown = false; _._ui = _._item_dialog$_inspected = null; }, TossDialog: function TossDialog(t0, t1) { var _ = this; _.gameScreen = t0; _._item_dialog$_location = t1; _._selectedItem = null; _._item_dialog$_count = -1; _._item_dialog$_shiftDown = false; _._ui = _._item_dialog$_inspected = null; }, TossDialog_selectItem_closure: function TossDialog_selectItem_closure(t0, t1, t2, t3) { var _ = this; _.$this = t0; _.location = t1; _.item = t2; _.hit = t3; }, TownScreen: function TownScreen() { }, _ItemVerbScreen: function _ItemVerbScreen() { }, _HomeScreen: function _HomeScreen(t0) { var _ = this; _._town_screen$_gameScreen = t0; _._shiftDown = false; _._town_screen$_isActive = true; _._ui = _._town_screen$_error = _._inspected = null; }, _GetScreen: function _GetScreen() { }, _GetFromHomeScreen: function _GetFromHomeScreen(t0) { var _ = this; _._town_screen$_gameScreen = t0; _._shiftDown = false; _._town_screen$_isActive = true; _._ui = _._town_screen$_error = _._inspected = null; }, _GetFromCrucibleScreen: function _GetFromCrucibleScreen(t0, t1) { var _ = this; _._town_screen$_onTransfer = t0; _._town_screen$_gameScreen = t1; _._shiftDown = false; _._town_screen$_isActive = true; _._ui = _._town_screen$_error = _._inspected = null; }, _CrucibleScreen: function _CrucibleScreen(t0) { var _ = this; _._completeRecipe = null; _._town_screen$_gameScreen = t0; _._shiftDown = false; _._town_screen$_isActive = true; _._ui = _._town_screen$_error = _._inspected = null; }, _ShopScreen: function _ShopScreen(t0, t1) { var _ = this; _._shop = t0; _._town_screen$_gameScreen = t1; _._shiftDown = false; _._town_screen$_isActive = true; _._ui = _._town_screen$_error = _._inspected = null; }, _ShopBuyScreen: function _ShopBuyScreen(t0, t1) { var _ = this; _._shop = t0; _._town_screen$_gameScreen = t1; _._shiftDown = false; _._town_screen$_isActive = true; _._ui = _._town_screen$_error = _._inspected = null; }, _CountScreen: function _CountScreen(t0, t1, t2, t3) { var _ = this; _._parent = t0; _._town_screen$_item = t1; _._town_screen$_count = t2; _._town_screen$_gameScreen = t3; _._shiftDown = false; _._town_screen$_isActive = true; _._ui = _._town_screen$_error = _._inspected = null; }, UseDialog: function UseDialog(t0, t1) { var _ = this; _.gameScreen = t0; _._item_dialog$_location = t1; _._selectedItem = null; _._item_dialog$_count = -1; _._item_dialog$_shiftDown = false; _._ui = _._item_dialog$_inspected = null; }, LoadingDialog: function LoadingDialog(t0, t1) { var _ = this; _._loading_dialog$_game = t0; _._steps = t1; _._loading_dialog$_frame = 0; _._ui = null; }, MainMenuScreen: function MainMenuScreen(t0, t1) { var _ = this; _.content = t0; _.storage = t1; _.selectedHero = 0; _._generator = _._game = null; _._lightDungeon = false; _._regenerateDelay = 0; _._isActive = true; _._scroll = 0; _._ui = null; }, MainMenuScreen__renderTile_multiply: function MainMenuScreen__renderTile_multiply() { }, MainMenuScreen__renderTile_applyLighting: function MainMenuScreen__renderTile_applyLighting(t0) { this.tile = t0; }, NewHeroScreen$(_content, _storage) { var t4, t5, t6, t7, t8, t1 = type$.JSArray_Control, t2 = A._setArrayType([], t1), t3 = $.$get$rng(); type$.List_String._as(B.List_E8g); t4 = B.List_E8g.length; t5 = t3.range$1(t4); if (!(t5 >= 0 && t5 < t4)) return A.ioore(B.List_E8g, t5); t5 = new A.NameControl(0, 0, _storage, B.List_E8g[t5]); t5._refreshUnique$0(); t4 = $.$get$Races_all(); t6 = A._arrayInstanceType(t4); t7 = t6._eval$1("MappedListIterable<1,String>"); t4 = A.List_List$_of(new A.MappedListIterable(t4, t6._eval$1("String(1)")._as(new A.NewHeroScreen_closure()), t7), t7._eval$1("ListIterable.E")); t4 = new A.SelectControl(0, 4, "Race", t4); t6 = $.$get$Classes_all(); t7 = A._arrayInstanceType(t6); t8 = t7._eval$1("MappedListIterable<1,String>"); t6 = A.List_List$_of(new A.MappedListIterable(t6, t7._eval$1("String(1)")._as(new A.NewHeroScreen_closure0()), t8), t8._eval$1("ListIterable.E")); t6 = new A.SelectControl(0, 14, "Class", t6); t7 = new A.SelectControl(0, 28, "Death", B.List_Stairs_Permanent); B.JSArray_methods.addAll$1(t2, A._setArrayType([t5, t4, t6, t7], t1)); t4.selected = t3.range$1(5); t6.selected = t3.range$1(3); return new A.NewHeroScreen(_content, _storage, t5, t4, t6, t7, t2); }, NewHeroScreen: function NewHeroScreen(t0, t1, t2, t3, t4, t5, t6) { var _ = this; _._content = t0; _._storage = t1; _._new_hero_screen$_focus = 0; _._new_hero_screen$_name = t2; _._race = t3; _._class = t4; _._death = t5; _._controls = t6; _._ui = null; }, NewHeroScreen_closure: function NewHeroScreen_closure() { }, NewHeroScreen_closure0: function NewHeroScreen_closure0() { }, NewHeroScreen_render_closure: function NewHeroScreen_render_closure(t0) { this.$this = t0; }, Control: function Control() { }, NameControl: function NameControl(t0, t1, t2, t3) { var _ = this; _._new_hero_screen$_x = t0; _._new_hero_screen$_y = t1; _._storage = t2; _._enteredName = ""; _._defaultName = t3; _._isUnique = false; }, NameControl__refreshUnique_closure: function NameControl__refreshUnique_closure(t0) { this.$this = t0; }, SelectControl: function SelectControl(t0, t1, t2, t3) { var _ = this; _._new_hero_screen$_x = t0; _._new_hero_screen$_y = t1; _._new_hero_screen$_name = t2; _._options = t3; _.selected = 0; }, ItemPanel: function ItemPanel(t0) { this._item_panel$_game = t0; this._bounds = null; }, LogPanel: function LogPanel(t0) { this._log = t0; this._bounds = null; }, Panel: function Panel() { }, SidebarPanel: function SidebarPanel(t0) { this._sidebar_panel$_gameScreen = t0; this._bounds = null; }, SidebarPanel_renderPanel_closure: function SidebarPanel_renderPanel_closure(t0) { this.hero = t0; }, SidebarPanel__drawStats_drawStat: function SidebarPanel__drawStats_drawStat(t0, t1, t2) { this._box_0 = t0; this.terminal = t1; this.y = t2; }, SidebarPanel__drawHealthBar_drawCondition: function SidebarPanel__drawHealthBar_drawCondition(t0, t1, t2) { this._box_0 = t0; this.terminal = t1; this.y = t2; }, StagePanel: function StagePanel(t0, t1, t2, t3, t4) { var _ = this; _._stage_panel$_gameScreen = t0; _._effects = t1; _.visibleMonsters = t2; _._hasAnimatedTile = false; _._stage_panel$_frame = 0; _._cameraBounds = t3; _._renderOffset = t4; _._bounds = null; }, StagePanel_update_closure: function StagePanel_update_closure(t0) { this.$this = t0; }, StagePanel_renderPanel_multiply: function StagePanel_renderPanel_multiply() { }, StagePanel_renderPanel_applyLighting: function StagePanel_renderPanel_applyLighting(t0) { this.tile = t0; }, StagePanel_renderPanel_closure: function StagePanel_renderPanel_closure(t0, t1) { this.$this = t0; this.terminal = t1; }, StagePanel__positionCamera_centerX: function StagePanel__positionCamera_centerX(t0, t1) { this.game = t0; this.viewSize = t1; }, StagePanel__positionCamera_centerY: function StagePanel__positionCamera_centerY(t0, t1) { this.game = t0; this.viewSize = t1; }, Popup: function Popup() { }, Popup_render_closure: function Popup_render_closure() { }, Popup_render_closure0: function Popup_render_closure0() { }, SelectDepthPopup: function SelectDepthPopup(t0) { this.save = t0; this._select_depth_popup$_depth = 1; this._ui = null; }, SelectSkillDialog: function SelectSkillDialog(t0, t1) { this._select_skill_dialog$_gameScreen = t0; this._select_skill_dialog$_skills = t1; this._ui = null; }, SkillDialog_SkillDialog(hero) { var t2, screens, i, t1 = new A.DisciplineDialog(hero, A._setArrayType([], type$.JSArray_Discipline)); t1.SkillTypeDialog$1(hero, type$.Discipline); t2 = new A.SpellDialog(hero, A._setArrayType([], type$.JSArray_Spell)); t2.SkillTypeDialog$1(hero, type$.Spell); screens = [t1, t2]; for (i = 0; i < 2;) { t1 = screens[i]; ++i; t2 = screens[i % 2]; t1.__SkillDialog__nextScreen_F !== $ && A.throwLateFieldAI("_nextScreen"); t1.__SkillDialog__nextScreen_F = t2; } return B.JSArray_methods.get$first(screens); }, SkillDialog: function SkillDialog() { }, SkillTypeDialog: function SkillTypeDialog() { }, DisciplineDialog: function DisciplineDialog(t0, t1) { var _ = this; _._skill_dialog$_hero = t0; _._skill_dialog$_skills = t1; _._selectedSkill = 0; _.__SkillDialog__nextScreen_F = $; _._ui = null; }, SpellDialog: function SpellDialog(t0, t1) { var _ = this; _._skill_dialog$_hero = t0; _._skill_dialog$_skills = t1; _._selectedSkill = 0; _.__SkillDialog__nextScreen_F = $; _._ui = null; }, Storage: function Storage(t0, t1) { this.content = t0; this.heroes = t1; }, Storage_remove_closure: function Storage_remove_closure(t0) { this.hero = t0; }, Storage_replace_closure: function Storage_replace_closure(t0) { this.hero = t0; }, Storage__load_closure: function Storage__load_closure(t0) { this.raceName = t0; }, Storage__load_closure0: function Storage__load_closure0(t0) { this.name = t0; }, Storage__load_closure1: function Storage__load_closure1(t0, t1, t2) { this.$this = t0; this.shopsData = t1; this.shops = t2; }, Storage__loadLog_closure: function Storage__loadLog_closure(t0) { this.messageMap = t0; }, Storage__loadLore_closure: function Storage__loadLore_closure(t0, t1) { this.$this = t0; this.seenBreeds = t1; }, Storage__loadLore_closure0: function Storage__loadLore_closure0(t0, t1) { this.$this = t0; this.slain = t1; }, Storage__loadLore_closure1: function Storage__loadLore_closure1(t0, t1) { this.$this = t0; this.foundItems = t1; }, Storage__loadLore_closure2: function Storage__loadLore_closure2(t0, t1) { this.$this = t0; this.foundAffixes = t1; }, Storage__loadLore_closure3: function Storage__loadLore_closure3(t0, t1) { this.$this = t0; this.usedItems = t1; }, TargetDialog$(_gameScreen, _range, _onSelect) { var t1 = new A.TargetDialog(_gameScreen, _range, _onSelect, A._setArrayType([], type$.JSArray_Monster)); t1.TargetDialog$3(_gameScreen, _range, _onSelect); return t1; }, _findLowest(collection, callback, $T) { var t1, bestItem, bestScore, _i, item, score; for (t1 = collection.length, bestItem = null, bestScore = null, _i = 0; _i < collection.length; collection.length === t1 || (0, A.throwConcurrentModificationError)(collection), ++_i) { item = collection[_i]; score = callback.call$1(item); if (bestScore == null || score < bestScore) { bestScore = score; bestItem = item; } } return bestItem; }, _findHighest(collection, callback, $T) { var t1, bestItem, bestScore, _i, item, score; for (t1 = collection.length, bestItem = null, bestScore = null, _i = 0; _i < collection.length; collection.length === t1 || (0, A.throwConcurrentModificationError)(collection), ++_i) { item = collection[_i]; score = callback.call$1(item); if (bestScore == null || score > bestScore) { bestScore = score; bestItem = item; } } return bestItem; }, TargetDialog: function TargetDialog(t0, t1, t2, t3) { var _ = this; _._target_dialog$_gameScreen = t0; _._target_dialog$_range = t1; _._target_dialog$_onSelect = t2; _._monsters = t3; _._targetingFloor = false; _._target_dialog$_animateOffset = 0; _._ui = null; }, TargetDialog__changeMonsterTarget_closure: function TargetDialog__changeMonsterTarget_closure(t0) { this.target = t0; }, TargetDialog__changeMonsterTarget_closure0: function TargetDialog__changeMonsterTarget_closure0(t0) { this.target = t0; }, WizardDialog: function WizardDialog(t0, t1) { var _ = this; _._menuItems = t0; _._wizard_dialog$_game = t1; _._wizard_dialog$_isActive = true; _._ui = null; }, _SearchDialog: function _SearchDialog() { }, _SearchDialog__matchedItems_closure: function _SearchDialog__matchedItems_closure(t0) { this.$this = t0; }, _WizardDropDialog: function _WizardDropDialog(t0) { this._wizard_dialog$_game = t0; this._wizard_dialog$_pattern = ""; this._ui = null; }, _WizardSpawnDialog: function _WizardSpawnDialog(t0) { this._wizard_dialog$_game = t0; this._wizard_dialog$_pattern = ""; this._ui = null; }, _WizardSpawnDialog__selectItem_closure: function _WizardSpawnDialog__selectItem_closure(t0) { this.$this = t0; }, _WizardTrainDialog: function _WizardTrainDialog(t0) { this._wizard_dialog$_game = t0; this._wizard_dialog$_pattern = ""; this._ui = null; }, Display: function Display(t0, t1) { this._glyphs = t0; this._changedGlyphs = t1; }, Glyph$(char, fore, $back) { var t1; if (0 >= char.length) return A.ioore(char, 0); t1 = $back == null ? B.Color_0_0_0 : $back; return new A.Glyph(char.charCodeAt(0), fore, t1); }, Glyph$fromCharCode(char, fore, $back) { var t1 = fore == null ? B.Color_255_255_255 : fore; return new A.Glyph(char, t1, $back == null ? B.Color_0_0_0 : $back); }, Color: function Color(t0, t1, t2) { this.r = t0; this.g = t1; this.b = t2; }, Glyph: function Glyph(t0, t1, t2) { this.char = t0; this.fore = t1; this.back = t2; }, KeyBindings: function KeyBindings(t0, t1) { this._bindings = t0; this.$ti = t1; }, _KeyBinding: function _KeyBinding(t0, t1, t2) { this.charCode = t0; this.shift = t1; this.alt = t2; }, PortTerminal: function PortTerminal(t0, t1, t2, t3) { var _ = this; _.size = t0; _._port_terminal$_x = t1; _._port_terminal$_y = t2; _._root = t3; }, RetroTerminal$_(_display, _charWidth, _charHeight, canvas, _font, _scale) { var t1 = A._asJSObjectQ(canvas.getContext("2d")); if (t1 == null) t1 = A._asJSObject(t1); t1 = new A.RetroTerminal(_display, t1, _font, A.LinkedHashMap_LinkedHashMap$_empty(type$.Color, type$.JSObject), _scale, _charWidth, _charHeight); t1.RetroTerminal$_$6(_display, _charWidth, _charHeight, canvas, _font, _scale); return t1; }, RetroTerminal: function RetroTerminal(t0, t1, t2, t3, t4, t5, t6) { var _ = this; _._display = t0; _._context = t1; _._font = t2; _._fontColorCache = t3; _._scale = t4; _._imageLoaded = false; _._charWidth = t5; _._charHeight = t6; }, RetroTerminal$__closure: function RetroTerminal$__closure(t0) { this.$this = t0; }, RetroTerminal_render_closure: function RetroTerminal_render_closure(t0) { this.$this = t0; }, Terminal: function Terminal() { }, RenderableTerminal: function RenderableTerminal() { }, UserInterface: function UserInterface(t0, t1, t2, t3) { var _ = this; _.keyPress = t0; _._screens = t1; _._terminal = t2; _._dirty = true; _._keyUpSubscription = _._keyDownSubscription = null; _.__UserInterface__tickJS_FI = $; _._running = false; _._lastRefreshTime = null; _.$ti = t3; }, Screen: function Screen() { }, Array2D: function Array2D(t0, t1, t2) { this._elements = t0; this.bounds = t1; this.$ti = t2; }, _CircleIterator__CircleIterator(circle, edge) { var t1 = circle.radius, size = t1 + t1 + 1, t2 = circle.center; return new A._CircleIterator(circle, A.RectIterator$(new A.Rect(new A.Vec(t2.get$x() - t1, t2.get$y() - t1), new A.Vec(size, size))), edge); }, _contains(center, radius, pos) { var lengthSquared = pos.$sub(0, center).get$lengthSquared(); if (radius < 7) { if (!(radius >= 0)) return A.ioore(B.List_EnP, radius); return lengthSquared <= B.List_EnP[radius]; } return lengthSquared <= radius * (radius + 1); }, Circle: function Circle(t0, t1) { this.center = t0; this.radius = t1; }, _CircleIterator: function _CircleIterator(t0, t1, t2) { this._circle = t0; this._boundsIterator = t1; this._edge = t2; }, Direction: function Direction(t0, t1, t2, t3) { var _ = this; _.x = t0; _.y = t1; _.index = t2; _._core$_name = t3; }, _Direction__Enum_VecMixin: function _Direction__Enum_VecMixin() { }, _LineIterator__LineIterator(start, end) { var t0, delta = end.$sub(0, start), t1 = delta.x, primaryStep = new A.Vec(B.JSInt_methods.get$sign(t1), 0), t2 = delta.y, secondaryStep = new A.Vec(0, B.JSInt_methods.get$sign(t2)), primary = Math.abs(t1), secondary = Math.abs(t2); if (secondary > primary) { t0 = secondary; secondary = primary; primary = t0; t0 = secondaryStep; secondaryStep = primaryStep; primaryStep = t0; } return new A._LineIterator(start, 0, primary, secondary, primaryStep, secondaryStep); }, _LineIterator: function _LineIterator(t0, t1, t2, t3, t4, t5) { var _ = this; _._line$_current = t0; _._error = t1; _._line$_primary = t2; _._secondary = t3; _._primaryStep = t4; _._secondaryStep = t5; }, Rect_intersect(a, b) { var left = Math.max(a.get$left(), b.get$left()), right = Math.min(a.get$right(), b.get$right()), $top = Math.max(a.get$top(), b.get$top()), bottom = Math.min(a.get$bottom(), b.get$bottom()); return new A.Rect(new A.Vec(left, $top), new A.Vec(Math.max(0, right - left), Math.max(0, bottom - $top))); }, RectIterator$(_rect) { var t1 = _rect.pos; return new A.RectIterator(_rect, t1.x - 1, t1.y); }, Rect: function Rect(t0, t1) { this.pos = t0; this.size = t1; }, RectIterator: function RectIterator(t0, t1, t2) { this._rect = t0; this._x = t1; this._y = t2; }, Rng: function Rng(t0) { this._random = t0; }, VecMixin: function VecMixin() { }, Vec: function Vec(t0, t1) { this.x = t0; this.y = t1; }, _Vec_Object_VecMixin: function _Vec_Object_VecMixin() { }, _EventStreamSubscription$(_target, _eventType, onData, _useCapture, $T) { var t1 = A._wrapZone(new A._EventStreamSubscription_closure(onData), type$.JSObject); t1 = t1 == null ? null : A._functionToJS1(t1); if (t1 != null) _target.addEventListener(_eventType, t1, false); return new A._EventStreamSubscription(_target, _eventType, t1, false, $T._eval$1("_EventStreamSubscription<0>")); }, _wrapZone(callback, $T) { var t1 = $.Zone__current; if (t1 === B.C__RootZone) return callback; return t1.bindUnaryCallbackGuarded$1$1(callback, $T); }, EventStreamProvider: function EventStreamProvider(t0, t1) { this._eventType = t0; this.$ti = t1; }, _EventStream: function _EventStream() { }, _ElementEventStreamImpl: function _ElementEventStreamImpl(t0, t1, t2, t3) { var _ = this; _._target = t0; _._eventType = t1; _._useCapture = t2; _.$ti = t3; }, _EventStreamSubscription: function _EventStreamSubscription(t0, t1, t2, t3, t4) { var _ = this; _._target = t0; _._eventType = t1; _._onData = t2; _._useCapture = t3; _.$ti = t4; }, _EventStreamSubscription_closure: function _EventStreamSubscription_closure(t0) { this.onData = t0; }, main() { var t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, description, t14, t15, t16, t17, t18, drop, tableCells, $content, fontName, _i, thisFont, _null = null, _s4_ = "item", _s11_ = "Insect Wing", _s7_ = "Feather", _s9_ = "item/food", _s6_ = "hit[s]", _s16_ = "Healing Poultice", _1000 = 1000, _s20_ = "equipment/armor/body", _s22_ = "The shield blocks {2}.", _s21_ = "equipment/armor/boots", _s8_ = "fearless", _s7_0 = "bite[s]", _s1_ = " ", _s25_ = "{1} flits out of the way.", _s6_0 = "canine", _s11_0 = "stare[s] at", _s9_0 = "the spark", _s4_0 = "zaps", _s12_ = "gaze[s] into", _s8_0 = "splashes", _s9_1 = "the stone", _s4_1 = "hits", _s11_1 = "scratch[es]", _s7_1 = "stab[s]", _s8_1 = "treasure", _s5_ = "spear", _s7_2 = "healing", _s6_1 = "goblin", _s9_2 = "the arrow", _s5_0 = "armor", _s10_ = "resistance", _s10_0 = "protective", _s4_2 = "robe", _s5_1 = "magic", _s9_3 = "slash[es]", _s9_4 = "equipment", _s11_2 = "crawl[s] on", _s17_ = "fearless immobile", _s8_2 = "cowardly", _s4_3 = "club", _s6_2 = "kobold", _s7_3 = "poke[s]", _s7_4 = "claw[s]", _s7_5 = "saurian", _s10_1 = "salamander", _s6_3 = "weapon", _s8_3 = "strangle", _s16_0 = "natural/bug/worm", _s9_5 = "bony hand", _s8_4 = "bony arm", _s13_ = "severed skull", _s20_0 = "decapitated skeleton", _s16_1 = "armless skeleton", _s18_ = "one-armed skeleton", _s20_1 = "{1}'s arm falls off!", _s21_0 = "{1}'s hand falls off!", _s20_2 = "{1}'s head pops off!", _s7_6 = "Elven _", _s12_0 = "High Elven _", _s9_6 = "Dwarven _", _s11_3 = "animal herp", _s12_1 = "dungeon keep", _s5_2 = "built"; $.$get$Items_types().defineTags$1(_s4_); t1 = A.category(199, 10, _null); t1.tag$1(_s4_); t2 = $.$get$Elements_earth(); t1.toss$4$breakage$damage$element$range(10, 3, t2, 7); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Rock", B.Color_142_82_55, 0); t1.depth$1(1); t1._frequency = 0.5; t1 = A.category(252, 4, _null); t1.tag$1(_s4_); t1.toss$3$breakage$damage$range(30, 2, 5); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Skull", B.Color_116_146_181, 0); t1._frequency = 0.25; t1.depth$1(1); t1 = A.category(162, _null, _null); t1.tag$1("treasure/coin"); t1._isTreasure = true; A.finishItem(); t1 = A.ItemBuilder$("Copper Coin", B.Color_110_32_13, 4); $._itemBuilder = t1; t1.depth$2$to(1, 11); A.finishItem(); t1 = A.ItemBuilder$("Bronze Coin", B.Color_142_82_55, 8); $._itemBuilder = t1; t1.depth$2$to(7, 20); A.finishItem(); t1 = A.ItemBuilder$("Silver Coin", B.Color_129_231_235, 20); $._itemBuilder = t1; t1.depth$2$to(11, 30); A.finishItem(); t1 = A.ItemBuilder$("Electrum Coin", B.Color_255_238_168, 50); $._itemBuilder = t1; t1.depth$2$to(20, 40); A.finishItem(); t1 = A.ItemBuilder$("Gold Coin", B.Color_222_156_33, 100); $._itemBuilder = t1; t1.depth$2$to(30, 50); A.finishItem(); t1 = A.ItemBuilder$("Platinum Coin", B.Color_116_146_181, 300); $._itemBuilder = t1; t1.depth$2$to(40, 70); t1 = A.category(36, _null, _null); t1.tag$1("treasure/bar"); t1._isTreasure = true; A.finishItem(); t1 = A.ItemBuilder$("Copper Bar", B.Color_110_32_13, 150); $._itemBuilder = t1; t1.depth$2$to(35, 60); A.finishItem(); t1 = A.ItemBuilder$("Bronze Bar", B.Color_142_82_55, 500); $._itemBuilder = t1; t1.depth$2$to(50, 70); A.finishItem(); t1 = A.ItemBuilder$("Silver Bar", B.Color_129_231_235, 800); $._itemBuilder = t1; t1.depth$2$to(60, 80); A.finishItem(); t1 = A.ItemBuilder$("Electrum Bar", B.Color_255_238_168, 1200); $._itemBuilder = t1; t1.depth$2$to(70, 90); A.finishItem(); t1 = A.ItemBuilder$("Gold Bar", B.Color_222_156_33, 2000); $._itemBuilder = t1; t1.depth$1(80); A.finishItem(); t1 = A.ItemBuilder$("Platinum Bar", B.Color_116_146_181, 3000); $._itemBuilder = t1; t1.depth$1(90); t1 = A.category(162, _null, _null); t1.tag$1("item/gem"); t3 = $.$get$Elements_acid(); t1._destroyChance.$indexSet(0, t3, 50); t1._fuel = null; A.finishItem(); t1 = A.ItemBuilder$("Amethyst Shard", B.Color_201_166_255, 30); $._itemBuilder = t1; t1.depth$2$to(7, 27); A.finishItem(); t1 = A.ItemBuilder$("Uncut Amethyst", B.Color_173_88_219, 100); $._itemBuilder = t1; t1.depth$2$to(27, 57); A.finishItem(); t1 = A.ItemBuilder$("Faceted Amethyst", B.Color_86_30_138, 400); $._itemBuilder = t1; t1.depth$1(57); A.finishItem(); t1 = A.ItemBuilder$("Sapphire Shard", B.Color_64_163_229, 34); $._itemBuilder = t1; t1.depth$2$to(8, 28); A.finishItem(); t1 = A.ItemBuilder$("Uncut Sapphire", B.Color_21_87_194, 125); $._itemBuilder = t1; t1.depth$2$to(28, 58); A.finishItem(); t1 = A.ItemBuilder$("Faceted Sapphire", B.Color_26_46_150, 440); $._itemBuilder = t1; t1.depth$1(58); A.finishItem(); t1 = A.ItemBuilder$("Emerald Shard", B.Color_131_158_13, 37); $._itemBuilder = t1; t1.depth$2$to(9, 29); A.finishItem(); t1 = A.ItemBuilder$("Uncut Emerald", B.Color_22_117_38, 136); $._itemBuilder = t1; t1.depth$2$to(29, 59); A.finishItem(); t1 = A.ItemBuilder$("Faceted Emerald", B.Color_0_64_39, 486); $._itemBuilder = t1; t1.depth$1(59); A.finishItem(); t1 = A.ItemBuilder$("Ruby Shard", B.Color_255_122_105, 41); $._itemBuilder = t1; t1.depth$2$to(10, 30); A.finishItem(); t1 = A.ItemBuilder$("Uncut Ruby", B.Color_204_35_57, 142); $._itemBuilder = t1; t1.depth$2$to(30, 60); A.finishItem(); t1 = A.ItemBuilder$("Faceted Ruby", B.Color_84_0_39, 498); $._itemBuilder = t1; t1.depth$1(60); A.finishItem(); t1 = A.ItemBuilder$("Diamond Shard", B.Color_63_75_115, 45); $._itemBuilder = t1; t1.depth$2$to(11, 31); A.finishItem(); t1 = A.ItemBuilder$("Uncut Diamond", B.Color_116_146_181, 153); $._itemBuilder = t1; t1.depth$2$to(31, 61); A.finishItem(); t1 = A.ItemBuilder$("Faceted Diamond", B.Color_226_223_240, 507); $._itemBuilder = t1; t1.depth$1(61); t1 = A.category(233, 20, _null); t1.tag$1("item/pelt"); t1._frequency = 0; t4 = $.$get$Elements_fire(); t1._destroyChance.$indexSet(0, t4, 80); t1._fuel = 1; A.finishItem(); t1 = A.ItemBuilder$(_s11_, B.Color_56_16_125, 0); $._itemBuilder = t1; t1.depth$1(1); A.finishItem(); t1 = A.ItemBuilder$(_s7_, B.Color_116_146_181, 0); $._itemBuilder = t1; t1.depth$1(1); t1 = A.category(161, _null, _null); t1.tag$1(_s9_); t1._destroyChance.$indexSet(0, t4, 20); t1._fuel = 3; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Stale Biscuit", B.Color_189_144_108, 0); t1.depth$2$to(1, 10); t1._maxStack = 6; t1.food$1(100); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Loa[f|ves] of Bread", B.Color_142_82_55, 4); t1.depth$2$to(3, 40); t1._maxStack = 6; t1.food$1(200); t1 = A.category(188, _null, _null); t1.tag$1(_s9_); t1._destroyChance.$indexSet(0, t4, 15); t1._fuel = 2; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Chunk[s] of Meat", B.Color_77_29_21, 10); t1.depth$2$to(8, 60); t1._maxStack = 4; t1.food$1(400); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Piece[s] of Jerky", B.Color_142_82_55, 20); t1.depth$1(15); t1._maxStack = 12; t1.food$1(600); t1 = A.category(172, _null, _s6_); t1.tag$1("equipment/light"); t1.toss$1$breakage(70); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Tallow Candle", B.Color_189_144_108, 6); t1.depth$2$to(1, 12); t1._maxStack = 10; t1.toss$3$damage$element$range(2, t4, 8); t1.lightSource$2$level$range(2, 5); t1._destroyChance.$indexSet(0, t4, 40); t1._fuel = 20; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Wax Candle", B.Color_226_223_240, 8); t1.depth$2$to(4, 20); t1._maxStack = 10; t1.toss$3$damage$element$range(3, t4, 8); t1.lightSource$2$level$range(3, 7); t1._destroyChance.$indexSet(0, t4, 40); t1._fuel = 25; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Oil Lamp", B.Color_77_29_21, 18); t1.depth$2$to(8, 30); t1._maxStack = 4; t1.toss$3$damage$element$range(10, t4, 8); t1.lightSource$2$level$range(4, 10); t1._destroyChance.$indexSet(0, t4, 50); t1._fuel = 40; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Torch[es]", B.Color_142_82_55, 16); t1.depth$2$to(11, 45); t1._maxStack = 4; t1.toss$3$damage$element$range(6, t4, 10); t1.lightSource$2$level$range(5, 14); t1._destroyChance.$indexSet(0, t4, 60); t1._fuel = 60; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Lantern", B.Color_222_156_33, 78); t1.depth$1(18); t1._frequency = 0.3; t1.toss$3$damage$element$range(5, t4, 5); t1.lightSource$2$level$range(6, 18); t1 = A.category(231, 10, _null); t1.tag$1("magic/potion/healing"); t1.toss$3$breakage$damage$range(100, 1, 6); t5 = $.$get$Elements_cold(); t1._destroyChance.$indexSet(0, t5, 20); t1._fuel = null; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Soothing Balm", B.Color_255_122_105, 10); t1.depth$2$to(2, 30); t1.heal$1(36); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Mending Salve", B.Color_204_35_57, 30); t1.depth$2$to(20, 40); t1.heal$1(64); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$(_s16_, B.Color_84_0_39, 80); t1.depth$1(30); t1.heal$2$curePoison(120, true); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Potion[s] of Amelioration", B.Color_56_16_125, 220); t1.depth$1(60); t1.heal$2$curePoison(200, true); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Potion[s] of Rejuvenation", B.Color_86_30_138, _1000); t1.depth$1(80); t1.heal$2$curePoison(_1000, true); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Antidote", B.Color_22_117_38, 20); t1.depth$1(2); t1.heal$2$curePoison(0, true); t1 = A.category(234, 10, _null); t1.tag$1("magic/potion/resistance"); t1._frequency = 0.5; t1.toss$3$breakage$damage$range(100, 1, 6); t1._destroyChance.$indexSet(0, t5, 20); t1._fuel = null; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Salve[s] of Heat Resistance", B.Color_179_74_4, 50); t1.depth$1(5); t1.resistSalve$1(t4); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Salve[s] of Cold Resistance", B.Color_64_163_229, 55); t1.depth$1(6); t1.resistSalve$1(t5); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Salve[s] of Light Resistance", B.Color_255_238_168, 60); t1.depth$1(7); t6 = $.$get$Elements_light(); t1.resistSalve$1(t6); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Salve[s] of Wind Resistance", B.Color_129_231_235, 65); t1.depth$1(8); t7 = $.$get$Elements_air(); t1.resistSalve$1(t7); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Salve[s] of Lightning Resistance", B.Color_173_88_219, 70); t1.depth$1(9); t8 = $.$get$Elements_lightning(); t1.resistSalve$1(t8); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Salve[s] of Darkness Resistance", B.Color_63_75_115, 75); t1.depth$1(10); t9 = $.$get$Elements_dark(); t1.resistSalve$1(t9); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Salve[s] of Earth Resistance", B.Color_142_82_55, 80); t1.depth$1(13); t1.resistSalve$1(t2); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Salve[s] of Water Resistance", B.Color_26_46_150, 85); t1.depth$1(16); t10 = $.$get$Elements_water(); t1.resistSalve$1(t10); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Salve[s] of Acid Resistance", B.Color_189_144_108, 90); t1.depth$1(19); t1.resistSalve$1(t3); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Salve[s] of Poison Resistance", B.Color_131_158_13, 95); t1.depth$1(23); t11 = $.$get$Elements_poison(); t1.resistSalve$1(t11); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Salve[s] of Death Resistance", B.Color_86_30_138, 100); t1.depth$1(30); t12 = $.$get$Elements_spirit(); t1.resistSalve$1(t12); t1 = A.category(235, 10, _null); t1.tag$1("magic/potion/speed"); t1._frequency = 0.3; t1.toss$3$breakage$damage$range(100, 1, 6); t1._destroyChance.$indexSet(0, t5, 20); t1._fuel = null; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Potion[s] of Quickness", B.Color_131_158_13, 25); t1.depth$2$to(3, 30); t1.haste$2(1, 40); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Potion[s] of Alacrity", B.Color_22_117_38, 60); t1.depth$2$to(18, 50); t1.haste$2(2, 60); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Potion[s] of Speed", B.Color_0_64_39, 150); t1.depth$1(34); t1._frequency = 0.25; t1.haste$2(3, 100); t1 = A.category(232, 10, _null); t1.tag$1("magic/potion/bottled"); t1._frequency = 0.5; t1.toss$3$breakage$damage$range(100, 1, 8); t1._destroyChance.$indexSet(0, t5, 15); t1._fuel = null; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Bottled Wind", B.Color_64_163_229, 100); t1.depth$1(4); t1.flow$5$fly(t7, "the wind", "blasts", 10, true); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Bottled Ice", B.Color_21_87_194, 120); t1.depth$1(7); t1.ball$4(t5, "the cold", "freezes", 16); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Bottled Fire", B.Color_204_35_57, 140); t1.depth$1(11); t1.flow$5$fly(t4, "the fire", "burns", 23, true); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Bottled Ocean", B.Color_26_46_150, 160); t1.depth$1(12); t1.flow$4(t10, "the water", "drowns", 30); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Bottled Poison", B.Color_0_64_39, 240); t1.depth$1(13); t1.flow$5$fly(t11, "the poison", "infects", 10, true); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Bottled Earth", B.Color_142_82_55, 180); t1.depth$1(16); t1.ball$4(t2, "the dirt", "crushes", 58); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Bottled Lightning", B.Color_173_88_219, 200); t1.depth$1(18); t1.ball$4(t8, "the lightning", "shocks", 68); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Bottled Acid", B.Color_131_158_13, 220); t1.depth$1(22); t1.flow$4(t3, "the acid", "corrodes", 72); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Bottled Shadow", B.Color_38_42_66, 260); t1.depth$1(28); t1.ball$4(t9, "the darkness", "torments", 120); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Bottled Radiance", B.Color_255_238_168, 280); t1.depth$1(34); t1.ball$4(t6, "light", "sears", 140); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Bottled Spirit", B.Color_63_75_115, 300); t1.depth$1(40); t1.flow$5$fly(t12, "the spirit", "haunts", 160, true); t1 = A.category(226, 20, _null); t1.tag$1("magic/scroll/teleportation"); t1._frequency = 0.3; t1.toss$3$breakage$damage$range(75, 1, 3); t1._destroyChance.$indexSet(0, t4, 20); t1._fuel = 5; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Scroll[s] of Sidestepping", B.Color_173_88_219, 16); t1.depth$1(2); t1._frequency = 0.5; t1.teleport$1(8); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Scroll[s] of Phasing", B.Color_86_30_138, 28); t1.depth$1(6); t1.teleport$1(14); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Scroll[s] of Teleportation", B.Color_56_16_125, 52); t1.depth$1(15); t1.teleport$1(28); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Scroll[s] of Disappearing", B.Color_26_46_150, 74); t1.depth$1(26); t1.teleport$1(54); t1 = A.category(228, 20, _null); t1.tag$1("magic/scroll/detection"); t1.toss$3$breakage$damage$range(75, 1, 3); t1._destroyChance.$indexSet(0, t4, 20); t1._fuel = 5; A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Scroll[s] of Find Nearby Escape", B.Color_255_238_168, 12); t1.depth$2$to(1, 10); t13 = type$.JSArray_DetectType; t1.detection$2$range(A._setArrayType([B.DetectType_0], t13), 20); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Scroll[s] of Locate Escape", B.Color_189_144_108, 28); t1.depth$2$to(8, 30); t1.detection$1(A._setArrayType([B.DetectType_0], t13)); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Scroll[s] of Find Nearby Items", B.Color_222_156_33, 24); t1.depth$2$to(2, 16); t1.detection$2$range(A._setArrayType([B.DetectType_1], t13), 20); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Scroll[s] of Item Detection", B.Color_179_74_4, 64); t1.depth$2$to(12, 40); t1.detection$1(A._setArrayType([B.DetectType_1], t13)); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Scroll[s] of Detect Nearby", B.Color_131_158_13, 36); t1.depth$2$to(12, 36); t1.detection$2$range(A._setArrayType([B.DetectType_0, B.DetectType_1], t13), 20); A.finishItem(); t1 = $._itemBuilder = A.ItemBuilder$("Scroll[s] of Detection", B.Color_110_32_13, 124); t1.depth$1(30); t1.detection$1(A._setArrayType([B.DetectType_0, B.DetectType_1], t13)); A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Scroll[s] of Sense Nearby Monsters", B.Color_64_163_229, 50); t13.depth$2$to(6, 19); t13.perception$1$distance(15); A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Scroll[s] of Sense Monsters", B.Color_15_130_148, 70); t13.depth$2$to(20, 39); t13.perception$1$distance(20); A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Scroll[s] of Perceive Monsters", B.Color_21_87_194, 100); t13.depth$2$to(40, 69); t13.perception$2$distance$duration(30, 50); A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Scroll[s] of Telepathy", B.Color_26_46_150, 150); t13.depth$1(70); t13.perception$1$distance(200); t13 = A.category(224, 20, _null); t13.tag$1("magic/scroll/mapping"); t13._frequency = 0.25; t13.toss$3$breakage$damage$range(75, 1, 3); t13._destroyChance.$indexSet(0, t4, 15); t13._fuel = 5; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Adventurer's Map", B.Color_0_64_39, 70); t13.depth$2$to(10, 50); t13.mapping$1(16); A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Explorer's Map", B.Color_22_117_38, 160); t13.depth$2$to(30, 70); t13.mapping$1(32); A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Cartographer's Map", B.Color_129_217_117, 240); t13.depth$2$to(50, 90); t13.mapping$1(64); A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Wizard's Map", B.Color_15_130_148, 360); t13.depth$1(70); t13.mapping$2$illuminate(200, true); t13 = A.category(189, _null, _null); t13.tag$1("magic/book/sorcery"); t13.toss$3$breakage$damage$range(25, 1, 3); t13._destroyChance.$indexSet(0, t4, 5); t13._fuel = 10; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$('Spellbook[s] "Elemental Primer"', B.Color_84_0_39, 100); t13.depth$1(1); t13._frequency = 0.05; t1 = type$.JSArray_String; B.JSArray_methods.addAll$1(t13._skills, new A.MappedListIterable(type$.List_String._as(A._setArrayType(["Sense Items", "Flee", "Escape", "Disappear", "Icicle", "Brilliant Beam", "Windstorm", "Fire Barrier", "Tidal Wave"], t1)), type$.Skill_Function_String._as(A.skills_Skills_find$closure()), type$.MappedListIterable_String_Skill)); A.rings(); A.weapons(); t13 = A.category(201, _null, _null); t13.tag$1("equipment/armor/helm"); t13._frequency = 0.5; t13.toss$3$breakage$damage$range(10, 3, 5); A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Leather Cap", B.Color_142_82_55, 50); t13.depth$2$to(4, 40); t13._weight = t13._armor = 2; t13._destroyChance.$indexSet(0, t4, 12); t13._fuel = 2; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Chainmail Coif", B.Color_38_42_66, 160); t13.depth$2$to(10, 60); t13._weight = t13._armor = 3; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Steel Cap", B.Color_63_75_115, 200); t13.depth$2$to(25, 80); t13._armor = 4; t13._weight = 3; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Visored Helm", B.Color_116_146_181, 350); t13.depth$1(40); t13._armor = 5; t13._weight = 6; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Great Helm", B.Color_226_223_240, 550); t13.depth$1(50); t13._armor = 6; t13._weight = 8; A.category(244, _null, _null).tag$1("equipment/armor/body/robe"); A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Robe", B.Color_21_87_194, 30); t13.depth$2$to(2, 40); t13._frequency = 0.5; t13._armor = 4; t13._weight = null; t13._destroyChance.$indexSet(0, t4, 15); t13._fuel = 8; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Fur-lined Robe", B.Color_0_64_39, 110); t13.depth$1(6); t13._frequency = 0.25; t13._armor = 6; t13._weight = null; t13._destroyChance.$indexSet(0, t4, 12); t13._fuel = 8; t13 = A.category(246, _null, _null); t13.tag$1(_s20_); t13._frequency = 0.5; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Cloth Shirt", B.Color_226_223_240, 20); t13.depth$2$to(2, 30); t13._armor = 3; t13._weight = null; t13._destroyChance.$indexSet(0, t4, 15); t13._fuel = 4; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Leather Shirt", B.Color_142_82_55, 90); t13.depth$2$to(5, 50); t13._armor = 6; t13._weight = 1; t13._destroyChance.$indexSet(0, t4, 12); t13._fuel = 4; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Jerkin", B.Color_116_146_181, 130); t13.depth$2$to(8, 70); t13._armor = 8; t13._weight = 1; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Leather Armor", B.Color_77_29_21, 240); t13.depth$2$to(12, 90); t13._armor = 11; t13._weight = 2; t13._destroyChance.$indexSet(0, t4, 10); t13._fuel = 4; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Padded Armor", B.Color_38_42_66, 320); t13.depth$1(16); t13._armor = 15; t13._weight = 3; t13._destroyChance.$indexSet(0, t4, 8); t13._fuel = 4; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Studded Armor", B.Color_63_75_115, 400); t13.depth$1(20); t13._armor = 22; t13._weight = 4; t13._destroyChance.$indexSet(0, t4, 6); t13._fuel = 4; t13 = A.category(242, _null, _null); t13.tag$1(_s20_); t13._frequency = 0.5; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Mail Hauberk", B.Color_38_42_66, 500); t13.depth$1(25); t13._armor = 28; t13._weight = 5; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Scale Mail", B.Color_116_146_181, 700); t13.depth$1(35); t13._armor = 36; t13._weight = 7; A.category(198, _null, _null).tag$1("equipment/armor/cloak"); A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Cloak", B.Color_26_46_150, 70); t13.depth$2$to(10, 40); t13._frequency = 0.5; t13._armor = 2; t13._weight = 1; t13._destroyChance.$indexSet(0, t4, 20); t13._fuel = 5; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Fur Cloak", B.Color_77_29_21, 140); t13.depth$2$to(20, 60); t13._frequency = 0.3; t13._armor = 4; t13._weight = 2; t13._destroyChance.$indexSet(0, t4, 16); t13._fuel = 5; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Spidersilk Cloak", B.Color_38_42_66, 460); t13.depth$1(40); t13._frequency = 0.2; t13._armor = 6; t13._weight = null; t13._destroyChance.$indexSet(0, t4, 25); t13._fuel = 3; t13 = A.category(197, _null, _null); t13.tag$1("equipment/armor/gloves"); t13._frequency = 0.5; t13.toss$3$breakage$damage$range(20, 5, 4); A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Pair[s] of Gloves", B.Color_189_144_108, 170); t13.depth$1(8); t13._armor = 1; t13._weight = null; t13._destroyChance.$indexSet(0, t4, 7); t13._fuel = 2; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Set[s] of Bracers", B.Color_77_29_21, 480); t13.depth$1(17); t13._armor = 2; t13._weight = 1; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Pair[s] of Gauntlets", B.Color_38_42_66, 800); t13.depth$1(34); t13._armor = 4; t13._weight = 2; t13 = A.category(230, _null, _null); t13.tag$1("equipment/armor/shield"); t13._frequency = 0.5; t13.toss$3$breakage$damage$range(10, 5, 8); A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Small Leather Shield", B.Color_77_29_21, 170); t13.depth$2$to(12, 50); t13._armor = 0; t13._weight = 2; t13._defense = new A.Defense(4, _s22_); t13._destroyChance.$indexSet(0, t4, 7); t13._fuel = 14; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Wooden Targe", B.Color_189_144_108, 250); t13.depth$1(25); t13._armor = 0; t13._weight = 4; t13._defense = new A.Defense(6, "The targe blocks {2}."); t13._destroyChance.$indexSet(0, t4, 14); t13._fuel = 20; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Large Leather Shield", B.Color_142_82_55, 320); t13.depth$1(35); t13._armor = 0; t13._weight = 5; t13._defense = new A.Defense(8, _s22_); t13._destroyChance.$indexSet(0, t4, 7); t13._fuel = 17; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Steel Buckler", B.Color_38_42_66, 450); t13.depth$1(50); t13._armor = 0; t13._weight = 4; t13._defense = new A.Defense(10, "The buckler blocks {2}."); A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Kite Shield", B.Color_116_146_181, 650); t13.depth$1(65); t13._armor = 0; t13._weight = 7; t13._defense = new A.Defense(12, _s22_); t13 = A.category(236, _null, _null); t13.tag$1(_s21_); t13._frequency = 0.3; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Pair[s] of Sandals", B.Color_142_82_55, 10); t13.depth$2$to(2, 20); t13._armor = 1; t13._weight = null; t13._destroyChance.$indexSet(0, t4, 20); t13._fuel = 3; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Pair[s] of Shoes", B.Color_77_29_21, 30); t13.depth$2$to(8, 40); t13._armor = 2; t13._weight = null; t13._destroyChance.$indexSet(0, t4, 14); t13._fuel = 3; t13 = A.category(196, _null, _null); t13.tag$1(_s21_); t13._frequency = 0.3; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Pair[s] of Boots", B.Color_142_82_55, 70); t13.depth$1(14); t13._armor = 6; t13._weight = 1; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Pair[s] of Plated Boots", B.Color_63_75_115, 250); t13.depth$1(22); t13._armor = 8; t13._weight = 2; A.finishItem(); t13 = $._itemBuilder = A.ItemBuilder$("Pair[s] of Greaves", B.Color_116_146_181, 350); t13.depth$1(47); t13._armor = 12; t13._weight = 3; A.finishItem(); A.gems(); A.healing(); A.teleportation(); t13 = A.family("a", "natural/bug/spider", _null, _s8_, _null, _null, _null); t13._vision = 4; t13._hearing = 2; t13._stain = $.$get$Tiles_spiderweb(); t13 = A.breed("little brown spider", 3, B.Color_142_82_55, 2, 30, _null, 0); t13._meander = 40; t13.attack$3(_s7_0, 5, t11); t13 = $.$get$collapseNewlines(); description = A.stringReplaceAllUnchecked("Seems harmless enough. What's that dripping from its pedipalps?", t13, _s1_); $._builder._description = description; t14 = A.breed("gray spider", 7, B.Color_63_75_115, 20, 30, _null, 0); t14._meander = 30; t14.attack$3(_s7_0, 5, t11); t14 = A.breed("spiderling", 9, B.Color_226_223_240, 14, 35, _null, 0); t14._meander = 50; t14.count$2(2, 7); t14.attack$3(_s7_0, 10, t11); t14 = A.breed("giant spider", 12, B.Color_26_46_150, 40, _null, _null, 0); t14._meander = 30; t14.attack$3(_s7_0, 7, t11); description = A.stringReplaceAllUnchecked("Like a large dog, if the dog had eight articulated legs, eight\n glittering eyes, and wanted nothing more than to kill you.", t13, _s1_); $._builder._description = description; t14 = A.family("b", "natural/animal/mammal/bat", _null, _null, _null, 1, _null); t14._vision = 2; t14._hearing = 8; t15 = t14._motility; t16 = $.$get$Motility_fly()._bitMask; t14._motility = new A.Motility(t15._bitMask | t16); t14._location = B.SpawnLocation_1; t14 = A.breed("brown bat", 1, B.Color_142_82_55, 4, _null, 0.5, 0); t14._meander = 50; B.JSArray_methods.add$1(t14._defenses, new A.Defense(20, _s25_)); t14.count$2(2, 4); t14.attack$2(_s7_0, 3); t14 = A.breed("giant bat", 4, B.Color_77_29_21, 24, _null, _null, 0); t14._meander = 30; t14.attack$2(_s7_0, 6); t14 = A.breed("cave bat", 6, B.Color_116_146_181, 30, _null, _null, 0); t14._meander = 40; B.JSArray_methods.add$1(t14._defenses, new A.Defense(20, _s25_)); t14.count$2(2, 5); t14.attack$2(_s7_0, 6); t14 = A.family("c", "natural/animal/mammal/canine", 25, _null, _null, _null, 20); t14._vision = 5; t14._hearing = 10; t14._meander = 25; t14 = A.breed("mangy cur", 2, B.Color_255_238_168, 11, _null, _null, 0); t14.count$1(4); t14.attack$2(_s7_0, 4); B.JSArray_methods.add$1(t14._moves, new A.HowlMove(6, _null, 10)); t14 = A.breed("wild dog", 4, B.Color_116_146_181, 20, _null, _null, 0); t14.count$1(4); t14.attack$2(_s7_0, 6); B.JSArray_methods.add$1(t14._moves, new A.HowlMove(8, _null, 10)); t14 = A.breed("mongrel", 7, B.Color_179_74_4, 28, _null, _null, 0); t14.count$2(2, 5); t14.attack$2(_s7_0, 8); B.JSArray_methods.add$1(t14._moves, new A.HowlMove(10, _null, 10)); t14 = A.breed("wolf", 26, B.Color_226_223_240, 60, _null, _null, 0); t14.count$2(3, 6); t14.attack$2(_s7_0, 12); B.JSArray_methods.add$1(t14._moves, new A.HowlMove(10, _null, 10)); t14 = A.breed("varg", 30, B.Color_63_75_115, 80, _null, _null, 0); t14.count$2(2, 6); t14.attack$2(_s7_0, 16); B.JSArray_methods.add$1(t14._moves, new A.HowlMove(10, _null, 10)); t14 = A.breed("Skoll", 36, B.Color_222_156_33, 200, _null, _null, 0); t14.unique$0(); t14._minion$3(new A._TagSpawn(_s6_0), 5, 9); t14.attack$2(_s7_0, 20); B.JSArray_methods.add$1(t14._moves, new A.HowlMove(10, _null, 10)); t14 = A.breed("Hati", 40, B.Color_21_87_194, 250, _null, _null, 0); t14.unique$0(); t14._minion$3(new A._TagSpawn(_s6_0), 5, 9); t14.attack$2(_s7_0, 23); B.JSArray_methods.add$1(t14._moves, new A.HowlMove(10, _null, 10)); t14 = A.breed("Fenrir", 44, B.Color_38_42_66, 300, _null, _null, 0); t14.unique$0(); t14._minion$3(new A._TagSpawn(_s6_0), 3, 5); t14.minionBreed$1("Skoll"); t14.minionBreed$1("Hati"); t14.attack$2(_s7_0, 26); B.JSArray_methods.add$1(t14._moves, new A.HowlMove(10, _null, 10)); A.dragons(); t14 = A.family("e", "magical/eye", _null, "immobile", _null, _null, _null); t14._vision = 16; t14._hearing = 1; B.JSArray_methods.add$1(t14._defenses, new A.Defense(10, "{1} blinks out of the way.")); t14._motility = new A.Motility(t14._motility._bitMask | t16); t14._location = B.SpawnLocation_1; t14 = A.breed("lazy eye", 5, B.Color_64_163_229, 20, _null, _null, 0); t14.attack$2(_s11_0, 8); t14._bolt$6$damage$range$rate(_s9_0, _s4_0, t8, 12, 8, 5); t14 = A.breed("mad eye", 9, B.Color_255_122_105, 40, _null, _null, 0); t14.attack$2(_s11_0, 8); t14.bolt$4$damage$range$rate(t7, 15, 8, 6); t14 = A.breed("floating eye", 15, B.Color_255_238_168, 60, _null, _null, 0); t14.attack$2(_s11_0, 10); t14._bolt$6$damage$range$rate(_s9_0, _s4_0, t8, 24, 6, 4); B.JSArray_methods.add$1(t14._moves, new A.TeleportMove(7, 10)); t14 = A.breed("baleful eye", 20, B.Color_179_74_4, 80, _null, _null, 0); t14.attack$2(_s12_, 12); t14.bolt$4$damage$range$rate(t4, 20, 8, 4); t14._bolt$6$damage$range$rate("the jet", _s8_0, t10, 20, 8, 4); B.JSArray_methods.add$1(t14._moves, new A.TeleportMove(9, 10)); t14 = A.breed("malevolent eye", 30, B.Color_204_35_57, 120, _null, _null, 0); t14.attack$2(_s12_, 20); t14.bolt$4$damage$range$rate(t6, 20, 10, 4); t14.bolt$4$damage$range$rate(t9, 20, 10, 4); t14.cone$4$damage$range$rate(t4, 30, _null, 7); B.JSArray_methods.add$1(t14._moves, new A.TeleportMove(9, 10)); t14 = A.breed("murderous eye", 40, B.Color_84_0_39, 180, _null, _null, 0); t14.attack$2(_s12_, 30); t14.bolt$4$damage$range$rate(t3, 40, 8, 7); t14._bolt$6$damage$range$rate(_s9_1, _s4_1, t2, 40, 8, 7); t14.cone$4$damage$range$rate(t5, 30, _null, 7); B.JSArray_methods.add$1(t14._moves, new A.TeleportMove(9, 10)); t14 = A.breed("watcher", 60, B.Color_116_146_181, 300, _null, _null, 0); t14.attack$2("see[s]", 50); t14.bolt$4$damage$range$rate(t6, 40, 10, 7); t14.cone$4$damage$range$rate(t6, 30, _null, 7); t14.bolt$4$damage$range$rate(t9, 50, 10, 7); t14.cone$4$damage$range$rate(t9, 40, _null, 7); t14 = A.family("f", "natural/animal/mammal/feline", _null, _null, _null, _null, _null); t14._vision = 10; t14._hearing = 8; t14 = A.breed("stray cat", 1, B.Color_222_156_33, 11, _null, _null, 1); t14._meander = 30; B.JSArray_methods.add$1(t14._moves, new A.MissiveMove(B.Missive_3, 4)); t14.attack$2(_s7_0, 5); t14.attack$2(_s11_1, 4); t14 = A.family("g", "humanoid/hob/goblin", _null, _null, _null, _null, _null); t14._vision = 8; t14._hearing = 4; t14._meander = 10; t15 = t14._motility; t17 = $.$get$Motility_door()._bitMask; t14._motility = new A.Motility(t15._bitMask | t17); t15 = A.breed("goblin peon", 4, B.Color_189_144_108, 30, _null, _null, 0); t15._meander = 20; t15.count$1(4); t15.attack$2(_s7_1, 8); B.JSArray_methods.add$1(t15._moves, new A.MissiveMove(B.Missive_1, 8)); t15.drop$2$percent(_s8_1, 20); t15.drop$2$percent(_s5_, 5); t15.drop$2$percent(_s7_2, 10); t15 = A.breed("goblin archer", 6, B.Color_22_117_38, 36, _null, _null, 0); t15.count$1(2); t15._minion$3(new A._TagSpawn(_s6_1), 0, 3); t15.attack$2(_s7_1, 4); t14 = $.$get$Element_none(); t15._bolt$6$damage$range$rate(_s9_2, _s4_1, t14, 8, 8, 3); t15.drop$2$percent(_s8_1, 30); t15.drop$2$percent("bow", 10); t15.drop$2$percent("dagger", 5); t15.drop$2$percent(_s7_2, 10); t15 = A.breed("goblin fighter", 6, B.Color_142_82_55, 58, _null, _null, 0); t15.count$1(2); t15._minion$3(new A._TagSpawn(_s6_1), 1, 4); t15.attack$2(_s7_1, 12); t15.drop$2$percent(_s8_1, 20); t15.drop$2$percent(_s5_, 10); t15.drop$2$percent(_s5_0, 10); t15.drop$2$percent(_s10_, 5); t15.drop$2$percent(_s7_2, 10); t15 = A.breed("goblin warrior", 8, B.Color_116_146_181, 68, _null, _null, 0); t15.count$1(2); t15._minion$3(new A._TagSpawn(_s6_1), 1, 5); t15.attack$2(_s7_1, 16); t15.drop$2$percent(_s8_1, 25); t15.drop$2$percent("axe", 10); t15.drop$2$percent(_s5_0, 10); t15.drop$2$percent(_s10_, 5); t15.drop$2$percent(_s7_2, 10); B.JSArray_methods.addAll$1(t15._flags, A._setArrayType(_s10_0.split(_s1_), t1)); t15 = A.breed("goblin mage", 9, B.Color_26_46_150, 50, _null, _null, 0); t15._minion$3(new A._TagSpawn(_s6_1), 1, 4); t15.attack$2("whip[s]", 7); t15.bolt$4$damage$range$rate(t4, 12, 8, 12); t15._bolt$6$damage$range$rate(_s9_0, _s4_0, t8, 16, 6, 12); t15.drop$2$percent(_s8_1, 20); t15.drop$2$percent(_s4_2, 10); t15.drop$2$percent(_s5_1, 30); t15 = A.breed("goblin ranger", 12, B.Color_0_64_39, 60, _null, _null, 0); t15._minion$3(new A._TagSpawn(_s6_1), 0, 5); t15.attack$2(_s7_1, 10); t15._bolt$6$damage$range$rate(_s9_2, _s4_1, t14, 12, 8, 3); t15.drop$2$percent(_s8_1, 20); t15.drop$2$percent("bow", 15); t15.drop$2$percent(_s5_0, 10); t15.drop$2$percent(_s5_1, 20); t15 = A.breed("Erlkonig, the Goblin Prince", 14, B.Color_38_42_66, 120, _null, _null, 0); t15.unique$1$pronoun(B.Pronoun_he_him_his); t15._minion$3(new A._TagSpawn(_s6_1), 4, 8); t15.attack$2(_s6_, 10); t15.attack$2(_s9_3, 14); t15.bolt$4$damage$range$rate(t9, 20, 10, 20); t15.drop$2$count(_s8_1, 3); t15.dropGood$3$count$depthOffset(_s9_4, 2, 4); t15.drop$3$count$depthOffset(_s5_1, 3, 4); B.JSArray_methods.addAll$1(t15._flags, A._setArrayType(_s10_0.split(_s1_), t1)); t15 = A.family("i", "bug", _null, _s8_, _null, _null, 3); t15._vision = 5; t15._hearing = 2; t15._meander = 40; t15 = A.breed("giant cockroach[es]", 1, B.Color_77_29_21, 4, _null, 0.4, 0); t15.count$2(2, 5); t15._location = B.SpawnLocation_3; t15.attack$2(_s11_2, 2); B.JSArray_methods.add$1(t15._moves, new A.SpawnMove(false, 4)); t15.drop$2$percent(_s11_, 30); description = A.stringReplaceAllUnchecked("It's not quite as easy to squash one of these when it's as long as\n your arm.", t13, _s1_); $._builder._description = description; t15 = A.breed("giant centipede", 3, B.Color_204_35_57, 14, _null, _null, 2); t15._meander = 20; t15.attack$2(_s11_2, 4); t15.attack$2(_s7_0, 8); t15 = A.family("i", "natural/bug/fly", _null, _s8_, _null, _null, 3); t15._vision = 5; t15._hearing = 2; t15._meander = 40; t15 = A.breed("firefly", 8, B.Color_179_74_4, 6, _null, _null, 1); t15._meander = 70; t15.count$2(3, 8); t15.attack$3(_s7_0, 12, t4); t15.drop$2$percent(_s11_, 40); t15 = A.family("j", "magical/jelly", _null, _s8_, 0.7, -1, _null); t15._vision = 3; t15._hearing = 1; t15._meander = 30; t15._location = B.SpawnLocation_2; t15.count$1(4); t15 = A.breed("green jelly", 1, B.Color_131_158_13, 5, _null, _null, 0); t18 = t15._stain = $.$get$Tiles_greenJellyStain(); t15.attack$2(_s11_2, 3); t15 = A.family("j", "jelly", _null, _s17_, 0.6, _null, _null); t15._vision = 2; t15._hearing = 1; t15._location = B.SpawnLocation_3; t15.count$1(4); t15 = A.breed("green slime", 2, B.Color_22_117_38, 8, _null, _null, 0); t15._stain = t18; t15.attack$2(_s11_2, 4); B.JSArray_methods.add$1(t15._moves, new A.SpawnMove(false, 4)); t15 = A.breed("frosty slime", 4, B.Color_226_223_240, 14, _null, _null, 0); t15._stain = $.$get$Tiles_whiteJellyStain(); t15.attack$3(_s11_2, 5, t5); B.JSArray_methods.add$1(t15._moves, new A.SpawnMove(false, 4)); t15 = A.breed("mud slime", 6, B.Color_142_82_55, 20, _null, _null, 0); t15._stain = $.$get$Tiles_brownJellyStain(); t15.attack$3(_s11_2, 8, t2); B.JSArray_methods.add$1(t15._moves, new A.SpawnMove(false, 4)); t15 = A.breed("smoking slime", 15, B.Color_204_35_57, 30, _null, _null, 0); t15._emanationLevel = 4; t15._stain = $.$get$Tiles_redJellyStain(); t15.attack$3(_s11_2, 10, t4); B.JSArray_methods.add$1(t15._moves, new A.SpawnMove(false, 4)); t15 = A.breed("sparkling slime", 20, B.Color_86_30_138, 40, _null, _null, 0); t15._emanationLevel = 3; t15._stain = $.$get$Tiles_violetJellyStain(); t15.attack$3(_s11_2, 12, t8); B.JSArray_methods.add$1(t15._moves, new A.SpawnMove(false, 4)); t15 = A.breed("caustic slime", 25, B.Color_129_217_117, 50, _null, _null, 0); t15._stain = t18; t15.attack$3(_s11_2, 13, t3); B.JSArray_methods.add$1(t15._moves, new A.SpawnMove(false, 4)); t15 = A.breed("virulent slime", 35, B.Color_0_64_39, 60, _null, _null, 0); t15._stain = t18; t15.attack$3(_s11_2, 14, t11); B.JSArray_methods.add$1(t15._moves, new A.SpawnMove(false, 4)); t15 = A.breed("ectoplasm", 45, B.Color_38_42_66, 40, _null, _null, 0); t15._stain = $.$get$Tiles_grayJellyStain(); t15.attack$3(_s11_2, 15, t12); B.JSArray_methods.add$1(t15._moves, new A.SpawnMove(false, 4)); t15 = A.family("k", "humanoid/hob/kobold", _null, _s8_2, _null, _null, _null); t15._vision = 10; t15._hearing = 4; t15._meander = 15; t15 = A.breed("scurrilous imp", 1, B.Color_255_122_105, 12, _null, _null, 0); t15._meander = 20; t15.count$1(2); t15.attack$2("club[s]", 4); B.JSArray_methods.add$1(t15._moves, new A.MissiveMove(B.Missive_1, 5)); t15.haste$0(); t15.drop$2$percent(_s8_1, 20); t15.drop$2$percent(_s4_3, 10); t15.drop$2$percent("speed", 20); t15 = A.breed("vexing imp", 2, B.Color_86_30_138, 16, _null, _null, 0); t15.count$1(2); t15._minion$3(new A._TagSpawn(_s6_2), 0, 1); t15.attack$2(_s11_1, 4); B.JSArray_methods.add$1(t15._moves, new A.MissiveMove(B.Missive_1, 5)); t15._bolt$6$damage$range$rate(_s9_0, _s4_0, t8, 6, 6, 5); t15.drop$2$percent(_s8_1, 25); t15.drop$2$percent("teleportation", 20); A.family("k", _s6_2, _null, _null, _null, _null, _null)._meander = 20; t15 = A.breed(_s6_2, 3, B.Color_204_35_57, 20, _null, _null, 0); t15.count$1(3); t15._minion$3(new A._TagSpawn(_s6_0), 0, 3); t15.attack$2(_s7_3, 4); B.JSArray_methods.add$1(t15._moves, new A.TeleportMove(6, 10)); t15.drop$2$percent(_s8_1, 25); t15.drop$2$percent(_s9_4, 10); t15.drop$2$percent(_s5_1, 20); t15 = A.breed("kobold shaman", 4, B.Color_26_46_150, 20, _null, _null, 0); t15.count$1(2); t15._minion$3(new A._TagSpawn(_s6_0), 0, 3); t15.attack$2(_s6_, 4); t15._bolt$6$damage$range$rate("the jet", _s8_0, t10, 8, 8, 10); t15.drop$2$percent(_s8_1, 25); t15.drop$2$percent(_s4_2, 10); t15.drop$2$percent(_s5_1, 20); t15 = A.breed("kobold trickster", 5, B.Color_222_156_33, 24, _null, _null, 0); t15.attack$2(_s6_, 5); t18 = t15._moves; B.JSArray_methods.add$1(t18, new A.MissiveMove(B.Missive_1, 5)); t15._bolt$6$damage$range$rate(_s9_0, _s4_0, t8, 8, 6, 5); B.JSArray_methods.add$1(t18, new A.TeleportMove(6, 7)); t15.haste$1$rate(7); t15.drop$2$percent(_s8_1, 35); t15.drop$2$percent(_s5_1, 20); t15 = A.breed("kobold priest", 6, B.Color_21_87_194, 30, _null, _null, 0); t15.count$1(2); t15._minion$3(new A._TagSpawn(_s6_2), 1, 3); t15.attack$2("club[s]", 6); B.JSArray_methods.add$1(t15._moves, new A.HealMove(10, 15)); t15.haste$1$rate(7); t15.drop$2$percent(_s8_1, 20); t15.drop$2$percent(_s4_3, 10); t15.drop$2$percent(_s4_2, 10); t15.drop$2$percent(_s5_1, 30); t15 = A.breed("imp incanter", 7, B.Color_173_88_219, 33, _null, _null, 0); t15.count$1(2); t15._minion$3(new A._TagSpawn(_s6_2), 1, 3); t15._minion$3(new A._TagSpawn(_s6_0), 0, 3); t15.attack$2(_s11_1, 4); B.JSArray_methods.add$1(t15._moves, new A.MissiveMove(B.Missive_1, 6)); t15._bolt$6$damage$range$rate(_s9_0, _s4_0, t8, 10, 6, 5); t15.drop$2$percent(_s8_1, 30); t15.drop$2$percent(_s4_2, 10); t15.drop$2$percent(_s5_1, 35); B.JSArray_methods.addAll$1(t15._flags, A._setArrayType(_s8_2.split(_s1_), t1)); t15 = A.breed("imp warlock", 8, B.Color_56_16_125, 46, _null, _null, 0); t15._minion$3(new A._TagSpawn(_s6_2), 2, 5); t15._minion$3(new A._TagSpawn(_s6_0), 0, 3); t15.attack$2(_s7_1, 5); t15._bolt$6$damage$range$rate("the ice", "freezes", t5, 12, 8, 8); t15._bolt$6$damage$range$rate(_s9_0, _s4_0, t8, 12, 6, 8); t15.drop$2$percent(_s8_1, 30); t15.drop$2$percent("staff", 20); t15.drop$2$percent(_s4_2, 10); t15.drop$2$percent(_s5_1, 30); t15 = A.breed("Feng", 10, B.Color_179_74_4, 80, _null, _null, 1); t15._meander = 10; t15.unique$1$pronoun(B.Pronoun_he_him_his); t15._minion$3(new A._TagSpawn(_s6_2), 4, 10); t15._minion$3(new A._TagSpawn(_s6_0), 1, 3); t15.attack$2(_s7_1, 5); t18 = t15._moves; B.JSArray_methods.add$1(t18, new A.MissiveMove(B.Missive_1, 7)); B.JSArray_methods.add$1(t18, new A.TeleportMove(6, 5)); B.JSArray_methods.add$1(t18, new A.TeleportMove(30, 50)); t15.cone$4$damage$range$rate(t8, 12, _null, 8); t15.drop$3$count$depthOffset(_s8_1, 3, 5); t15.dropGood$3$depthOffset$percent(_s5_, 5, 20); t15.dropGood$3$depthOffset$percent(_s5_0, 5, 30); t15.drop$3$count$depthOffset(_s5_1, 2, 5); t15 = A.family("l", "humanoid/saurian", _null, _s8_, _null, _null, _null); t15._vision = 10; t15._hearing = 5; t15._meander = 10; B.JSArray_methods.add$1(t15._defenses, new A.Defense(5, "{2} [are|is] deflected by its scales.")); t15 = A.breed("lizard guard", 11, B.Color_222_156_33, 26, _null, _null, 0); t15.attack$2(_s7_4, 8); t15.attack$2(_s7_0, 10); t15.drop$2$percent(_s8_1, 30); t15.drop$2$percent(_s5_0, 10); t15.drop$2$percent(_s5_, 10); t15 = A.breed("lizard protector", 15, B.Color_131_158_13, 30, _null, _null, 0); t15._minion$3(new A._TagSpawn(_s7_5), 0, 2); t15.attack$2(_s7_4, 10); t15.attack$2(_s7_0, 14); t15.drop$2$percent(_s8_1, 30); t15.drop$2$percent(_s5_0, 10); t15.drop$2$percent(_s5_, 10); t15 = A.breed("armored lizard", 17, B.Color_116_146_181, 38, _null, _null, 0); t15._minion$3(new A._TagSpawn(_s7_5), 0, 2); t15.attack$2(_s7_4, 10); t15.attack$2(_s7_0, 15); t15.drop$2$percent(_s8_1, 30); t15.drop$2$percent(_s5_0, 20); t15.drop$2$percent(_s5_, 10); t15 = A.breed("scaled guardian", 19, B.Color_38_42_66, 50, _null, _null, 0); t15._minion$3(new A._TagSpawn(_s7_5), 0, 3); t15._minion$3(new A._TagSpawn(_s10_1), 0, 2); t15.attack$2(_s7_4, 10); t15.attack$2(_s7_0, 15); t15.drop$2$percent(_s8_1, 40); t15.drop$2$percent(_s9_4, 10); t15 = A.breed(_s7_5, 21, B.Color_179_74_4, 64, _null, _null, 0); t15._minion$3(new A._TagSpawn(_s7_5), 1, 4); t15._minion$3(new A._TagSpawn(_s10_1), 0, 2); t15.attack$2(_s7_4, 12); t15.attack$2(_s7_0, 17); t15.drop$2$percent(_s8_1, 50); t15.drop$2$percent(_s9_4, 10); t15 = A.family("o", "humanoid/orcus/orc", _null, _null, _null, _null, _null); t15._vision = 7; t15._hearing = 6; t15._meander = 10; t15._motility = new A.Motility(t15._motility._bitMask | t17); B.JSArray_methods.addAll$1(t15._flags, A._setArrayType(_s10_0.split(_s1_), t1)); t15 = A.breed("orc", 28, B.Color_179_74_4, 100, _null, _null, 0); t15.count$2(3, 6); t15.attack$2(_s7_1, 12); t15.drop$2$percent(_s8_1, 20); t15.drop$2$percent(_s9_4, 5); t15.drop$2$percent(_s5_, 5); t15 = A.breed("orc brute", 29, B.Color_129_217_117, 120, _null, _null, 0); t15._minion$3(new A._TagSpawn("orc"), 2, 5); t15.attack$2("bash[es]", 16); t15.drop$2$percent(_s8_1, 20); t15.drop$2$percent(_s4_3, 10); t15.drop$2$percent(_s5_0, 10); t15 = A.breed("orc soldier", 30, B.Color_116_146_181, 140, _null, _null, 0); t15.count$2(4, 6); t15._minion$3(new A._TagSpawn("orcus"), 1, 5); t15.attack$2(_s7_1, 20); t15.drop$2$percent(_s8_1, 25); t15.drop$2$percent("axe", 10); t15.drop$2$percent(_s5_0, 10); t15 = A.breed("orc chieftain", 31, B.Color_204_35_57, 180, _null, _null, 0); t15._minion$3(new A._TagSpawn("orcus"), 2, 10); t15.attack$2(_s7_1, 10); t15.drop$3$count$percent(_s8_1, 2, 40); t15.drop$2$percent(_s9_4, 20); t15.drop$2$percent(_s4_, 20); t15 = A.family("p", "humanoid/human", _null, _null, _null, _null, 14); t15._vision = 10; t15._hearing = 5; t15._meander = 10; t15._motility = new A.Motility(t15._motility._bitMask | t17); t15._emanationLevel = 2; t15 = A.breed("Harold the Misfortunate", 1, B.Color_173_88_219, 30, _null, _null, 0); t15.unique$1$pronoun(B.Pronoun_he_him_his); t15.attack$2(_s6_, 3); B.JSArray_methods.add$1(t15._moves, new A.MissiveMove(B.Missive_0, 5)); t15.drop$2$percent(_s8_1, 80); t15.drop$3$depthOffset$percent(_s6_3, 4, 20); t15.drop$3$depthOffset$percent(_s5_0, 4, 30); t15.drop$3$depthOffset$percent(_s5_1, 4, 40); t15 = A.breed("hapless adventurer", 1, B.Color_255_238_168, 14, 15, _null, 0); t15._meander = 30; t15.attack$2(_s6_, 3); B.JSArray_methods.add$1(t15._moves, new A.MissiveMove(B.Missive_0, 12)); t15.drop$2$percent(_s8_1, 15); t15.drop$2$percent(_s6_3, 10); t15.drop$2$percent(_s5_0, 15); t15.drop$2$percent(_s5_1, 20); B.JSArray_methods.addAll$1(t15._flags, A._setArrayType(_s8_2.split(_s1_), t1)); t15 = A.breed("simpering knave", 2, B.Color_179_74_4, 17, _null, _null, 0); t15.attack$2(_s6_, 2); t15.attack$2(_s7_1, 4); t15.drop$2$percent(_s8_1, 20); t15.drop$2$percent("whip", 10); t15.drop$2$percent(_s5_0, 15); t15.drop$2$percent(_s5_1, 20); B.JSArray_methods.addAll$1(t15._flags, A._setArrayType(_s8_2.split(_s1_), t1)); t15 = A.breed("decrepit mage", 3, B.Color_86_30_138, 20, _null, _null, 0); t15._meander = 30; t15.attack$2(_s6_, 2); t15._bolt$6$damage$range$rate(_s9_0, _s4_0, t8, 8, 6, 10); t15.drop$2$percent(_s8_1, 15); t15.drop$2$percent(_s5_1, 30); t15.drop$2$percent("dagger", 5); t15.drop$2$percent("staff", 5); t15.drop$2$percent(_s4_2, 10); t15.drop$2$percent("boots", 5); t15 = A.breed("unlucky ranger", 5, B.Color_22_117_38, 30, 25, _null, 0); t15._meander = 20; t15.attack$2(_s9_3, 2); t15._bolt$6$damage$range$rate(_s9_2, _s4_1, t14, 2, 8, 4); B.JSArray_methods.add$1(t15._moves, new A.MissiveMove(B.Missive_0, 10)); t15.drop$2$percent(_s8_1, 20); t15.drop$2$percent("potion", 20); t15.drop$2$percent("bow", 10); t15.drop$2$percent("body", 20); t15 = A.breed("drunken priest", 5, B.Color_21_87_194, 34, _null, _null, 0); t15._meander = 40; t15.attack$2(_s6_, 8); t14 = t15._moves; B.JSArray_methods.add$1(t14, new A.HealMove(8, 15)); B.JSArray_methods.add$1(t14, new A.MissiveMove(B.Missive_0, 5)); t15.drop$2$percent(_s8_1, 35); t15.drop$2$percent("scroll", 20); t15.drop$2$percent(_s4_3, 10); t15.drop$2$percent(_s4_2, 10); B.JSArray_methods.addAll$1(t15._flags, A._setArrayType(_s8_.split(_s1_), t1)); t15 = A.family("r", "natural/animal/mammal/rodent", 30, _null, _null, _null, _null); t15._vision = 4; t15._hearing = 6; t15._meander = 30; t15._location = B.SpawnLocation_2; t15 = A.breed("[mouse|mice]", 1, B.Color_189_144_108, 3, _null, 0.7, 0); t15.count$1(6); t15.attack$2(_s7_0, 3); t15.attack$2(_s11_1, 2); t15 = A.breed("sewer rat", 2, B.Color_63_75_115, 8, _null, _null, 0); t15._meander = 20; t15.count$1(4); t15.attack$2(_s7_0, 4); t15.attack$2(_s11_1, 3); t15 = A.breed("sickly rat", 3, B.Color_22_117_38, 10, _null, _null, 0); t15.attack$3(_s7_0, 8, t11); t15.attack$2(_s11_1, 4); t15 = A.breed("plague rat", 6, B.Color_131_158_13, 20, _null, _null, 0); t15.count$1(4); t15.attack$3(_s7_0, 15, t11); t15.attack$2(_s11_1, 8); t15 = A.breed("giant rat", 8, B.Color_179_74_4, 40, _null, _null, 0); t15.attack$2(_s7_0, 12); t15.attack$2(_s11_1, 8); t15 = A.breed("The Rat King", 8, B.Color_84_0_39, 120, _null, _null, 0); t15.unique$1$pronoun(B.Pronoun_he_him_his); t15.attack$2(_s7_0, 16); t15.attack$2(_s11_1, 10); t15._minion$3(new A._TagSpawn("rodent"), 8, 16); t15.drop$2$count(_s8_1, 3); t15.dropGood$3$depthOffset$percent(_s4_, 10, 50); t15 = A.family("s", "natural/bug/slug", 5, _s8_, _null, -3, 2); t15._vision = 3; t15._hearing = 1; t15._meander = 30; A.breed("giant slug", 3, B.Color_99_87_7, 20, _null, _null, 0).attack$2(_s11_2, 8); A.breed("suppurating slug", 6, B.Color_131_158_13, 50, _null, _null, 0).attack$3(_s11_2, 12, t11); A.breed("acidic slug", 9, B.Color_99_87_7, 70, _null, _null, 0).attack$3(_s11_2, 16, t3); t15 = A.family("v", "natural/plant/vine", _null, _s17_, _null, _null, _null); t15._hearing = t15._vision = 10; A.breed("choker", 16, B.Color_22_117_38, 40, _null, _null, 0).attack$2(_s8_3, 12); t15 = A.breed("nightshade", 19, B.Color_173_88_219, 50, _null, _null, 0); t15.whip$2$damage$rate(10, 3); t15.attack$3("touch[es]", 12, t11); t15 = A.breed("creeper", 22, B.Color_131_158_13, 60, _null, _null, 0); B.JSArray_methods.add$1(t15._moves, new A.SpawnMove(true, 10)); t15.whip$2$damage$rate(10, 3); t15.attack$2(_s8_3, 8); A.breed("strangler", 26, B.Color_0_64_39, 80, _null, _null, 0).attack$2(_s8_3, 14); t14 = A.family("w", _s16_0, 15, _s8_, _null, _null, _null); t14._vision = 2; t14._hearing = 3; t14._meander = 40; t14 = A.breed("blood worm", 1, B.Color_84_0_39, 4, _null, 0.5, 0); t14.count$2(3, 7); t14.attack$2(_s11_2, 5); t14 = A.breed("fire worm", 10, B.Color_179_74_4, 6, _null, _null, 0); t14.count$2(2, 6); t14._location = B.SpawnLocation_2; t14.attack$3(_s11_2, 5, t4); A.family("w", _s16_0, 10, _s8_, _null, _null, _null)._meander = 30; A.breed("giant earthworm", 3, B.Color_255_122_105, 30, _null, _null, -2).attack$2(_s11_2, 5); A.breed("giant cave worm", 7, B.Color_189_144_108, 80, _null, _null, -2).attack$3(_s11_2, 12, t3); t14 = A.family("x", "undead/skeleton", _null, _null, _null, _null, _null); t14._hearing = t14._vision = 4; t14._meander = 30; t14 = A.breed(_s9_5, 3, B.Color_63_75_115, 18, _null, 3, -1); t14._meander = 40; t14.attack$2(_s7_4, 6); t14 = A.breed(_s8_4, 4, B.Color_116_146_181, 26, _null, 4, 0); t14._meander = 40; t14.attack$2(_s7_4, 8); t14 = A.breed(_s13_, 7, B.Color_189_144_108, 33, _null, 3, -2); t14._meander = 40; t14.attack$2(_s7_0, 10); t14 = A.breed(_s20_0, 10, B.Color_255_238_168, 44, _null, 4, 0); t14._hearing = t14._vision = 0; t14._meander = 60; t14._motility = new A.Motility(t14._motility._bitMask | t17); t14.attack$2(_s7_4, 7); t14.drop$2$percent(_s8_1, 30); t14.drop$2$percent(_s6_3, 10); t14.drop$2$percent(_s5_0, 10); t14 = A.breed(_s16_1, 12, B.Color_129_217_117, 50, _null, 4, 0); t14.attack$2(_s7_0, 9); t14.attack$2("kick[s]", 7); t14.drop$2$percent(_s8_1, 30); t14.drop$2$percent(_s5_0, 10); t14 = A.breed(_s18_, 13, B.Color_131_158_13, 60, _null, 5, 0); t14._motility = new A.Motility(t14._motility._bitMask | t17); t14.attack$2(_s7_4, 7); t15 = t14._moves; B.JSArray_methods.add$1(t15, new A.AmputateMove(A.BreedRef$(_s16_1), A.BreedRef$(_s8_4), _s20_1, 1)); B.JSArray_methods.add$1(t15, new A.AmputateMove(A.BreedRef$(_s16_1), A.BreedRef$(_s9_5), _s21_0, 1)); t14.drop$2$percent(_s8_1, 30); t14.drop$2$percent(_s6_3, 5); t14.drop$2$percent(_s5_0, 10); t14 = A.breed("skeleton", 15, B.Color_226_223_240, 70, _null, 6, 0); t14._motility = new A.Motility(t14._motility._bitMask | t17); t14.attack$2(_s7_4, 7); t14.attack$2(_s7_0, 9); t15 = t14._moves; B.JSArray_methods.add$1(t15, new A.AmputateMove(A.BreedRef$(_s20_0), A.BreedRef$(_s13_), _s20_2, 1)); B.JSArray_methods.add$1(t15, new A.AmputateMove(A.BreedRef$(_s18_), A.BreedRef$(_s8_4), _s20_1, 1)); B.JSArray_methods.add$1(t15, new A.AmputateMove(A.BreedRef$(_s18_), A.BreedRef$(_s9_5), _s21_0, 1)); t14.drop$2$percent(_s8_1, 40); t14.drop$2$percent(_s6_3, 10); t14.drop$2$percent(_s5_0, 10); t14 = A.breed("skeleton warrior", 17, B.Color_255_122_105, 90, _null, 6, 0); t14._motility = new A.Motility(t14._motility._bitMask | t17); t14.attack$2(_s9_3, 13); t14.attack$2(_s7_1, 10); t15 = t14._moves; B.JSArray_methods.add$1(t15, new A.AmputateMove(A.BreedRef$(_s20_0), A.BreedRef$(_s13_), _s20_2, 1)); B.JSArray_methods.add$1(t15, new A.AmputateMove(A.BreedRef$(_s18_), A.BreedRef$(_s8_4), _s20_1, 1)); B.JSArray_methods.add$1(t15, new A.AmputateMove(A.BreedRef$(_s18_), A.BreedRef$(_s9_5), _s21_0, 1)); t14.drop$2$percent(_s8_1, 50); t14.drop$2$percent(_s6_3, 20); t14.drop$2$percent(_s5_0, 15); t14 = A.breed("robed skeleton", 19, B.Color_173_88_219, 110, _null, 4, 0); t14._motility = new A.Motility(t14._motility._bitMask | t17); t14.attack$2(_s9_3, 13); t14.attack$2(_s7_1, 10); t14.bolt$4$damage$range$rate(t8, 15, 10, 8); t15 = t14._moves; B.JSArray_methods.add$1(t15, new A.AmputateMove(A.BreedRef$(_s20_0), A.BreedRef$(_s13_), _s20_2, 1)); B.JSArray_methods.add$1(t15, new A.AmputateMove(A.BreedRef$(_s18_), A.BreedRef$(_s8_4), _s20_1, 1)); B.JSArray_methods.add$1(t15, new A.AmputateMove(A.BreedRef$(_s18_), A.BreedRef$(_s9_5), _s21_0, 1)); t14.drop$2$percent(_s8_1, 50); t14.drop$2$percent(_s5_1, 20); t14.drop$2$percent(_s5_0, 10); t14 = A.family("B", "natural/animal/bird", _null, _null, _null, _null, _null); t14._vision = 8; t14._hearing = 6; B.JSArray_methods.add$1(t14._defenses, new A.Defense(10, "{1} flaps out of the way.")); t14._motility = new A.Motility(t14._motility._bitMask | t16); t14.count$2(3, 6); t14 = A.breed("crow", 4, B.Color_38_42_66, 10, _null, _null, 2); t14._meander = 30; t14.attack$2(_s7_0, 5); t14.drop$2$percent(_s7_, 30); description = A.stringReplaceAllUnchecked('"What harm can a stupid little crow do?" you think as it and its\n murderous friends dive towards your eyes, claws extended.', t13, _s1_); $._builder._description = description; t14 = A.breed("raven", 6, B.Color_63_75_115, 16, _null, _null, 0); t14._meander = 15; t14.attack$2(_s7_0, 5); t14.attack$2(_s7_4, 4); t14.drop$2$percent(_s7_, 30); B.JSArray_methods.addAll$1(t14._flags, A._setArrayType(_s10_0.split(_s1_), t1)); description = A.stringReplaceAllUnchecked("Its black eyes gleam with a malevolent intelligence.", t13, _s1_); $._builder._description = description; A.greaterDragons(); t13 = A.family("F", "humanoid/hob/fae", _null, _s8_2, _null, 2, _null); t13._vision = 10; t13._hearing = 8; t13._meander = 30; B.JSArray_methods.add$1(t13._defenses, new A.Defense(10, _s25_)); t13._motility = new A.Motility(t13._motility._bitMask | t16); t13._location = B.SpawnLocation_1; t13 = A.breed("forest sprite", 2, B.Color_129_217_117, 6, _null, _null, 0); t13.attack$2(_s11_1, 3); B.JSArray_methods.add$1(t13._moves, new A.MissiveMove(B.Missive_1, 4)); t13._bolt$6$damage$range$rate(_s9_0, _s4_0, t8, 4, 6, 12); t13.drop$2$percent(_s8_1, 10); t13.drop$2$percent(_s5_1, 30); t13.drop$2$percent(_s11_, 30); t13 = A.breed("house sprite", 5, B.Color_64_163_229, 10, _null, _null, 0); t13.attack$2(_s7_3, 5); t14 = t13._moves; B.JSArray_methods.add$1(t14, new A.MissiveMove(B.Missive_1, 4)); t13._bolt$6$damage$range$rate(_s9_1, _s4_1, t2, 4, 8, 10); B.JSArray_methods.add$1(t14, new A.TeleportMove(4, 8)); t13.drop$2$percent(_s8_1, 10); t13.drop$2$percent(_s5_1, 30); t13.drop$2$percent(_s11_, 30); t13 = A.breed("mischievous sprite", 7, B.Color_255_122_105, 24, _null, _null, 0); t13.attack$2(_s7_3, 6); t14 = t13._moves; B.JSArray_methods.add$1(t14, new A.MissiveMove(B.Missive_1, 4)); t13.bolt$4$damage$range$rate(t7, 8, 8, 10); B.JSArray_methods.add$1(t14, new A.TeleportMove(5, 10)); t13.drop$2$percent(_s8_1, 10); t13.drop$2$percent(_s5_1, 30); t13.drop$2$percent(_s11_, 30); t13 = A.breed("Tink", 8, B.Color_22_117_38, 40, _null, _null, 0); t13.unique$1$pronoun(B.Pronoun_she_her_her); t13._meander = 10; t13.attack$2(_s7_3, 8); t14 = t13._moves; B.JSArray_methods.add$1(t14, new A.MissiveMove(B.Missive_1, 4)); t13._bolt$6$damage$range$rate(_s9_0, _s4_0, t8, 4, 6, 8); t13.bolt$4$damage$range$rate(t7, 7, 8, 10); B.JSArray_methods.add$1(t14, new A.TeleportMove(5, 10)); t13.drop$2$count(_s8_1, 2); t13.drop$3$count$depthOffset(_s5_1, 3, 3); t13 = A.family("H", "mythical/beast/hybrid", _null, _null, _null, _null, _null); t13._vision = 10; t13._hearing = 12; t13 = A.breed("harpy", 25, B.Color_173_88_219, 50, _null, _null, 2); t13._motility = new A.Motility(t13._motility._bitMask | t16); t13.count$2(2, 5); t13.attack$2(_s7_0, 10); t13.attack$2(_s11_1, 15); t16 = t13._moves; B.JSArray_methods.add$1(t16, new A.HowlMove(10, "screeches", 10)); B.JSArray_methods.add$1(t16, new A.MissiveMove(B.Missive_2, 5)); t13.drop$2$percent(_s7_, 50); t13 = A.breed("griffin", 35, B.Color_222_156_33, 200, _null, _null, 0); t13.attack$2(_s7_0, 20); t13.attack$2(_s11_1, 15); t13.drop$2$percent(_s7_, 50); A.family("Q", "magical", _null, _null, _null, _null, _null); t13 = A.breed("Nameless Unmaker", 100, B.Color_86_30_138, _1000, _null, _null, 2); t13.unique$1$pronoun(B.Pronoun_it_it_its); t13._hearing = t13._vision = 16; t13.attack$3("crushe[s]", 250, t2); t13.attack$3("blast[s]", 200, t8); t13.cone$4$damage$range$rate(t9, 500, _null, 10); B.JSArray_methods.addAll$1(t13._flags, A._setArrayType(_s8_.split(_s1_), t1)); t13._motility = new A.Motility(t13._motility._bitMask | t17); drop = A.repeatDrop(20, new A._PercentDrop(100, A.parseDrop(_s4_, t13._depth, B.ItemQuality_2))); B.JSArray_methods.add$1(t13._drops, drop); A.family("R", "natural/animal/herp", _null, _null, _null, _null, _null); t1 = A.breed("frog", 1, B.Color_131_158_13, 4, 30, _null, 0); t1._vision = 6; t1._hearing = 4; t1._meander = 30; t1._motility = new A.Motility(t1._motility._bitMask | $.$get$Motility_swim()._bitMask); t1.attack$2("hop[s] on", 2); t1 = A.family("R", "natural/animal/herp/salamander", 30, _null, _null, _null, _null); t1._vision = 6; t1._hearing = 5; t1._meander = 20; t1._location = B.SpawnLocation_1; t1._emanationLevel = 3; t1 = A.breed("juvenile salamander", 7, B.Color_255_122_105, 20, _null, _null, 0); t1.attack$3(_s7_0, 14, t4); t1.cone$4$damage$range$rate(t4, 20, 4, 16); t1 = A.breed(_s10_1, 13, B.Color_204_35_57, 30, _null, _null, 0); t1.attack$3(_s7_0, 18, t4); t1.cone$4$damage$range$rate(t4, 30, 5, 16); t1 = A.breed("three-headed salamander", 23, B.Color_84_0_39, 90, _null, _null, 0); t1.attack$3(_s7_0, 24, t4); t1.cone$4$damage$range$rate(t4, 20, 5, 10); t1 = A.family("S", "natural/animal/herp/snake", 30, _null, _null, _null, _null); t1._vision = 4; t1._hearing = 7; t1._meander = 30; A.breed("water snake", 1, B.Color_131_158_13, 11, _null, _null, 0).attack$2(_s7_0, 3); A.breed("brown snake", 3, B.Color_142_82_55, 25, _null, _null, 0).attack$2(_s7_0, 4); A.breed("cave snake", 8, B.Color_116_146_181, 40, _null, _null, 0).attack$2(_s7_0, 10); A.finishBreed(); A.BreedRef_resolve($.$get$Monsters_breeds().get$find()); A.finishAffix(); $._affixTag = "body"; t1 = A.affix(_s7_6, 1); t1.depth$1(40); t1.parameter$3$boostOneIn$max(2, 4, 3); t1.price$2(400, 2); t1.weight$1(-2); t13 = type$.int_Function_int; t13._as(A.builder___intIdentity$closure()); t1._armorBonus = A.builder___intIdentity$closure(); t1.resist$1(t6); t1 = A.affix(_s12_0, 0.3); t1.depth$1(60); t1.parameter$3$boostOneIn$max(4, 4, 6); t1.price$2(600, 3); t1.weight$1(-3); t1._armorBonus = A.builder___intIdentity$closure(); t14 = type$.int; t1._statBonuses.$indexSet(0, B.Stat_Agility_1_agility, t13._as(A.fixed(1, t14))); t1.resist$1(t7); t1.resist$1(t6); A.finishAffix(); $._affixTag = "cloak"; t1 = A.affix(_s7_6, 1); t1.depth$2$to(40, 80); t1.parameter$3$boostOneIn$max(4, 4, 6); t1.price$2(300, 2); t1.weight$1(-1); t1._armorBonus = A.builder___intIdentity$closure(); t1.resist$1(t6); t1 = A.affix(_s12_0, 0.3); t1.depth$1(60); t1.parameter$3$boostOneIn$max(5, 4, 8); t1.price$2(500, 3); t1.weight$1(-2); t1._armorBonus = A.builder___intIdentity$closure(); t1._statBonuses.$indexSet(0, B.Stat_Agility_1_agility, t13._as(A.fixed(2, t14))); t1.resist$1(t7); t1.resist$1(t6); A.finishAffix(); $._affixTag = "boots"; t1 = A.affix(_s7_6, 1); t1.depth$1(50); t1.parameter$3$boostOneIn$max(2, 4, 5); t1.price$2(400, 2.5); t1.weight$1(-2); t1._armorBonus = A.builder___intIdentity$closure(); A.finishAffix(); $._affixTag = "helm"; t1 = A.affix(_s7_6, 1); t1.depth$2$to(40, 80); t1.parameter$3$boostOneIn$max(1, 4, 3); t1.price$2(400, 2); t1.weight$1(-1); t1._armorBonus = A.builder___intIdentity$closure(); t1._statBonuses.$indexSet(0, B.Stat_Intellect_3_intellect, t13._as(A.fixed(1, t14))); t1.resist$1(t6); t1 = A.affix(_s12_0, 0.3); t1.depth$1(60); t1.parameter$2$boostOneIn(2, 4); t1.price$2(600, 3); t1.weight$1(-1); t1._armorBonus = A.builder___intIdentity$closure(); t1._statBonuses.$indexSet(0, B.Stat_Intellect_3_intellect, A.builder___intIdentity$closure()); t1.resist$1(t7); t1.resist$1(t6); A.finishAffix(); $._affixTag = "shield"; t1 = A.affix(_s7_6, 1); t1.depth$2$to(40, 80); t1.parameter$3$boostOneIn$max(3, 4, 5); t1.price$2(300, 1.6); t1.heft$1(0.8); t1.damage$1$scale(A.scaleParam()); t1.resist$1(t6); t1 = A.affix(_s12_0, 0.5); t1.depth$1(50); t1.parameter$2$boostOneIn(1, 4); t1.price$2(500, 2.2); t1.heft$1(0.6); t15 = type$.double; t1.damage$1$scale(A.fixed(1.5, t15)); t1._statBonuses.$indexSet(0, B.Stat_Intellect_3_intellect, A.builder___intIdentity$closure()); t1.resist$1(t7); t1.resist$1(t6); A.finishAffix(); $._affixTag = "body"; t1 = A.affix(_s9_6, 1); t1.depth$1(30); t1.parameter$3$boostOneIn$max(4, 3, 6); t1.price$2(400, 2); t1.weight$1(2); t1._armorBonus = A.builder___intIdentity$closure(); t1.resist$1(t2); t1.resist$1(t9); A.finishAffix(); $._affixTag = "helm"; t1 = A.affix(_s9_6, 1); t1.depth$1(50); t1.parameter$3$boostOneIn$max(3, 4, 5); t1.price$2(300, 2); t1.weight$1(1); t1._armorBonus = A.builder___intIdentity$closure(); t1.resist$1(t2); t1.resist$1(t9); A.finishAffix(); $._affixTag = "gloves"; t1 = A.affix(_s9_6, 1); t1.depth$1(50); t1.price$2(300, 2); t1.parameter$3$boostOneIn$max(2, 4, 4); t1.weight$1(1); t1._armorBonus = A.builder___intIdentity$closure(); t1._statBonuses.$indexSet(0, B.Stat_Strength_0_strength, t13._as(A.fixed(1, t14))); t1.resist$1(t2); t1.resist$1(t9); A.finishAffix(); $._affixTag = "boots"; t1 = A.affix(_s9_6, 1); t1.depth$1(50); t1.parameter$3$boostOneIn$max(3, 4, 5); t1.price$2(300, 2); t1.weight$1(1); t1._armorBonus = A.builder___intIdentity$closure(); t1.resist$1(t2); t1.resist$1(t9); A.finishAffix(); $._affixTag = "shield"; t1 = A.affix(_s9_6, 1); t1.depth$1(40); t1.parameter$3$boostOneIn$max(4, 3, 8); t1.price$2(200, 2.2); t1.heft$1(1.2); t1.damage$2$bonus$scale(A.builder___intIdentity$closure(), A.scaleParam()); t1.resist$1(t2); t1.resist$1(t9); A.finishAffix(); $._affixTag = "armor"; t1 = A.affix("_ of Resist Air", 0.5); t1.depth$2$to(10, 50); t1.price$2(200, 1.2); t1.resist$1(t7); t1 = A.affix("_ of Resist Earth", 0.5); t1.depth$2$to(11, 51); t1.price$2(230, 1.2); t1.resist$1(t2); t1 = A.affix("_ of Resist Fire", 0.5); t1.depth$2$to(12, 52); t1.price$2(260, 1.3); t1.resist$1(t4); t1 = A.affix("_ of Resist Water", 0.5); t1.depth$2$to(13, 53); t1.price$2(310, 1.2); t1.resist$1(t10); t1 = A.affix("_ of Resist Acid", 0.3); t1.depth$2$to(14, 54); t1.price$2(340, 1.3); t1.resist$1(t3); t1 = A.affix("_ of Resist Cold", 0.5); t1.depth$2$to(15, 55); t1.price$2(400, 1.2); t1.resist$1(t5); t1 = A.affix("_ of Resist Lightning", 0.3); t1.depth$2$to(16, 56); t1.price$2(430, 1.2); t1.resist$1(t8); t1 = A.affix("_ of Resist Poison", 0.25); t1.depth$2$to(17, 57); t1.price$2(460, 1.5); t1.resist$1(t11); t1 = A.affix("_ of Resist Dark", 0.25); t1.depth$2$to(18, 58); t1.price$2(490, 1.3); t1.resist$1(t9); t1 = A.affix("_ of Resist Light", 0.25); t1.depth$2$to(19, 59); t1.price$2(490, 1.3); t1.resist$1(t6); t1 = A.affix("_ of Resist Spirit", 0.4); t1.depth$2$to(10, 60); t1.price$2(520, 1.4); t1.resist$1(t12); t1 = A.affix("_ of Resist Nature", 0.3); t1.depth$1(40); t1.price$2(3000, 4); t1.resist$1(t7); t1.resist$1(t2); t1.resist$1(t4); t1.resist$1(t10); t1.resist$1(t5); t1.resist$1(t8); t1 = A.affix("_ of Resist Destruction", 0.3); t1.depth$1(40); t1.price$2(1300, 2.6); t1.resist$1(t3); t1.resist$1(t4); t1.resist$1(t8); t1.resist$1(t11); t1 = A.affix("_ of Resist Evil", 0.3); t1.depth$1(60); t1.price$2(1500, 3); t1.resist$1(t3); t1.resist$1(t11); t1.resist$1(t9); t1.resist$1(t12); t1 = A.affix("_ of Resistance", 0.3); t1.depth$1(70); t1.price$2(5000, 6); t1.resist$1(t7); t1.resist$1(t2); t1.resist$1(t4); t1.resist$1(t10); t1.resist$1(t3); t1.resist$1(t5); t1.resist$1(t8); t1.resist$1(t11); t1.resist$1(t9); t1.resist$1(t6); t1.resist$1(t12); t1 = A.affix("_ of Protection from Air", 0.25); t1.depth$1(36); t1.parameter$2$boostOneIn(2, 5); t1.price$2(500, 1.4); t1.resist$2(t7, A.builder___intIdentity$closure()); t7 = A.affix("_ of Protection from Earth", 0.25); t7.depth$1(37); t7.parameter$2$boostOneIn(2, 5); t7.price$2(500, 1.4); t7.resist$2(t2, A.builder___intIdentity$closure()); t2 = A.affix("_ of Protection from Fire", 0.25); t2.depth$1(38); t2.parameter$2$boostOneIn(2, 5); t2.price$2(500, 1.5); t2.resist$2(t4, A.builder___intIdentity$closure()); t2 = A.affix("_ of Protection from Water", 0.25); t2.depth$1(39); t2.parameter$2$boostOneIn(2, 5); t2.price$2(500, 1.4); t2.resist$2(t10, A.builder___intIdentity$closure()); t10 = A.affix("_ of Protection from Acid", 0.2); t10.depth$1(40); t10.parameter$2$boostOneIn(2, 5); t10.price$2(500, 1.5); t10.resist$2(t3, A.builder___intIdentity$closure()); t3 = A.affix("_ of Protection from Cold", 0.25); t3.depth$1(41); t3.parameter$2$boostOneIn(2, 5); t3.price$2(500, 1.4); t3.resist$2(t5, A.builder___intIdentity$closure()); t3 = A.affix("_ of Protection from Lightning", 0.16); t3.depth$1(42); t3.parameter$2$boostOneIn(2, 5); t3.price$2(500, 1.4); t3.resist$2(t8, A.builder___intIdentity$closure()); t3 = A.affix("_ of Protection from Poison", 0.14); t3.depth$1(43); t3.parameter$2$boostOneIn(2, 5); t3.price$2(_1000, 1.6); t3.resist$2(t11, A.builder___intIdentity$closure()); t3 = A.affix("_ of Protection from Dark", 0.14); t3.depth$1(44); t3.parameter$2$boostOneIn(2, 5); t3.price$2(500, 1.5); t3.resist$2(t9, A.builder___intIdentity$closure()); t3 = A.affix("_ of Protection from Light", 0.14); t3.depth$1(45); t3.parameter$2$boostOneIn(2, 5); t3.price$2(500, 1.5); t3.resist$2(t6, A.builder___intIdentity$closure()); t3 = A.affix("_ of Protection from Spirit", 0.13); t3.depth$1(46); t3.parameter$2$boostOneIn(2, 5); t3.price$2(800, 1.6); t3.resist$2(t12, A.builder___intIdentity$closure()); A.finishAffix(); $._affixTag = "weapon"; t3 = A.affix("_ of Harming", 1); t3.depth$2$to(1, 30); t3.parameter$3$boostOneIn$max(1, 3, 2); t3.price$2(100, 1.2); t3.heft$1(1.05); t3.damage$1$bonus(A.builder___intIdentity$closure()); t3 = A.affix("_ of Wounding", 1); t3.depth$2$to(10, 50); t3.parameter$3$boostOneIn$max(3, 3, 5); t3.price$2(140, 1.3); t3.heft$1(1.07); t3.damage$1$bonus(A.builder___intIdentity$closure()); t3 = A.affix("_ of Maiming", 1); t3.depth$2$to(25, 75); t3.parameter$3$boostOneIn$max(2, 3, 4); t3.price$2(180, 1.5); t3.heft$1(1.09); t3.damage$2$bonus$scale(A.builder___intIdentity$closure(), A.scaleParam()); t3 = A.affix("_ of Slaying", 1); t3.depth$1(45); t3.parameter$3$boostOneIn$max(4, 2, 8); t3.price$2(200, 2); t3.heft$1(1.11); t3.damage$2$bonus$scale(A.builder___intIdentity$closure(), A.scaleParam()); A.finishAffix(); $._affixTag = "bow"; t3 = A.affix("Ash _", 1); t3.depth$2$to(10, 70); t3.parameter$3$boostOneIn$max(2, 4, 4); t3.price$2(300, 1.3); t3.heft$1(0.8); t3.damage$1$bonus(A.builder___intIdentity$closure()); t3 = A.affix("Yew _", 1); t3.depth$1(20); t3.parameter$3$boostOneIn$max(5, 3, 8); t3.price$2(500, 1.4); t3.heft$1(0.8); t3.damage$1$bonus(A.builder___intIdentity$closure()); A.finishAffix(); $._affixTag = "weapon"; t3 = A.affix("Glimmering _", 0.3); t3.depth$2$to(20, 60); t3.parameter$3$boostOneIn$max(2, 3, 3); t3.price$2(300, 1.3); t3.damage$1$scale(A.scaleParam()); t3.brand$1(t6); t3 = A.affix("Shining _", 0.25); t3.depth$2$to(32, 90); t3.parameter$3$boostOneIn$max(4, 3, 5); t3.price$2(400, 1.6); t3.damage$1$scale(A.scaleParam()); t3.brand$1(t6); t3 = A.affix("Radiant _", 0.2); t3.depth$1(48); t3.parameter$3$boostOneIn$max(6, 3, 8); t3.price$2(500, 2); t3.damage$1$scale(A.scaleParam()); t3.brand$2$resist(t6, 2); t6 = A.affix("Dim _", 0.3); t6.depth$2$to(16, 60); t6.parameter$3$boostOneIn$max(2, 3, 3); t6.price$2(300, 1.3); t6.damage$1$scale(A.scaleParam()); t6.brand$1(t9); t6 = A.affix("Dark _", 0.25); t6.depth$2$to(32, 80); t6.parameter$3$boostOneIn$max(4, 3, 5); t6.price$2(400, 1.6); t6.damage$1$scale(A.scaleParam()); t6.brand$1(t9); t6 = A.affix("Black _", 0.2); t6.depth$1(56); t6.parameter$3$boostOneIn$max(6, 3, 8); t6.price$2(500, 2); t6.damage$1$scale(A.scaleParam()); t6.brand$2$resist(t9, 2); t9 = A.affix("Chilling _", 0.3); t9.depth$2$to(20, 65); t9.parameter$3$boostOneIn$max(4, 3, 6); t9.price$2(300, 1.5); t9.damage$1$scale(A.scaleParam()); t9.brand$1(t5); t9 = A.affix("Freezing _", 0.25); t9.depth$1(40); t9.parameter$3$boostOneIn$max(6, 3, 9); t9.price$2(400, 1.7); t9.damage$1$scale(A.scaleParam()); t9.brand$2$resist(t5, 2); t5 = A.affix("Burning _", 0.3); t5.depth$2$to(20, 60); t5.parameter$3$boostOneIn$max(3, 3, 5); t5.price$2(300, 1.5); t5.damage$1$scale(A.scaleParam()); t5.brand$1(t4); t5 = A.affix("Flaming _", 0.25); t5.depth$2$to(40, 90); t5.parameter$3$boostOneIn$max(6, 3, 7); t5.price$2(360, 1.8); t5.damage$1$scale(A.scaleParam()); t5.brand$1(t4); t5 = A.affix("Searing _", 0.2); t5.depth$1(60); t5.parameter$3$boostOneIn$max(8, 3, 11); t5.price$2(500, 2.1); t5.damage$1$scale(A.scaleParam()); t5.brand$2$resist(t4, 2); t4 = A.affix("Electric _", 0.2); t4.depth$1(50); t4.parameter$3$boostOneIn$max(4, 3, 7); t4.price$2(300, 1.5); t4.damage$1$scale(A.scaleParam()); t4.brand$1(t8); t4 = A.affix("Shocking _", 0.2); t4.depth$1(70); t4.parameter$3$boostOneIn$max(8, 3, 11); t4.price$2(400, 2); t4.damage$1$scale(A.scaleParam()); t4.brand$2$resist(t8, 2); t8 = A.affix("Poisonous _", 0.2); t8.depth$2$to(35, 90); t8.parameter$3$boostOneIn$max(1, 4, 2); t8.price$2(500, 1.5); t8.damage$1$scale(A.scaleParam()); t8.brand$1(t11); t8 = A.affix("Venomous _", 0.2); t8.depth$1(70); t8.parameter$3$boostOneIn$max(3, 4, 5); t8.price$2(800, 1.8); t8.damage$1$scale(A.scaleParam()); t8.brand$2$resist(t11, 2); t11 = A.affix("Ghostly _", 0.2); t11.depth$2$to(45, 85); t11.parameter$3$boostOneIn$max(4, 3, 6); t11.price$2(300, 1.6); t11.heft$1(0.7); t11.damage$1$scale(A.scaleParam()); t11.brand$1(t12); t11 = A.affix("Spiritual _", 0.15); t11.depth$1(80); t11.parameter$3$boostOneIn$max(7, 3, 10); t11.price$2(400, 2.1); t11.heft$1(0.7); t11.damage$1$scale(A.scaleParam()); t11.brand$2$resist(t12, 2); A.finishAffix(); $._affixTag = "helm"; t12 = A.affix("_ of Acumen", 1); t12.depth$2$to(35, 55); t12.parameter$2$boostOneIn(1, 4); t12.price$2(300, 2); t12._statBonuses.$indexSet(0, B.Stat_Intellect_3_intellect, A.builder___intIdentity$closure()); t12 = A.affix("_ of Wisdom", 1); t12.depth$2$to(45, 75); t12.parameter$3$boostOneIn$max(2, 4, 3); t12.price$2(500, 3); t12._statBonuses.$indexSet(0, B.Stat_Intellect_3_intellect, A.builder___intIdentity$closure()); t12 = A.affix("_ of Sagacity", 1); t12.depth$1(75); t12.parameter$3$boostOneIn$max(4, 4, 5); t12.price$2(700, 4); t12._statBonuses.$indexSet(0, B.Stat_Intellect_3_intellect, A.builder___intIdentity$closure()); t12 = A.affix("_ of Genius", 1); t12.depth$1(85); t12.parameter$3$boostOneIn$max(6, 4, 7); t12.price$2(_1000, 5); t12._statBonuses.$indexSet(0, B.Stat_Intellect_3_intellect, A.builder___intIdentity$closure()); A.finishAffix(); t12 = type$.String; A.shop("The General's General Store", A.LinkedHashMap_LinkedHashMap$_literal(["Loaf of Bread", 2, "Chunk of Meat", 0.6, "Tallow Candle", 1, "Wax Candle", 0.7, "Oil Lamp", 0.5, "Torch", 0.3, "Lantern", 0.1, "Soothing Balm", 0.6, "Mending Salve", 0.4, _s16_, 0.2, "Club", 0.1, "Staff", 0.1, "Quarterstaff", 0.05, "Whip", 0.1, "Dagger", 0.1], t12, t15)); A.shop("Dirk's Death Emporium", A.LinkedHashMap_LinkedHashMap$_literal(["Hammer", 0.5, "Mattock", 0.2, "War Hammer", 0.1, "Morningstar", 0.6, "Mace", 0.3, "Chain Whip", 0.2, "Flail", 0.1, "Falchion", 0.7, "Rapier", 1, "Shortsword", 0.6, "Scimitar", 0.4, "Cutlass", 0.2, "Spear", 1, "Angon", 0.4, "Lance", 0.2, "Partisan", 0.1, "Hatchet", 1, "Axe", 0.5, "Valaska", 0.25, "Battleaxe", 0.2, "Short Bow", 1, "Longbow", 0.3, "Crossbow", 0.05], t12, t15)); A.shop("Skullduggery and Bamboozelry", A.LinkedHashMap_LinkedHashMap$_literal(["Dirk", 1, "Dagger", 0.3, "Stiletto", 0.1, "Rondel", 0.05, "Baselard", 0.02], t12, t15)); A.shop("Garthag's Armoury", A.LinkedHashMap_LinkedHashMap$_literal(["Cloak", 1, "Fur Cloak", 1, "Cloth Shirt", 1, "Leather Shirt", 1, "Jerkin", 1, "Leather Armor", 1, "Padded Armor", 1, "Studded Armor", 1, "Mail Hauberk", 1, "Scale Mail", 1, "Robe", 1, "Fur-lined Robe", 1, "Pair of Sandals", 1, "Pair of Shoes", 1, "Pair of Boots", 1, "Pair of Plated Boots", 1, "Pair of Greaves", 1], t12, t15)); A.shop("Unguence the Alchemist", A.LinkedHashMap_LinkedHashMap$_literal(["Soothing Balm", 1, "Mending Salve", 1, _s16_, 1, "Antidote", 1, "Potion of Quickness", 1, "Potion of Alacrity", 1, "Bottled Wind", 1, "Bottled Ice", 1, "Bottled Fire", 1, "Bottled Ocean", 1, "Bottled Earth", 1], t12, t15)); A.shop("The Droll Magery", A.LinkedHashMap_LinkedHashMap$_literal(['Spellbook "Elemental Primer"', 1, "Scroll of Sidestepping", 1, "Scroll of Phasing", 1, "Scroll of Item Detection", 1], t12, t15)); A.gems(); A.healing(); A.teleportation(); A.floorDrop(new A._AllOfDrop(A._setArrayType([new A._PercentDrop(30, A.parseDrop("Skull", _null, _null)), new A._PercentDrop(30, A.parseDrop(_s8_1, _null, _null)), new A._PercentDrop(20, A.parseDrop(_s6_3, _null, _null)), new A._PercentDrop(20, A.parseDrop(_s5_0, _null, _null)), new A._PercentDrop(20, A.parseDrop("food", _null, _null)), new A._PercentDrop(15, A.parseDrop(_s5_1, _null, _null))], type$.JSArray_Drop)), _null, B.SpawnLocation_2, 2); A.floorDrop(A.parseDrop("food", _null, _null), 1, _null, 10); A.floorDrop(A.parseDrop("Rock", _null, _null), 0.01, B.SpawnLocation_3, 3); A.floorDrop(A.parseDrop(_s8_1, _null, _null), _null, _null, 10); A.floorDrop(A.parseDrop("light", _null, _null), 0.1, _null, 4); A.floorDrop(A.parseDrop(_s4_, _null, _null), 5, B.SpawnLocation_0, 2); A.dungeon(B.RoomShapes_0, 6); A.dungeon(B.RoomShapes_1, 1); A.dungeon(B.RoomShapes_2, 3); A.catacomb("bat bug humanoid natural", 2, 1); A.cavern("animal bat bug natural", 1, 0.2); A.lake(_s11_3, 100, 1); A.river(_s11_3, 100, 1); A.pit("bug", 40, 1); A.pit("jelly", 50, 5); A.pit("bat", 40, 10); A.pit("rodent", 50, 1); A.pit("snake", 60, 8); A.pit("plant", 40, 15); A.pit("eye", 100, 20); A.pit("dragon", 100, 60); A.keep(_s6_2, 16, 2); A.keep(_s6_1, 23, 5); A.keep(_s7_5, 30, 10); A.keep("orc", 40, 28); t15 = $.$get$Decor_all(); t15.defineTags$1("built/room/dungeon"); t15.defineTags$1("built/room/keep"); t15.defineTags$1("catacomb"); t15.defineTags$1("cave/glowing-moss"); t15.defineTags$1("water"); t15 = $.$get$Tiles_glowingMoss(); t11 = $.$get$Motility_walk(); t8 = type$.Cell; t15 = A.LinkedHashMap_LinkedHashMap$_literal(["*", A.Cell$(t15, t11, _null, _null)], t12, t8); $.___themes._value = "glowing-moss"; $._categoryFrequency = null; $._categoryCells = t15; A.furnishing(_null, B.Symmetry_4, " #\n *"); A.furnishing(_null, B.Symmetry_4, " ##\n #*"); A.furnishing(_null, _null, " ?.?\n .*.\n ?.?"); t15 = $.$get$Tiles_candle(); t4 = A.LinkedHashMap_LinkedHashMap$_literal(["!", A.Cell$(t15, t11, _null, _null)], t12, t8); $.___themes._value = "catacomb dungeon"; $._categoryFrequency = null; $._categoryCells = t4; A.furnishing(_null, _null, " ?.?\n .!.\n ?.?"); tableCells = A.LinkedHashMap_LinkedHashMap$_literal(["\u250c", A.Cell$($.$get$Tiles_tableTopLeft(), t11, _null, _null), "\u2500", A.Cell$($.$get$Tiles_tableTop(), t11, _null, _null), "\u2510", A.Cell$($.$get$Tiles_tableTopRight(), t11, _null, _null), "-", A.Cell$($.$get$Tiles_tableCenter(), t11, _null, _null), "\u2502", A.Cell$($.$get$Tiles_tableSide(), t11, _null, _null), "\u2558", A.Cell$($.$get$Tiles_tableBottomLeft(), t11, _null, _null), "\u2550", A.Cell$($.$get$Tiles_tableBottom(), t11, _null, _null), "\u255b", A.Cell$($.$get$Tiles_tableBottomRight(), t11, _null, _null), "\u255e", A.Cell$($.$get$Tiles_tableLegLeft(), t11, _null, _null), "\u2564", A.Cell$($.$get$Tiles_tableLeg(), t11, _null, _null), "\u2561", A.Cell$($.$get$Tiles_tableLegRight(), t11, _null, _null), "i", A.Cell$(t15, t11, _null, _null)], t12, t8); $.___themes._value = _s12_1; $._categoryFrequency = null; $._categoryCells = tableCells; A.furnishing(_null, B.Symmetry_1, " ?...\n #\u2500\u2510.\n #-\u2502.\n #\u2564\u255b.\n ?..."); A.furnishing(_null, B.Symmetry_1, " ?...\n #\u2500\u2510.\n #i\u2502.\n #\u2564\u255b.\n ?..."); A.furnishing(_null, B.Symmetry_1, " ?...\n #\u2500\u2510.\n #-\u2502.\n #-\u2502.\n #\u2564\u255b.\n ?..."); A.furnishing(_null, B.Symmetry_1, " ?...\n #\u2500\u2510.\n #i\u2502.\n #i\u2502.\n #\u2564\u255b.\n ?..."); A.furnishing(_null, B.Symmetry_1, " ?...\n #\u2500\u2510.\n #-\u2502.\n #-\u2502.\n #-\u2502.\n #\u2564\u255b.\n ?..."); A.furnishing(_null, B.Symmetry_1, " ?...\n #\u2500\u2510.\n #-\u2502.\n #i\u2502.\n #-\u2502.\n #\u2564\u255b.\n ?..."); A.furnishing(_null, B.Symmetry_1, " ?...\n #\u2500\u2510.\n #i\u2502.\n #-\u2502.\n #i\u2502.\n #\u2564\u255b.\n ?..."); A.furnishing(_null, _null, " .....\n .\u250c\u2500\u2510.\n .\u2502-\u2502.\n ?###?"); A.furnishing(_null, _null, " .....\n .\u250c\u2500\u2510.\n .\u2502i\u2502.\n ?###?"); A.furnishing(_null, _null, " ......\n .\u250c\u2500\u2500\u2510.\n .\u2502--\u2502.\n ?####?"); A.furnishing(_null, _null, " ......\n .\u250c\u2500\u2500\u2510.\n .\u2502ii\u2502.\n ?####?"); A.furnishing(_null, _null, " .......\n .\u250c\u2500\u2500\u2500\u2510.\n .\u2502---\u2502.\n ?#####?"); A.furnishing(_null, _null, " .......\n .\u250c\u2500\u2500\u2500\u2510.\n .\u2502-i-\u2502.\n ?#####?"); A.furnishing(_null, _null, " .......\n .\u250c\u2500\u2500\u2500\u2510.\n .\u2502i-i\u2502.\n ?#####?"); A.furnishing(_null, _null, " ?###?\n .\u2502-\u2502.\n .\u255e\u2550\u2561.\n ....."); A.furnishing(_null, _null, " ?###?\n .\u2502i\u2502.\n .\u255e\u2550\u2561.\n ....."); A.furnishing(_null, _null, " ?####?\n .\u2502--\u2502.\n .\u255e\u2550\u2550\u2561.\n ......"); A.furnishing(_null, _null, " ?####?\n .\u2502ii\u2502.\n .\u255e\u2550\u2550\u2561.\n ......"); A.furnishing(_null, _null, " ?#####?\n .\u2502---\u2502.\n .\u255e\u2550\u2550\u2550\u2561.\n ......."); A.furnishing(_null, _null, " ?#####?\n .\u2502-i-\u2502.\n .\u255e\u2550\u2550\u2550\u2561.\n ......."); A.furnishing(_null, _null, " ?#####?\n .\u2502i-i\u2502.\n .\u255e\u2550\u2550\u2550\u2561.\n ......."); $.___themes._value = _s12_1; $._categoryFrequency = null; $._categoryCells = tableCells; A.furnishing(_null, _null, " ?.....?\n #\u2500\u2510.\u250c\u2500#\n #\u2564\u255b.\u2558\u2564#\n ?.....?"); A.furnishing(_null, _null, " ?.......?\n #\u2500\u2500\u2510.\u250c\u2500\u2500#\n #\u2550\u2564\u255b.\u2558\u2564\u2550#\n ?.......?"); A.furnishing(_null, _null, " ?.........?\n #\u2500\u2500\u2500\u2510.\u250c\u2500\u2500\u2500#\n #\u2550\u2550\u2564\u255b.\u2558\u2564\u2550\u2550#\n ?.........?"); A.furnishing(_null, _null, " ?##?\n .\u2502\u2502.\n .\u255e\u2561.\n ....\n .\u250c\u2510.\n .\u2502\u2502.\n ?##?"); A.furnishing(_null, _null, " ?##?\n .\u2502\u2502.\n .\u2502\u2502.\n .\u255e\u2561.\n ....\n .\u250c\u2510.\n .\u2502\u2502.\n .\u2502\u2502.\n ?##?"); A.furnishing(_null, _null, " ?##?\n .\u2502\u2502.\n .\u2502\u2502.\n .\u2502\u2502.\n .\u255e\u2561.\n ....\n .\u250c\u2510.\n .\u2502\u2502.\n .\u2502\u2502.\n .\u2502\u2502.\n ?##?"); $.___themes._value = _s12_1; $._categoryFrequency = null; $._categoryCells = tableCells; A.furnishing(_null, _null, " .....\n .\u250c\u2500\u2510.\n .\u2502-\u2502.\n .\u255e\u2550\u2561.\n ....."); A.furnishing(_null, _null, " .....\n .\u250c\u2500\u2510.\n .\u2502i\u2502.\n .\u255e\u2550\u2561.\n ....."); A.furnishing(_null, _null, " ......\n .\u250c\u2500\u2500\u2510.\n .\u2502--\u2502.\n .\u255e\u2550\u2550\u2561.\n ......"); A.furnishing(_null, _null, " ......\n .\u250c\u2500\u2500\u2510.\n .\u2502ii\u2502.\n .\u255e\u2550\u2550\u2561.\n ......"); A.furnishing(_null, _null, " .......\n .\u250c\u2500\u2500\u2500\u2510.\n .\u2502---\u2502.\n .\u2558\u2564\u2550\u2564\u255b.\n ......."); A.furnishing(_null, _null, " .......\n .\u250c\u2500\u2500\u2500\u2510.\n .\u2502-i-\u2502.\n .\u2558\u2564\u2550\u2564\u255b.\n ......."); A.furnishing(_null, _null, " .......\n .\u250c\u2500\u2500\u2500\u2510.\n .\u2502i-i\u2502.\n .\u2558\u2564\u2550\u2564\u255b.\n ......."); A.furnishing(_null, _null, " ........\n .\u250c\u2500\u2500\u2500\u2500\u2510.\n .\u2502----\u2502.\n .\u2558\u2564\u2550\u2550\u2564\u255b.\n ........"); A.furnishing(_null, _null, " ........\n .\u250c\u2500\u2500\u2500\u2500\u2510.\n .\u2502i--i\u2502.\n .\u2558\u2564\u2550\u2550\u2564\u255b.\n ........"); A.furnishing(_null, _null, " .........\n .\u250c\u2500\u2500\u2500\u2500\u2500\u2510.\n .\u2502-----\u2502.\n .\u2558\u2564\u2550\u2550\u2550\u2564\u255b.\n ........."); A.furnishing(_null, _null, " .........\n .\u250c\u2500\u2500\u2500\u2500\u2500\u2510.\n .\u2502--i--\u2502.\n .\u2558\u2564\u2550\u2550\u2550\u2564\u255b.\n ........."); A.furnishing(_null, _null, " .........\n .\u250c\u2500\u2500\u2500\u2500\u2500\u2510.\n .\u2502-i-i-\u2502.\n .\u2558\u2564\u2550\u2550\u2550\u2564\u255b.\n ........."); A.furnishing(_null, _null, " ..........\n .\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510.\n .\u2502------\u2502.\n .\u2558\u2564\u2550\u2550\u2550\u2550\u2564\u255b.\n .........."); A.furnishing(_null, _null, " ..........\n .\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510.\n .\u2502-i--i-\u2502.\n .\u2558\u2564\u2550\u2550\u2550\u2550\u2564\u255b.\n .........."); A.furnishing(_null, _null, " .....\n .\u250c\u2500\u2510.\n .\u2502-\u2502.\n .\u2502-\u2502.\n .\u255e\u2550\u2561.\n ....."); A.furnishing(_null, _null, " .....\n .\u250c\u2500\u2510.\n .\u2502i\u2502.\n .\u2502i\u2502.\n .\u255e\u2550\u2561.\n ....."); A.furnishing(_null, _null, " ......\n .\u250c\u2500\u2500\u2510.\n .\u2502--\u2502.\n .\u2502--\u2502.\n .\u255e\u2550\u2550\u2561.\n ......"); A.furnishing(_null, B.Symmetry_1, " ......\n .\u250c\u2500\u2500\u2510.\n .\u2502i-\u2502.\n .\u2502-i\u2502.\n .\u255e\u2550\u2550\u2561.\n ......"); A.furnishing(_null, _null, " .......\n .\u250c\u2500\u2500\u2500\u2510.\n .\u2502---\u2502.\n .\u2502---\u2502.\n .\u2558\u2564\u2550\u2564\u255b.\n ......."); A.furnishing(_null, _null, " .......\n .\u250c\u2500\u2500\u2500\u2510.\n .\u2502-i-\u2502.\n .\u2502-i-\u2502.\n .\u2558\u2564\u2550\u2564\u255b.\n ......."); A.furnishing(_null, _null, " .......\n .\u250c\u2500\u2500\u2500\u2510.\n .\u2502-i-\u2502.\n .\u2502i-i\u2502.\n .\u2558\u2564\u2550\u2564\u255b.\n ......."); A.furnishing(_null, _null, " .......\n .\u250c\u2500\u2500\u2500\u2510.\n .\u2502i-i\u2502.\n .\u2502-i-\u2502.\n .\u2558\u2564\u2550\u2564\u255b.\n ......."); A.furnishing(_null, _null, " ........\n .\u250c\u2500\u2500\u2500\u2500\u2510.\n .\u2502----\u2502.\n .\u2502----\u2502.\n .\u2558\u2564\u2550\u2550\u2564\u255b.\n ........"); A.furnishing(_null, B.Symmetry_1, " ........\n .\u250c\u2500\u2500\u2500\u2500\u2510.\n .\u2502i---\u2502.\n .\u2502---i\u2502.\n .\u2558\u2564\u2550\u2550\u2564\u255b.\n ........"); A.furnishing(_null, _null, " .........\n .\u250c\u2500\u2500\u2500\u2500\u2500\u2510.\n .\u2502-----\u2502.\n .\u2502-----\u2502.\n .\u2558\u2564\u2550\u2550\u2550\u2564\u255b.\n ........."); A.furnishing(_null, _null, " .........\n .\u250c\u2500\u2500\u2500\u2500\u2500\u2510.\n .\u2502--i--\u2502.\n .\u2502-i-i-\u2502.\n .\u2558\u2564\u2550\u2550\u2550\u2564\u255b.\n ........."); A.furnishing(_null, _null, " .........\n .\u250c\u2500\u2500\u2500\u2500\u2500\u2510.\n .\u2502i---i\u2502.\n .\u2502--i--\u2502.\n .\u2558\u2564\u2550\u2550\u2550\u2564\u255b.\n ........."); A.furnishing(_null, _null, " ..........\n .\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510.\n .\u2502------\u2502.\n .\u2502------\u2502.\n .\u2558\u2564\u2550\u2550\u2550\u2550\u2564\u255b.\n .........."); A.furnishing(_null, _null, " ..........\n .\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510.\n .\u2502-i--i-\u2502.\n .\u2502-i--i-\u2502.\n .\u2558\u2564\u2550\u2550\u2550\u2550\u2564\u255b.\n .........."); t15 = A.LinkedHashMap_LinkedHashMap$_literal(["\u03c0", A.Cell$($.$get$Tiles_chair(), t11, _null, _null)], t12, t8); $.___themes._value = _s5_2; $._categoryFrequency = 2; $._categoryCells = t15; A.furnishing(_null, B.Symmetry_3, " \u03c0.\n .\u250c"); A.furnishing(_null, B.Symmetry_3, " \u03c0.\n \u250c?"); A.furnishing(_null, B.Symmetry_3, " ..\n \u03c0\u250c"); A.furnishing(_null, B.Symmetry_1, " .\u255e\n \u03c0."); A.furnishing(_null, B.Symmetry_4, " ?\u2550?\n .\u03c0."); A.furnishing(_null, _null, " ?\u2564?\n .\u03c0."); A.furnishing(_null, B.Symmetry_4, " \u03c0\n #"); A.furnishing(_null, B.Symmetry_4, " \u03c0\n .\n #"); t15 = A.LinkedHashMap_LinkedHashMap$_literal(["%", A.Cell$($.$get$Tiles_closedBarrel(), t11, _null, _null)], t12, t8); $.___themes._value = _s5_2; $._categoryFrequency = 0.7; $._categoryCells = t15; A.furnishing(_null, B.Symmetry_4, " ##?\n #%.\n ?.?"); A.furnishing(_null, B.Symmetry_4, " ?.?\n .%.\n ?.?"); A.furnishing(_null, B.Symmetry_4, " ###?\n #%%.\n ?..?"); A.furnishing(_null, B.Symmetry_4, " ###?\n #%%.\n #%.?\n ?.??"); A.furnishing(_null, B.Symmetry_4, " ?##?\n .%%.\n ?..?"); A.furnishing(_null, B.Symmetry_4, " ?###?\n .%%%.\n ?...?"); t11 = A.LinkedHashMap_LinkedHashMap$_literal(["&", A.Cell$($.$get$Tiles_closedChest(), t11, _null, _null)], t12, t8); $.___themes._value = _s5_2; $._categoryFrequency = 0.5; $._categoryCells = t11; A.furnishing(_null, B.Symmetry_4, " ##?\n #&.\n ?.?"); A.furnishing(_null, B.Symmetry_4, " ?#?\n .&.\n ?.?"); $.___themes._value = _s5_2; $._categoryFrequency = 10; $._categoryCells = null; A.furnishing(_null, B.Symmetry_4, " #...#\n #\u2248\u2261\u2248#\n #...#"); A.furnishing(_null, B.Symmetry_4, " #....#\n #\u2248\u2248\u2261\u2248#\n #....#"); A.furnishing(_null, B.Symmetry_4, " #.....#\n #\u2248\u2248\u2261\u2248\u2248#\n #.....#"); A.furnishing(_null, B.Symmetry_4, " #.....#\n #\u2248\u2261\u2248\u2261\u2248#\n #.....#"); A.furnishing(_null, B.Symmetry_4, " #......#\n #......#\n #\u2248\u2248\u2261\u2248\u2248\u2248#\n #......#\n #......#"); A.furnishing(_null, B.Symmetry_4, " #......#\n #......#\n #\u2248\u2261\u2248\u2248\u2261\u2248#\n #......#\n #......#"); A.furnishing(_null, B.Symmetry_4, " #.......#\n #\u2248\u2248\u2248\u2261\u2248\u2248\u2248#\n #.......#\n #.......#"); A.furnishing(_null, B.Symmetry_4, " #.......#\n #.......#\n #\u2248\u2248\u2261\u2248\u2261\u2248\u2248#\n #.......#\n #.......#"); A.furnishing(_null, B.Symmetry_4, " #.......#\n #.......#\n #\u2248\u2261\u2248\u2248\u2248\u2261\u2248#\n #.......#\n #.......#"); A.furnishing(_null, B.Symmetry_4, " #........#\n #........#\n #\u2248\u2248\u2248\u2261\u2248\u2248\u2248\u2248#\n #........#\n #........#"); A.furnishing(_null, B.Symmetry_4, " #........#\n #........#\n #\u2248\u2248\u2261\u2248\u2248\u2261\u2248\u2248#\n #........#\n #........#"); A.furnishing(_null, B.Symmetry_4, " #.........#\n #.........#\n #\u2248\u2248\u2248\u2248\u2261\u2248\u2248\u2248\u2248#\n #.........#\n #.........#"); A.furnishing(_null, B.Symmetry_4, " #.........#\n #.........#\n #\u2248\u2248\u2261\u2248\u2248\u2248\u2261\u2248\u2248#\n #.........#\n #.........#"); A.furnishing(_null, B.Symmetry_4, " #.........#\n #.........#\n #\u2248\u2248\u2248\u2248\u2261\u2248\u2248\u2248\u2248#\n #\u2248\u2248\u2248\u2248\u2261\u2248\u2248\u2248\u2248#\n #.........#\n #.........#"); A.furnishing(_null, B.Symmetry_4, " #.........#\n #.........#\n #\u2248\u2248\u2261\u2248\u2248\u2248\u2261\u2248\u2248#\n #\u2248\u2248\u2261\u2248\u2248\u2248\u2261\u2248\u2248#\n #.........#\n #.........#"); t11 = $.$get$Tiles_steppingStone(); t8 = A.LinkedHashMap_LinkedHashMap$_literal(["*", A.Cell$(t11, _null, $.$get$Tiles_water(), _null), "o", A.Cell$(_null, _null, t11, _null)], t12, t8); $.___themes._value = "water"; $._categoryFrequency = null; $._categoryCells = t8; A.furnishing(0.6, B.Symmetry_4, " .*"); A.furnishing(0.6, B.Symmetry_4, " ..\n .*"); A.furnishing(_null, B.Symmetry_4, " o*"); A.furnishing(_null, B.Symmetry_4, " \u2248*\n o\u2248"); $content = new A.GameContent(); A._addFont("6x8", 6, 8); A._addFont("8x8", 8, _null); A._addFont("8x10", 8, 10); A._addFont("9x12", 9, 12); A._addFont("10x12", 10, 12); A._addFont("12x16", 12, 16); A._addFont("16x16", 16, _null); A._addFont("16x20", 16, 20); t8 = init.G; fontName = A._asStringQ(A._asJSObject(A._asJSObject(t8.window).localStorage).getItem("font")); t12 = $._fonts.length; if (1 >= t12) return A.ioore($._fonts, 1); $.___font._value = $._fonts[1]; for (_i = 0; _i < t12; ++_i) { thisFont = $._fonts[_i]; if (thisFont.name === fontName) { $.___font._value = thisFont; break; } } t1 = A._asJSObjectQ(A._asJSObject(t8.document).querySelector("#game")); t1.toString; t1.append($.___font._readField$0().canvas); A._asJSObject(t8.window).addEventListener("resize", A._functionToJS0(A.main___resizeTerminal$closure())); t1 = $.___font._readField$0().terminal; t2 = A._setArrayType([], type$.JSArray_Screen_Input); if ($.___ui._value !== $.___ui) A.throwExpression(A.LateError$fieldAI($.___ui._name)); $.___ui._value = new A.UserInterface(new A.KeyBindings(A.LinkedHashMap_LinkedHashMap$_empty(type$._KeyBinding, type$.Input), type$.KeyBindings_Input), t2, t1, type$.UserInterface_Input); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(13, false, false), t1.$ti._precomputed1._as(B.Input_ok)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(27, false, false), t1.$ti._precomputed1._as(B.Input_cancel)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(192, false, false), t1.$ti._precomputed1._as(B.Input_cancel)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(70, true, false), t1.$ti._precomputed1._as(B.Input_forfeit)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(81, false, false), t1.$ti._precomputed1._as(B.Input_quit)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(67, false, false), t1.$ti._precomputed1._as(B.Input_operate)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(68, false, false), t1.$ti._precomputed1._as(B.Input_drop)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(85, false, false), t1.$ti._precomputed1._as(B.Input_use)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(71, false, false), t1.$ti._precomputed1._as(B.Input_pickUp)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(88, false, false), t1.$ti._precomputed1._as(B.Input_swap)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(69, false, false), t1.$ti._precomputed1._as(B.Input_equip)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(84, false, false), t1.$ti._precomputed1._as(B.Input_toss)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(83, false, false), t1.$ti._precomputed1._as(B.Input_selectSkill)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(65, false, false), t1.$ti._precomputed1._as(B.Input_heroInfo)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(83, true, false), t1.$ti._precomputed1._as(B.Input_editSkills)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(69, true, false), t1.$ti._precomputed1._as(B.Input_spendExperience)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(73, false, false), t1.$ti._precomputed1._as(B.Input_nw)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(79, false, false), t1.$ti._precomputed1._as(B.Input_n)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(80, false, false), t1.$ti._precomputed1._as(B.Input_ne)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(75, false, false), t1.$ti._precomputed1._as(B.Input_w)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(186, false, false), t1.$ti._precomputed1._as(B.Input_e)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(188, false, false), t1.$ti._precomputed1._as(B.Input_sw)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(190, false, false), t1.$ti._precomputed1._as(B.Input_s)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(191, false, false), t1.$ti._precomputed1._as(B.Input_se)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(73, true, false), t1.$ti._precomputed1._as(B.Input_runNW)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(79, true, false), t1.$ti._precomputed1._as(B.Input_runN)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(80, true, false), t1.$ti._precomputed1._as(B.Input_runNE)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(75, true, false), t1.$ti._precomputed1._as(B.Input_runW)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(186, true, false), t1.$ti._precomputed1._as(B.Input_runE)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(188, true, false), t1.$ti._precomputed1._as(B.Input_runSW)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(190, true, false), t1.$ti._precomputed1._as(B.Input_runS)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(191, true, false), t1.$ti._precomputed1._as(B.Input_runSE)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(73, false, true), t1.$ti._precomputed1._as(B.Input_fireNW)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(79, false, true), t1.$ti._precomputed1._as(B.Input_fireN)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(80, false, true), t1.$ti._precomputed1._as(B.Input_fireNE)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(75, false, true), t1.$ti._precomputed1._as(B.Input_fireW)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(186, false, true), t1.$ti._precomputed1._as(B.Input_fireE)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(188, false, true), t1.$ti._precomputed1._as(B.Input_fireSW)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(190, false, true), t1.$ti._precomputed1._as(B.Input_fireS)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(191, false, true), t1.$ti._precomputed1._as(B.Input_fireSE)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(76, false, false), t1.$ti._precomputed1._as(B.Input_ok)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(76, true, false), t1.$ti._precomputed1._as(B.Input_rest)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(76, false, true), t1.$ti._precomputed1._as(B.Input_fire)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(38, false, false), t1.$ti._precomputed1._as(B.Input_n)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(37, false, false), t1.$ti._precomputed1._as(B.Input_w)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(39, false, false), t1.$ti._precomputed1._as(B.Input_e)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(40, false, false), t1.$ti._precomputed1._as(B.Input_s)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(38, true, false), t1.$ti._precomputed1._as(B.Input_runN)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(37, true, false), t1.$ti._precomputed1._as(B.Input_runW)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(39, true, false), t1.$ti._precomputed1._as(B.Input_runE)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(40, true, false), t1.$ti._precomputed1._as(B.Input_runS)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(38, false, true), t1.$ti._precomputed1._as(B.Input_fireN)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(37, false, true), t1.$ti._precomputed1._as(B.Input_fireW)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(39, false, true), t1.$ti._precomputed1._as(B.Input_fireE)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(40, false, true), t1.$ti._precomputed1._as(B.Input_fireS)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(103, false, false), t1.$ti._precomputed1._as(B.Input_nw)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(104, false, false), t1.$ti._precomputed1._as(B.Input_n)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(105, false, false), t1.$ti._precomputed1._as(B.Input_ne)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(100, false, false), t1.$ti._precomputed1._as(B.Input_w)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(102, false, false), t1.$ti._precomputed1._as(B.Input_e)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(97, false, false), t1.$ti._precomputed1._as(B.Input_sw)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(98, false, false), t1.$ti._precomputed1._as(B.Input_s)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(99, false, false), t1.$ti._precomputed1._as(B.Input_se)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(103, true, false), t1.$ti._precomputed1._as(B.Input_runNW)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(104, true, false), t1.$ti._precomputed1._as(B.Input_runN)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(105, true, false), t1.$ti._precomputed1._as(B.Input_runNE)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(100, true, false), t1.$ti._precomputed1._as(B.Input_runW)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(102, true, false), t1.$ti._precomputed1._as(B.Input_runE)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(97, true, false), t1.$ti._precomputed1._as(B.Input_runSW)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(98, true, false), t1.$ti._precomputed1._as(B.Input_runS)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(99, true, false), t1.$ti._precomputed1._as(B.Input_runSE)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(101, false, false), t1.$ti._precomputed1._as(B.Input_ok)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(1001, false, false), t1.$ti._precomputed1._as(B.Input_ok)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(101, true, false), t1.$ti._precomputed1._as(B.Input_rest)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(1001, true, false), t1.$ti._precomputed1._as(B.Input_rest)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(101, false, true), t1.$ti._precomputed1._as(B.Input_fire)); t1 = $.___ui._readField$0().keyPress; t1._bindings.$indexSet(0, new A._KeyBinding(87, true, true), t1.$ti._precomputed1._as(B.Input_wizard)); t1 = $.___ui._readField$0(); t2 = new A.Storage($content, A._setArrayType([], type$.JSArray_HeroSave)); t2._load$0(); t1.push$1(new A.MainMenuScreen($content, t2)); $.___ui._readField$0().set$handlingInput(true); $.___ui._readField$0().set$running(true); t8 = A._asJSObjectQ(A._asJSObject(t8.document).body); t8.toString; t2 = type$._ElementEventStreamImpl_JSObject; A._EventStreamSubscription$(t8, "keydown", t2._eval$1("~(1)?")._as(new A.main_closure()), false, t2._precomputed1); }, _addFont($name, charWidth, charHeight) { var t1, _this, t2, t3, terminal; if (charHeight == null) charHeight = charWidth; t1 = init.G; _this = A._asJSObject(A._asJSObject(t1.document).createElement("canvas")); t2 = type$._ElementEventStreamImpl_JSObject; t3 = t2._eval$1("~(1)?"); t2 = t2._precomputed1; A._EventStreamSubscription$(_this, "dblclick", t3._as(new A._addFont_closure()), false, t2); terminal = A._makeTerminal(_this, charWidth, charHeight); B.JSArray_methods.add$1($._fonts, new A.TerminalFont($name, _this, terminal, charWidth, charHeight)); A._EventStreamSubscription$(_this, "click", t3._as(new A._addFont_closure0(terminal)), false, t2); _this = A._asJSObject(A._asJSObject(t1.document).createElement("button")); _this.innerHTML = $name; A._EventStreamSubscription$(_this, "click", t3._as(new A._addFont_closure1($name)), false, t2); A._asJSObject(A._asJSObjectQ(A._asJSObject(t1.document).querySelector(".button-bar")).appendChild(_this)); }, _makeTerminal(canvas, charWidth, charHeight) { var scale, canvasWidth, canvasHeight, file, t2, t3, _this, t1 = init.G, width = B.JSInt_methods.$tdiv(A._asInt(A._asJSObject(t1.window).innerWidth) - 20, charWidth), height = B.JSInt_methods.$tdiv(A._asInt(A._asJSObject(t1.window).innerHeight) - 30, charHeight); width = Math.max(width, 80); height = Math.max(height, 40); scale = B.JSNumber_methods.toInt$0(A._asDouble(A._asJSObject(t1.window).devicePixelRatio)); canvasWidth = charWidth * width; canvasHeight = charHeight * height; canvas.width = canvasWidth * scale; canvas.height = canvasHeight * scale; A._asJSObject(canvas.style).width = "" + canvasWidth + "px"; A._asJSObject(canvas.style).height = "" + canvasHeight + "px"; file = "font_" + charWidth; if (charWidth !== charHeight) file += "_" + charHeight; scale = B.JSNumber_methods.toInt$0(A._asDouble(A._asJSObject(t1.window).devicePixelRatio)); t2 = width * height; t3 = A.List_List$filled(t2, B.Glyph_F97, false, type$.Glyph); t2 = A.List_List$filled(t2, B.Glyph_F97, false, type$.nullable_Glyph); _this = A._asJSObject(A._asJSObject(t1.document).createElement("img")); _this.src = file + ".png"; return A.RetroTerminal$_(new A.Display(new A.Array2D(t3, new A.Rect(new A.Vec(0, 0), new A.Vec(width, height)), type$.Array2D_Glyph), new A.Array2D(t2, new A.Rect(new A.Vec(0, 0), new A.Vec(width, height)), type$.Array2D_nullable_Glyph)), charWidth, charHeight, canvas, _this, scale); }, _resizeTerminal() { var terminal = A._makeTerminal($.___font._readField$0().canvas, $.___font._readField$0().charWidth, $.___font._readField$0().charHeight); $.___font._readField$0().terminal = terminal; $.___ui._readField$0().setTerminal$1(terminal); }, _fullscreen() { var methods, _i, method, _null = null, t1 = A._asJSObjectQ(A._asJSObject(init.G.document).querySelector("#game")); t1.toString; methods = ["requestFullscreen", "mozRequestFullScreen", "webkitRequestFullscreen", "msRequestFullscreen"]; for (_i = 0; _i < 4; ++_i) { method = methods[_i]; if (method in t1) { A.JSObjectUnsafeUtilExtension__callMethod(t1, method, _null, _null, _null, _null); return; } } }, _refreshDebugBoxes() { A._asInt(A._asJSObject(init.G.window).requestAnimationFrame(A._functionToJS0(new A._refreshDebugBoxes_refresh()))); }, TerminalFont: function TerminalFont(t0, t1, t2, t3, t4) { var _ = this; _.name = t0; _.canvas = t1; _.terminal = t2; _.charWidth = t3; _.charHeight = t4; }, main_closure: function main_closure() { }, _addFont_closure: function _addFont_closure() { }, _addFont_closure0: function _addFont_closure0(t0) { this.terminal = t0; }, _addFont_closure1: function _addFont_closure1(t0) { this.name = t0; }, _refreshDebugBoxes_refresh: function _refreshDebugBoxes_refresh() { }, _refreshDebugBoxes_refresh_closure: function _refreshDebugBoxes_refresh_closure() { }, printString(string) { if (typeof dartPrint == "function") { dartPrint(string); return; } if (typeof console == "object" && typeof console.log != "undefined") { console.log(string); return; } if (typeof print == "function") { print(string); return; } throw "Unable to print message: " + String(string); }, JSObjectUnsafeUtilExtension__callMethod(_this, method, arg1, arg2, arg3, arg4) { var t1 = _this[method](); return t1; }, _functionToJS0(f) { var result; if (typeof f == "function") throw A.wrapException(A.ArgumentError$("Attempting to rewrap a JS function.", null)); result = function(_call, f) { return function() { return _call(f); }; }(A._callDartFunctionFast0, f); result[$.$get$DART_CLOSURE_PROPERTY_NAME()] = f; return result; }, _functionToJS1(f) { var result; if (typeof f == "function") throw A.wrapException(A.ArgumentError$("Attempting to rewrap a JS function.", null)); result = function(_call, f) { return function(arg1) { return _call(f, arg1, arguments.length); }; }(A._callDartFunctionFast1, f); result[$.$get$DART_CLOSURE_PROPERTY_NAME()] = f; return result; }, _callDartFunctionFast0(callback) { return type$.Function._as(callback).call$0(); }, _callDartFunctionFast1(callback, arg1, $length) { type$.Function._as(callback); if (A._asInt($length) >= 1) return callback.call$1(arg1); return callback.call$0(); }, _class($name, startingItems, description, masteries, spells) { var t1, t2, _i, skill, proficiency, proficiencies = A.LinkedHashMap_LinkedHashMap$_empty(type$.Skill, type$.double); for (t1 = $.$get$Skills_all(), t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { skill = t1[_i]; proficiency = skill instanceof A.MasteryDiscipline ? masteries : 1; proficiencies.$indexSet(0, skill, skill instanceof A.Spell ? proficiency * spells : proficiency); } return new A.HeroClass($name, description, proficiencies, startingItems); }, Affixes_find($name) { var t1, _i, affix; for (t1 = [$.$get$Affixes_prefixes(), $.$get$Affixes_suffixes()], _i = 0; _i < 2; ++_i) { affix = t1[_i].tryFind$1($name); if (affix != null) return affix; } throw A.wrapException(A.ArgumentError$("Unknown affix '" + $name + "'.", null)); }, gems() { var t1 = type$.String, t2 = type$.int; A.recipe("Uncut Amethyst", A.LinkedHashMap_LinkedHashMap$_literal(["Amethyst Shard", 4], t1, t2)); A.recipe("Faceted Amethyst", A.LinkedHashMap_LinkedHashMap$_literal(["Uncut Amethyst", 4], t1, t2)); A.recipe("Uncut Sapphire", A.LinkedHashMap_LinkedHashMap$_literal(["Sapphire Shard", 4], t1, t2)); A.recipe("Faceted Sapphire", A.LinkedHashMap_LinkedHashMap$_literal(["Uncut Sapphire", 4], t1, t2)); A.recipe("Uncut Emerald", A.LinkedHashMap_LinkedHashMap$_literal(["Emerald Shard", 4], t1, t2)); A.recipe("Faceted Emerald", A.LinkedHashMap_LinkedHashMap$_literal(["Uncut Emerald", 4], t1, t2)); A.recipe("Uncut Ruby", A.LinkedHashMap_LinkedHashMap$_literal(["Ruby Shard", 4], t1, t2)); A.recipe("Faceted Ruby", A.LinkedHashMap_LinkedHashMap$_literal(["Uncut Ruby", 4], t1, t2)); A.recipe("Uncut Diamond", A.LinkedHashMap_LinkedHashMap$_literal(["Diamond Shard", 4], t1, t2)); A.recipe("Faceted Diamond", A.LinkedHashMap_LinkedHashMap$_literal(["Uncut Diamond", 4], t1, t2)); }, healing() { var _s16_ = "Healing Poultice", _s22_ = "Potion of Amelioration", t1 = type$.String, t2 = type$.int; A.recipe("Mending Salve", A.LinkedHashMap_LinkedHashMap$_literal(["Soothing Balm", 3], t1, t2)); A.recipe(_s16_, A.LinkedHashMap_LinkedHashMap$_literal(["Mending Salve", 3], t1, t2)); A.recipe(_s22_, A.LinkedHashMap_LinkedHashMap$_literal([_s16_, 3], t1, t2)); A.recipe("Potion of Rejuvenation", A.LinkedHashMap_LinkedHashMap$_literal([_s22_, 4], t1, t2)); }, teleportation() { var _s22_ = "Scroll of Sidestepping", _s17_ = "Scroll of Phasing", _s23_ = "Scroll of Teleportation", t1 = type$.String, t2 = type$.int; A.recipe(_s22_, A.LinkedHashMap_LinkedHashMap$_literal(["Insect Wing", 1, "Feather", 1], t1, t2)); A.recipe(_s17_, A.LinkedHashMap_LinkedHashMap$_literal([_s22_, 2], t1, t2)); A.recipe(_s23_, A.LinkedHashMap_LinkedHashMap$_literal([_s17_, 2], t1, t2)); A.recipe("Scroll of Disappearing", A.LinkedHashMap_LinkedHashMap$_literal([_s23_, 2], t1, t2)); }, recipe(drop, ingredientNames) { var t2, t3, $name, ingredient, resource, t1 = A.LinkedHashMap_LinkedHashMap$_empty(type$.ItemType, type$.int); for (t2 = new A.LinkedHashMapEntriesIterable(ingredientNames, A._instanceType(ingredientNames)._eval$1("LinkedHashMapEntriesIterable<1,2>")).get$iterator(0); t2.moveNext$0();) { t3 = t2.__js_helper$_current; $name = t3.key; ingredient = t3.value; resource = $.$get$Items_types()._resources.$index(0, $name); if (resource == null) A.throwExpression(A.ArgumentError$('Unknown resource "' + $name + '".', null)); t1.$indexSet(0, resource.object, ingredient); } B.JSArray_methods.add$1($.Recipes_all, new A.Recipe(t1, A.parseDrop(drop, 1, null), drop)); }, dragons() { var dragons, t2, i, _i, t3, $name, element, color, t4, t5, builder, drop, _s21_ = "mythical/beast/dragon", _null = null, _s37_ = "{2} [are|is] deflected by its scales.", _s8_ = "treasure", _s9_ = "equipment", t1 = A.family("d", _s21_, _null, _null, _null, _null, _null); t1._vision = 12; t1._hearing = 8; B.JSArray_methods.add$1(t1._defenses, new A.Defense(10, _s37_)); t1._location = B.SpawnLocation_1; t1 = $.$get$Element_none(); dragons = [new A._Record_4(["forest", t1, B.Color_22_117_38, B.Color_0_64_39]), new A._Record_4(["brown", $.$get$Elements_earth(), B.Color_189_144_108, B.Color_142_82_55]), new A._Record_4(["blue", $.$get$Elements_water(), B.Color_64_163_229, B.Color_21_87_194]), new A._Record_4(["white", $.$get$Elements_cold(), B.Color_116_146_181, B.Color_226_223_240]), new A._Record_4(["purple", $.$get$Elements_poison(), B.Color_173_88_219, B.Color_86_30_138]), new A._Record_4(["green", $.$get$Elements_acid(), B.Color_131_158_13, B.Color_99_87_7]), new A._Record_4(["silver", $.$get$Elements_lightning(), B.Color_129_231_235, B.Color_64_163_229]), new A._Record_4(["red", $.$get$Elements_fire(), B.Color_255_122_105, B.Color_204_35_57]), new A._Record_4(["gold", $.$get$Elements_light(), B.Color_255_238_168, B.Color_222_156_33]), new A._Record_4(["black", $.$get$Elements_dark(), B.Color_63_75_115, B.Color_38_42_66]), new A._Record_4(["ethereal", $.$get$Elements_spirit(), B.Color_15_130_148, B.Color_26_46_150])]; for (t2 = $.___family._name, i = 0, _i = 0; _i < 11; ++_i) { t3 = dragons[_i]._values; $name = t3[0]; element = t3[1]; color = t3[2]; t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 38, 53)); t4 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 150, 350)); A.finishBreed(); t5 = $.___family._value; if (t5 === $.___family) A.throwExpression(A.LateError$fieldNI(t2)); t5 = t5._character; if (0 >= t5.length) return A.ioore(t5, 0); builder = A.BreedBuilder$("juvenile " + $name + " dragon", t3, _null, new A.Glyph(t5.charCodeAt(0), color, B.Color_0_0_0), t4); builder._speed = 0; builder._dodge = null; $._builder = builder; t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 20, 40)); t4 = builder._attacks; B.JSArray_methods.add$1(t4, new A.Attack(_null, "bite[s]", t3, 0, t1)); t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 15, 25)); B.JSArray_methods.add$1(t4, new A.Attack(_null, "claw[s]", t3, 0, t1)); t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 2, 10)); t4 = builder._depth; drop = new A._PercentDrop(100, A.parseDrop(_s8_, t4, _null)); if (t3 > 1) drop = new A._RepeatDrop(t3, drop); t3 = builder._drops; B.JSArray_methods.add$1(t3, drop); t5 = A.parseDrop("magic", t4, _null); B.JSArray_methods.add$1(t3, new A._PercentDrop(100, t5)); t4 = A.parseDrop(_s9_, t4, _null); B.JSArray_methods.add$1(t3, new A._PercentDrop(100, t4)); if (element !== t1) { t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 40, 100)); t4 = $.$get$_elementText(); t5 = t4.$index(0, element)[0]; t4 = t4.$index(0, element)[1]; B.JSArray_methods.add$1(builder._moves, new A.ConeMove(new A.Attack(new A.Noun(t5), t4, t3, 5, element), 11)); } ++i; } t3 = A.family("d", _s21_, _null, _null, _null, _null, _null); t3._vision = 16; t3._hearing = 10; B.JSArray_methods.add$1(t3._defenses, new A.Defense(20, _s37_)); t3._location = B.SpawnLocation_1; for (i = 0, _i = 0; _i < 11; ++_i) { t3 = dragons[_i]._values; $name = t3[0]; element = t3[1]; color = t3[3]; t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 48, 62)); t4 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 350, 850)); A.finishBreed(); t5 = $.___family._value; if (t5 === $.___family) A.throwExpression(A.LateError$fieldNI(t2)); t5 = t5._character; if (0 >= t5.length) return A.ioore(t5, 0); builder = A.BreedBuilder$($name + " dragon", t3, _null, new A.Glyph(t5.charCodeAt(0), color, B.Color_0_0_0), t4); builder._speed = 0; builder._dodge = null; $._builder = builder; t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 30, 50)); t4 = builder._attacks; B.JSArray_methods.add$1(t4, new A.Attack(_null, "bite[s]", t3, 0, t1)); t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 25, 35)); B.JSArray_methods.add$1(t4, new A.Attack(_null, "claw[s]", t3, 0, t1)); t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 5, 15)); t4 = builder._depth; drop = new A._PercentDrop(100, A.parseDrop(_s8_, t4, _null)); if (t3 > 1) drop = new A._RepeatDrop(t3, drop); t3 = builder._drops; B.JSArray_methods.add$1(t3, drop); t5 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 2, 5)); drop = new A._PercentDrop(100, A.parseDrop("magic", t4, _null)); if (t5 > 1) drop = new A._RepeatDrop(t5, drop); B.JSArray_methods.add$1(t3, drop); t5 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 2, 5)); drop = new A._PercentDrop(100, A.parseDrop(_s9_, t4, _null)); if (t5 > 1) drop = new A._RepeatDrop(t5, drop); B.JSArray_methods.add$1(t3, drop); if (element !== t1) { t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 70, 150)); t4 = $.$get$_elementText(); t5 = t4.$index(0, element)[0]; t4 = t4.$index(0, element)[1]; B.JSArray_methods.add$1(builder._moves, new A.ConeMove(new A.Attack(new A.Noun(t5), t4, t3, 10, element), 8)); } ++i; } }, greaterDragons() { var i, _i, t3, $name, element, color, t4, t5, builder, drop, _s21_ = "mythical/beast/dragon", _null = null, _s37_ = "{2} [are|is] deflected by its scales.", _s8_ = "treasure", _s9_ = "equipment", t1 = $.$get$Element_none(), dragons = [new A._Record_4(["forest", t1, B.Color_22_117_38, B.Color_0_64_39]), new A._Record_4(["brown", $.$get$Elements_earth(), B.Color_189_144_108, B.Color_142_82_55]), new A._Record_4(["blue", $.$get$Elements_water(), B.Color_64_163_229, B.Color_21_87_194]), new A._Record_4(["white", $.$get$Elements_cold(), B.Color_116_146_181, B.Color_226_223_240]), new A._Record_4(["purple", $.$get$Elements_poison(), B.Color_173_88_219, B.Color_86_30_138]), new A._Record_4(["green", $.$get$Elements_acid(), B.Color_131_158_13, B.Color_99_87_7]), new A._Record_4(["silver", $.$get$Elements_lightning(), B.Color_129_231_235, B.Color_64_163_229]), new A._Record_4(["red", $.$get$Elements_fire(), B.Color_255_122_105, B.Color_204_35_57]), new A._Record_4(["gold", $.$get$Elements_light(), B.Color_255_238_168, B.Color_222_156_33]), new A._Record_4(["black", $.$get$Elements_dark(), B.Color_63_75_115, B.Color_38_42_66]), new A._Record_4(["ethereal", $.$get$Elements_spirit(), B.Color_15_130_148, B.Color_26_46_150])], t2 = A.family("D", _s21_, _null, _null, _null, _null, _null); t2._vision = 12; t2._hearing = 8; B.JSArray_methods.add$1(t2._defenses, new A.Defense(10, _s37_)); t2._location = B.SpawnLocation_1; for (t2 = $.___family._name, i = 0, _i = 0; _i < 11; ++_i) { t3 = dragons[_i]._values; $name = t3[0]; element = t3[1]; color = t3[2]; t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 65, 85)); t4 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 800, 1500)); A.finishBreed(); t5 = $.___family._value; if (t5 === $.___family) A.throwExpression(A.LateError$fieldNI(t2)); t5 = t5._character; if (0 >= t5.length) return A.ioore(t5, 0); builder = A.BreedBuilder$("elder " + $name + " dragon", t3, _null, new A.Glyph(t5.charCodeAt(0), color, B.Color_0_0_0), t4); builder._speed = 0; builder._dodge = null; $._builder = builder; t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 40, 80)); t4 = builder._attacks; B.JSArray_methods.add$1(t4, new A.Attack(_null, "bite[s]", t3, 0, t1)); t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 35, 75)); B.JSArray_methods.add$1(t4, new A.Attack(_null, "claw[s]", t3, 0, t1)); t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 6, 16)); t4 = builder._depth; drop = new A._PercentDrop(100, A.parseDrop(_s8_, t4, _null)); if (t3 > 1) drop = new A._RepeatDrop(t3, drop); t3 = builder._drops; B.JSArray_methods.add$1(t3, drop); t5 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 3, 6)); drop = new A._PercentDrop(100, A.parseDrop("magic", t4, _null)); if (t5 > 1) drop = new A._RepeatDrop(t5, drop); B.JSArray_methods.add$1(t3, drop); t5 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 3, 6)); drop = new A._PercentDrop(100, A.parseDrop(_s9_, t4, _null)); if (t5 > 1) drop = new A._RepeatDrop(t5, drop); B.JSArray_methods.add$1(t3, drop); if (element !== t1) { t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 40, 100)); t4 = $.$get$_elementText(); t5 = t4.$index(0, element)[0]; t4 = t4.$index(0, element)[1]; B.JSArray_methods.add$1(builder._moves, new A.ConeMove(new A.Attack(new A.Noun(t5), t4, t3, 5, element), 11)); } ++i; } t3 = A.family("D", _s21_, _null, _null, _null, _null, _null); t3._vision = 16; t3._hearing = 10; B.JSArray_methods.add$1(t3._defenses, new A.Defense(20, _s37_)); t3._location = B.SpawnLocation_1; for (i = 0, _i = 0; _i < 11; ++_i) { t3 = dragons[_i]._values; $name = t3[0]; element = t3[1]; color = t3[3]; t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 80, 99)); t4 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 1400, 2000)); A.finishBreed(); t5 = $.___family._value; if (t5 === $.___family) A.throwExpression(A.LateError$fieldNI(t2)); t5 = t5._character; if (0 >= t5.length) return A.ioore(t5, 0); builder = A.BreedBuilder$("ancient " + $name + " dragon", t3, _null, new A.Glyph(t5.charCodeAt(0), color, B.Color_0_0_0), t4); builder._speed = 0; builder._dodge = null; $._builder = builder; t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 60, 100)); t4 = builder._attacks; B.JSArray_methods.add$1(t4, new A.Attack(_null, "bite[s]", t3, 0, t1)); t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 50, 80)); B.JSArray_methods.add$1(t4, new A.Attack(_null, "claw[s]", t3, 0, t1)); t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 7, 20)); t4 = builder._depth; drop = new A._PercentDrop(100, A.parseDrop(_s8_, t4, _null)); if (t3 > 1) drop = new A._RepeatDrop(t3, drop); t3 = builder._drops; B.JSArray_methods.add$1(t3, drop); t5 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 4, 7)); drop = new A._PercentDrop(100, A.parseDrop("magic", t4, _null)); if (t5 > 1) drop = new A._RepeatDrop(t5, drop); B.JSArray_methods.add$1(t3, drop); t5 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 4, 7)); drop = new A._PercentDrop(100, A.parseDrop(_s9_, t4, _null)); if (t5 > 1) drop = new A._RepeatDrop(t5, drop); B.JSArray_methods.add$1(t3, drop); if (element !== t1) { t3 = B.JSNumber_methods.round$0(A.lerpDouble(i, 0, 10, 200, 400)); t4 = $.$get$_elementText(); t5 = t4.$index(0, element)[0]; t4 = t4.$index(0, element)[1]; B.JSArray_methods.add$1(builder._moves, new A.ConeMove(new A.Attack(new A.Noun(t5), t4, t3, 10, element), 8)); } ++i; } }, Races__race($name, agility, description, fortitude, intellect, strength) { return new A.Race($name, description, A.LinkedHashMap_LinkedHashMap$_literal([B.Stat_Strength_0_strength, strength, B.Stat_Agility_1_agility, agility, B.Stat_Fortitude_2_fortitude, fortitude, B.Stat_Intellect_3_intellect, intellect], type$.Stat, type$.double)); }, Skills_find($name) { var skill; A._asString($name); skill = $.$get$Skills__byName().$index(0, $name); if (skill == null) throw A.wrapException(A.ArgumentError$("Unknown skill '" + $name + "'.", null)); return skill; }, Blob_make(size) { var blob, _null = null; if (size >= 64) { size = B.JSInt_methods._tdivFast$1(size, 8) * 8; blob = A.Blob__make(B.JSInt_methods._tdivFast$1(size, 8), 2, _null); blob = A.Blob__make(B.JSInt_methods._tdivFast$1(size, 4), 3, blob); blob = A.Blob__make(size, 6, A.Blob__make(B.JSInt_methods._tdivFast$1(size, 2), 5, blob)); } else if (size >= 32) { size = B.JSInt_methods._tdivFast$1(size, 4) * 4; blob = A.Blob__make(B.JSInt_methods._tdivFast$1(size, 4), 2, _null); blob = A.Blob__make(size, 5, A.Blob__make(B.JSInt_methods._tdivFast$1(size, 2), 3, blob)); } else if (size >= 16) { size = B.JSInt_methods._tdivFast$1(size, 2) * 2; blob = A.Blob__make(size, 3, A.Blob__make(B.JSInt_methods._tdivFast$1(size, 2), 2, _null)); } else blob = A.Blob__make(size, 3, _null); return A.Blob__crop(blob); }, Blob__make(size, smoothing, input) { var t6, t7, t8, t9, value, center, maxLength, i, t0, t10, walls, t11, _i, neighbor, t12, t13, t1 = type$.bool, t2 = new A.Rect(new A.Vec(0, 0), new A.Vec(size, size)), t3 = size * size, t4 = A.List_List$filled(t3, false, false, t1), t5 = type$.Array2D_bool, cells = new A.Array2D(t4, t2, t5), dest = new A.Array2D(A.List_List$filled(t3, false, false, t1), new A.Rect(new A.Vec(0, 0), new A.Vec(size, size)), t5); if (input != null) for (t1 = A.RectIterator$(t2.inflate$1(-1)), t2 = input._elements, t3 = input.bounds.size.x, t5 = t2.length; t1.moveNext$0();) { t6 = t1._x; t7 = t1._y; t8 = B.JSInt_methods._tdivFast$1(t6, 2); t9 = B.JSInt_methods._tdivFast$1(t7, 2); input._checkBounds$2(t8, t9); t8 = t9 * t3 + t8; if (!(t8 >= 0 && t8 < t5)) return A.ioore(t2, t8); value = t2[t8] ? 0.3 : 0.7; t8 = $.$get$rng().float$1(1); cells._checkBounds$2(t6, t7); B.JSArray_methods.$indexSet(t4, t7 * size + t6, t8 > value); } else { center = t2.get$center(); maxLength = Math.sqrt(new A.Vec(t2.get$left(), t2.get$top()).$sub(0, t2.get$center()).get$lengthSquared()); for (t1 = A.RectIterator$(t2.inflate$1(-1)); t1.moveNext$0();) { t2 = t1._x; t3 = t1._y; t5 = new A.Vec(t2, t3).$sub(0, center); t6 = t5.x; t5 = t5.y; t5 = Math.sqrt(t6 * t6 + t5 * t5); t6 = $.$get$rng().float$1(1); cells._checkBounds$2(t2, t3); B.JSArray_methods.$indexSet(t4, t3 * size + t2, t6 > t5 / maxLength); } } for (i = 0; i < smoothing; ++i, t0 = dest, dest = cells, cells = t0) for (t1 = cells.bounds, t2 = t1.inflate$1(-1), t3 = t2.pos, t3 = new A.RectIterator(t2, t3.x - 1, t3.y), t2 = dest.$ti._precomputed1, t4 = dest._elements, t5 = dest.bounds.size.x, t6 = cells._elements, t1 = t1.size.x, t7 = t6.length; t3.moveNext$0();) { t8 = t3._x; t9 = t3._y; cells._checkBounds$2(t8, t9); t10 = t9 * t1 + t8; if (!(t10 >= 0 && t10 < t7)) return A.ioore(t6, t10); walls = t6[t10] ? 1 : 0; for (t10 = new A.Vec(t8, t9).get$neighbors(), t11 = t10.length, _i = 0; _i < t11; ++_i) { neighbor = t10[_i]; t12 = neighbor.x; t13 = neighbor.y; cells._checkBounds$2(t12, t13); t12 = t13 * t1 + t12; if (!(t12 >= 0 && t12 < t7)) return A.ioore(t6, t12); if (t6[t12]) ++walls; } t10 = t2._as(walls >= 5); dest._checkBounds$2(t8, t9); B.JSArray_methods.$indexSet(t4, t9 * t5 + t8, t10); } return dest; }, Blob__crop(blob) { var t3, minX0, maxX, maxY, t4, t5, t6, result, t7, t8, t9, t1 = blob.bounds, t2 = t1.size, minX = t2.x, minY = t2.y; for (t1 = A.RectIterator$(t1), t2 = blob._elements, t3 = t2.length, minX0 = minX, maxX = -1, maxY = -1; t1.moveNext$0();) { t4 = t1._x; t5 = t1._y; blob._checkBounds$2(t4, t5); t6 = t5 * minX + t4; if (!(t6 >= 0 && t6 < t3)) return A.ioore(t2, t6); if (t2[t6]) { minX0 = Math.min(minX0, t4); maxX = Math.max(maxX, t4); minY = Math.min(minY, t5); maxY = Math.max(maxY, t5); } } t1 = maxX - minX0 + 1; t4 = maxY - minY + 1; t5 = new A.Rect(new A.Vec(0, 0), new A.Vec(t1, t4)); t4 = A.List_List$filled(t1 * t4, false, false, type$.bool); result = new A.Array2D(t4, t5, type$.Array2D_bool); for (t5 = A.RectIterator$(t5); t5.moveNext$0();) { t6 = t5._x; t7 = t5._y; t8 = t6 + minX0; t9 = t7 + minY; blob._checkBounds$2(t8, t9); t8 = t9 * minX + t8; if (!(t8 >= 0 && t8 < t3)) return A.ioore(t2, t8); t8 = A._asBool(t2[t8]); result._checkBounds$2(t6, t7); B.JSArray_methods.$indexSet(t4, t7 * t1 + t6, t8); } return result; }, elementColor(element) { var t1 = A.LinkedHashMap_LinkedHashMap$_literal([$.$get$Element_none(), B.Color_116_146_181, $.$get$Elements_air(), B.Color_129_231_235, $.$get$Elements_earth(), B.Color_142_82_55, $.$get$Elements_fire(), B.Color_204_35_57, $.$get$Elements_water(), B.Color_26_46_150, $.$get$Elements_acid(), B.Color_131_158_13, $.$get$Elements_cold(), B.Color_64_163_229, $.$get$Elements_lightning(), B.Color_173_88_219, $.$get$Elements_poison(), B.Color_22_117_38, $.$get$Elements_dark(), B.Color_38_42_66, $.$get$Elements_light(), B.Color_255_238_168, $.$get$Elements_spirit(), B.Color_86_30_138], type$.Element, type$.Color).$index(0, element); t1.toString; return t1; } }, B = {}; var holders = [A, J, B]; var $ = {}; A.JS_CONST.prototype = {}; J.Interceptor.prototype = { $eq(receiver, other) { return receiver === other; }, get$hashCode(receiver) { return A.Primitives_objectHashCode(receiver); }, toString$0(receiver) { return "Instance of '" + A.Primitives_objectTypeName(receiver) + "'"; }, get$runtimeType(receiver) { return A.createRuntimeType(A._instanceTypeFromConstructor(this)); } }; J.JSBool.prototype = { toString$0(receiver) { return String(receiver); }, get$hashCode(receiver) { return receiver ? 519018 : 218159; }, get$runtimeType(receiver) { return A.createRuntimeType(type$.bool); }, $isTrustedGetRuntimeType: 1, $isbool: 1 }; J.JSNull.prototype = { $eq(receiver, other) { return null == other; }, toString$0(receiver) { return "null"; }, get$hashCode(receiver) { return 0; }, $isTrustedGetRuntimeType: 1 }; J.JavaScriptObject.prototype = {$isJSObject: 1}; J.LegacyJavaScriptObject.prototype = { get$hashCode(receiver) { return 0; }, toString$0(receiver) { return String(receiver); } }; J.PlainJavaScriptObject.prototype = {}; J.UnknownJavaScriptObject.prototype = {}; J.JavaScriptFunction.prototype = { toString$0(receiver) { var dartClosure = receiver[$.$get$DART_CLOSURE_PROPERTY_NAME()]; if (dartClosure == null) return this.super$LegacyJavaScriptObject$toString(receiver); return "JavaScript function for " + J.toString$0$(dartClosure); }, $isFunction: 1 }; J.JavaScriptBigInt.prototype = { get$hashCode(receiver) { return 0; }, toString$0(receiver) { return String(receiver); } }; J.JavaScriptSymbol.prototype = { get$hashCode(receiver) { return 0; }, toString$0(receiver) { return String(receiver); } }; J.JSArray.prototype = { add$1(receiver, value) { A._arrayInstanceType(receiver)._precomputed1._as(value); receiver.$flags & 1 && A.throwUnsupportedOperation(receiver, 29); receiver.push(value); }, removeAt$1(receiver, index) { receiver.$flags & 1 && A.throwUnsupportedOperation(receiver, "removeAt", 1); if (index < 0 || index >= receiver.length) throw A.wrapException(A.RangeError$value(index, null)); return receiver.splice(index, 1)[0]; }, removeLast$0(receiver) { receiver.$flags & 1 && A.throwUnsupportedOperation(receiver, "removeLast", 1); if (receiver.length === 0) throw A.wrapException(A.diagnoseIndexError(receiver, -1)); return receiver.pop(); }, remove$1(receiver, element) { var i; receiver.$flags & 1 && A.throwUnsupportedOperation(receiver, "remove", 1); for (i = 0; i < receiver.length; ++i) if (J.$eq$(receiver[i], element)) { receiver.splice(i, 1); return true; } return false; }, removeWhere$1(receiver, test) { A._arrayInstanceType(receiver)._eval$1("bool(1)")._as(test); receiver.$flags & 1 && A.throwUnsupportedOperation(receiver, 16); this._removeWhere$2(receiver, test, true); }, _removeWhere$2(receiver, test, removeMatching) { var retained, end, i, element, t1; A._arrayInstanceType(receiver)._eval$1("bool(1)")._as(test); retained = []; end = receiver.length; for (i = 0; i < end; ++i) { element = receiver[i]; if (!test.call$1(element)) retained.push(element); if (receiver.length !== end) throw A.wrapException(A.ConcurrentModificationError$(receiver)); } t1 = retained.length; if (t1 === end) return; this.set$length(receiver, t1); for (i = 0; i < retained.length; ++i) receiver[i] = retained[i]; }, where$1(receiver, f) { var t1 = A._arrayInstanceType(receiver); return new A.WhereIterable(receiver, t1._eval$1("bool(1)")._as(f), t1._eval$1("WhereIterable<1>")); }, addAll$1(receiver, collection) { var t1; A._arrayInstanceType(receiver)._eval$1("Iterable<1>")._as(collection); receiver.$flags & 1 && A.throwUnsupportedOperation(receiver, "addAll", 2); if (Array.isArray(collection)) { this._addAllFromArray$1(receiver, collection); return; } for (t1 = J.get$iterator$ax(collection); t1.moveNext$0();) receiver.push(t1.get$current()); }, _addAllFromArray$1(receiver, array) { var len, i; type$.JSArray_dynamic._as(array); len = array.length; if (len === 0) return; if (receiver === array) throw A.wrapException(A.ConcurrentModificationError$(receiver)); for (i = 0; i < len; ++i) receiver.push(array[i]); }, clear$0(receiver) { receiver.$flags & 1 && A.throwUnsupportedOperation(receiver, "clear", "clear"); receiver.length = 0; }, forEach$1(receiver, f) { var end, i; A._arrayInstanceType(receiver)._eval$1("~(1)")._as(f); end = receiver.length; for (i = 0; i < end; ++i) { f.call$1(receiver[i]); if (receiver.length !== end) throw A.wrapException(A.ConcurrentModificationError$(receiver)); } }, join$1(receiver, separator) { var i, list = A.List_List$filled(receiver.length, "", false, type$.String); for (i = 0; i < receiver.length; ++i) this.$indexSet(list, i, A.S(receiver[i])); return list.join(separator); }, fold$1$2(receiver, initialValue, combine, $T) { var $length, value, i; $T._as(initialValue); A._arrayInstanceType(receiver)._bind$1($T)._eval$1("1(1,2)")._as(combine); $length = receiver.length; for (value = initialValue, i = 0; i < $length; ++i) { value = combine.call$2(value, receiver[i]); if (receiver.length !== $length) throw A.wrapException(A.ConcurrentModificationError$(receiver)); } return value; }, firstWhere$2$orElse(receiver, test, orElse) { var end, i, element; A._arrayInstanceType(receiver)._eval$1("bool(1)")._as(test); end = receiver.length; for (i = 0; i < end; ++i) { element = receiver[i]; if (test.call$1(element)) return element; if (receiver.length !== end) throw A.wrapException(A.ConcurrentModificationError$(receiver)); } throw A.wrapException(A.IterableElementError_noElement()); }, firstWhere$1(receiver, test) { return this.firstWhere$2$orElse(receiver, test, null); }, elementAt$1(receiver, index) { if (!(index >= 0 && index < receiver.length)) return A.ioore(receiver, index); return receiver[index]; }, sublist$2(receiver, start, end) { var end0 = receiver.length; if (start > end0) throw A.wrapException(A.RangeError$range(start, 0, end0, "start", null)); if (end == null) end = end0; else if (end < start || end > end0) throw A.wrapException(A.RangeError$range(end, start, end0, "end", null)); if (start === end) return A._setArrayType([], A._arrayInstanceType(receiver)); return A._setArrayType(receiver.slice(start, end), A._arrayInstanceType(receiver)); }, sublist$1(receiver, start) { return this.sublist$2(receiver, start, null); }, get$first(receiver) { if (receiver.length > 0) return receiver[0]; throw A.wrapException(A.IterableElementError_noElement()); }, get$last(receiver) { var t1 = receiver.length; if (t1 > 0) return receiver[t1 - 1]; throw A.wrapException(A.IterableElementError_noElement()); }, get$single(receiver) { var t1 = receiver.length; if (t1 === 1) { if (0 >= t1) return A.ioore(receiver, 0); return receiver[0]; } if (t1 === 0) throw A.wrapException(A.IterableElementError_noElement()); throw A.wrapException(A.IterableElementError_tooMany()); }, setRange$4(receiver, start, end, iterable, skipCount) { var $length, otherList, t1, i; A._arrayInstanceType(receiver)._eval$1("Iterable<1>")._as(iterable); receiver.$flags & 2 && A.throwUnsupportedOperation(receiver, 5); A.RangeError_checkValidRange(start, end, receiver.length); $length = end - start; if ($length === 0) return; A.RangeError_checkNotNegative(skipCount, "skipCount"); otherList = iterable; t1 = J.getInterceptor$asx(otherList); if (skipCount + $length > t1.get$length(otherList)) throw A.wrapException(A.IterableElementError_tooFew()); if (skipCount < start) for (i = $length - 1; i >= 0; --i) receiver[start + i] = t1.$index(otherList, skipCount + i); else for (i = 0; i < $length; ++i) receiver[start + i] = t1.$index(otherList, skipCount + i); }, fillRange$3(receiver, start, end, fillValue) { var i; A._arrayInstanceType(receiver)._eval$1("1?")._as(fillValue); receiver.$flags & 2 && A.throwUnsupportedOperation(receiver, "fillRange"); A.RangeError_checkValidRange(start, end, receiver.length); for (i = start; i < end; ++i) receiver[i] = fillValue; }, any$1(receiver, test) { var end, i; A._arrayInstanceType(receiver)._eval$1("bool(1)")._as(test); end = receiver.length; for (i = 0; i < end; ++i) { if (test.call$1(receiver[i])) return true; if (receiver.length !== end) throw A.wrapException(A.ConcurrentModificationError$(receiver)); } return false; }, every$1(receiver, test) { var end, i; A._arrayInstanceType(receiver)._eval$1("bool(1)")._as(test); end = receiver.length; for (i = 0; i < end; ++i) { if (!test.call$1(receiver[i])) return false; if (receiver.length !== end) throw A.wrapException(A.ConcurrentModificationError$(receiver)); } return true; }, sort$1(receiver, compare) { var len, a, b, undefineds, i, t1 = A._arrayInstanceType(receiver); t1._eval$1("int(1,1)?")._as(compare); receiver.$flags & 2 && A.throwUnsupportedOperation(receiver, "sort"); len = receiver.length; if (len < 2) return; if (compare == null) compare = J._interceptors_JSArray__compareAny$closure(); if (len === 2) { a = receiver[0]; b = receiver[1]; t1 = compare.call$2(a, b); if (typeof t1 !== "number") return t1.$gt(); if (t1 > 0) { receiver[0] = b; receiver[1] = a; } return; } undefineds = 0; if (t1._precomputed1._is(null)) for (i = 0; i < receiver.length; ++i) if (receiver[i] === void 0) { receiver[i] = null; ++undefineds; } receiver.sort(A.convertDartClosureToJS(compare, 2)); if (undefineds > 0) this._replaceSomeNullsWithUndefined$1(receiver, undefineds); }, sort$0(receiver) { return this.sort$1(receiver, null); }, _replaceSomeNullsWithUndefined$1(receiver, count) { var i0, i = receiver.length; for (; i0 = i - 1, i > 0; i = i0) if (receiver[i0] === null) { receiver[i0] = void 0; --count; if (count === 0) break; } }, shuffle$1(receiver, random) { var $length, pos, t1, tmp; receiver.$flags & 2 && A.throwUnsupportedOperation(receiver, "shuffle"); $length = receiver.length; while ($length > 1) { pos = random.nextInt$1($length); --$length; t1 = receiver.length; if (!($length < t1)) return A.ioore(receiver, $length); tmp = receiver[$length]; if (!(pos >= 0 && pos < t1)) return A.ioore(receiver, pos); receiver[$length] = receiver[pos]; receiver[pos] = tmp; } }, indexOf$1(receiver, element) { var i, $length = receiver.length; if (0 >= $length) return -1; for (i = 0; i < $length; ++i) { if (!(i < receiver.length)) return A.ioore(receiver, i); if (J.$eq$(receiver[i], element)) return i; } return -1; }, contains$1(receiver, other) { var i; for (i = 0; i < receiver.length; ++i) if (J.$eq$(receiver[i], other)) return true; return false; }, get$isNotEmpty(receiver) { return receiver.length !== 0; }, toString$0(receiver) { return A.Iterable_iterableToFullString(receiver, "[", "]"); }, toList$1$growable(receiver, growable) { var t1 = A._setArrayType(receiver.slice(0), A._arrayInstanceType(receiver)); return t1; }, toList$0(receiver) { return this.toList$1$growable(receiver, true); }, get$iterator(receiver) { return new J.ArrayIterator(receiver, receiver.length, A._arrayInstanceType(receiver)._eval$1("ArrayIterator<1>")); }, get$hashCode(receiver) { return A.Primitives_objectHashCode(receiver); }, get$length(receiver) { return receiver.length; }, set$length(receiver, newLength) { receiver.$flags & 1 && A.throwUnsupportedOperation(receiver, "set length", "change the length of"); if (newLength < 0) throw A.wrapException(A.RangeError$range(newLength, 0, null, "newLength", null)); if (newLength > receiver.length) A._arrayInstanceType(receiver)._precomputed1._as(null); receiver.length = newLength; }, $index(receiver, index) { A._asInt(index); if (!(index >= 0 && index < receiver.length)) throw A.wrapException(A.diagnoseIndexError(receiver, index)); return receiver[index]; }, $indexSet(receiver, index, value) { A._arrayInstanceType(receiver)._precomputed1._as(value); receiver.$flags & 2 && A.throwUnsupportedOperation(receiver); if (!(index >= 0 && index < receiver.length)) throw A.wrapException(A.diagnoseIndexError(receiver, index)); receiver[index] = value; }, indexWhere$1(receiver, test) { var i; A._arrayInstanceType(receiver)._eval$1("bool(1)")._as(test); if (0 >= receiver.length) return -1; for (i = 0; i < receiver.length; ++i) if (test.call$1(receiver[i])) return i; return -1; }, $isEfficientLengthIterable: 1, $isIterable: 1, $isList: 1 }; J.JSArraySafeToStringHook.prototype = { tryFormat$1(array) { var flags, info, base; if (!Array.isArray(array)) return null; flags = array.$flags | 0; if ((flags & 4) !== 0) info = "const, "; else if ((flags & 2) !== 0) info = "unmodifiable, "; else info = (flags & 1) !== 0 ? "fixed, " : ""; base = "Instance of '" + A.Primitives_objectTypeName(array) + "'"; if (info === "") return base; return base + " (" + info + "length: " + array.length + ")"; } }; J.JSUnmodifiableArray.prototype = {}; J.ArrayIterator.prototype = { get$current() { var t1 = this.__interceptors$_current; return t1 == null ? this.$ti._precomputed1._as(t1) : t1; }, moveNext$0() { var t2, _this = this, t1 = _this.__interceptors$_iterable, $length = t1.length; if (_this.__interceptors$_length !== $length) { t1 = A.throwConcurrentModificationError(t1); throw A.wrapException(t1); } t2 = _this.__interceptors$_index; if (t2 >= $length) { _this.__interceptors$_current = null; return false; } _this.__interceptors$_current = t1[t2]; _this.__interceptors$_index = t2 + 1; return true; }, $isIterator: 1 }; J.JSNumber.prototype = { compareTo$1(receiver, b) { var bIsNegative; A._asNum(b); if (receiver < b) return -1; else if (receiver > b) return 1; else if (receiver === b) { if (receiver === 0) { bIsNegative = this.get$isNegative(b); if (this.get$isNegative(receiver) === bIsNegative) return 0; if (this.get$isNegative(receiver)) return -1; return 1; } return 0; } else if (isNaN(receiver)) { if (isNaN(b)) return 0; return 1; } else return -1; }, get$isNegative(receiver) { return receiver === 0 ? 1 / receiver < 0 : receiver < 0; }, toInt$0(receiver) { var t1; if (receiver >= -2147483648 && receiver <= 2147483647) return receiver | 0; if (isFinite(receiver)) { t1 = receiver < 0 ? Math.ceil(receiver) : Math.floor(receiver); return t1 + 0; } throw A.wrapException(A.UnsupportedError$("" + receiver + ".toInt()")); }, ceil$0(receiver) { var truncated, d; if (receiver >= 0) { if (receiver <= 2147483647) { truncated = receiver | 0; return receiver === truncated ? truncated : truncated + 1; } } else if (receiver >= -2147483648) return receiver | 0; d = Math.ceil(receiver); if (isFinite(d)) return d; throw A.wrapException(A.UnsupportedError$("" + receiver + ".ceil()")); }, floor$0(receiver) { var truncated, d; if (receiver >= 0) { if (receiver <= 2147483647) return receiver | 0; } else if (receiver >= -2147483648) { truncated = receiver | 0; return receiver === truncated ? truncated : truncated - 1; } d = Math.floor(receiver); if (isFinite(d)) return d; throw A.wrapException(A.UnsupportedError$("" + receiver + ".floor()")); }, round$0(receiver) { if (receiver > 0) { if (receiver !== 1 / 0) return Math.round(receiver); } else if (receiver > -1 / 0) return 0 - Math.round(0 - receiver); throw A.wrapException(A.UnsupportedError$("" + receiver + ".round()")); }, clamp$2(receiver, lowerLimit, upperLimit) { if (B.JSInt_methods.compareTo$1(lowerLimit, upperLimit) > 0) throw A.wrapException(A.argumentErrorValue(lowerLimit)); if (this.compareTo$1(receiver, lowerLimit) < 0) return lowerLimit; if (this.compareTo$1(receiver, upperLimit) > 0) return upperLimit; return receiver; }, toStringAsFixed$1(receiver, fractionDigits) { var result; if (fractionDigits > 20) throw A.wrapException(A.RangeError$range(fractionDigits, 0, 20, "fractionDigits", null)); result = receiver.toFixed(fractionDigits); if (receiver === 0 && this.get$isNegative(receiver)) return "-" + result; return result; }, toString$0(receiver) { if (receiver === 0 && 1 / receiver < 0) return "-0.0"; else return "" + receiver; }, get$hashCode(receiver) { var absolute, floorLog2, factor, scaled, intValue = receiver | 0; if (receiver === intValue) return intValue & 536870911; absolute = Math.abs(receiver); floorLog2 = Math.log(absolute) / 0.6931471805599453 | 0; factor = Math.pow(2, floorLog2); scaled = absolute < 1 ? absolute / factor : factor / absolute; return ((scaled * 9007199254740992 | 0) + (scaled * 3542243181176521 | 0)) * 599197 + floorLog2 * 1259 & 536870911; }, $mod(receiver, other) { var result = receiver % other; if (result === 0) return 0; if (result > 0) return result; if (other < 0) return result - other; else return result + other; }, $tdiv(receiver, other) { if ((receiver | 0) === receiver) if (other >= 1 || other < -1) return receiver / other | 0; return this._tdivSlow$1(receiver, other); }, _tdivFast$1(receiver, other) { return (receiver | 0) === receiver ? receiver / other | 0 : this._tdivSlow$1(receiver, other); }, _tdivSlow$1(receiver, other) { var quotient = receiver / other; if (quotient >= -2147483648 && quotient <= 2147483647) return quotient | 0; if (quotient > 0) { if (quotient !== 1 / 0) return Math.floor(quotient); } else if (quotient > -1 / 0) return Math.ceil(quotient); throw A.wrapException(A.UnsupportedError$("Result of truncating division is " + A.S(quotient) + ": " + A.S(receiver) + " ~/ " + other)); }, _shrOtherPositive$1(receiver, other) { var t1; if (receiver > 0) t1 = this._shrBothPositive$1(receiver, other); else { t1 = other > 31 ? 31 : other; t1 = receiver >> t1 >>> 0; } return t1; }, _shrBothPositive$1(receiver, other) { return other > 31 ? 0 : receiver >>> other; }, get$runtimeType(receiver) { return A.createRuntimeType(type$.num); }, $isComparable: 1, $isdouble: 1, $isnum: 1 }; J.JSInt.prototype = { get$sign(receiver) { var t1; if (receiver > 0) t1 = 1; else t1 = receiver < 0 ? -1 : receiver; return t1; }, get$runtimeType(receiver) { return A.createRuntimeType(type$.int); }, $isTrustedGetRuntimeType: 1, $isint: 1 }; J.JSNumNotInt.prototype = { get$runtimeType(receiver) { return A.createRuntimeType(type$.double); }, $isTrustedGetRuntimeType: 1 }; J.JSString.prototype = { allMatches$1(receiver, string) { return new A._StringAllMatchesIterable(string, receiver, 0); }, endsWith$1(receiver, other) { var otherLength = other.length, t1 = receiver.length; if (otherLength > t1) return false; return other === this.substring$1(receiver, t1 - otherLength); }, startsWith$1(receiver, pattern) { var otherLength = pattern.length; if (otherLength > receiver.length) return false; return pattern === receiver.substring(0, otherLength); }, substring$2(receiver, start, end) { return receiver.substring(start, A.RangeError_checkValidRange(start, end, receiver.length)); }, substring$1(receiver, start) { return this.substring$2(receiver, start, null); }, trim$0(receiver) { var startIndex, t1, endIndex0, result = receiver.trim(), endIndex = result.length; if (endIndex === 0) return result; if (0 >= endIndex) return A.ioore(result, 0); if (result.charCodeAt(0) === 133) { startIndex = J.JSString__skipLeadingWhitespace(result, 1); if (startIndex === endIndex) return ""; } else startIndex = 0; t1 = endIndex - 1; if (!(t1 >= 0)) return A.ioore(result, t1); endIndex0 = result.charCodeAt(t1) === 133 ? J.JSString__skipTrailingWhitespace(result, t1) : endIndex; if (startIndex === 0 && endIndex0 === endIndex) return result; return result.substring(startIndex, endIndex0); }, $mul(receiver, times) { var s, result; if (0 >= times) return ""; if (times === 1 || receiver.length === 0) return receiver; if (times !== times >>> 0) throw A.wrapException(B.C_OutOfMemoryError); for (s = receiver, result = "";;) { if ((times & 1) === 1) result = s + result; times = times >>> 1; if (times === 0) break; s += s; } return result; }, padLeft$2(receiver, width, padding) { var delta = width - receiver.length; if (delta <= 0) return receiver; return this.$mul(padding, delta) + receiver; }, padLeft$1(receiver, width) { return this.padLeft$2(receiver, width, " "); }, padRight$1(receiver, width) { var delta = width - receiver.length; if (delta <= 0) return receiver; return receiver + this.$mul(" ", delta); }, indexOf$1(receiver, pattern) { var t1 = receiver.indexOf(pattern, 0); return t1; }, contains$1(receiver, other) { return A.stringContainsUnchecked(receiver, other, 0); }, compareTo$1(receiver, other) { var t1; A._asString(other); if (receiver === other) t1 = 0; else t1 = receiver < other ? -1 : 1; return t1; }, toString$0(receiver) { return receiver; }, get$hashCode(receiver) { var t1, hash, i; for (t1 = receiver.length, hash = 0, i = 0; i < t1; ++i) { hash = hash + receiver.charCodeAt(i) & 536870911; hash = hash + ((hash & 524287) << 10) & 536870911; hash ^= hash >> 6; } hash = hash + ((hash & 67108863) << 3) & 536870911; hash ^= hash >> 11; return hash + ((hash & 16383) << 15) & 536870911; }, get$runtimeType(receiver) { return A.createRuntimeType(type$.String); }, get$length(receiver) { return receiver.length; }, $isTrustedGetRuntimeType: 1, $isComparable: 1, $isPattern: 1, $isString: 1 }; A.LateError.prototype = { toString$0(_) { return "LateInitializationError: " + this._message; } }; A.CodeUnits.prototype = { get$length(_) { return this._string.length; }, $index(_, i) { var t1; A._asInt(i); t1 = this._string; if (!(i >= 0 && i < t1.length)) return A.ioore(t1, i); return t1.charCodeAt(i); } }; A.SentinelValue.prototype = {}; A.EfficientLengthIterable.prototype = {}; A.ListIterable.prototype = { get$iterator(_) { var _this = this; return new A.ListIterator(_this, _this.get$length(_this), A._instanceType(_this)._eval$1("ListIterator")); }, get$isEmpty(_) { return this.get$length(this) === 0; }, join$1(_, separator) { var first, t1, i, _this = this, $length = _this.get$length(_this); if (separator.length !== 0) { if ($length === 0) return ""; first = A.S(_this.elementAt$1(0, 0)); if ($length !== _this.get$length(_this)) throw A.wrapException(A.ConcurrentModificationError$(_this)); for (t1 = first, i = 1; i < $length; ++i) { t1 = t1 + separator + A.S(_this.elementAt$1(0, i)); if ($length !== _this.get$length(_this)) throw A.wrapException(A.ConcurrentModificationError$(_this)); } return t1.charCodeAt(0) == 0 ? t1 : t1; } else { for (i = 0, t1 = ""; i < $length; ++i) { t1 += A.S(_this.elementAt$1(0, i)); if ($length !== _this.get$length(_this)) throw A.wrapException(A.ConcurrentModificationError$(_this)); } return t1.charCodeAt(0) == 0 ? t1 : t1; } } }; A.SubListIterable.prototype = { get$_endIndex() { var $length = J.get$length$asx(this._iterable), endOrLength = this._endOrLength; if (endOrLength == null || endOrLength > $length) return $length; return endOrLength; }, get$_startIndex() { var $length = J.get$length$asx(this._iterable), t1 = this.__internal$_start; if (t1 > $length) return $length; return t1; }, get$length(_) { var endOrLength, $length = J.get$length$asx(this._iterable), t1 = this.__internal$_start; if (t1 >= $length) return 0; endOrLength = this._endOrLength; if (endOrLength == null || endOrLength >= $length) return $length - t1; return endOrLength - t1; }, elementAt$1(_, index) { var _this = this, realIndex = _this.get$_startIndex() + index; if (index < 0 || realIndex >= _this.get$_endIndex()) throw A.wrapException(A.IndexError$withLength(index, _this.get$length(0), _this, null, "index")); return J.elementAt$1$ax(_this._iterable, realIndex); } }; A.ListIterator.prototype = { get$current() { var t1 = this._current; return t1 == null ? this.$ti._precomputed1._as(t1) : t1; }, moveNext$0() { var t3, _this = this, t1 = _this._iterable, t2 = J.getInterceptor$asx(t1), $length = t2.get$length(t1); if (_this._length !== $length) throw A.wrapException(A.ConcurrentModificationError$(t1)); t3 = _this._index; if (t3 >= $length) { _this._current = null; return false; } _this._current = t2.elementAt$1(t1, t3); ++_this._index; return true; }, $isIterator: 1 }; A.MappedIterable.prototype = { get$iterator(_) { return new A.MappedIterator(J.get$iterator$ax(this._iterable), this._f, A._instanceType(this)._eval$1("MappedIterator<1,2>")); }, get$length(_) { return J.get$length$asx(this._iterable); } }; A.EfficientLengthMappedIterable.prototype = {$isEfficientLengthIterable: 1}; A.MappedIterator.prototype = { moveNext$0() { var _this = this, t1 = _this._iterator; if (t1.moveNext$0()) { _this._current = _this._f.call$1(t1.get$current()); return true; } _this._current = null; return false; }, get$current() { var t1 = this._current; return t1 == null ? this.$ti._rest[1]._as(t1) : t1; }, $isIterator: 1 }; A.MappedListIterable.prototype = { get$length(_) { return J.get$length$asx(this._source); }, elementAt$1(_, index) { return this._f.call$1(J.elementAt$1$ax(this._source, index)); } }; A.WhereIterable.prototype = { get$iterator(_) { return new A.WhereIterator(J.get$iterator$ax(this._iterable), this._f, this.$ti._eval$1("WhereIterator<1>")); } }; A.WhereIterator.prototype = { moveNext$0() { var t1, t2; for (t1 = this._iterator, t2 = this._f; t1.moveNext$0();) if (t2.call$1(t1.get$current())) return true; return false; }, get$current() { return this._iterator.get$current(); }, $isIterator: 1 }; A.TakeIterable.prototype = { get$iterator(_) { var t1 = this._iterable; return new A.TakeIterator(t1.get$iterator(t1), this._takeCount, A._instanceType(this)._eval$1("TakeIterator<1>")); } }; A.EfficientLengthTakeIterable.prototype = { get$length(_) { var t1 = this._iterable, iterableLength = t1.get$length(t1); t1 = this._takeCount; if (iterableLength > t1) return t1; return iterableLength; }, $isEfficientLengthIterable: 1 }; A.TakeIterator.prototype = { moveNext$0() { if (--this._remaining >= 0) return this._iterator.moveNext$0(); this._remaining = -1; return false; }, get$current() { if (this._remaining < 0) { this.$ti._precomputed1._as(null); return null; } return this._iterator.get$current(); }, $isIterator: 1 }; A.TakeWhileIterable.prototype = { get$iterator(_) { return new A.TakeWhileIterator(J.get$iterator$ax(this._iterable), this._f, this.$ti._eval$1("TakeWhileIterator<1>")); } }; A.TakeWhileIterator.prototype = { moveNext$0() { var t1, _this = this; if (_this._isFinished) return false; t1 = _this._iterator; if (!t1.moveNext$0() || !_this._f.call$1(t1.get$current())) { _this._isFinished = true; return false; } return true; }, get$current() { if (this._isFinished) { this.$ti._precomputed1._as(null); return null; } return this._iterator.get$current(); }, $isIterator: 1 }; A.WhereTypeIterable.prototype = { get$iterator(_) { return new A.WhereTypeIterator(J.get$iterator$ax(this._source), this.$ti._eval$1("WhereTypeIterator<1>")); } }; A.WhereTypeIterator.prototype = { moveNext$0() { var t1, t2; for (t1 = this._source, t2 = this.$ti._precomputed1; t1.moveNext$0();) if (t2._is(t1.get$current())) return true; return false; }, get$current() { return this.$ti._precomputed1._as(this._source.get$current()); }, $isIterator: 1 }; A.FixedLengthListMixin.prototype = { set$length(receiver, newLength) { throw A.wrapException(A.UnsupportedError$("Cannot change the length of a fixed-length list")); }, add$1(receiver, value) { A.instanceType(receiver)._eval$1("FixedLengthListMixin.E")._as(value); throw A.wrapException(A.UnsupportedError$("Cannot add to a fixed-length list")); } }; A.UnmodifiableListMixin.prototype = { $indexSet(_, index, value) { A._instanceType(this)._eval$1("UnmodifiableListMixin.E")._as(value); throw A.wrapException(A.UnsupportedError$("Cannot modify an unmodifiable list")); }, set$length(_, newLength) { throw A.wrapException(A.UnsupportedError$("Cannot change the length of an unmodifiable list")); }, add$1(_, value) { A._instanceType(this)._eval$1("UnmodifiableListMixin.E")._as(value); throw A.wrapException(A.UnsupportedError$("Cannot add to an unmodifiable list")); } }; A.UnmodifiableListBase.prototype = {}; A.ReversedListIterable.prototype = { get$length(_) { return J.get$length$asx(this._source); }, elementAt$1(_, index) { var t1 = this._source, t2 = J.getInterceptor$asx(t1); return t2.elementAt$1(t1, t2.get$length(t1) - 1 - index); } }; A._Record_2.prototype = {$recipe: "+(1,2)", $shape: 1}; A._Record_4.prototype = {$recipe: "+(1,2,3,4)", $shape: 2}; A.ConstantMap.prototype = { get$isEmpty(_) { return this.get$length(this) === 0; }, toString$0(_) { return A.MapBase_mapToString(this); }, $isMap: 1 }; A.ConstantStringMap.prototype = { get$length(_) { return this._values.length; }, get$_keys() { var keys = this.$keys; if (keys == null) { keys = Object.keys(this._jsIndex); this.$keys = keys; } return keys; }, containsKey$1(key) { if (typeof key != "string") return false; if ("__proto__" === key) return false; return this._jsIndex.hasOwnProperty(key); }, $index(_, key) { if (!this.containsKey$1(key)) return null; return this._values[this._jsIndex[key]]; }, forEach$1(_, f) { var keys, values, t1, i; this.$ti._eval$1("~(1,2)")._as(f); keys = this.get$_keys(); values = this._values; for (t1 = keys.length, i = 0; i < t1; ++i) f.call$2(keys[i], values[i]); }, get$keys() { return new A._KeysOrValues(this.get$_keys(), this.$ti._eval$1("_KeysOrValues<1>")); } }; A._KeysOrValues.prototype = { get$length(_) { return this.__js_helper$_elements.length; }, get$iterator(_) { var t1 = this.__js_helper$_elements; return new A._KeysOrValuesOrElementsIterator(t1, t1.length, this.$ti._eval$1("_KeysOrValuesOrElementsIterator<1>")); } }; A._KeysOrValuesOrElementsIterator.prototype = { get$current() { var t1 = this.__js_helper$_current; return t1 == null ? this.$ti._precomputed1._as(t1) : t1; }, moveNext$0() { var _this = this, t1 = _this.__js_helper$_index; if (t1 >= _this.__js_helper$_length) { _this.__js_helper$_current = null; return false; } _this.__js_helper$_current = _this.__js_helper$_elements[t1]; _this.__js_helper$_index = t1 + 1; return true; }, $isIterator: 1 }; A.GeneralConstantMap.prototype = { _getMap$0() { var _this = this, backingMap = _this.$map; if (backingMap == null) { backingMap = new A.JsConstantLinkedHashMap(_this.$ti._eval$1("JsConstantLinkedHashMap<1,2>")); A.fillLiteralMap(_this._jsData, backingMap); _this.$map = backingMap; } return backingMap; }, containsKey$1(key) { return this._getMap$0().containsKey$1(key); }, $index(_, key) { return this._getMap$0().$index(0, key); }, forEach$1(_, f) { this.$ti._eval$1("~(1,2)")._as(f); this._getMap$0().forEach$1(0, f); }, get$keys() { var t1 = this._getMap$0(); return new A.LinkedHashMapKeysIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeysIterable<1>")); }, get$length(_) { return this._getMap$0().__js_helper$_length; } }; A.Primitives_initTicker_closure.prototype = { call$0() { return B.JSNumber_methods.floor$0(1000 * this.performance.now()); }, $signature: 2 }; A.SafeToStringHook.prototype = {}; A.TypeErrorDecoder.prototype = { matchTypeError$1(message) { var result, t1, _this = this, match = new RegExp(_this._pattern).exec(message); if (match == null) return null; result = Object.create(null); t1 = _this._arguments; if (t1 !== -1) result.arguments = match[t1 + 1]; t1 = _this._argumentsExpr; if (t1 !== -1) result.argumentsExpr = match[t1 + 1]; t1 = _this._expr; if (t1 !== -1) result.expr = match[t1 + 1]; t1 = _this._method; if (t1 !== -1) result.method = match[t1 + 1]; t1 = _this._receiver; if (t1 !== -1) result.receiver = match[t1 + 1]; return result; } }; A.NullError.prototype = { toString$0(_) { return "Null check operator used on a null value"; } }; A.JsNoSuchMethodError.prototype = { toString$0(_) { var t2, _this = this, _s38_ = "NoSuchMethodError: method not found: '", t1 = _this._method; if (t1 == null) return "NoSuchMethodError: " + _this.__js_helper$_message; t2 = _this._receiver; if (t2 == null) return _s38_ + t1 + "' (" + _this.__js_helper$_message + ")"; return _s38_ + t1 + "' on '" + t2 + "' (" + _this.__js_helper$_message + ")"; } }; A.UnknownJsTypeError.prototype = { toString$0(_) { var t1 = this.__js_helper$_message; return t1.length === 0 ? "Error" : "Error: " + t1; } }; A.NullThrownFromJavaScriptException.prototype = { toString$0(_) { return "Throw of null ('" + (this._irritant === null ? "null" : "undefined") + "' from JavaScript)"; } }; A._StackTrace.prototype = { toString$0(_) { var trace, t1 = this._trace; if (t1 != null) return t1; t1 = this._exception; trace = t1 !== null && typeof t1 === "object" ? t1.stack : null; return this._trace = trace == null ? "" : trace; }, $isStackTrace: 1 }; A.Closure.prototype = { toString$0(_) { var $constructor = this.constructor, $name = $constructor == null ? null : $constructor.name; return "Closure '" + A.unminifyOrTag($name == null ? "unknown" : $name) + "'"; }, $isFunction: 1, get$$call() { return this; }, "call*": "call$1", $requiredArgCount: 1, $defaultValues: null }; A.Closure0Args.prototype = {"call*": "call$0", $requiredArgCount: 0}; A.Closure2Args.prototype = {"call*": "call$2", $requiredArgCount: 2}; A.TearOffClosure.prototype = {}; A.StaticClosure.prototype = { toString$0(_) { var $name = this.$static_name; if ($name == null) return "Closure of unknown static method"; return "Closure '" + A.unminifyOrTag($name) + "'"; } }; A.BoundClosure.prototype = { $eq(_, other) { if (other == null) return false; if (this === other) return true; if (!(other instanceof A.BoundClosure)) return false; return this.$_target === other.$_target && this._receiver === other._receiver; }, get$hashCode(_) { return (A.objectHashCode(this._receiver) ^ A.Primitives_objectHashCode(this.$_target)) >>> 0; }, toString$0(_) { return "Closure '" + this.$_name + "' of " + ("Instance of '" + A.Primitives_objectTypeName(this._receiver) + "'"); } }; A.RuntimeError.prototype = { toString$0(_) { return "RuntimeError: " + this.message; } }; A.JsLinkedHashMap.prototype = { get$length(_) { return this.__js_helper$_length; }, get$isEmpty(_) { return this.__js_helper$_length === 0; }, get$keys() { return new A.LinkedHashMapKeysIterable(this, A._instanceType(this)._eval$1("LinkedHashMapKeysIterable<1>")); }, containsKey$1(key) { var strings, nums; if (typeof key == "string") { strings = this._strings; if (strings == null) return false; return strings[key] != null; } else if (typeof key == "number" && (key & 0x3fffffff) === key) { nums = this._nums; if (nums == null) return false; return nums[key] != null; } else return this.internalContainsKey$1(key); }, internalContainsKey$1(key) { var rest = this.__js_helper$_rest; if (rest == null) return false; return this.internalFindBucketIndex$2(rest[this.internalComputeHashCode$1(key)], key) >= 0; }, addAll$1(_, other) { A._instanceType(this)._eval$1("Map<1,2>")._as(other).forEach$1(0, new A.JsLinkedHashMap_addAll_closure(this)); }, $index(_, key) { var strings, cell, t1, nums, _null = null; if (typeof key == "string") { strings = this._strings; if (strings == null) return _null; cell = strings[key]; t1 = cell == null ? _null : cell.hashMapCellValue; return t1; } else if (typeof key == "number" && (key & 0x3fffffff) === key) { nums = this._nums; if (nums == null) return _null; cell = nums[key]; t1 = cell == null ? _null : cell.hashMapCellValue; return t1; } else return this.internalGet$1(key); }, internalGet$1(key) { var bucket, index, rest = this.__js_helper$_rest; if (rest == null) return null; bucket = rest[this.internalComputeHashCode$1(key)]; index = this.internalFindBucketIndex$2(bucket, key); if (index < 0) return null; return bucket[index].hashMapCellValue; }, $indexSet(_, key, value) { var strings, nums, _this = this, t1 = A._instanceType(_this); t1._precomputed1._as(key); t1._rest[1]._as(value); if (typeof key == "string") { strings = _this._strings; _this._addHashTableEntry$3(strings == null ? _this._strings = _this._newHashTable$0() : strings, key, value); } else if (typeof key == "number" && (key & 0x3fffffff) === key) { nums = _this._nums; _this._addHashTableEntry$3(nums == null ? _this._nums = _this._newHashTable$0() : nums, key, value); } else _this.internalSet$2(key, value); }, internalSet$2(key, value) { var rest, hash, bucket, index, _this = this, t1 = A._instanceType(_this); t1._precomputed1._as(key); t1._rest[1]._as(value); rest = _this.__js_helper$_rest; if (rest == null) rest = _this.__js_helper$_rest = _this._newHashTable$0(); hash = _this.internalComputeHashCode$1(key); bucket = rest[hash]; if (bucket == null) rest[hash] = [_this._newLinkedCell$2(key, value)]; else { index = _this.internalFindBucketIndex$2(bucket, key); if (index >= 0) bucket[index].hashMapCellValue = value; else bucket.push(_this._newLinkedCell$2(key, value)); } }, putIfAbsent$2(key, ifAbsent) { var t2, value, _this = this, t1 = A._instanceType(_this); t1._precomputed1._as(key); t1._eval$1("2()")._as(ifAbsent); if (_this.containsKey$1(key)) { t2 = _this.$index(0, key); return t2 == null ? t1._rest[1]._as(t2) : t2; } value = ifAbsent.call$0(); _this.$indexSet(0, key, value); return value; }, remove$1(_, key) { var t1 = this.internalRemove$1(key); return t1; }, internalRemove$1(key) { var hash, bucket, index, cell, _this = this, rest = _this.__js_helper$_rest; if (rest == null) return null; hash = _this.internalComputeHashCode$1(key); bucket = rest[hash]; index = _this.internalFindBucketIndex$2(bucket, key); if (index < 0) return null; cell = bucket.splice(index, 1)[0]; _this._unlinkCell$1(cell); if (bucket.length === 0) delete rest[hash]; return cell.hashMapCellValue; }, clear$0(_) { var _this = this; if (_this.__js_helper$_length > 0) { _this._strings = _this._nums = _this.__js_helper$_rest = _this._first = _this._last = null; _this.__js_helper$_length = 0; _this._modified$0(); } }, forEach$1(_, action) { var cell, modifications, _this = this; A._instanceType(_this)._eval$1("~(1,2)")._as(action); cell = _this._first; modifications = _this._modifications; while (cell != null) { action.call$2(cell.hashMapCellKey, cell.hashMapCellValue); if (modifications !== _this._modifications) throw A.wrapException(A.ConcurrentModificationError$(_this)); cell = cell._next; } }, _addHashTableEntry$3(table, key, value) { var cell, t1 = A._instanceType(this); t1._precomputed1._as(key); t1._rest[1]._as(value); cell = table[key]; if (cell == null) table[key] = this._newLinkedCell$2(key, value); else cell.hashMapCellValue = value; }, _modified$0() { this._modifications = this._modifications + 1 & 1073741823; }, _newLinkedCell$2(key, value) { var _this = this, t1 = A._instanceType(_this), cell = new A.LinkedHashMapCell(t1._precomputed1._as(key), t1._rest[1]._as(value)); if (_this._first == null) _this._first = _this._last = cell; else { t1 = _this._last; t1.toString; cell._previous = t1; _this._last = t1._next = cell; } ++_this.__js_helper$_length; _this._modified$0(); return cell; }, _unlinkCell$1(cell) { var _this = this, previous = cell._previous, next = cell._next; if (previous == null) _this._first = next; else previous._next = next; if (next == null) _this._last = previous; else next._previous = previous; --_this.__js_helper$_length; _this._modified$0(); }, internalComputeHashCode$1(key) { return J.get$hashCode$(key) & 1073741823; }, internalFindBucketIndex$2(bucket, key) { var $length, i; if (bucket == null) return -1; $length = bucket.length; for (i = 0; i < $length; ++i) if (J.$eq$(bucket[i].hashMapCellKey, key)) return i; return -1; }, toString$0(_) { return A.MapBase_mapToString(this); }, _newHashTable$0() { var table = Object.create(null); table[""] = table; delete table[""]; return table; }, $isLinkedHashMap: 1 }; A.JsLinkedHashMap_addAll_closure.prototype = { call$2(key, value) { var t1 = this.$this, t2 = A._instanceType(t1); t1.$indexSet(0, t2._precomputed1._as(key), t2._rest[1]._as(value)); }, $signature() { return A._instanceType(this.$this)._eval$1("~(1,2)"); } }; A.LinkedHashMapCell.prototype = {}; A.LinkedHashMapKeysIterable.prototype = { get$length(_) { return this._map.__js_helper$_length; }, get$isEmpty(_) { return this._map.__js_helper$_length === 0; }, get$iterator(_) { var t1 = this._map; return new A.LinkedHashMapKeyIterator(t1, t1._modifications, t1._first, this.$ti._eval$1("LinkedHashMapKeyIterator<1>")); }, contains$1(_, element) { return this._map.containsKey$1(element); } }; A.LinkedHashMapKeyIterator.prototype = { get$current() { return this.__js_helper$_current; }, moveNext$0() { var cell, _this = this, t1 = _this._map; if (_this._modifications !== t1._modifications) throw A.wrapException(A.ConcurrentModificationError$(t1)); cell = _this._cell; if (cell == null) { _this.__js_helper$_current = null; return false; } else { _this.__js_helper$_current = cell.hashMapCellKey; _this._cell = cell._next; return true; } }, $isIterator: 1 }; A.LinkedHashMapValuesIterable.prototype = { get$length(_) { return this._map.__js_helper$_length; }, get$iterator(_) { var t1 = this._map; return new A.LinkedHashMapValueIterator(t1, t1._modifications, t1._first, this.$ti._eval$1("LinkedHashMapValueIterator<1>")); } }; A.LinkedHashMapValueIterator.prototype = { get$current() { return this.__js_helper$_current; }, moveNext$0() { var cell, _this = this, t1 = _this._map; if (_this._modifications !== t1._modifications) throw A.wrapException(A.ConcurrentModificationError$(t1)); cell = _this._cell; if (cell == null) { _this.__js_helper$_current = null; return false; } else { _this.__js_helper$_current = cell.hashMapCellValue; _this._cell = cell._next; return true; } }, $isIterator: 1 }; A.LinkedHashMapEntriesIterable.prototype = { get$length(_) { return this._map.__js_helper$_length; }, get$iterator(_) { var t1 = this._map; return new A.LinkedHashMapEntryIterator(t1, t1._modifications, t1._first, this.$ti._eval$1("LinkedHashMapEntryIterator<1,2>")); } }; A.LinkedHashMapEntryIterator.prototype = { get$current() { var t1 = this.__js_helper$_current; t1.toString; return t1; }, moveNext$0() { var cell, _this = this, t1 = _this._map; if (_this._modifications !== t1._modifications) throw A.wrapException(A.ConcurrentModificationError$(t1)); cell = _this._cell; if (cell == null) { _this.__js_helper$_current = null; return false; } else { _this.__js_helper$_current = new A.MapEntry(cell.hashMapCellKey, cell.hashMapCellValue, _this.$ti._eval$1("MapEntry<1,2>")); _this._cell = cell._next; return true; } }, $isIterator: 1 }; A.JsConstantLinkedHashMap.prototype = { internalComputeHashCode$1(key) { return A.constantHashCode(key) & 1073741823; }, internalFindBucketIndex$2(bucket, key) { var $length, i; if (bucket == null) return -1; $length = bucket.length; for (i = 0; i < $length; ++i) if (J.$eq$(bucket[i].hashMapCellKey, key)) return i; return -1; } }; A.initHooks_closure.prototype = { call$1(o) { return this.getTag(o); }, $signature: 33 }; A.initHooks_closure0.prototype = { call$2(o, tag) { return this.getUnknownTag(o, tag); }, $signature: 120 }; A.initHooks_closure1.prototype = { call$1(tag) { return this.prototypeForTag(A._asString(tag)); }, $signature: 118 }; A._Record.prototype = { toString$0(_) { return this._toString$1(false); }, _toString$1(safe) { var t2, separator, i, key, value, keys = this._fieldKeys$0(), values = this._getFieldValues$0(), t1 = (safe ? "Record " : "") + "("; for (t2 = keys.length, separator = "", i = 0; i < t2; ++i, separator = ", ") { t1 += separator; key = keys[i]; if (typeof key == "string") t1 = t1 + key + ": "; if (!(i < values.length)) return A.ioore(values, i); value = values[i]; t1 = safe ? t1 + A.Primitives_safeToString(value) : t1 + A.S(value); } t1 += ")"; return t1.charCodeAt(0) == 0 ? t1 : t1; }, _fieldKeys$0() { var t1, shapeTag = this.$shape; while ($._Record__computedFieldKeys.length <= shapeTag) B.JSArray_methods.add$1($._Record__computedFieldKeys, null); t1 = $._Record__computedFieldKeys[shapeTag]; if (t1 == null) { t1 = this._computeFieldKeys$0(); B.JSArray_methods.$indexSet($._Record__computedFieldKeys, shapeTag, t1); } return t1; }, _computeFieldKeys$0() { var i, names, last, recipe = this.$recipe, position = recipe.indexOf("("), joinedNames = recipe.substring(1, position), fields = recipe.substring(position), arity = fields === "()" ? 0 : fields.replace(/[^,]/g, "").length + 1, t1 = type$.Object, result = J.JSArray_JSArray$allocateGrowable(arity, t1); for (i = 0; i < arity; ++i) result[i] = i; if (joinedNames !== "") { names = joinedNames.split(","); i = names.length; for (last = arity; i > 0;) { --last; --i; B.JSArray_methods.$indexSet(result, last, names[i]); } } result = A.List_List$from(result, false, t1); result.$flags = 3; return result; } }; A._Record2.prototype = { _getFieldValues$0() { return [this._0, this._1]; }, $eq(_, other) { if (other == null) return false; return other instanceof A._Record2 && this.$shape === other.$shape && J.$eq$(this._0, other._0) && J.$eq$(this._1, other._1); }, get$hashCode(_) { return A.Object_hash(this.$shape, this._0, this._1, B.C_SentinelValue); } }; A._RecordN.prototype = { _getFieldValues$0() { return this._values; }, $eq(_, other) { if (other == null) return false; return other instanceof A._RecordN && this.$shape === other.$shape && A._RecordN__equalValues(this._values, other._values); }, get$hashCode(_) { return A.Object_hash(this.$shape, A.Object_hashAll(this._values), B.C_SentinelValue, B.C_SentinelValue); } }; A.JSSyntaxRegExp.prototype = { toString$0(_) { return "RegExp/" + this.pattern + "/" + this._nativeRegExp.flags; }, get$_nativeGlobalVersion() { var _this = this, t1 = _this._nativeGlobalRegExp; if (t1 != null) return t1; t1 = _this._nativeRegExp; return _this._nativeGlobalRegExp = A.JSSyntaxRegExp_makeNative(_this.pattern, t1.multiline, !t1.ignoreCase, t1.unicode, t1.dotAll, "g"); }, firstMatch$1(string) { var m = this._nativeRegExp.exec(string); if (m == null) return null; return new A._MatchImplementation(m); }, allMatches$1(_, string) { return new A._AllMatchesIterable(this, string, 0); }, _execGlobal$2(string, start) { var match, regexp = this.get$_nativeGlobalVersion(); if (regexp == null) regexp = A._asObject(regexp); regexp.lastIndex = start; match = regexp.exec(string); if (match == null) return null; return new A._MatchImplementation(match); }, $isPattern: 1, $isRegExp: 1 }; A._MatchImplementation.prototype = { get$start() { return this._match.index; }, get$end() { var t1 = this._match; return t1.index + t1[0].length; }, $isMatch: 1, $isRegExpMatch: 1 }; A._AllMatchesIterable.prototype = { get$iterator(_) { return new A._AllMatchesIterator(this._re, this.__js_helper$_string, this.__js_helper$_start); } }; A._AllMatchesIterator.prototype = { get$current() { var t1 = this.__js_helper$_current; return t1 == null ? type$.RegExpMatch._as(t1) : t1; }, moveNext$0() { var t1, t2, t3, match, nextIndex, t4, _this = this, string = _this.__js_helper$_string; if (string == null) return false; t1 = _this._nextIndex; t2 = string.length; if (t1 <= t2) { t3 = _this._regExp; match = t3._execGlobal$2(string, t1); if (match != null) { _this.__js_helper$_current = match; nextIndex = match.get$end(); if (match._match.index === nextIndex) { t1 = false; if (t3._nativeRegExp.unicode) { t3 = _this._nextIndex; t4 = t3 + 1; if (t4 < t2) { if (!(t3 >= 0 && t3 < t2)) return A.ioore(string, t3); t3 = string.charCodeAt(t3); if (t3 >= 55296 && t3 <= 56319) { if (!(t4 >= 0)) return A.ioore(string, t4); t1 = string.charCodeAt(t4); t1 = t1 >= 56320 && t1 <= 57343; } } } nextIndex = (t1 ? nextIndex + 1 : nextIndex) + 1; } _this._nextIndex = nextIndex; return true; } } _this.__js_helper$_string = _this.__js_helper$_current = null; return false; }, $isIterator: 1 }; A.StringMatch.prototype = { get$end() { return this.start + this.pattern.length; }, $isMatch: 1, get$start() { return this.start; } }; A._StringAllMatchesIterable.prototype = { get$iterator(_) { return new A._StringAllMatchesIterator(this._input, this._pattern, this.__js_helper$_index); } }; A._StringAllMatchesIterator.prototype = { moveNext$0() { var index, end, _this = this, t1 = _this.__js_helper$_index, t2 = _this._pattern, t3 = t2.length, t4 = _this._input, t5 = t4.length; if (t1 + t3 > t5) { _this.__js_helper$_current = null; return false; } index = t4.indexOf(t2, t1); if (index < 0) { _this.__js_helper$_index = t5 + 1; _this.__js_helper$_current = null; return false; } end = index + t3; _this.__js_helper$_current = new A.StringMatch(index, t2); _this.__js_helper$_index = end === _this.__js_helper$_index ? end + 1 : end; return true; }, get$current() { var t1 = this.__js_helper$_current; t1.toString; return t1; }, $isIterator: 1 }; A._Cell.prototype = { _readLocal$0() { var t1 = this._value; if (t1 === this) throw A.wrapException(new A.LateError("Local '" + this._name + "' has not been initialized.")); return t1; }, _readField$0() { var t1 = this._value; if (t1 === this) throw A.wrapException(A.LateError$fieldNI(this._name)); return t1; } }; A.NativeByteBuffer.prototype = { get$runtimeType(receiver) { return B.Type_ByteBuffer_rqD; }, $isTrustedGetRuntimeType: 1 }; A.NativeTypedData.prototype = {}; A.NativeByteData.prototype = { get$runtimeType(receiver) { return B.Type_ByteData_9dB; }, $isTrustedGetRuntimeType: 1 }; A.NativeTypedArray.prototype = { get$length(receiver) { return receiver.length; }, $isJavaScriptIndexingBehavior: 1 }; A.NativeTypedArrayOfDouble.prototype = { $index(receiver, index) { A._asInt(index); A._checkValidIndex(index, receiver, receiver.length); return receiver[index]; }, $indexSet(receiver, index, value) { A._asDouble(value); receiver.$flags & 2 && A.throwUnsupportedOperation(receiver); A._checkValidIndex(index, receiver, receiver.length); receiver[index] = value; }, $isEfficientLengthIterable: 1, $isIterable: 1, $isList: 1 }; A.NativeTypedArrayOfInt.prototype = { $indexSet(receiver, index, value) { A._asInt(value); receiver.$flags & 2 && A.throwUnsupportedOperation(receiver); A._checkValidIndex(index, receiver, receiver.length); receiver[index] = value; }, $isEfficientLengthIterable: 1, $isIterable: 1, $isList: 1 }; A.NativeFloat32List.prototype = { get$runtimeType(receiver) { return B.Type_Float32List_9Kz; }, $isTrustedGetRuntimeType: 1 }; A.NativeFloat64List.prototype = { get$runtimeType(receiver) { return B.Type_Float64List_9Kz; }, $isTrustedGetRuntimeType: 1 }; A.NativeInt16List.prototype = { get$runtimeType(receiver) { return B.Type_Int16List_s5h; }, $index(receiver, index) { A._asInt(index); A._checkValidIndex(index, receiver, receiver.length); return receiver[index]; }, $isTrustedGetRuntimeType: 1 }; A.NativeInt32List.prototype = { get$runtimeType(receiver) { return B.Type_Int32List_O8Z; }, $index(receiver, index) { A._asInt(index); A._checkValidIndex(index, receiver, receiver.length); return receiver[index]; }, $isTrustedGetRuntimeType: 1 }; A.NativeInt8List.prototype = { get$runtimeType(receiver) { return B.Type_Int8List_rFV; }, $index(receiver, index) { A._asInt(index); A._checkValidIndex(index, receiver, receiver.length); return receiver[index]; }, $isTrustedGetRuntimeType: 1 }; A.NativeUint16List.prototype = { get$runtimeType(receiver) { return B.Type_Uint16List_kmP; }, $index(receiver, index) { A._asInt(index); A._checkValidIndex(index, receiver, receiver.length); return receiver[index]; }, $isTrustedGetRuntimeType: 1 }; A.NativeUint32List.prototype = { get$runtimeType(receiver) { return B.Type_Uint32List_kmP; }, $index(receiver, index) { A._asInt(index); A._checkValidIndex(index, receiver, receiver.length); return receiver[index]; }, $isTrustedGetRuntimeType: 1 }; A.NativeUint8ClampedList.prototype = { get$runtimeType(receiver) { return B.Type_Uint8ClampedList_04U; }, get$length(receiver) { return receiver.length; }, $index(receiver, index) { A._asInt(index); A._checkValidIndex(index, receiver, receiver.length); return receiver[index]; }, $isTrustedGetRuntimeType: 1 }; A.NativeUint8List.prototype = { get$runtimeType(receiver) { return B.Type_Uint8List_8Eb; }, get$length(receiver) { return receiver.length; }, $index(receiver, index) { A._asInt(index); A._checkValidIndex(index, receiver, receiver.length); return receiver[index]; }, $isTrustedGetRuntimeType: 1 }; A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin.prototype = {}; A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin.prototype = {}; A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin.prototype = {}; A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin.prototype = {}; A.Rti.prototype = { _eval$1(recipe) { return A._Universe_evalInEnvironment(init.typeUniverse, this, recipe); }, _bind$1(typeOrTuple) { return A._Universe_bind(init.typeUniverse, this, typeOrTuple); } }; A._FunctionParameters.prototype = {}; A._Type.prototype = { toString$0(_) { return A._rtiToString(this._rti, null); } }; A._Error.prototype = { toString$0(_) { return this.__rti$_message; } }; A._TypeError.prototype = {$isTypeError: 1}; A._AsyncRun__initializeScheduleImmediate_internalCallback.prototype = { call$1(__wc0_formal) { var t1 = this._box_0, f = t1.storedCallback; t1.storedCallback = null; f.call$0(); }, $signature: 44 }; A._AsyncRun__initializeScheduleImmediate_closure.prototype = { call$1(callback) { var t1, t2; this._box_0.storedCallback = type$.void_Function._as(callback); t1 = this.div; t2 = this.span; t1.firstChild ? t1.removeChild(t2) : t1.appendChild(t2); }, $signature: 136 }; A._AsyncRun__scheduleImmediateJsOverride_internalCallback.prototype = { call$0() { this.callback.call$0(); }, $signature: 40 }; A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback.prototype = { call$0() { this.callback.call$0(); }, $signature: 40 }; A._TimerImpl.prototype = { _TimerImpl$2(milliseconds, callback) { if (self.setTimeout != null) self.setTimeout(A.convertDartClosureToJS(new A._TimerImpl_internalCallback(this, callback), 0), milliseconds); else throw A.wrapException(A.UnsupportedError$("`setTimeout()` not found.")); } }; A._TimerImpl_internalCallback.prototype = { call$0() { this.callback.call$0(); }, $signature: 0 }; A._SyncStarIterator.prototype = { get$current() { var t1 = this._async$_current; return t1 == null ? this.$ti._precomputed1._as(t1) : t1; }, _resumeBody$2(errorCode, errorValue) { var body, t1, exception; errorCode = A._asInt(errorCode); errorValue = errorValue; body = this._async$_body; for (;;) try { t1 = body(this, errorCode, errorValue); return t1; } catch (exception) { errorValue = exception; errorCode = 1; } }, moveNext$0() { var nestedIterator, exception, value, suspendedBodies, _this = this, errorValue = null, errorCode = 0; for (;;) { nestedIterator = _this._nestedIterator; if (nestedIterator != null) try { if (nestedIterator.moveNext$0()) { _this._async$_current = nestedIterator.get$current(); return true; } else _this._nestedIterator = null; } catch (exception) { errorValue = exception; errorCode = 1; _this._nestedIterator = null; } value = _this._resumeBody$2(errorCode, errorValue); if (1 === value) return true; if (0 === value) { _this._async$_current = null; suspendedBodies = _this._suspendedBodies; if (suspendedBodies == null || suspendedBodies.length === 0) { _this._async$_body = A._SyncStarIterator__terminatedBody; return false; } if (0 >= suspendedBodies.length) return A.ioore(suspendedBodies, -1); _this._async$_body = suspendedBodies.pop(); errorCode = 0; errorValue = null; continue; } if (2 === value) { errorCode = 0; errorValue = null; continue; } if (3 === value) { errorValue = _this._datum; _this._datum = null; suspendedBodies = _this._suspendedBodies; if (suspendedBodies == null || suspendedBodies.length === 0) { _this._async$_current = null; _this._async$_body = A._SyncStarIterator__terminatedBody; throw errorValue; return false; } if (0 >= suspendedBodies.length) return A.ioore(suspendedBodies, -1); _this._async$_body = suspendedBodies.pop(); errorCode = 1; continue; } throw A.wrapException(A.StateError$("sync*")); } return false; }, _yieldStar$1(iterable) { var t1, t2, _this = this; if (iterable instanceof A._SyncStarIterable) { t1 = iterable._outerHelper(); t2 = _this._suspendedBodies; if (t2 == null) t2 = _this._suspendedBodies = []; B.JSArray_methods.add$1(t2, _this._async$_body); _this._async$_body = t1; return 2; } else { _this._nestedIterator = J.get$iterator$ax(iterable); return 2; } }, $isIterator: 1 }; A._SyncStarIterable.prototype = { get$iterator(_) { return new A._SyncStarIterator(this._outerHelper(), this.$ti._eval$1("_SyncStarIterator<1>")); } }; A.AsyncError.prototype = { toString$0(_) { return A.S(this.error); }, $isError: 1, get$stackTrace() { return this.stackTrace; } }; A._FutureListener.prototype = { matchesErrorTest$1(asyncError) { if ((this.state & 15) !== 6) return true; return this.result._zone.runUnary$2$2(type$.bool_Function_Object._as(this.callback), asyncError.error, type$.bool, type$.Object); }, handleError$1(asyncError) { var exception, _this = this, errorCallback = _this.errorCallback, result = null, t1 = type$.dynamic, t2 = type$.Object, t3 = asyncError.error, t4 = _this.result._zone; if (type$.dynamic_Function_Object_StackTrace._is(errorCallback)) result = t4.runBinary$3$3(errorCallback, t3, asyncError.stackTrace, t1, t2, type$.StackTrace); else result = t4.runUnary$2$2(type$.dynamic_Function_Object._as(errorCallback), t3, t1, t2); try { t1 = _this.$ti._eval$1("2/")._as(result); return t1; } catch (exception) { if (type$.TypeError._is(A.unwrapException(exception))) { if ((_this.state & 1) !== 0) throw A.wrapException(A.ArgumentError$("The error handler of Future.then must return a value of the returned future's type", "onError")); throw A.wrapException(A.ArgumentError$("The error handler of Future.catchError must return a value of the future's type", "onError")); } else throw exception; } } }; A._Future.prototype = { then$1$2$onError(f, onError, $R) { var currentZone, result, t1 = this.$ti; t1._bind$1($R)._eval$1("1/(2)")._as(f); currentZone = $.Zone__current; if (currentZone === B.C__RootZone) { if (!type$.dynamic_Function_Object_StackTrace._is(onError) && !type$.dynamic_Function_Object._is(onError)) throw A.wrapException(A.ArgumentError$value(onError, "onError", string$.Error_)); } else { $R._eval$1("@<0/>")._bind$1(t1._precomputed1)._eval$1("1(2)")._as(f); onError = A._registerErrorHandler(onError, currentZone); } result = new A._Future(currentZone, $R._eval$1("_Future<0>")); this._addListener$1(new A._FutureListener(result, 3, f, onError, t1._eval$1("@<1>")._bind$1($R)._eval$1("_FutureListener<1,2>"))); return result; }, _setErrorObject$1(error) { this._state = this._state & 1 | 16; this._resultOrListeners = error; }, _cloneResult$1(source) { this._state = source._state & 30 | this._state & 1; this._resultOrListeners = source._resultOrListeners; }, _addListener$1(listener) { var source, _this = this, t1 = _this._state; if (t1 <= 3) { listener._nextListener = type$.nullable__FutureListener_dynamic_dynamic._as(_this._resultOrListeners); _this._resultOrListeners = listener; } else { if ((t1 & 4) !== 0) { source = type$._Future_dynamic._as(_this._resultOrListeners); if ((source._state & 24) === 0) { source._addListener$1(listener); return; } _this._cloneResult$1(source); } A._rootScheduleMicrotask(null, null, _this._zone, type$.void_Function._as(new A._Future__addListener_closure(_this, listener))); } }, _prependListeners$1(listeners) { var t1, existingListeners, next, cursor, next0, source, _this = this, _box_0 = {}; _box_0.listeners = listeners; if (listeners == null) return; t1 = _this._state; if (t1 <= 3) { existingListeners = type$.nullable__FutureListener_dynamic_dynamic._as(_this._resultOrListeners); _this._resultOrListeners = listeners; if (existingListeners != null) { next = listeners._nextListener; for (cursor = listeners; next != null; cursor = next, next = next0) next0 = next._nextListener; cursor._nextListener = existingListeners; } } else { if ((t1 & 4) !== 0) { source = type$._Future_dynamic._as(_this._resultOrListeners); if ((source._state & 24) === 0) { source._prependListeners$1(listeners); return; } _this._cloneResult$1(source); } _box_0.listeners = _this._reverseListeners$1(listeners); A._rootScheduleMicrotask(null, null, _this._zone, type$.void_Function._as(new A._Future__prependListeners_closure(_box_0, _this))); } }, _removeListeners$0() { var current = type$.nullable__FutureListener_dynamic_dynamic._as(this._resultOrListeners); this._resultOrListeners = null; return this._reverseListeners$1(current); }, _reverseListeners$1(listeners) { var current, prev, next; for (current = listeners, prev = null; current != null; prev = current, current = next) { next = current._nextListener; current._nextListener = prev; } return prev; }, _completeWithResultOf$1(source) { var t1, listeners, _this = this; if ((source._state & 16) !== 0) { t1 = _this._zone === source._zone; t1 = !(t1 || t1); } else t1 = false; if (t1) return; listeners = _this._removeListeners$0(); _this._cloneResult$1(source); A._Future__propagateToListeners(_this, listeners); }, _completeErrorObject$1(error) { var listeners = this._removeListeners$0(); this._setErrorObject$1(error); A._Future__propagateToListeners(this, listeners); }, _asyncCompleteErrorObject$1(error) { this._state ^= 2; A._rootScheduleMicrotask(null, null, this._zone, type$.void_Function._as(new A._Future__asyncCompleteErrorObject_closure(this, error))); }, $isFuture: 1 }; A._Future__addListener_closure.prototype = { call$0() { A._Future__propagateToListeners(this.$this, this.listener); }, $signature: 0 }; A._Future__prependListeners_closure.prototype = { call$0() { A._Future__propagateToListeners(this.$this, this._box_0.listeners); }, $signature: 0 }; A._Future__chainCoreFuture_closure.prototype = { call$0() { A._Future__chainCoreFuture(this._box_0.source, this.target, true); }, $signature: 0 }; A._Future__asyncCompleteErrorObject_closure.prototype = { call$0() { this.$this._completeErrorObject$1(this.error); }, $signature: 0 }; A._Future__propagateToListeners_handleWhenCompleteCallback.prototype = { call$0() { var e, s, t1, exception, t2, t3, originalSource, joinedResult, _this = this, completeResult = null; try { t1 = _this._box_0.listener; completeResult = t1.result._zone.run$1$1(type$.dynamic_Function._as(t1.callback), type$.dynamic); } catch (exception) { e = A.unwrapException(exception); s = A.getTraceFromException(exception); if (_this.hasError && type$.AsyncError._as(_this._box_1.source._resultOrListeners).error === e) { t1 = _this._box_0; t1.listenerValueOrError = type$.AsyncError._as(_this._box_1.source._resultOrListeners); } else { t1 = e; t2 = s; if (t2 == null) t2 = A.AsyncError_defaultStackTrace(t1); t3 = _this._box_0; t3.listenerValueOrError = new A.AsyncError(t1, t2); t1 = t3; } t1.listenerHasError = true; return; } if (completeResult instanceof A._Future && (completeResult._state & 24) !== 0) { if ((completeResult._state & 16) !== 0) { t1 = _this._box_0; t1.listenerValueOrError = type$.AsyncError._as(completeResult._resultOrListeners); t1.listenerHasError = true; } return; } if (completeResult instanceof A._Future) { originalSource = _this._box_1.source; joinedResult = new A._Future(originalSource._zone, originalSource.$ti); completeResult.then$1$2$onError(new A._Future__propagateToListeners_handleWhenCompleteCallback_closure(joinedResult, originalSource), new A._Future__propagateToListeners_handleWhenCompleteCallback_closure0(joinedResult), type$.void); t1 = _this._box_0; t1.listenerValueOrError = joinedResult; t1.listenerHasError = false; } }, $signature: 0 }; A._Future__propagateToListeners_handleWhenCompleteCallback_closure.prototype = { call$1(__wc0_formal) { this.joinedResult._completeWithResultOf$1(this.originalSource); }, $signature: 44 }; A._Future__propagateToListeners_handleWhenCompleteCallback_closure0.prototype = { call$2(e, s) { A._asObject(e); type$.StackTrace._as(s); this.joinedResult._completeErrorObject$1(new A.AsyncError(e, s)); }, $signature: 141 }; A._Future__propagateToListeners_handleValueCallback.prototype = { call$0() { var e, s, t1, t2, t3, t4, t5, exception; try { t1 = this._box_0; t2 = t1.listener; t3 = t2.$ti; t4 = t3._precomputed1; t5 = t4._as(this.sourceResult); t1.listenerValueOrError = t2.result._zone.runUnary$2$2(t3._eval$1("2/(1)")._as(t2.callback), t5, t3._eval$1("2/"), t4); } catch (exception) { e = A.unwrapException(exception); s = A.getTraceFromException(exception); t1 = e; t2 = s; if (t2 == null) t2 = A.AsyncError_defaultStackTrace(t1); t3 = this._box_0; t3.listenerValueOrError = new A.AsyncError(t1, t2); t3.listenerHasError = true; } }, $signature: 0 }; A._Future__propagateToListeners_handleError.prototype = { call$0() { var asyncError, e, s, t1, exception, t2, t3, _this = this; try { asyncError = type$.AsyncError._as(_this._box_1.source._resultOrListeners); t1 = _this._box_0; if (t1.listener.matchesErrorTest$1(asyncError) && t1.listener.errorCallback != null) { t1.listenerValueOrError = t1.listener.handleError$1(asyncError); t1.listenerHasError = false; } } catch (exception) { e = A.unwrapException(exception); s = A.getTraceFromException(exception); t1 = type$.AsyncError._as(_this._box_1.source._resultOrListeners); if (t1.error === e) { t2 = _this._box_0; t2.listenerValueOrError = t1; t1 = t2; } else { t1 = e; t2 = s; if (t2 == null) t2 = A.AsyncError_defaultStackTrace(t1); t3 = _this._box_0; t3.listenerValueOrError = new A.AsyncError(t1, t2); t1 = t3; } t1.listenerHasError = true; } }, $signature: 0 }; A._AsyncCallbackEntry.prototype = {}; A.Stream.prototype = { get$length(_) { var t2, t3, _this = this, t1 = {}, future = new A._Future($.Zone__current, type$._Future_int); t1.count = 0; t2 = _this.$ti; t3 = t2._eval$1("~(1)?")._as(new A.Stream_length_closure(t1, _this)); type$.nullable_void_Function._as(new A.Stream_length_closure0(t1, future)); A._EventStreamSubscription$(_this._target, _this._eventType, t3, false, t2._precomputed1); return future; } }; A.Stream_length_closure.prototype = { call$1(__wc0_formal) { this.$this.$ti._precomputed1._as(__wc0_formal); ++this._box_0.count; }, $signature() { return this.$this.$ti._eval$1("~(1)"); } }; A.Stream_length_closure0.prototype = { call$0() { var t1 = this.future, t2 = t1.$ti, t3 = t2._eval$1("1/")._as(this._box_0.count), listeners = t1._removeListeners$0(); t2._precomputed1._as(t3); t1._state = 8; t1._resultOrListeners = t3; A._Future__propagateToListeners(t1, listeners); }, $signature: 0 }; A._Zone.prototype = {$isZone: 1}; A._rootHandleError_closure.prototype = { call$0() { A.Error_throwWithStackTrace(this.error, this.stackTrace); }, $signature: 0 }; A._RootZone.prototype = { runGuarded$1(f) { var e, s, exception; type$.void_Function._as(f); try { if (B.C__RootZone === $.Zone__current) { f.call$0(); return; } A._rootRun(null, null, this, f, type$.void); } catch (exception) { e = A.unwrapException(exception); s = A.getTraceFromException(exception); A._rootHandleError(A._asObject(e), type$.StackTrace._as(s)); } }, runUnaryGuarded$1$2(f, arg, $T) { var e, s, exception; $T._eval$1("~(0)")._as(f); $T._as(arg); try { if (B.C__RootZone === $.Zone__current) { f.call$1(arg); return; } A._rootRunUnary(null, null, this, f, arg, type$.void, $T); } catch (exception) { e = A.unwrapException(exception); s = A.getTraceFromException(exception); A._rootHandleError(A._asObject(e), type$.StackTrace._as(s)); } }, bindCallbackGuarded$1(f) { return new A._RootZone_bindCallbackGuarded_closure(this, type$.void_Function._as(f)); }, bindUnaryCallbackGuarded$1$1(f, $T) { return new A._RootZone_bindUnaryCallbackGuarded_closure(this, $T._eval$1("~(0)")._as(f), $T); }, run$1$1(f, $R) { $R._eval$1("0()")._as(f); if ($.Zone__current === B.C__RootZone) return f.call$0(); return A._rootRun(null, null, this, f, $R); }, runUnary$2$2(f, arg, $R, $T) { $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f); $T._as(arg); if ($.Zone__current === B.C__RootZone) return f.call$1(arg); return A._rootRunUnary(null, null, this, f, arg, $R, $T); }, runBinary$3$3(f, arg1, arg2, $R, $T1, $T2) { $R._eval$1("@<0>")._bind$1($T1)._bind$1($T2)._eval$1("1(2,3)")._as(f); $T1._as(arg1); $T2._as(arg2); if ($.Zone__current === B.C__RootZone) return f.call$2(arg1, arg2); return A._rootRunBinary(null, null, this, f, arg1, arg2, $R, $T1, $T2); } }; A._RootZone_bindCallbackGuarded_closure.prototype = { call$0() { return this.$this.runGuarded$1(this.f); }, $signature: 0 }; A._RootZone_bindUnaryCallbackGuarded_closure.prototype = { call$1(arg) { var t1 = this.T; return this.$this.runUnaryGuarded$1$2(this.f, t1._as(arg), t1); }, $signature() { return this.T._eval$1("~(0)"); } }; A._LinkedHashSet.prototype = { _newSet$0() { return new A._LinkedHashSet(A._instanceType(this)._eval$1("_LinkedHashSet<1>")); }, get$iterator(_) { var _this = this, t1 = new A._LinkedHashSetIterator(_this, _this._collection$_modifications, A._instanceType(_this)._eval$1("_LinkedHashSetIterator<1>")); t1._collection$_cell = _this._collection$_first; return t1; }, get$length(_) { return this._collection$_length; }, contains$1(_, object) { var strings, nums; if (typeof object == "string" && object !== "__proto__") { strings = this._collection$_strings; if (strings == null) return false; return type$.nullable__LinkedHashSetCell._as(strings[object]) != null; } else if (typeof object == "number" && (object & 1073741823) === object) { nums = this._collection$_nums; if (nums == null) return false; return type$.nullable__LinkedHashSetCell._as(nums[object]) != null; } else return this._contains$1(object); }, _contains$1(object) { var rest = this._collection$_rest; if (rest == null) return false; return this._findBucketIndex$2(rest[this._computeHashCode$1(object)], object) >= 0; }, get$first(_) { var first = this._collection$_first; if (first == null) throw A.wrapException(A.StateError$("No elements")); return A._instanceType(this)._precomputed1._as(first._element); }, add$1(_, element) { var strings, nums, _this = this; A._instanceType(_this)._precomputed1._as(element); if (typeof element == "string" && element !== "__proto__") { strings = _this._collection$_strings; return _this._collection$_addHashTableEntry$2(strings == null ? _this._collection$_strings = A._LinkedHashSet__newHashTable() : strings, element); } else if (typeof element == "number" && (element & 1073741823) === element) { nums = _this._collection$_nums; return _this._collection$_addHashTableEntry$2(nums == null ? _this._collection$_nums = A._LinkedHashSet__newHashTable() : nums, element); } else return _this._add$1(element); }, _add$1(element) { var rest, hash, bucket, _this = this; A._instanceType(_this)._precomputed1._as(element); rest = _this._collection$_rest; if (rest == null) rest = _this._collection$_rest = A._LinkedHashSet__newHashTable(); hash = _this._computeHashCode$1(element); bucket = rest[hash]; if (bucket == null) rest[hash] = [_this._collection$_newLinkedCell$1(element)]; else { if (_this._findBucketIndex$2(bucket, element) >= 0) return false; bucket.push(_this._collection$_newLinkedCell$1(element)); } return true; }, remove$1(_, object) { var _this = this; if (typeof object == "string" && object !== "__proto__") return _this._removeHashTableEntry$2(_this._collection$_strings, object); else if (typeof object == "number" && (object & 1073741823) === object) return _this._removeHashTableEntry$2(_this._collection$_nums, object); else return _this._remove$1(object); }, _remove$1(object) { var hash, bucket, index, cell, _this = this, rest = _this._collection$_rest; if (rest == null) return false; hash = _this._computeHashCode$1(object); bucket = rest[hash]; index = _this._findBucketIndex$2(bucket, object); if (index < 0) return false; cell = bucket.splice(index, 1)[0]; if (0 === bucket.length) delete rest[hash]; _this._collection$_unlinkCell$1(cell); return true; }, _filterWhere$2(test, removeMatching) { var cell, element, next, modifications, t2, _this = this, t1 = A._instanceType(_this); t1._eval$1("bool(1)")._as(test); cell = _this._collection$_first; for (t1 = t1._precomputed1; cell != null; cell = next) { element = t1._as(cell._element); next = cell._collection$_next; modifications = _this._collection$_modifications; t2 = test.call$1(element); if (modifications !== _this._collection$_modifications) throw A.wrapException(A.ConcurrentModificationError$(_this)); if (true === t2) _this.remove$1(0, element); } }, _collection$_addHashTableEntry$2(table, element) { A._instanceType(this)._precomputed1._as(element); if (type$.nullable__LinkedHashSetCell._as(table[element]) != null) return false; table[element] = this._collection$_newLinkedCell$1(element); return true; }, _removeHashTableEntry$2(table, element) { var cell; if (table == null) return false; cell = type$.nullable__LinkedHashSetCell._as(table[element]); if (cell == null) return false; this._collection$_unlinkCell$1(cell); delete table[element]; return true; }, _collection$_modified$0() { this._collection$_modifications = this._collection$_modifications + 1 & 1073741823; }, _collection$_newLinkedCell$1(element) { var t1, _this = this, cell = new A._LinkedHashSetCell(A._instanceType(_this)._precomputed1._as(element)); if (_this._collection$_first == null) _this._collection$_first = _this._collection$_last = cell; else { t1 = _this._collection$_last; t1.toString; cell._collection$_previous = t1; _this._collection$_last = t1._collection$_next = cell; } ++_this._collection$_length; _this._collection$_modified$0(); return cell; }, _collection$_unlinkCell$1(cell) { var _this = this, previous = cell._collection$_previous, next = cell._collection$_next; if (previous == null) _this._collection$_first = next; else previous._collection$_next = next; if (next == null) _this._collection$_last = previous; else next._collection$_previous = previous; --_this._collection$_length; _this._collection$_modified$0(); }, _computeHashCode$1(element) { return J.get$hashCode$(element) & 1073741823; }, _findBucketIndex$2(bucket, element) { var $length, i; if (bucket == null) return -1; $length = bucket.length; for (i = 0; i < $length; ++i) if (J.$eq$(bucket[i]._element, element)) return i; return -1; } }; A._LinkedHashSetCell.prototype = {}; A._LinkedHashSetIterator.prototype = { get$current() { var t1 = this._collection$_current; return t1 == null ? this.$ti._precomputed1._as(t1) : t1; }, moveNext$0() { var _this = this, cell = _this._collection$_cell, t1 = _this._set; if (_this._collection$_modifications !== t1._collection$_modifications) throw A.wrapException(A.ConcurrentModificationError$(t1)); else if (cell == null) { _this._collection$_current = null; return false; } else { _this._collection$_current = _this.$ti._eval$1("1?")._as(cell._element); _this._collection$_cell = cell._collection$_next; return true; } }, $isIterator: 1 }; A.LinkedHashMap_LinkedHashMap$from_closure.prototype = { call$2(k, v) { this.result.$indexSet(0, this.K._as(k), this.V._as(v)); }, $signature: 140 }; A.ListBase.prototype = { get$iterator(receiver) { return new A.ListIterator(receiver, this.get$length(receiver), A.instanceType(receiver)._eval$1("ListIterator")); }, elementAt$1(receiver, index) { return this.$index(receiver, index); }, get$isNotEmpty(receiver) { return this.get$length(receiver) !== 0; }, where$1(receiver, test) { var t1 = A.instanceType(receiver); return new A.WhereIterable(receiver, t1._eval$1("bool(ListBase.E)")._as(test), t1._eval$1("WhereIterable")); }, toList$1$growable(receiver, growable) { var t1, first, result, i, _this = this; if (_this.get$length(receiver) === 0) { t1 = J.JSArray_JSArray$growable(0, A.instanceType(receiver)._eval$1("ListBase.E")); return t1; } first = _this.$index(receiver, 0); result = A.List_List$filled(_this.get$length(receiver), first, true, A.instanceType(receiver)._eval$1("ListBase.E")); for (i = 1; i < _this.get$length(receiver); ++i) B.JSArray_methods.$indexSet(result, i, _this.$index(receiver, i)); return result; }, toList$0(receiver) { return this.toList$1$growable(receiver, true); }, add$1(receiver, element) { var t1; A.instanceType(receiver)._eval$1("ListBase.E")._as(element); t1 = this.get$length(receiver); this.set$length(receiver, t1 + 1); this.$indexSet(receiver, t1, element); }, toString$0(receiver) { return A.Iterable_iterableToFullString(receiver, "[", "]"); }, $isEfficientLengthIterable: 1, $isIterable: 1, $isList: 1 }; A.MapBase.prototype = { forEach$1(_, action) { var t2, key, t3, t1 = A._instanceType(this); t1._eval$1("~(MapBase.K,MapBase.V)")._as(action); for (t2 = this.get$keys(), t2 = t2.get$iterator(t2), t1 = t1._eval$1("MapBase.V"); t2.moveNext$0();) { key = t2.get$current(); t3 = this.$index(0, key); action.call$2(key, t3 == null ? t1._as(t3) : t3); } }, containsKey$1(key) { return this.get$keys().contains$1(0, key); }, get$length(_) { var t1 = this.get$keys(); return t1.get$length(t1); }, get$isEmpty(_) { var t1 = this.get$keys(); return t1.get$isEmpty(t1); }, toString$0(_) { return A.MapBase_mapToString(this); }, $isMap: 1 }; A.MapBase_mapToString_closure.prototype = { call$2(k, v) { var t2, t1 = this._box_0; if (!t1.first) this.result._contents += ", "; t1.first = false; t1 = this.result; t2 = A.S(k); t1._contents = (t1._contents += t2) + ": "; t2 = A.S(v); t1._contents += t2; }, $signature: 43 }; A.ListQueue.prototype = { get$iterator(_) { var _this = this; return new A._ListQueueIterator(_this, _this._tail, _this._modificationCount, _this._head, _this.$ti._eval$1("_ListQueueIterator<1>")); }, get$isEmpty(_) { return this._head === this._tail; }, get$length(_) { return (this._tail - this._head & this._table.length - 1) >>> 0; }, elementAt$1(_, index) { var t2, t3, _this = this, t1 = _this.get$length(0); if (0 > index || index >= t1) A.throwExpression(A.IndexError$withLength(index, t1, _this, null, "index")); t1 = _this._table; t2 = t1.length; t3 = (_this._head + index & t2 - 1) >>> 0; if (!(t3 >= 0 && t3 < t2)) return A.ioore(t1, t3); t3 = t1[t3]; return t3 == null ? _this.$ti._precomputed1._as(t3) : t3; }, toString$0(_) { return A.Iterable_iterableToFullString(this, "{", "}"); }, removeFirst$0() { var t2, result, _this = this, t1 = _this._head; if (t1 === _this._tail) throw A.wrapException(A.IterableElementError_noElement()); ++_this._modificationCount; t2 = _this._table; if (!(t1 < t2.length)) return A.ioore(t2, t1); result = t2[t1]; if (result == null) result = _this.$ti._precomputed1._as(result); B.JSArray_methods.$indexSet(t2, t1, null); _this._head = (_this._head + 1 & _this._table.length - 1) >>> 0; return result; }, _add$1(element) { var t1, _this = this; _this.$ti._precomputed1._as(element); B.JSArray_methods.$indexSet(_this._table, _this._tail, element); t1 = (_this._tail + 1 & _this._table.length - 1) >>> 0; _this._tail = t1; if (_this._head === t1) _this._grow$0(); ++_this._modificationCount; }, _grow$0() { var _this = this, newTable = A.List_List$filled(_this._table.length * 2, null, false, _this.$ti._eval$1("1?")), t1 = _this._table, t2 = _this._head, split = t1.length - t2; B.JSArray_methods.setRange$4(newTable, 0, split, t1, t2); B.JSArray_methods.setRange$4(newTable, split, split + _this._head, _this._table, 0); _this._head = 0; _this._tail = _this._table.length; _this._table = newTable; }, $isQueue: 1 }; A._ListQueueIterator.prototype = { get$current() { var t1 = this._collection$_current; return t1 == null ? this.$ti._precomputed1._as(t1) : t1; }, moveNext$0() { var t2, t3, _this = this, t1 = _this._collection$_queue; if (_this._modificationCount !== t1._modificationCount) A.throwExpression(A.ConcurrentModificationError$(t1)); t2 = _this._position; if (t2 === _this._end) { _this._collection$_current = null; return false; } t1 = t1._table; t3 = t1.length; if (!(t2 < t3)) return A.ioore(t1, t2); _this._collection$_current = t1[t2]; _this._position = (t2 + 1 & t3 - 1) >>> 0; return true; }, $isIterator: 1 }; A.SetBase.prototype = { addAll$1(_, elements) { var t1; for (t1 = J.get$iterator$ax(A._instanceType(this)._eval$1("Iterable<1>")._as(elements)); t1.moveNext$0();) this.add$1(0, t1.get$current()); }, toString$0(_) { return A.Iterable_iterableToFullString(this, "{", "}"); }, join$1(_, separator) { var t1, first, t2, t3, iterator = A._LinkedHashSetIterator$(this, this._collection$_modifications, A._instanceType(this)._precomputed1); if (!iterator.moveNext$0()) return ""; t1 = iterator._collection$_current; first = J.toString$0$(t1 == null ? iterator.$ti._precomputed1._as(t1) : t1); if (!iterator.moveNext$0()) return first; t1 = iterator.$ti._precomputed1; if (separator.length === 0) { t2 = first; do { t3 = iterator._collection$_current; t2 += A.S(t3 == null ? t1._as(t3) : t3); } while (iterator.moveNext$0()); t1 = t2; } else { t2 = first; do { t3 = iterator._collection$_current; t2 = t2 + separator + A.S(t3 == null ? t1._as(t3) : t3); } while (iterator.moveNext$0()); t1 = t2; } return t1.charCodeAt(0) == 0 ? t1 : t1; }, any$1(_, test) { var t2, element, t1 = A._instanceType(this); t1._eval$1("bool(1)")._as(test); for (t1 = A._LinkedHashSetIterator$(this, this._collection$_modifications, t1._precomputed1), t2 = t1.$ti._precomputed1; t1.moveNext$0();) { element = t1._collection$_current; if (test.call$1(element == null ? t2._as(element) : element)) return true; } return false; }, $isEfficientLengthIterable: 1, $isIterable: 1, $isSet: 1 }; A._SetBase.prototype = {}; A._JsonMap.prototype = { $index(_, key) { var result, t1 = this._processed; if (t1 == null) return this._data.$index(0, key); else if (typeof key != "string") return null; else { result = t1[key]; return typeof result == "undefined" ? this._convert$_process$1(key) : result; } }, get$length(_) { return this._processed == null ? this._data.__js_helper$_length : this._computeKeys$0().length; }, get$isEmpty(_) { return this.get$length(0) === 0; }, get$keys() { if (this._processed == null) { var t1 = this._data; return new A.LinkedHashMapKeysIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeysIterable<1>")); } return new A._JsonMapKeyIterable(this); }, containsKey$1(key) { if (this._processed == null) return this._data.containsKey$1(key); return Object.prototype.hasOwnProperty.call(this._original, key); }, forEach$1(_, f) { var keys, i, key, value, _this = this; type$.void_Function_String_dynamic._as(f); if (_this._processed == null) return _this._data.forEach$1(0, f); keys = _this._computeKeys$0(); for (i = 0; i < keys.length; ++i) { key = keys[i]; value = _this._processed[key]; if (typeof value == "undefined") { value = A._convertJsonToDartLazy(_this._original[key]); _this._processed[key] = value; } f.call$2(key, value); if (keys !== _this._data) throw A.wrapException(A.ConcurrentModificationError$(_this)); } }, _computeKeys$0() { var keys = type$.nullable_List_dynamic._as(this._data); if (keys == null) keys = this._data = A._setArrayType(Object.keys(this._original), type$.JSArray_String); return keys; }, _convert$_process$1(key) { var result; if (!Object.prototype.hasOwnProperty.call(this._original, key)) return null; result = A._convertJsonToDartLazy(this._original[key]); return this._processed[key] = result; } }; A._JsonMapKeyIterable.prototype = { get$length(_) { return this._convert$_parent.get$length(0); }, elementAt$1(_, index) { var t1 = this._convert$_parent; if (t1._processed == null) t1 = t1.get$keys().elementAt$1(0, index); else { t1 = t1._computeKeys$0(); if (!(index >= 0 && index < t1.length)) return A.ioore(t1, index); t1 = t1[index]; } return t1; }, get$iterator(_) { var t1 = this._convert$_parent; if (t1._processed == null) { t1 = t1.get$keys(); t1 = t1.get$iterator(t1); } else { t1 = t1._computeKeys$0(); t1 = new J.ArrayIterator(t1, t1.length, A._arrayInstanceType(t1)._eval$1("ArrayIterator<1>")); } return t1; }, contains$1(_, key) { return this._convert$_parent.containsKey$1(key); } }; A.Codec.prototype = {}; A.Converter.prototype = {}; A.JsonUnsupportedObjectError.prototype = { toString$0(_) { var safeString = A.Error_safeToString(this.unsupportedObject); return (this.cause != null ? "Converting object to an encodable object failed:" : "Converting object did not return an encodable object:") + " " + safeString; } }; A.JsonCyclicError.prototype = { toString$0(_) { return "Cyclic error in JSON stringify"; } }; A.JsonCodec.prototype = { decode$1(source) { var t1 = A._parseJson(source, this.get$decoder()._reviver); return t1; }, encode$1(value) { var t1 = A._JsonStringStringifier_stringify(value, this.get$encoder()._toEncodable, null); return t1; }, get$encoder() { return B.JsonEncoder_null; }, get$decoder() { return B.JsonDecoder_null; } }; A.JsonEncoder.prototype = {}; A.JsonDecoder.prototype = {}; A._JsonStringifier.prototype = { writeStringContent$1(s) { var t1, offset, i, charCode, t2, t3, $length = s.length; for (t1 = this._sink, offset = 0, i = 0; i < $length; ++i) { charCode = s.charCodeAt(i); if (charCode > 92) { if (charCode >= 55296) { t2 = charCode & 64512; if (t2 === 55296) { t3 = i + 1; t3 = !(t3 < $length && (s.charCodeAt(t3) & 64512) === 56320); } else t3 = false; if (!t3) if (t2 === 56320) { t2 = i - 1; t2 = !(t2 >= 0 && (s.charCodeAt(t2) & 64512) === 55296); } else t2 = false; else t2 = true; if (t2) { if (i > offset) t1._contents += B.JSString_methods.substring$2(s, offset, i); offset = i + 1; t2 = A.Primitives_stringFromCharCode(92); t1._contents += t2; t2 = A.Primitives_stringFromCharCode(117); t1._contents += t2; t2 = A.Primitives_stringFromCharCode(100); t1._contents += t2; t2 = charCode >>> 8 & 15; t2 = A.Primitives_stringFromCharCode(t2 < 10 ? 48 + t2 : 87 + t2); t1._contents += t2; t2 = charCode >>> 4 & 15; t2 = A.Primitives_stringFromCharCode(t2 < 10 ? 48 + t2 : 87 + t2); t1._contents += t2; t2 = charCode & 15; t2 = A.Primitives_stringFromCharCode(t2 < 10 ? 48 + t2 : 87 + t2); t1._contents += t2; } } continue; } if (charCode < 32) { if (i > offset) t1._contents += B.JSString_methods.substring$2(s, offset, i); offset = i + 1; t2 = A.Primitives_stringFromCharCode(92); t1._contents += t2; switch (charCode) { case 8: t2 = A.Primitives_stringFromCharCode(98); t1._contents += t2; break; case 9: t2 = A.Primitives_stringFromCharCode(116); t1._contents += t2; break; case 10: t2 = A.Primitives_stringFromCharCode(110); t1._contents += t2; break; case 12: t2 = A.Primitives_stringFromCharCode(102); t1._contents += t2; break; case 13: t2 = A.Primitives_stringFromCharCode(114); t1._contents += t2; break; default: t2 = A.Primitives_stringFromCharCode(117); t1._contents += t2; t2 = A.Primitives_stringFromCharCode(48); t1._contents = (t1._contents += t2) + t2; t2 = charCode >>> 4 & 15; t2 = A.Primitives_stringFromCharCode(t2 < 10 ? 48 + t2 : 87 + t2); t1._contents += t2; t2 = charCode & 15; t2 = A.Primitives_stringFromCharCode(t2 < 10 ? 48 + t2 : 87 + t2); t1._contents += t2; break; } } else if (charCode === 34 || charCode === 92) { if (i > offset) t1._contents += B.JSString_methods.substring$2(s, offset, i); offset = i + 1; t2 = A.Primitives_stringFromCharCode(92); t1._contents += t2; t2 = A.Primitives_stringFromCharCode(charCode); t1._contents += t2; } } if (offset === 0) t1._contents += s; else if (offset < $length) t1._contents += B.JSString_methods.substring$2(s, offset, $length); }, _checkCycle$1(object) { var t1, t2, i, t3; for (t1 = this._seen, t2 = t1.length, i = 0; i < t2; ++i) { t3 = t1[i]; if (object == null ? t3 == null : object === t3) throw A.wrapException(new A.JsonCyclicError(object, null)); } B.JSArray_methods.add$1(t1, object); }, writeObject$1(object) { var customJson, e, t1, exception, _this = this; if (_this.writeJsonValue$1(object)) return; _this._checkCycle$1(object); try { customJson = _this._toEncodable.call$1(object); if (!_this.writeJsonValue$1(customJson)) { t1 = A.JsonUnsupportedObjectError$(object, null, _this.get$_partialResult()); throw A.wrapException(t1); } t1 = _this._seen; if (0 >= t1.length) return A.ioore(t1, -1); t1.pop(); } catch (exception) { e = A.unwrapException(exception); t1 = A.JsonUnsupportedObjectError$(object, e, _this.get$_partialResult()); throw A.wrapException(t1); } }, writeJsonValue$1(object) { var t1, success, _this = this; if (typeof object == "number") { if (!isFinite(object)) return false; _this._sink._contents += B.JSNumber_methods.toString$0(object); return true; } else if (object === true) { _this._sink._contents += "true"; return true; } else if (object === false) { _this._sink._contents += "false"; return true; } else if (object == null) { _this._sink._contents += "null"; return true; } else if (typeof object == "string") { t1 = _this._sink; t1._contents += '"'; _this.writeStringContent$1(object); t1._contents += '"'; return true; } else if (type$.List_dynamic._is(object)) { _this._checkCycle$1(object); _this.writeList$1(object); t1 = _this._seen; if (0 >= t1.length) return A.ioore(t1, -1); t1.pop(); return true; } else if (type$.Map_dynamic_dynamic._is(object)) { _this._checkCycle$1(object); success = _this.writeMap$1(object); t1 = _this._seen; if (0 >= t1.length) return A.ioore(t1, -1); t1.pop(); return success; } else return false; }, writeList$1(list) { var t2, i, t1 = this._sink; t1._contents += "["; t2 = J.getInterceptor$asx(list); if (t2.get$isNotEmpty(list)) { this.writeObject$1(t2.$index(list, 0)); for (i = 1; i < t2.get$length(list); ++i) { t1._contents += ","; this.writeObject$1(t2.$index(list, i)); } } t1._contents += "]"; }, writeMap$1(map) { var t1, keyValueList, i, t2, separator, t3, _this = this, _box_0 = {}; if (map.get$isEmpty(map)) { _this._sink._contents += "{}"; return true; } t1 = map.get$length(map) * 2; keyValueList = A.List_List$filled(t1, null, false, type$.nullable_Object); i = _box_0.i = 0; _box_0.allStringKeys = true; map.forEach$1(0, new A._JsonStringifier_writeMap_closure(_box_0, keyValueList)); if (!_box_0.allStringKeys) return false; t2 = _this._sink; t2._contents += "{"; for (separator = '"'; i < t1; i += 2, separator = ',"') { t2._contents += separator; _this.writeStringContent$1(A._asString(keyValueList[i])); t2._contents += '":'; t3 = i + 1; if (!(t3 < t1)) return A.ioore(keyValueList, t3); _this.writeObject$1(keyValueList[t3]); } t2._contents += "}"; return true; } }; A._JsonStringifier_writeMap_closure.prototype = { call$2(key, value) { var t1, t2; if (typeof key != "string") this._box_0.allStringKeys = false; t1 = this.keyValueList; t2 = this._box_0; B.JSArray_methods.$indexSet(t1, t2.i++, key); B.JSArray_methods.$indexSet(t1, t2.i++, value); }, $signature: 43 }; A._JsonStringStringifier.prototype = { get$_partialResult() { var t1 = this._sink._contents; return t1.charCodeAt(0) == 0 ? t1 : t1; } }; A.DateTime.prototype = { $eq(_, other) { var t1; if (other == null) return false; t1 = false; if (other instanceof A.DateTime) if (this._core$_value === other._core$_value) t1 = this._microsecond === other._microsecond; return t1; }, get$hashCode(_) { return A.Object_hash(this._core$_value, this._microsecond, B.C_SentinelValue, B.C_SentinelValue); }, compareTo$1(_, other) { var r; type$.DateTime._as(other); r = B.JSInt_methods.compareTo$1(this._core$_value, other._core$_value); if (r !== 0) return r; return B.JSInt_methods.compareTo$1(this._microsecond, other._microsecond); }, toString$0(_) { var _this = this, y = A.DateTime__fourDigits(A.Primitives_getYear(_this)), m = A.DateTime__twoDigits(A.Primitives_getMonth(_this)), d = A.DateTime__twoDigits(A.Primitives_getDay(_this)), h = A.DateTime__twoDigits(A.Primitives_getHours(_this)), min = A.DateTime__twoDigits(A.Primitives_getMinutes(_this)), sec = A.DateTime__twoDigits(A.Primitives_getSeconds(_this)), ms = A.DateTime__threeDigits(A.Primitives_getMilliseconds(_this)), t1 = _this._microsecond, us = t1 === 0 ? "" : A.DateTime__threeDigits(t1); return y + "-" + m + "-" + d + " " + h + ":" + min + ":" + sec + "." + ms + us; }, $isComparable: 1 }; A._Enum.prototype = { toString$0(_) { return this._enumToString$0(); } }; A.Error.prototype = { get$stackTrace() { return A.Primitives_extractStackTrace(this); } }; A.AssertionError.prototype = { toString$0(_) { var t1 = this.message; if (t1 != null) return "Assertion failed: " + A.Error_safeToString(t1); return "Assertion failed"; } }; A.TypeError.prototype = {}; A.ArgumentError.prototype = { get$_errorName() { return "Invalid argument" + (!this._hasValue ? "(s)" : ""); }, get$_errorExplanation() { return ""; }, toString$0(_) { var _this = this, $name = _this.name, nameString = $name == null ? "" : " (" + $name + ")", message = _this.message, messageString = message == null ? "" : ": " + A.S(message), prefix = _this.get$_errorName() + nameString + messageString; if (!_this._hasValue) return prefix; return prefix + _this.get$_errorExplanation() + ": " + A.Error_safeToString(_this.get$invalidValue()); }, get$invalidValue() { return this.invalidValue; } }; A.RangeError.prototype = { get$invalidValue() { return A._asNumQ(this.invalidValue); }, get$_errorName() { return "RangeError"; }, get$_errorExplanation() { var explanation, start = this.start, end = this.end; if (start == null) explanation = end != null ? ": Not less than or equal to " + A.S(end) : ""; else if (end == null) explanation = ": Not greater than or equal to " + A.S(start); else if (end > start) explanation = ": Not in inclusive range " + A.S(start) + ".." + A.S(end); else explanation = end < start ? ": Valid value range is empty" : ": Only valid value is " + A.S(start); return explanation; } }; A.IndexError.prototype = { get$invalidValue() { return A._asInt(this.invalidValue); }, get$_errorName() { return "RangeError"; }, get$_errorExplanation() { if (A._asInt(this.invalidValue) < 0) return ": index must not be negative"; var t1 = this.length; if (t1 === 0) return ": no indices are valid"; return ": index should be less than " + t1; }, get$length(receiver) { return this.length; } }; A.UnsupportedError.prototype = { toString$0(_) { return "Unsupported operation: " + this.message; } }; A.UnimplementedError.prototype = { toString$0(_) { var message = this.message; return message != null ? "UnimplementedError: " + message : "UnimplementedError"; } }; A.StateError.prototype = { toString$0(_) { return "Bad state: " + this.message; } }; A.ConcurrentModificationError.prototype = { toString$0(_) { var t1 = this.modifiedObject; if (t1 == null) return "Concurrent modification during iteration."; return "Concurrent modification during iteration: " + A.Error_safeToString(t1) + "."; } }; A.OutOfMemoryError.prototype = { toString$0(_) { return "Out of Memory"; }, get$stackTrace() { return null; }, $isError: 1 }; A.StackOverflowError.prototype = { toString$0(_) { return "Stack Overflow"; }, get$stackTrace() { return null; }, $isError: 1 }; A._Exception.prototype = { toString$0(_) { return "Exception: " + this.message; } }; A.FormatException.prototype = { toString$0(_) { var message = this.message, report = "" !== message ? "FormatException: " + message : "FormatException", source = this.source; if (typeof source == "string") { if (source.length > 78) source = B.JSString_methods.substring$2(source, 0, 75) + "..."; return report + "\n" + source; } else return report; } }; A.Iterable.prototype = { fold$1$2(_, initialValue, combine, $T) { var t1, value; $T._as(initialValue); A._instanceType(this)._bind$1($T)._eval$1("1(1,Iterable.E)")._as(combine); for (t1 = this.get$iterator(this), value = initialValue; t1.moveNext$0();) value = combine.call$2(value, t1.get$current()); return value; }, any$1(_, test) { var t1; A._instanceType(this)._eval$1("bool(Iterable.E)")._as(test); for (t1 = this.get$iterator(this); t1.moveNext$0();) if (test.call$1(t1.get$current())) return true; return false; }, toList$1$growable(_, growable) { var t1 = A.List_List$_of(this, A._instanceType(this)._eval$1("Iterable.E")); return t1; }, toList$0(_) { return this.toList$1$growable(0, true); }, get$length(_) { var count, it = this.get$iterator(this); for (count = 0; it.moveNext$0();) ++count; return count; }, get$isEmpty(_) { return !this.get$iterator(this).moveNext$0(); }, get$first(_) { var it = this.get$iterator(this); if (!it.moveNext$0()) throw A.wrapException(A.IterableElementError_noElement()); return it.get$current(); }, firstWhere$2$orElse(_, test, orElse) { var element, t1 = A._instanceType(this); t1._eval$1("bool(Iterable.E)")._as(test); t1._eval$1("Iterable.E()?")._as(orElse); for (t1 = this.get$iterator(this); t1.moveNext$0();) { element = t1.get$current(); if (test.call$1(element)) return element; } t1 = orElse.call$0(); return t1; }, elementAt$1(_, index) { var iterator, skipCount; A.RangeError_checkNotNegative(index, "index"); iterator = this.get$iterator(this); for (skipCount = index; iterator.moveNext$0();) { if (skipCount === 0) return iterator.get$current(); --skipCount; } throw A.wrapException(A.IndexError$withLength(index, index - skipCount, this, null, "index")); }, toString$0(_) { return A.Iterable_iterableToShortString(this, "(", ")"); } }; A.MapEntry.prototype = { toString$0(_) { return "MapEntry(" + A.S(this.key) + ": " + A.S(this.value) + ")"; } }; A.Null.prototype = { get$hashCode(_) { return A.Object.prototype.get$hashCode.call(this, 0); }, toString$0(_) { return "null"; } }; A.Object.prototype = {$isObject: 1, $eq(_, other) { return this === other; }, get$hashCode(_) { return A.Primitives_objectHashCode(this); }, toString$0(_) { return "Instance of '" + A.Primitives_objectTypeName(this) + "'"; }, get$runtimeType(_) { return A.getRuntimeTypeOfDartObject(this); }, toString() { return this.toString$0(this); } }; A._StringStackTrace.prototype = { toString$0(_) { return ""; }, $isStackTrace: 1 }; A.Stopwatch.prototype = { get$elapsedMilliseconds() { var ticks, t1 = this._stop; if (t1 == null) t1 = $.Primitives_timerTicks.call$0(); ticks = t1 - this._core$_start; if ($.$get$Stopwatch__frequency() === 1000) return ticks; return B.JSInt_methods._tdivFast$1(ticks, 1000); } }; A.StringBuffer.prototype = { get$length(_) { return this._contents.length; }, toString$0(_) { var t1 = this._contents; return t1.charCodeAt(0) == 0 ? t1 : t1; }, $isStringSink: 1 }; A._JSRandom.prototype = { nextInt$1(max) { if (max <= 0 || max > 4294967296) throw A.wrapException(A.RangeError$(string$.max_mu + max)); return Math.random() * max >>> 0; }, nextDouble$0() { return Math.random(); }, $isRandom: 1 }; A._Random.prototype = { _Random$1(seed) { var low, high, tmplow, low0, t1, t2, t3, _this = this, _4294967296 = 4294967296, empty_seed = seed < 0 ? -1 : 0; do { low = seed >>> 0; seed = B.JSInt_methods._tdivFast$1(seed - low, _4294967296); high = seed >>> 0; seed = B.JSInt_methods._tdivFast$1(seed - high, _4294967296); tmplow = (~low >>> 0) + (low << 21 >>> 0); low0 = tmplow >>> 0; high = (~high >>> 0) + ((high << 21 | low >>> 11) >>> 0) + B.JSInt_methods._tdivFast$1(tmplow - low0, _4294967296) >>> 0; tmplow = ((low0 ^ (low0 >>> 24 | high << 8)) >>> 0) * 265; low = tmplow >>> 0; high = ((high ^ high >>> 24) >>> 0) * 265 + B.JSInt_methods._tdivFast$1(tmplow - low, _4294967296) >>> 0; tmplow = ((low ^ (low >>> 14 | high << 18)) >>> 0) * 21; low = tmplow >>> 0; high = ((high ^ high >>> 14) >>> 0) * 21 + B.JSInt_methods._tdivFast$1(tmplow - low, _4294967296) >>> 0; low = (low ^ (low >>> 28 | high << 4)) >>> 0; high = (high ^ high >>> 28) >>> 0; tmplow = (low << 31 >>> 0) + low; low0 = tmplow >>> 0; t1 = B.JSInt_methods._tdivFast$1(tmplow - low0, _4294967296); tmplow = _this._lo * 1037; t2 = _this._lo = tmplow >>> 0; t3 = _this._hi * 1037 + B.JSInt_methods._tdivFast$1(tmplow - t2, _4294967296) >>> 0; _this._hi = t3; t2 = (t2 ^ low0) >>> 0; _this._lo = t2; t1 = (t3 ^ high + ((high << 31 | low >>> 1) >>> 0) + t1 >>> 0) >>> 0; _this._hi = t1; } while (seed !== empty_seed); if (t1 === 0 && t2 === 0) _this._lo = 23063; _this._nextState$0(); _this._nextState$0(); _this._nextState$0(); _this._nextState$0(); }, _nextState$0() { var _this = this, t1 = _this._lo, tmpHi = 4294901760 * t1, tmpHiLo = tmpHi >>> 0, tmpLo = 55905 * t1, tmpLoLo = tmpLo >>> 0, newLo = tmpLoLo + tmpHiLo + _this._hi; t1 = newLo >>> 0; _this._lo = t1; _this._hi = B.JSInt_methods._tdivFast$1(tmpLo - tmpLoLo + (tmpHi - tmpHiLo) + (newLo - t1), 4294967296) >>> 0; }, nextInt$1(max) { var t1, rnd32, result, _this = this; if (max <= 0 || max > 4294967296) throw A.wrapException(A.RangeError$(string$.max_mu + max)); t1 = max - 1; if ((max & t1) >>> 0 === 0) { _this._nextState$0(); return (_this._lo & t1) >>> 0; } do { _this._nextState$0(); rnd32 = _this._lo; result = rnd32 % max; } while (rnd32 - result + max >= 4294967296); return result; }, nextDouble$0() { var t1, _this = this; _this._nextState$0(); t1 = _this._lo; _this._nextState$0(); return ((t1 & 67108863) * 134217728 + (_this._lo & 134217727)) / 9007199254740992; }, $isRandom: 1 }; A.GameContent.prototype = { buildStage$4(lore, stage, depth, placeHero) { var t1, t2; type$.dynamic_Function_Vec._as(placeHero); if (depth === 0) return new A.Town(stage).buildStage$1(placeHero); t1 = stage.tiles.bounds.size; t2 = t1.x; t1 = t1.y; return new A.Architect(lore, stage, depth, new A.Array2D(A.List_List$filled(t2 * t1, null, false, type$.nullable_Architecture), new A.Rect(new A.Vec(0, 0), new A.Vec(t2, t1)), type$.Array2D_nullable_Architecture)).buildStage$1(placeHero); }, createHero$4$heroClass$permadeath$race($name, heroClass, permadeath, race) { var t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, inventory, _null = null; if (race == null) race = $.$get$Races_human(); if (heroClass == null) heroClass = $.$get$Classes_adventurer(); t1 = A.Inventory$(B.ItemLocation_Inventory, 24, _null); t2 = A.List_List$filled(9, _null, false, type$.nullable_Item); t3 = A.Inventory$(B.ItemLocation_Home, 26, _null); t4 = A.Inventory$(B.ItemLocation_Crucible, 8, _null); t5 = new A.Strength(); t6 = new A.Agility(); t7 = new A.Vitality(); t8 = new A.Intellect(); t9 = A.LinkedHashMap_LinkedHashMap$_empty(type$.Shop, type$.Inventory); t10 = type$.Skill; t11 = type$.int; t12 = A._setArrayType([], type$.JSArray_Message); t13 = type$.Breed; t14 = type$.ItemType; t8._baseValue = t7._baseValue = t6._baseValue = t5._baseValue = 10; for (t15 = new A.LinkedHashMapValueIterator($.Shops_all, $.Shops_all._modifications, $.Shops_all._first, A._instanceType($.Shops_all)._eval$1("LinkedHashMapValueIterator<2>")), t16 = type$.JSArray_Item; t15.moveNext$0();) { t17 = t15.__js_helper$_current; t18 = t17.name; t19 = A._setArrayType([], t16); inventory = new A.Inventory(new A.ItemLocation(t18), t19, 26); t17.update$1(inventory); t9.$indexSet(0, t17, inventory); } return new A.HeroSave($name, race, heroClass, permadeath, t1, new A.Equipment(t2), t3, t4, t9, 0, new A.SkillSet(A.LinkedHashMap_LinkedHashMap$_empty(t10, t11), A.LinkedHashMap_LinkedHashMap$_empty(t10, t11)), 60, 0, new A.Log(t12), new A.Lore(A.LinkedHashMap_LinkedHashMap$_empty(t13, t11), A.LinkedHashMap_LinkedHashMap$_empty(t13, t11), A.LinkedHashMap_LinkedHashMap$_empty(t14, t11), A.LinkedHashMap_LinkedHashMap$_empty(type$.AffixType, t11), A.LinkedHashSet_LinkedHashSet$_empty(t14), A.LinkedHashMap_LinkedHashMap$_empty(t14, t11)), t5, t6, t7, t8); }, createHero$1($name) { return this.createHero$4$heroClass$permadeath$race($name, null, false, null); }, startingItems$1(hero) { var t4, type, amount, resource, _null = null, t1 = type$.String, t2 = type$.int, initialItems = A.LinkedHashMap_LinkedHashMap$_literal(["Mending Salve", 3, "Scroll of Sidestepping", 2, "Tallow Candle", 4, "Loaf of Bread", 5], t1, t2), t3 = A._setArrayType([], type$.JSArray_Item); for (t1 = A.MapExtensions_get_pairs(initialItems, t1, t2), t2 = A._instanceType(t1), t1 = new A.MappedIterator(J.get$iterator$ax(t1._iterable), t1._f, t2._eval$1("MappedIterator<1,2>")), t2 = t2._rest[1]; t1.moveNext$0();) { t4 = t1._current; if (t4 == null) t4 = t2._as(t4); type = t4._0; amount = t4._1; resource = $.$get$Items_types()._resources.$index(0, type); if (resource == null) A.throwExpression(A.ArgumentError$('Unknown resource "' + type + '".', _null)); t3.push(new A.Item(resource.object, _null, _null, _null, amount)); } hero.heroClass.startingItems.dropItem$3(hero.lore, 1, new A.GameContent_startingItems_closure(hero, t3)); return t3; }, updateSubstance$2(stage, pos) { var t3, t1 = stage.tiles.$get$2(pos.get$x(), pos.get$y()), t2 = t1.substance; if (t2 === 0) { if (!this._tryToIgniteTile$3(stage, pos, t1)) this._spreadPoison$3(stage, pos, t1); } else { t3 = t1.element; if (t3 === $.$get$Elements_fire()) { --t2; t1.substance = t2; if (t2 <= 0) { t2 = t1.type; t2 = $.$get$Tiles__ignition().$index(0, t2); if ((t2 == null ? 0 : t2) > 0) { t2 = $.$get$rng(); t3 = type$.List_TileType._as(A.Tiles_burnResult(t1.type)); t2 = t2.range$1(t3.length); if (!(t2 >= 0 && t2 < t3.length)) return A.ioore(t3, t2); t1.type = t3[t2]; } stage.get$_lighting()._floorLightDirty = true; } else return new A.BurningFloorAction(pos); } else if (t3 === $.$get$Elements_poison()) { this._spreadPoison$3(stage, pos, t1); t1 = t1.substance; if (t1 > 0) return new A.PoisonedFloorAction(pos, B.JSNumber_methods.round$0(A.lerpDouble(t1, 0, 255, 3, 8))); } } return null; }, _tryToIgniteTile$3(stage, pos, tile) { var fuel, t1 = {}, t2 = tile.type, ignition = $.$get$Tiles__ignition().$index(0, t2); if (ignition == null) ignition = 0; if (ignition === 0) return false; t1.fire = 0; t2 = new A.GameContent__tryToIgniteTile_neighbor(t1, stage, pos); t2.call$3(-1, 0, 3); t2.call$3(1, 0, 3); t2.call$3(0, -1, 3); t2.call$3(0, 1, 3); t2.call$3(-1, -1, 2); t2.call$3(-1, 1, 2); t2.call$3(1, -1, 2); t2.call$3(1, 1, 2); t1 = t1.fire; t2 = $.$get$rng(); if (t1 <= t2.range$1(50 + ignition)) return false; t1 = tile.type; fuel = $.$get$Tiles__fuel().$index(0, t1); if (fuel == null) fuel = 0; tile.substance = t2.range$2(fuel / 2 | 0, fuel); tile.element = $.$get$Elements_fire(); return stage.get$_lighting()._floorLightDirty = true; }, _spreadPoison$3(stage, pos, tile) { var t1 = {}, t2 = $.$get$Motility_fly(); if ((tile.type.motility._bitMask & t2._bitMask) === 0) return; t1.tiles = t1.poison = 0; t2 = new A.GameContent__spreadPoison_neighbor(t1, stage, pos); t2.call$2(0, 0); t2.call$2(-1, 0); t2.call$2(1, 0); t2.call$2(0, -1); t2.call$2(0, 1); t2.call$2(-1, -1); t2.call$2(1, -1); t2.call$2(-1, 1); t2.call$2(1, 1); tile.element = $.$get$Elements_poison(); tile.substance = B.JSInt_methods.clamp$2(B.JSNumber_methods.toInt$0(t1.poison / t1.tiles) - 4, 0, 255); }, $isContent: 1 }; A.GameContent_startingItems_closure.prototype = { call$1(item) { var t1 = item.type; if (t1.isArtifact) this.hero.lore._createdArtifacts.add$1(0, t1); B.JSArray_methods.add$1(this.items, item); }, $signature: 10 }; A.GameContent__tryToIgniteTile_neighbor.prototype = { call$3(x, y, amount) { var t1 = this.pos, neighbor = this.stage.tiles.$get$2(t1.get$x() + x, t1.get$y() + y); if (neighbor.substance === 0) return; if (neighbor.element === $.$get$Elements_fire()) this._box_0.fire += amount; }, $signature: 28 }; A.GameContent__spreadPoison_neighbor.prototype = { call$2(x, y) { var t1 = this.pos, neighbor = this.stage.tiles.$get$2(t1.get$x() + x, t1.get$y() + y); t1 = $.$get$Motility_fly(); if ((neighbor.type.motility._bitMask & t1._bitMask) !== 0) { t1 = this._box_0; ++t1.tiles; if (neighbor.element === $.$get$Elements_poison()) t1.poison = t1.poison + neighbor.substance; } }, $signature: 135 }; A.BarrierAction.prototype = { get$isImmediate() { return false; }, onPerform$0() { var t1, t2, _this = this; while (_this._distance < 6) { t1 = {}; t1.madeProgress = false; t2 = new A.BarrierAction_onPerform_tryDirection(t1, _this); _this._goingPositive = t2.call$2(_this._goingPositive, 1); _this._goingNegative = t2.call$2(_this._goingNegative, -1); if (t1.madeProgress) return B.ActionResult_null_true_false; _this._distance += 0.1; } return B.ActionResult_null_true_true; } }; A.BarrierAction_onPerform_tryDirection.prototype = { call$2(going, sign) { var t1, allStopped; if (!going) return false; t1 = new A.BarrierAction_onPerform_tryDirection_tryOffset(this._box_0, this.$this, sign); allStopped = !t1.call$2(0, 0) || false; if (t1.call$2(-0.1, 0)) allStopped = false; if (t1.call$2(0.1, 0)) allStopped = false; if (t1.call$2(0, -0.1)) allStopped = false; return !(t1.call$2(0, 0.1) ? false : allStopped); }, $signature: 134 }; A.BarrierAction_onPerform_tryDirection_tryOffset.prototype = { call$2(h, v) { var t3, t1 = this.$this, t2 = t1._distance, pos = t1._center.$add(0, new A.Vec(B.JSNumber_methods.round$0(t1._h * t2 + h), B.JSNumber_methods.round$0(t1._v * t2 + v)).$mul(0, this.sign)); t2 = t1.__Action__game_F; t2 === $ && A.throwLateFieldNI("_game"); t2 = t2.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t2 = t2.tiles.$get$2(pos.x, pos.y); t3 = $.$get$Motility_fly(); if ((t2.type.motility._bitMask & t3._bitMask) === 0) return false; if (t1._hitTiles.add$1(0, pos)) { t1.hitTile$4(t1._barrier$_hit, pos, t1._distance, $.$get$rng().range$2(30, 40)); this._box_0.madeProgress = true; } return true; }, $signature: 129 }; A._BarrierAction_Action_ElementActionMixin.prototype = {}; A.BoltAction.prototype = { get$range() { var t1 = this._bolt$_range; return t1 == null ? this._bolt$_hit.get$range() : t1; }, onStep$2(previous, pos) { var t1 = this._bolt$_hit.get$element(); this.addEvent$4$dir$element$pos(B.EventType_bolt, pos.$sub(0, previous).get$nearestDirection(), t1, pos); }, onHitActor$2(pos, target) { var _this = this; _this._bolt$_hit.perform$4$canMiss(_this, _this._actor, target, _this._canMiss); return true; } }; A.ConditionAction.prototype = { get$intensity() { return 1; }, onPerform$0() { var t1, oldDuration, _this = this, intensity = _this.get$intensity(), duration = _this.get$duration(); if (_this.get$condition()._turnsRemaining <= 0) { t1 = _this.get$condition(); t1._turnsRemaining = duration; t1._intensity = intensity; _this.onActivate$0(); return B.ActionResult_null_true_true; } if (_this.get$condition()._intensity >= intensity) { duration = B.JSInt_methods._tdivFast$1(B.JSInt_methods.$tdiv(duration * intensity, _this.get$condition()._intensity), 2); if (duration === 0) return _this.succeed$0(); _this.get$condition()._turnsRemaining += duration; _this.onExtend$0(); return B.ActionResult_null_true_true; } oldDuration = B.JSInt_methods.$tdiv(_this.get$condition()._turnsRemaining * _this.get$condition()._intensity, intensity); t1 = _this.get$condition(); t1._turnsRemaining = oldDuration + B.JSInt_methods._tdivFast$1(duration, 2); t1._intensity = intensity; _this.onIntensify$0(); return B.ActionResult_null_true_true; }, onIntensify$0() { } }; A.HasteAction.prototype = { get$condition() { return this._actor.haste; }, get$intensity() { return this._condition0$_speed; }, get$duration() { return this._condition0$_duration; }, onActivate$0() { return this.show$2("{1} start[s] moving faster.", this._actor); }, onExtend$0() { return this.show$2("{1} [feel]s the haste lasting longer.", this._actor); }, onIntensify$0() { return this.show$2("{1} move[s] even faster.", this._actor); } }; A.FreezeActorAction.prototype = { get$condition() { return this._actor.cold; }, onPerform$0() { this.destroyHeldItems$1($.$get$Elements_cold()); return this.super$ConditionAction$onPerform(); }, get$intensity() { return 1 + B.JSInt_methods._tdivFast$1(this._condition0$_damage, 40); }, get$duration() { var t1 = this._condition0$_damage; return 3 + $.$get$rng().triangleInt$2(t1 * 2, B.JSInt_methods._tdivFast$1(t1, 2)); }, onActivate$0() { return this.show$2("{1} [are|is] frozen!", this._actor); }, onExtend$0() { return this.show$2("{1} feel[s] the cold linger!", this._actor); }, onIntensify$0() { return this.show$2("{1} feel[s] the cold intensify!", this._actor); } }; A.PoisonAction.prototype = { get$condition() { return this._actor.poison; }, get$intensity() { return 1 + B.JSInt_methods._tdivFast$1(this._condition0$_damage, 20); }, get$duration() { var t1 = this._condition0$_damage; return 1 + $.$get$rng().triangleInt$2(t1 * 2, B.JSInt_methods._tdivFast$1(t1, 2)); }, onActivate$0() { return this.show$2("{1} [are|is] poisoned!", this._actor); }, onExtend$0() { return this.show$2("{1} feel[s] the poison linger!", this._actor); }, onIntensify$0() { return this.show$2("{1} feel[s] the poison intensify!", this._actor); } }; A.BlindAction.prototype = { get$condition() { return this._actor.blindness; }, get$duration() { var t1 = this._condition0$_damage; return 3 + $.$get$rng().triangleInt$2(t1 * 2, B.JSInt_methods._tdivFast$1(t1, 2)); }, onActivate$0() { this.show$2("{1 his} vision dims!", this._actor); var t1 = this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.get$_lighting()._visibilityDirty = true; }, onExtend$0() { return this.show$2("{1 his} vision dims!", this._actor); } }; A.DazzleAction.prototype = { get$condition() { return this._actor.dazzle; }, get$duration() { var t1 = this._condition0$_damage; return 3 + $.$get$rng().triangleInt$2(t1 * 2, B.JSInt_methods._tdivFast$1(t1, 2)); }, onActivate$0() { return this.show$2("{1} [are|is] dazzled by the light!", this._actor); }, onExtend$0() { return this.show$2("{1} [are|is] dazzled by the light!", this._actor); } }; A.ResistAction.prototype = { get$condition() { return this._actor.resistanceCondition$1(this._condition0$_element); }, get$duration() { return this._condition0$_duration; }, onActivate$0() { var t1, t2, _this = this; _this.show$2("{1} [are|is] resistant to " + _this._condition0$_element.toString$0(0) + ".", _this._actor); t1 = _this._actor; t2 = t1.poison; if (t2._turnsRemaining > 0) { t2._intensity = t2._turnsRemaining = 0; _this.show$2("{1} [are|is] no longer poisoned.", t1); } }, onExtend$0() { return this.show$2("{1} feel[s] the resistance extend.", this._actor); } }; A._FreezeActorAction_ConditionAction_DestroyActionMixin.prototype = {}; A.DetectType.prototype = { _enumToString$0() { return "DetectType." + this._core$_name; } }; A.DetectAction.prototype = { get$_tilesByDistance() { var result, _this = this, value = _this.__DetectAction__tilesByDistance_FI; if (value === $) { result = _this._findTiles$0(); _this.__DetectAction__tilesByDistance_FI !== $ && A.throwLateFieldADI("_tilesByDistance"); _this.__DetectAction__tilesByDistance_FI = result; value = result; } return value; }, get$isImmediate() { return false; }, onPerform$0() { var t2, t3, t4, t1 = this.get$_tilesByDistance(); if (t1.length === 0) return B.ActionResult_null_true_true; for (t1 = J.get$iterator$ax(B.JSArray_methods.removeLast$0(t1)); t1.moveNext$0();) { t2 = t1.get$current(); t3 = this.__Action__game_F; t3 === $ && A.throwLateFieldNI("_game"); t4 = t3.__Game__stage_F; t4 === $ && A.throwLateFieldNI("_stage"); t4.exploreAt$3$force(t2.get$x(), t2.get$y(), true); t4 = $.$get$Element_none(); B.JSArray_methods.add$1(t3._events, new A.Event(B.EventType_detect, null, t4, null, t2, null)); } return B.ActionResult_null_true_false; }, _findTiles$0() { var t2, t3, t4, t5, t6, t7, t8, distances, _this = this, _s6_ = "_stage", _box_0 = {}, distanceMap = A.LinkedHashMap_LinkedHashMap$_empty(type$.int, type$.List_Vec), addTile = new A.DetectAction__findTiles_addTile(_this, distanceMap), t1 = _this._types, foundExits = 0; if (t1.contains$1(0, B.DetectType_0)) { t2 = _this.__Action__game_F; t2 === $ && A.throwLateFieldNI("_game"); t3 = t2.__Game__stage_F; t3 === $ && A.throwLateFieldNI(_s6_); t3 = A.RectIterator$(t3.tiles.bounds); while (t3.moveNext$0()) { t4 = t3._x; t5 = t3._y; t6 = t2.__Game__stage_F; t6 === $ && A.throwLateFieldNI(_s6_); t6 = t6.tiles; t6._checkBounds$2(t4, t5); t7 = t6._elements; t8 = t5 * t6.bounds.size.x + t4; if (!(t8 >= 0 && t8 < t7.length)) return A.ioore(t7, t8); t8 = t7[t8]; if (t8._isExplored) continue; t6._checkBounds$2(t4, t5); if (t8.type.portal !== B.TilePortal_exit) continue; ++foundExits; addTile.call$1(new A.Vec(t4, t5)); } } _box_0.foundItems = 0; if (t1.contains$1(0, B.DetectType_1)) { t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI(_s6_); t1.forEachItem$1(new A.DetectAction__findTiles_closure(_box_0, _this, addTile)); } if (foundExits > 0) { t1 = _box_0.foundItems; t2 = _this._actor; if (t1 > 0) _this.show$2("{1} sense[s] hidden secrets in the dark!", t2); else _this.show$2("{1} sense[s] places to escape!", t2); } else if (_box_0.foundItems > 0) _this.show$2("{1} sense[s] the treasures held in the dark!", _this._actor); else _this.show$1("The darkness holds no secrets."); t1 = distanceMap.$ti._eval$1("LinkedHashMapKeysIterable<1>"); distances = A.List_List$_of(new A.LinkedHashMapKeysIterable(distanceMap, t1), t1._eval$1("Iterable.E")); B.JSArray_methods.sort$1(distances, new A.DetectAction__findTiles_closure0()); t1 = A._arrayInstanceType(distances); t2 = t1._eval$1("MappedListIterable<1,List>"); t1 = A.List_List$_of(new A.MappedListIterable(distances, t1._eval$1("List(1)")._as(new A.DetectAction__findTiles_closure1(distanceMap)), t2), t2._eval$1("ListIterable.E")); return t1; } }; A.DetectAction__findTiles_addTile.prototype = { call$1(pos) { var t1 = this.$this, distance = t1._actor._pos.$sub(0, pos).get$lengthSquared(); t1 = t1._maxDistance; if (t1 != null) t1 = distance > t1 * t1; else t1 = false; if (t1) return; t1 = this.distanceMap; t1.putIfAbsent$2(distance, new A.DetectAction__findTiles_addTile_closure()); t1 = t1.$index(0, distance); t1.toString; J.add$1$ax(t1, pos); }, $signature: 12 }; A.DetectAction__findTiles_addTile_closure.prototype = { call$0() { return A._setArrayType([], type$.JSArray_Vec); }, $signature: 45 }; A.DetectAction__findTiles_closure.prototype = { call$2(item, pos) { var t1 = this.$this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); if (t1.tiles.$get$2(pos.get$x(), pos.get$y())._isExplored) return; ++this._box_0.foundItems; this.addTile.call$1(pos); }, $signature: 124 }; A.DetectAction__findTiles_closure0.prototype = { call$2(a, b) { A._asInt(a); return B.JSInt_methods.compareTo$1(A._asInt(b), a); }, $signature: 31 }; A.DetectAction__findTiles_closure1.prototype = { call$1(distance) { var t1 = this.distanceMap.$index(0, A._asInt(distance)); t1.toString; return t1; }, $signature: 121 }; A.EatAction.prototype = { onPerform$0() { var _this = this, t1 = type$.Hero, t2 = t1._as(_this._actor), t3 = t2._stomach; if (t3 === 400) _this.show$2("{1} [are|is] already full!", t2); else if (t3 + _this._eat$_amount > 400) _this.show$2("{1} [are|is] stuffed!", t2); else _this.show$2("{1} feel[s] satiated.", t2); t1 = t1._as(_this._actor); t1._stomach = B.JSInt_methods.clamp$2(t1._stomach + _this._eat$_amount, 0, 400); return B.ActionResult_null_true_true; } }; A.ElementActionMixin.prototype = { hitTile$4(hit, pos, distance, fuel) { var t1, action, _this = this; _this.addEvent$3$element$pos(B.EventType_cone, hit.get$element(), pos); t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1 = t1._actorsByTile.$get$2(pos.get$x(), pos.get$y()); if (t1 != null && t1 !== _this._actor) hit.perform$4$canMiss(_this, _this._actor, t1, false); action = hit.get$element().floorAction.call$4(pos, hit, distance, fuel); if (action != null) _this.addAction$1(action); }, hitTile$3(hit, pos, distance) { return this.hitTile$4(hit, pos, distance, 0); } }; A.BurnActorAction.prototype = { onPerform$0() { var t1, t2; this.destroyHeldItems$1($.$get$Elements_fire()); t1 = this._actor; t2 = t1.cold; if (t2._turnsRemaining > 0) { t2._intensity = t2._turnsRemaining = 0; return this.succeed$2("The fire warms {1} back up.", t1); } return B.ActionResult_null_true_true; } }; A.BurnFloorAction.prototype = { onPerform$0() { var t4, ignition, _this = this, t1 = _this._element$_pos, t2 = $.$get$Elements_fire(), fuel = _this._element$_fuel + _this.destroyFloorItems$2(t1, t2), t3 = _this.__Action__game_F; t3 === $ && A.throwLateFieldNI("_game"); t4 = t3.__Game__stage_F; t4 === $ && A.throwLateFieldNI("_stage"); t1 = t4.tiles.$get$2(t1.get$x(), t1.get$y()); t4 = t1.type; ignition = $.$get$Tiles__ignition().$index(0, t4); if (ignition == null) ignition = 0; if (fuel <= 0) t4 = ignition > 0 && _this._element$_damage > $.$get$rng().range$1(ignition); else t4 = true; if (t4) { t4 = t1.type; t4 = $.$get$Tiles__fuel().$index(0, t4); fuel += t4 == null ? 0 : t4; t4 = $.$get$rng().range$2(B.JSInt_methods._tdivFast$1(fuel, 2), fuel); t1.substance = t4; t4 -= B.JSInt_methods._tdivFast$1(_this._element$_damage, 4); t1.substance = t4; if (t4 <= 0) t1.substance = 1; t1.element = t2; t1 = t3.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.get$_lighting()._floorLightDirty = true; } return B.ActionResult_null_true_true; } }; A.BurningFloorAction.prototype = { onPerform$0() { var t2, t3, _this = this, t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t3 = _this._element$_pos; t2 = t2._actorsByTile.$get$2(t3.get$x(), t3.get$y()); if (t2 != null) A.Hit$_(A.Attack$(new A.Noun("fire"), "burns", 10, 0, $.$get$Elements_fire())).perform$4$canMiss(_this, null, t2, false); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1 = t1.tiles.$get$2(t3.get$x(), t3.get$y()); t1.substance = t1.substance + _this.destroyFloorItems$2(t3, $.$get$Elements_fire()); return B.ActionResult_null_true_true; } }; A.FreezeFloorAction.prototype = { onPerform$0() { this.destroyFloorItems$2(this._element$_pos, $.$get$Elements_cold()); return B.ActionResult_null_true_true; } }; A.PoisonFloorAction.prototype = { onPerform$0() { var t2, t1 = this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = this._element$_pos; t2 = t1.tiles.$get$2(t2.get$x(), t2.get$y()); if (t2.element === $.$get$Elements_fire() && t2.substance > 0) return B.ActionResult_null_true_true; t1 = $.$get$Motility_fly(); if ((t2.type.motility._bitMask & t1._bitMask) !== 0) { t2.element = $.$get$Elements_poison(); t2.substance = B.JSInt_methods.clamp$2(t2.substance + this._element$_damage * 4, 0, 255); } return B.ActionResult_null_true_true; } }; A.PoisonedFloorAction.prototype = { onPerform$0() { var t2, _this = this, t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = _this._element$_pos; t2 = t1._actorsByTile.$get$2(t2.get$x(), t2.get$y()); if (t2 != null) { t1 = $.$get$Elements_poison(); if (t2.resistance$1(t1) > 0) _this.show$2("{1} [are|is] unaffected by the poison.", t2); else A.Hit$_(A.Attack$(new A.Noun("poison"), "chokes", _this._element$_damage, 0, t1)).perform$4$canMiss(_this, null, t2, false); } return B.ActionResult_null_true_true; } }; A.WindAction.prototype = { get$isImmediate() { return false; }, onPerform$0() { var t4, positions, _this = this, distance = (_this._actor.get$motility()._bitMask & $.$get$Motility_fly()._bitMask) !== 0 ? 6 : 3, t1 = _this._actor.get$motility(), t2 = $.$get$Motility_door(), t3 = _this.__Action__game_F; t3 === $ && A.throwLateFieldNI("_game"); t4 = t3.__Game__stage_F; t4 === $ && A.throwLateFieldNI("_stage"); t2 = A.MotilityFlow$(t4, _this._actor._pos, new A.Motility(t1._bitMask & ~t2._bitMask), null, null, distance).get$reachable(); t1 = t2.$ti; t4 = t1._eval$1("WhereIterable"); positions = A.List_List$_of(new A.WhereIterable(t2, t1._eval$1("bool(Iterable.E)")._as(new A.WindAction_onPerform_closure(_this)), t4), t4._eval$1("Iterable.E")); if (positions.length === 0) return B.ActionResult_null_false_true; _this.show$2("{1} [are|is] thrown by the wind!", _this._actor); t1 = _this._actor; _this.addEvent$3$actor$pos(B.EventType_wind, t1, t1._pos); t1 = _this._actor; t1.toString; t2 = $.$get$rng(); type$.List_Vec._as(positions); t2 = t2.range$1(positions.length); if (!(t2 >= 0 && t2 < positions.length)) return A.ioore(positions, t2); t1.setPosition$2(t3, type$.Vec._as(positions[t2])); return B.ActionResult_null_true_true; } }; A.WindAction_onPerform_closure.prototype = { call$1(pos) { var t1; type$.Vec._as(pos); t1 = this.$this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); return t1._actorsByTile.$get$2(pos.get$x(), pos.get$y()) == null; }, $signature: 1 }; A.LightFloorAction.prototype = { onPerform$0() { var t2, t3, t1 = this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t3 = this._element$_pos; t2.tiles.$get$2(t3.get$x(), t3.get$y()).addEmanation$1(this._element$_emanation); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.get$_lighting()._floorLightDirty = true; return B.ActionResult_null_true_true; } }; A._BurnActorAction_Action_DestroyActionMixin.prototype = {}; A._BurnFloorAction_Action_DestroyActionMixin.prototype = {}; A._BurningFloorAction_Action_DestroyActionMixin.prototype = {}; A._FreezeFloorAction_Action_DestroyActionMixin.prototype = {}; A._PoisonFloorAction_Action_DestroyActionMixin.prototype = {}; A._PoisonedFloorAction_Action_DestroyActionMixin.prototype = {}; A.FlowAction.prototype = { get$isImmediate() { return false; }, onPerform$0() { var t2, t3, end, t4, _i, _this = this, t1 = (_this._frame + 1) % _this._slowness; _this._frame = t1; if (t1 !== 0) { _this.addEvent$1(B.EventType_pause); return B.ActionResult_null_true_false; } t1 = _this._tiles; if (t1 == null) { t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1 = A.MotilityFlow$(t1, _this._from, _this._flow$_motility, false, null, null); _this.__FlowAction__flow_F !== $ && A.throwLateFieldAI("_flow"); _this.__FlowAction__flow_F = t1; t1 = t1.get$reachable(); t2 = t1.$ti; t3 = t2._eval$1("TakeWhileIterable"); t1 = A.List_List$_of(new A.TakeWhileIterable(t1, t2._eval$1("bool(Iterable.E)")._as(new A.FlowAction_onPerform_closure(_this)), t3), t3._eval$1("Iterable.E")); _this._tiles = t1; } t2 = _this.__FlowAction__flow_F; t2 === $ && A.throwLateFieldNI("_flow"); t1 = t2.costAt$1(B.JSArray_methods.get$first(t1)); t1.toString; for (end = 0; t3 = _this._tiles, end < t3.length; ++end) if (t2.costAt$1(t3[end]) !== t1) break; t2 = _this._tiles; t2.toString; t2 = B.JSArray_methods.sublist$2(t2, 0, end); t3 = t2.length; t4 = _this._hit; _i = 0; for (; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) _this.hitTile$3(t4, t2[_i], t1); t1 = _this._tiles; t1.toString; t1 = B.JSArray_methods.sublist$1(t1, end); _this._tiles = t1; if (t1.length === 0) return B.ActionResult_null_true_true; return B.ActionResult_null_true_false; } }; A.FlowAction_onPerform_closure.prototype = { call$1(pos) { var t1, t2; type$.Vec._as(pos); t1 = this.$this; t2 = t1.__FlowAction__flow_F; t2 === $ && A.throwLateFieldNI("_flow"); t2 = t2.costAt$1(pos); t2.toString; return t2 <= t1._hit.get$range(); }, $signature: 1 }; A.FlowSelfAction.prototype = { onPerform$0() { var _this = this; return _this.alternate$1(A.FlowAction$(_this._actor._pos, A.Hit$_(_this._flow$_attack), _this._flow$_motility, null)); } }; A.FlowFromAction.prototype = { onPerform$0() { var _this = this; return _this.alternate$1(A.FlowAction$(_this._flow$_pos, A.Hit$_(_this._flow$_attack), _this._flow$_motility, null)); } }; A._FlowAction_Action_ElementActionMixin.prototype = {}; A.HealAction.prototype = { onPerform$0() { var _this = this, t1 = _this._actor, t2 = t1.poison, changed = t2._turnsRemaining > 0 && _this.curePoison; if (changed) { t2._intensity = t2._turnsRemaining = 0; _this.show$2("{1} [are|is] cleansed of poison.", t1); } t1 = _this._actor; if (t1._health !== t1.get$maxHealth() && _this.amount > 0) { t1 = _this._actor; t2 = _this.amount; t1._health = B.JSInt_methods.clamp$2(t1._health + t2, 0, t1.get$maxHealth()); _this.addEvent$3$actor$other(B.EventType_heal, _this._actor, t2); _this.show$2("{1} feel[s] better.", _this._actor); changed = true; } if (changed) return B.ActionResult_null_true_true; else return _this.succeed$2("{1} [don't|doesn't] feel any different.", _this._actor); } }; A.HowlAction.prototype = { onPerform$0() { var t1, t2, t3, t4, t5, _i, other, t6, t7, t8, _this = this; _this.show$2("{1} " + _this._howl0$_verb + "!", _this._actor); _this.addEvent$2$actor(B.EventType_howl, _this._actor); t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t2 = t2._actors; t3 = t2.length; t4 = type$.Monster; t5 = _this._howl0$_range; _i = 0; for (; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { other = t2[_i]; t6 = _this._actor; if (other !== t6 && other instanceof A.Monster && other._pos.$sub(0, t4._as(t6)._pos).$le(0, t5)) { t7 = t1.__Game__stage_F; t7 === $ && A.throwLateFieldNI("_stage"); t6 = t6._pos; t8 = other._pos; t8 = t7.get$_sound().volumeBetween$2(t6, t8); t8 = other._alertness + t8 * other._breed.hearing; other._alertness = t8; other._alertness = B.JSNumber_methods.clamp$2(t8, 0, 1); } } return B.ActionResult_null_true_true; } }; A.IlluminateAction.prototype = { reachStartTile$1(pos) { this.reachTile$2(pos, 0); }, reachTile$2(pos, distance) { var t2, t3, t1 = this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t2 = t2.tiles.$get$2(pos.get$x(), pos.get$y()); t3 = A.Lighting_emanationForLevel(3); t2._appliedEmanation = Math.max(t2._appliedEmanation, t3); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.get$_lighting()._floorLightDirty = true; this.addEvent$1(B.EventType_pause); }, get$range() { return this.range; } }; A.IlluminateSelfAction.prototype = { get$isImmediate() { return false; }, onPerform$0() { var t2, t3, _this = this, t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t3 = _this._actor._pos; t3 = t2.tiles.$get$2(t3.get$x(), t3.get$y()); t2 = A.Lighting_emanationForLevel(3); t3._appliedEmanation = Math.max(t3._appliedEmanation, t2); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.get$_lighting()._floorLightDirty = true; _this.addEvent$1(B.EventType_pause); t1 = _this._actor._pos; t2 = new A.IlluminateAction(_this._illuminate$_range, t1, t1, A.LinkedHashSet_LinkedHashSet$_empty(type$.Vec), A._setArrayType([], type$.JSArray_double)); t2.RayActionBase$3(t1, t1, 1); return _this.alternate$1(t2); } }; A.MappingAction.prototype = { get$_mapping$_tilesByDistance() { var result, _this = this, value = _this.__MappingAction__tilesByDistance_FI; if (value === $) { result = _this._mapping$_findTiles$0(); _this.__MappingAction__tilesByDistance_FI !== $ && A.throwLateFieldADI("_tilesByDistance"); _this.__MappingAction__tilesByDistance_FI = result; value = result; } return value; }, get$isImmediate() { return false; }, onPerform$0() { var t1, i, t2, t3, t4, _i, pos, t5, t6, t7, t8, _i0, neighbor, _this = this, _s6_ = "_stage"; for (t1 = _this._illuminate, i = 0; i < 2; ++i) { t2 = _this._currentDistance; t3 = _this.get$_mapping$_tilesByDistance(); t4 = t3.length; if (t2 >= t4) return B.ActionResult_null_true_true; t2 = _this._currentDistance; if (!(t2 < t4)) return A.ioore(t3, t2); t2 = t3[t2]; t3 = t2.length; _i = 0; for (; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { pos = t2[_i]; t4 = _this.__Action__game_F; t4 === $ && A.throwLateFieldNI("_game"); t5 = t4.__Game__stage_F; t5 === $ && A.throwLateFieldNI(_s6_); t5.exploreAt$3$force(pos.get$x(), pos.get$y(), true); t5 = $.$get$Element_none(); B.JSArray_methods.add$1(t4._events, new A.Event(B.EventType_map, null, t5, null, pos, null)); if (t1) { t5 = t4.__Game__stage_F; t5 === $ && A.throwLateFieldNI(_s6_); t5 = t5.tiles; t6 = pos.get$x(); t7 = pos.get$y(); t5._checkBounds$2(t6, t7); t8 = t5._elements; t6 = t7 * t5.bounds.size.x + t6; if (!(t6 >= 0 && t6 < t8.length)) return A.ioore(t8, t6); t6 = t8[t6]; t6._appliedEmanation = B.JSInt_methods.clamp$2(t6._appliedEmanation + 255, 0, 192); t6 = t4.__Game__stage_F; t6 === $ && A.throwLateFieldNI(_s6_); t6.get$_lighting()._floorLightDirty = true; } for (t5 = pos.get$neighbors(), t6 = t5.length, _i0 = 0; _i0 < t5.length; t5.length === t6 || (0, A.throwConcurrentModificationError)(t5), ++_i0) { neighbor = t5[_i0]; t7 = t4.__Game__stage_F; t7 === $ && A.throwLateFieldNI(_s6_); t7.exploreAt$3$force(neighbor.x, neighbor.y, true); } } ++_this._currentDistance; } return B.ActionResult_null_true_false; }, _mapping$_findTiles$0() { var t2, t3, t4, flow, t5, i, _this = this, t1 = type$.JSArray_Vec, result = A._setArrayType([A._setArrayType([], t1)], type$.JSArray_List_Vec); if (0 >= result.length) return A.ioore(result, 0); B.JSArray_methods.add$1(result[0], _this._actor._pos); t2 = _this.__Action__game_F; t2 === $ && A.throwLateFieldNI("_game"); t2 = t2.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t3 = _this._actor._pos; t4 = _this._mapping$_maxDistance; flow = new A.MappingFlow(t4, t2, t3, new A.BucketQueue(A._setArrayType([], type$.JSArray_nullable_Queue_Vec), type$.BucketQueue_Vec), A._setArrayType([], t1)); flow.Flow$3$maxDistance(t2, t3, t4); for (t2 = flow.get$reachable(), t3 = t2.$ti, t2 = new A._SyncStarIterator(t2._outerHelper(), t3._eval$1("_SyncStarIterator<1>")), t3 = t3._precomputed1; t2.moveNext$0();) { t4 = t2._async$_current; if (t4 == null) t4 = t3._as(t4); t5 = flow.costAt$1(t4); t5.toString; for (i = result.length; i <= t5; ++i) B.JSArray_methods.add$1(result, A._setArrayType([], t1)); if (!(t5 >= 0 && t5 < result.length)) return A.ioore(result, t5); B.JSArray_methods.add$1(result[t5], t4); } for (t1 = type$.List_Vec, i = 0; i < result.length; ++i) { t2 = $.$get$rng(); B.JSArray_methods.shuffle$1(t1._as(result[i]), t2._random); } return result; } }; A.MappingFlow.prototype = { tileCost$4(parentCost, pos, tile, isDiagonal) { var t1 = $.$get$Motility_doorAndFly(); if ((tile.type.motility._bitMask & t1._bitMask) === 0) return null; if (parentCost >= this._mapping$_maxDistance * 2) return null; return isDiagonal ? 3 : 2; } }; A.Missive.prototype = { _enumToString$0() { return "Missive." + this._core$_name; } }; A.MissiveAction.prototype = { get$noise() { return 1; }, onPerform$0() { var t3, _this = this, t1 = $.$get$rng(), t2 = B.Map_DeHhx.$index(0, _this.missive); t2.toString; type$.List_String._as(t2); t3 = t2.length; t1 = t1.range$1(t3); if (!(t1 >= 0 && t1 < t3)) return A.ioore(t2, t1); return _this.succeed$3(t2[t1], _this._actor, _this.target); } }; A.PerceiveAction.prototype = { get$isImmediate() { return false; }, onPerform$0() { var t2, t3, t4, _i, actor, t5, perceived, t6, _this = this, alreadyPerceived = A.LinkedHashSet_LinkedHashSet$_empty(type$.Actor), t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t2 = t2._actors; t3 = t2.length; t4 = type$.Hero; _i = 0; for (; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { actor = t2[_i]; if (actor === t4._as(_this._actor)) continue; if (t1.heroCanPerceive$1(actor)) alreadyPerceived.add$1(0, actor); } t2 = t4._as(_this._actor).perception; t2._turnsRemaining = _this._perception$_duration; t2._intensity = _this._perception$_distance; t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t2 = t2._actors; t3 = t2.length; t5 = t1._events; perceived = false; _i = 0; for (; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { actor = t2[_i]; if (actor === t4._as(_this._actor)) continue; if (t1.heroCanPerceive$1(actor) && !alreadyPerceived.contains$1(0, actor)) { t6 = $.$get$Element_none(); B.JSArray_methods.add$1(t5, new A.Event(B.EventType_perceive, actor, t6, null, null, null)); perceived = true; } } t1 = _this._actor; if (perceived) return _this.succeed$2("{1} perceive[s] monsters beyond your sight!", t1); else return _this.succeed$2("{1} do[es]n't perceive anything.", t1); } }; A.PolymorphAction.prototype = { onPerform$0() { var _this = this, t1 = type$.Monster._as(_this._actor), t2 = _this._polymorph$_breed; t1._breed = t2; t1._health = B.JSInt_methods.clamp$2(B.JSInt_methods.clamp$2(t1._health, 0, t2.maxHealth), 0, t1.get$maxHealth()); t1._recharges.clear$0(0); t1._resetCharges$0(); _this.addEvent$2$actor(B.EventType_polymorph, _this._actor); return B.ActionResult_null_true_true; } }; A.AmputateAction.prototype = { onPerform$0() { var positions, t1, t2, _i, dir, pos, t3, t4, t5, t6, part, state, _this = this; _this.addAction$1(new A.PolymorphAction(_this._bodyBreed)); _this.show$2(_this._polymorph$_message, _this._actor); positions = A._setArrayType([], type$.JSArray_Vec); for (t1 = _this._partBreed, t2 = t1.motility, _i = 0; _i < 8; ++_i) { dir = B.List_wXx[_i]; pos = _this._actor._pos.$add(0, dir); t3 = _this.__Action__game_F; t3 === $ && A.throwLateFieldNI("_game"); t3 = t3.__Game__stage_F; t3 === $ && A.throwLateFieldNI("_stage"); if (t3.canOccupy$2(pos, t2)) { t3 = t3._actorsByTile; t4 = pos.x; t5 = pos.y; t3._checkBounds$2(t4, t5); t6 = t3._elements; t4 = t5 * t3.bounds.size.x + t4; if (!(t4 >= 0 && t4 < t6.length)) return A.ioore(t6, t4); t4 = t6[t4] == null; t3 = t4; } else t3 = false; if (t3) B.JSArray_methods.add$1(positions, pos); } t2 = positions.length; if (t2 !== 0) { t3 = $.$get$rng(); type$.List_Vec._as(positions); t2 = t3.range$1(t2); if (!(t2 >= 0 && t2 < positions.length)) return A.ioore(positions, t2); part = t1.spawn$2(positions[t2], type$.Monster._as(_this._actor)); state = new A.AwakeState(); part._monster$_state = state; state.__MonsterState__monster_F = part; t2 = _this.__Action__game_F; t2 === $ && A.throwLateFieldNI("_game"); t2 = t2.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t2.addActor$1(part); _this.addEvent$2$actor(B.EventType_spawn, part); } return B.ActionResult_null_true_true; } }; A.RayActionBase.prototype = { get$isImmediate() { return false; }, RayActionBase$3(_from, _to, fraction) { var t1, t2, offset, centerTheta, t3, i, thetaStep, _this = this, numRays = B.JSNumber_methods.ceil$0(6.283185307179586 * _this.get$range() * fraction * 2); if (fraction < 1) { t1 = _this._to; t2 = _this._ray$_from; offset = t1.$sub(0, t2); centerTheta = !t2.$eq(0, t1) ? Math.atan2(offset.x, offset.y) : 0; for (t1 = numRays - 1, t2 = _this._rays, t3 = 6.283185307179586 * fraction, i = 0; i < numRays; ++i) B.JSArray_methods.add$1(t2, centerTheta + (i / t1 - 0.5) * t3); } else { thetaStep = 6.283185307179586 / numRays; for (t1 = _this._rays, i = 0; i < numRays; ++i) B.JSArray_methods.add$1(t1, i * thetaStep); } }, onPerform$0() { var t1, _this = this; if (_this._radius === 0) { _this.reachStartTile$1(_this._ray$_from); ++_this._radius; return B.ActionResult_null_true_false; } t1 = _this._rays; B.JSArray_methods.removeWhere$1(t1, new A.RayActionBase_onPerform_closure(_this)); if (++_this._radius > _this.get$range() || t1.length === 0) return B.ActionResult_null_true_true; return B.ActionResult_null_true_false; }, reachStartTile$1(pos) { } }; A.RayActionBase_onPerform_closure.prototype = { call$1(ray) { var t1, t2, t3, t4, pos, t5; A._asDouble(ray); t1 = this.$this; t2 = t1._ray$_from; t3 = t2.get$x() + B.JSNumber_methods.round$0(Math.sin(ray) * t1._radius); t4 = t2.get$y() + B.JSNumber_methods.round$0(Math.cos(ray) * t1._radius); pos = new A.Vec(t3, t4); t5 = t1.__Action__game_F; t5 === $ && A.throwLateFieldNI("_game"); t5 = t5.__Game__stage_F; t5 === $ && A.throwLateFieldNI("_stage"); t4 = t5.tiles.$get$2(t3, t4); t3 = $.$get$Motility_fly(); if ((t4.type.motility._bitMask & t3._bitMask) === 0) return true; if (!t1._ray$_hitTiles.add$1(0, pos)) return false; t1.reachTile$2(pos, Math.sqrt(pos.$sub(0, t2).get$lengthSquared())); return false; }, $signature: 142 }; A.RayAction.prototype = { get$range() { return this._ray$_hit.get$range(); }, reachTile$2(pos, distance) { this.hitTile$3(this._ray$_hit, pos, distance); } }; A.RingSelfAction.prototype = { get$isImmediate() { return false; }, onPerform$0() { var t1 = this._actor._pos; return this.alternate$1(A.RayAction$_(A.Hit$_(this._ray$_attack), t1, t1, 1)); } }; A.RingFromAction.prototype = { get$isImmediate() { return false; }, onPerform$0() { var t1 = this._ray$_pos; return this.alternate$1(A.RayAction$_(A.Hit$_(this._ray$_attack), t1, t1, 1)); } }; A._RayAction_RayActionBase_ElementActionMixin.prototype = {}; A.SpawnAction.prototype = { onPerform$0() { var spawned, _this = this, t1 = type$.Monster; if ($.$get$rng().range$1(t1._as(_this._actor).generation) !== 0) return B.ActionResult_null_true_true; t1 = t1._as(_this._actor); ++t1.generation; spawned = _this._spawn$_breed.spawn$2(_this._spawn$_pos, t1); t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.addActor$1(spawned); _this.addEvent$2$actor(B.EventType_spawn, spawned); return B.ActionResult_null_true_true; } }; A.TeleportAction.prototype = { onPerform$0() { var t7, pos, t8, best, tries, from, _this = this, targets = A._setArrayType([], type$.JSArray_Vec), actorPos = _this._actor._pos, t1 = _this.distance, t2 = actorPos.get$x() - t1, t3 = actorPos.get$y() - t1, t4 = actorPos.get$x(), t5 = actorPos.get$y(), t6 = _this.__Action__game_F; t6 === $ && A.throwLateFieldNI("_game"); t7 = t6.__Game__stage_F; t7 === $ && A.throwLateFieldNI("_stage"); for (t2 = A.RectIterator$(A.Rect_intersect(new A.Rect(new A.Vec(t2, t3), new A.Vec(t4 + t1 - t2, t5 + t1 - t3)), t7.tiles.bounds)); t2.moveNext$0();) { t3 = t2._x; t4 = t2._y; pos = new A.Vec(t3, t4); t5 = t6.__Game__stage_F; t5 === $ && A.throwLateFieldNI("_stage"); if (t5.canOccupy$2(pos, _this._actor.get$motility())) { t7 = t5._actorsByTile; t7._checkBounds$2(t3, t4); t8 = t7._elements; t7 = t4 * t7.bounds.size.x + t3; if (!(t7 >= 0 && t7 < t8.length)) return A.ioore(t8, t7); t7 = t8[t7] == null; } else t7 = false; if (t7) { t5 = t5.tiles; t5._checkBounds$2(t3, t4); t7 = t5._elements; t3 = t4 * t5.bounds.size.x + t3; if (!(t3 >= 0 && t3 < t7.length)) return A.ioore(t7, t3); t3 = t7[t3].substance === 0; } else t3 = false; if (!t3) continue; if (pos.$sub(0, _this._actor._pos).$gt(0, t1)) continue; B.JSArray_methods.add$1(targets, pos); } t1 = targets.length; if (t1 === 0) return _this.fail$2("{1} couldn't escape.", _this._actor); t2 = $.$get$rng(); type$.List_Vec._as(targets); t1 = t2.range$1(t1); t3 = targets.length; if (!(t1 >= 0 && t1 < t3)) return A.ioore(targets, t1); best = targets[t1]; for (t1 = t3, tries = 0; tries < 10; ++tries, t1 = t3) { t1 = t2._random.nextInt$1(t1); t3 = targets.length; if (!(t1 >= 0 && t1 < t3)) return A.ioore(targets, t1); pos = targets[t1]; t1 = _this._actor._pos; if (pos.$sub(0, t1).$gt(0, best.$sub(0, t1))) best = pos; } t1 = _this._actor; from = t1._pos; t1.setPosition$2(t6, best); _this.addEvent$3$actor$pos(B.EventType_teleport, _this._actor, from); return _this.succeed$2("{1} teleport[s]!", _this._actor); } }; A._OpenTileAction.prototype = { onPerform$0() { var t2, t3, t4, _this = this, t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t3 = _this._tile$_pos; t2.tiles.$get$2(t3.get$x(), t3.get$y()).type = _this.get$_openTile(); _this.addEvent$2$pos(B.EventType_openBarrel, t3); t2 = $.$get$rng(); t4 = B.JSNumber_methods.round$0(A.lerpDouble(t1.depth, 1, 100, _this.get$_minDepthEmptyChance(), _this.get$_maxDepthEmptyChance())); if (t2.range$1(100) < t4) _this.show$2("The " + _this.get$_tile$_name() + " is empty.", _this._actor); else { t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t2.placeDrops$3$depth(t3, _this._createDrop$0(), t1.depth); _this.show$2("{1} open[s] the " + _this.get$_tile$_name() + ".", _this._actor); } return B.ActionResult_null_true_true; } }; A.OpenBarrelAction.prototype = { get$_tile$_name() { return "barrel"; }, get$_openTile() { return $.$get$Tiles_openBarrel(); }, get$_minDepthEmptyChance() { return 40; }, get$_maxDepthEmptyChance() { return 10; }, _createDrop$0() { var t1 = this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); return A.parseDrop("food", t1.depth, null); } }; A.OpenChestAction.prototype = { get$_tile$_name() { return "chest"; }, get$_openTile() { return $.$get$Tiles_openChest(); }, get$_minDepthEmptyChance() { return 20; }, get$_maxDepthEmptyChance() { return 2; }, _createDrop$0() { var t1 = this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); return A._OneOfDrop$(A.LinkedHashMap_LinkedHashMap$_literal([A.parseDrop("treasure", t1.depth, null), 0.5, A.parseDrop("magic", t1.depth, null), 0.2, A.parseDrop("equipment", t1.depth, null), 0.3], type$.Drop, type$.double)); } }; A.Decor.prototype = {}; A.Furnishing.prototype = { canPlace$2(painter, pos) { var t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, y, t16, x, t17, t18, t19; for (t1 = this._cells, t2 = t1.bounds.size, t3 = t2.y, t2 = t2.x, t4 = t1._elements, t5 = t4.length, t6 = painter._painter$_architect, t7 = t6.stage.tiles, t8 = t7._elements, t9 = t7.bounds, t10 = t9.size.x, t11 = t8.length, t6 = t6._owners, t12 = t6._elements, t13 = t6.bounds.size.x, t14 = t12.length, t15 = painter._architecture, y = 0; y < t3; ++y) for (t16 = y * t2, x = 0; x < t2; ++x) { t17 = pos.get$x() + x; t18 = pos.get$y() + y; if (!t9.contains$1(0, new A.Vec(t17, t18))) return false; t6._checkBounds$2(t17, t18); t19 = t18 * t13 + t17; if (!(t19 >= 0 && t19 < t14)) return A.ioore(t12, t19); if (t12[t19] != t15) return false; t1._checkBounds$2(x, y); t19 = t16 + x; if (!(t19 >= 0 && t19 < t5)) return A.ioore(t4, t19); t19 = t4[t19]; t7._checkBounds$2(t17, t18); t17 = t18 * t10 + t17; if (!(t17 >= 0 && t17 < t11)) return A.ioore(t8, t17); if (!t19.meetsRequirement$1(t8[t17].type)) return false; } return true; }, place$2(painter, pos) { var t1, t2, t3, t4, t5, t6, t7, t8, t9, y, t10, x, t11, t12, t13; for (t1 = this._cells, t2 = t1.bounds.size, t3 = t2.y, t2 = t2.x, t4 = t1._elements, t5 = t4.length, t6 = painter._painter$_architect.stage.tiles, t7 = t6._elements, t8 = t6.bounds.size.x, t9 = t7.length, y = 0; y < t3; ++y) for (t10 = y * t2, x = 0; x < t2; ++x) { t1._checkBounds$2(x, y); t11 = t10 + x; if (!(t11 >= 0 && t11 < t5)) return A.ioore(t4, t11); t11 = t4[t11]; t12 = pos.get$x() + x; t13 = pos.get$y() + y; t11 = t11._apply; if (t11 != null) { t6._checkBounds$2(t12, t13); t12 = t13 * t8 + t12; if (!(t12 >= 0 && t12 < t9)) return A.ioore(t7, t12); t7[t12].type = t11; ++painter._painted; } } } }; A.Cell.prototype = { meetsRequirement$1(tile) { var t1 = this._furnishing$_motility; if (t1 != null) t1 = (tile.motility._bitMask & t1._bitMask) === 0; else t1 = false; if (t1) return false; t1 = this._require; if (t1.length !== 0 && !B.JSArray_methods.contains$1(t1, tile)) return false; return true; } }; A.Symmetry.prototype = { _enumToString$0() { return "Symmetry." + this._core$_name; } }; A.furnishing_closure.prototype = { call$1(line) { return B.JSString_methods.trim$0(A._asString(line)); }, $signature: 7 }; A.Elements_air_closure.prototype = { call$1(__wc0_formal) { A._asInt(__wc0_formal); return new A.WindAction(); }, $signature: 116 }; A.Elements_fire_closure.prototype = { call$1(__wc0_formal) { A._asInt(__wc0_formal); return new A.BurnActorAction(); }, $signature: 114 }; A.Elements_fire_closure0.prototype = { call$4(pos, hit, distance, fuel) { type$.Vec._as(pos); type$.Hit._as(hit); A._asNum(distance); A._asInt(fuel); return new A.BurnFloorAction(pos, B.JSNumber_methods.toInt$0(hit.get$averageDamage()), fuel); }, $signature: 113 }; A.Elements_cold_closure.prototype = { call$1(damage) { return new A.FreezeActorAction(A._asInt(damage)); }, $signature: 111 }; A.Elements_cold_closure0.prototype = { call$4(pos, hit, distance, __wc0_formal) { type$.Vec._as(pos); type$.Hit._as(hit); A._asNum(distance); A._asInt(__wc0_formal); return new A.FreezeFloorAction(pos); }, $signature: 109 }; A.Elements_poison_closure.prototype = { call$1(damage) { return new A.PoisonAction(A._asInt(damage)); }, $signature: 108 }; A.Elements_poison_closure0.prototype = { call$4(pos, hit, distance, __wc0_formal) { type$.Vec._as(pos); type$.Hit._as(hit); A._asNum(distance); A._asInt(__wc0_formal); return new A.PoisonFloorAction(pos, B.JSNumber_methods.toInt$0(hit.get$averageDamage())); }, $signature: 107 }; A.Elements_dark_closure.prototype = { call$1(damage) { return new A.BlindAction(A._asInt(damage)); }, $signature: 104 }; A.Elements_light_closure.prototype = { call$1(damage) { return new A.DazzleAction(A._asInt(damage)); }, $signature: 97 }; A.Elements_light_closure0.prototype = { call$4(pos, hit, distance, __wc0_formal) { var min, max; type$.Vec._as(pos); type$.Hit._as(hit); A._asNum(distance); A._asInt(__wc0_formal); min = B.JSInt_methods.clamp$2(1 + B.JSNumber_methods.toInt$0(hit.get$averageDamage()) * 4, 0, 255); max = B.JSNumber_methods.clamp$2(128 + hit.get$averageDamage() * 16, 0, 255); return new A.LightFloorAction(pos, B.JSNumber_methods.toInt$0(A.lerpDouble(hit.get$range() - distance, 0, hit.get$range(), min, max))); }, $signature: 96 }; A._BaseBuilder.prototype = { toss$4$breakage$damage$element$range(breakage, damage, element, range) { var _this = this; _this._tossDamage = damage; _this._tossElement = element; _this._tossRange = range; _this._breakage = breakage; }, toss$3$breakage$damage$range(breakage, damage, range) { return this.toss$4$breakage$damage$element$range(breakage, damage, null, range); }, toss$1$breakage(breakage) { return this.toss$4$breakage$damage$element$range(breakage, null, null, null); }, toss$3$damage$element$range(damage, element, range) { return this.toss$4$breakage$damage$element$range(null, damage, element, range); }, toss$2$breakage$range(breakage, range) { return this.toss$4$breakage$damage$element$range(breakage, null, null, range); }, toss$1$damage(damage) { return this.toss$4$breakage$damage$element$range(null, damage, null, null); }, toss$1$range(range) { return this.toss$4$breakage$damage$element$range(null, null, null, range); }, toss$2$damage$range(damage, range) { return this.toss$4$breakage$damage$element$range(null, damage, null, range); } }; A.CategoryBuilder.prototype = { tag$1(tagPath) { var tags, t2, _i, equipSlot, _this = this, t1 = "item/" + tagPath; $.$get$Items_types().defineTags$1(t1); tags = A._setArrayType(tagPath.split("/"), type$.JSArray_String); t2 = B.JSArray_methods.get$last(tags); _this.__CategoryBuilder__tag_F !== $ && A.throwLateFieldAI("_tag"); _this.__CategoryBuilder__tag_F = t2; if (B.JSArray_methods.contains$1(tags, "shield") || B.JSArray_methods.contains$1(tags, "light")) _this._equipSlot = "hand"; else if (B.JSArray_methods.contains$1(tags, "weapon")) { _this._equipSlot = "hand"; t2 = B.JSArray_methods.indexOf$1(tags, "weapon") + 1; if (!(t2 >= 0 && t2 < tags.length)) return A.ioore(tags, t2); _this._weaponType = tags[t2]; } else for (_i = 0; _i < 8; ++_i) { equipSlot = B.List_l3H[_i]; if (B.JSArray_methods.contains$1(tags, equipSlot)) { _this._equipSlot = equipSlot; break; } } $.$get$Affixes_prefixes().defineTags$1(t1); $.$get$Affixes_suffixes().defineTags$1(t1); } }; A.ItemBuilder.prototype = { depth$2$to(from, to) { var t1, _this = this; _this.__ItemBuilder__minDepth_F !== $ && A.throwLateFieldAI("_minDepth"); _this.__ItemBuilder__minDepth_F = from; t1 = to == null ? 100 : to; _this.__ItemBuilder__maxDepth_F !== $ && A.throwLateFieldAI("_maxDepth"); _this.__ItemBuilder__maxDepth_F = t1; }, depth$1(from) { return this.depth$2$to(from, null); }, instrinsicAffix$1(buildAffix) { var builder; type$.void_Function_AffixBuilder._as(buildAffix); builder = A.AffixBuilder$(this._builder$_name + " intrinsic affix", null, 0); buildAffix.call$1(builder); this._instrinsicAffix = builder._build$0(); }, weapon$2$heft(damage, heft) { var t1 = $.___category._readField$0()._builder$_verb; t1.toString; this._builder$_attack = A.Attack$(null, t1, damage, null, null); this._heft = heft; }, food$1(amount) { this._use = new A.ItemUse("Provides " + amount + " turns of food.", type$.Action_Function._as(new A.ItemBuilder_food_closure(amount))); }, detection$2$range(types, range) { var t1, typeDescription, description; type$.List_DetectType._as(types); t1 = types.length; if (t1 === 1) { if (0 >= t1) return A.ioore(types, 0); typeDescription = types[0] === B.DetectType_0 ? "exits" : "items"; } else typeDescription = "exits and items"; description = "Detects " + typeDescription; if (range != null) description += " up to " + A.S(range) + " steps away"; this._use = new A.ItemUse(description + ".", type$.Action_Function._as(new A.ItemBuilder_detection_closure(types, range))); }, detection$1(types) { return this.detection$2$range(types, null); }, perception$2$distance$duration(distance, duration) { this._use = new A.ItemUse("Perceives the location of monsters, even those that are otherwise hidden.", type$.Action_Function._as(new A.ItemBuilder_perception_closure(duration, distance))); }, perception$1$distance(distance) { return this.perception$2$distance$duration(distance, 5); }, resistSalve$1(element) { this._use = new A.ItemUse("Grantes resistance to " + element.toString$0(0) + " for 40 turns.", type$.Action_Function._as(new A.ItemBuilder_resistSalve_closure(element))); }, mapping$2$illuminate(distance, illuminate) { var description = "Imparts knowledge of the dungeon up to " + distance + " steps from the hero."; if (illuminate) description += " Illuminates the dungeon."; this._use = new A.ItemUse(description, type$.Action_Function._as(new A.ItemBuilder_mapping_closure(distance, illuminate))); }, mapping$1(distance) { return this.mapping$2$illuminate(distance, false); }, haste$2(amount, duration) { this._use = new A.ItemUse("Raises speed by " + amount + " for " + duration + " turns.", type$.Action_Function._as(new A.ItemBuilder_haste_closure(amount, duration))); }, teleport$1(distance) { this._use = new A.ItemUse("Attempts to teleport up to " + distance + " steps away.", type$.Action_Function._as(new A.ItemBuilder_teleport_closure(distance))); }, heal$2$curePoison(amount, curePoison) { this._use = new A.ItemUse("Instantly heals " + amount + " lost health.", type$.Action_Function._as(new A.ItemBuilder_heal_closure(amount, curePoison))); }, heal$1(amount) { return this.heal$2$curePoison(amount, false); }, ball$4(element, noun, verb, damage) { var attack = A.Attack$(new A.Noun(noun), verb, damage, 3, element); this._use = new A.ItemUse("Unleashes a ball of " + element.toString$0(0) + " that inflicts " + damage + " damage out to 3 steps from the hero.", type$.Action_Function._as(new A.ItemBuilder_ball_closure(attack))); this._tossUse = type$.Action_Function_Vec._as(new A.ItemBuilder_ball_closure0(attack)); }, flow$5$fly(element, noun, verb, damage, fly) { var t1 = {}, attack = A.Attack$(new A.Noun(noun), verb, damage, 5, element), motility = $.$get$Motility_walk(); t1.motility = motility; if (fly) t1.motility = new A.Motility(motility._bitMask | $.$get$Motility_fly()._bitMask); this._use = new A.ItemUse("Unleashes a flow of " + element.toString$0(0) + " that inflicts " + damage + " damage out to 5 steps from the hero.", type$.Action_Function._as(new A.ItemBuilder_flow_closure(t1, attack))); this._tossUse = type$.Action_Function_Vec._as(new A.ItemBuilder_flow_closure0(t1, attack)); }, flow$4(element, noun, verb, damage) { return this.flow$5$fly(element, noun, verb, damage, false); }, lightSource$2$level$range(level, range) { this._builder$_emanation = level; this._use = new A.ItemUse("Illuminates out to a range of " + range + ".", type$.Action_Function._as(new A.ItemBuilder_lightSource_closure(range))); } }; A.ItemBuilder_food_closure.prototype = { call$0() { return new A.EatAction(this.amount); }, $signature: 93 }; A.ItemBuilder_detection_closure.prototype = { call$0() { return A.DetectAction$(this.types, this.range); }, $signature: 80 }; A.ItemBuilder_perception_closure.prototype = { call$0() { return new A.PerceiveAction(this.duration, this.distance); }, $signature: 79 }; A.ItemBuilder_resistSalve_closure.prototype = { call$0() { return new A.ResistAction(40, this.element); }, $signature: 78 }; A.ItemBuilder_mapping_closure.prototype = { call$0() { return new A.MappingAction(this.distance, this.illuminate); }, $signature: 77 }; A.ItemBuilder_haste_closure.prototype = { call$0() { return A.HasteAction$(this.amount, this.duration); }, $signature: 75 }; A.ItemBuilder_teleport_closure.prototype = { call$0() { return A.TeleportAction$(this.distance); }, $signature: 71 }; A.ItemBuilder_heal_closure.prototype = { call$0() { return A.HealAction$(this.amount, this.curePoison); }, $signature: 59 }; A.ItemBuilder_ball_closure.prototype = { call$0() { return new A.RingSelfAction(this.attack); }, $signature: 55 }; A.ItemBuilder_ball_closure0.prototype = { call$1(pos) { return new A.RingFromAction(this.attack, pos); }, $signature: 54 }; A.ItemBuilder_flow_closure.prototype = { call$0() { return new A.FlowSelfAction(this.attack, this._box_0.motility); }, $signature: 53 }; A.ItemBuilder_flow_closure0.prototype = { call$1(pos) { return new A.FlowFromAction(this.attack, pos, this._box_0.motility); }, $signature: 51 }; A.ItemBuilder_lightSource_closure.prototype = { call$0() { return new A.IlluminateSelfAction(this.range); }, $signature: 49 }; A.AffixBuilder.prototype = { depth$2$to(from, to) { this._minDepth = from; this._maxDepth = to == null ? 100 : to; }, depth$1(from) { return this.depth$2$to(from, null); }, price$2(bonus, scale) { var t1 = type$.int_Function_int._as(new A.AffixBuilder_price_closure(bonus)), t2 = type$.double_Function_int._as(new A.AffixBuilder_price_closure0(scale)); this._builder$_priceBonus = t1; this._builder$_priceScale = t2; }, parameter$3$boostOneIn$max(min, boostOneIn, max) { var t1 = {}; t1.max = max; if (max == null) t1.max = min; this._rollParameter = new A.AffixBuilder_parameter_closure(t1, min, boostOneIn); }, parameter$2$boostOneIn(min, boostOneIn) { return this.parameter$3$boostOneIn$max(min, boostOneIn, null); }, heft$1(scale) { this._builder$_heftScale = new A.AffixBuilder_heft_closure(scale); }, weight$1(bonus) { this._builder$_weightBonus = new A.AffixBuilder_weight_closure(bonus); }, damage$2$bonus$scale(bonus, scale) { type$.nullable_double_Function_int._as(scale); type$.nullable_int_Function_int._as(bonus); if (scale != null) this._builder$_damageScale = scale; if (bonus != null) this._builder$_damageBonus = bonus; }, damage$1$scale(scale) { return this.damage$2$bonus$scale(null, scale); }, damage$1$bonus(bonus) { return this.damage$2$bonus$scale(bonus, null); }, brand$2$resist(element, resist) { this._builder$_brand = element; this._builder$_resists.$indexSet(0, element, new A.AffixBuilder_brand_closure(resist)); }, brand$1(element) { return this.brand$2$resist(element, null); }, resist$2(element, power) { var t1; type$.nullable_int_Function_int._as(power); t1 = this._builder$_resists; if (power != null) t1.$indexSet(0, element, power); else t1.$indexSet(0, element, new A.AffixBuilder_resist_closure()); }, resist$1(element) { return this.resist$2(element, null); }, _build$0() { var t1, idBase, id0, index, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, affix, _this = this, id = _this._builder$_nameTemplate, affixSet = _this._affixSet; if (affixSet != null) { t1 = $._affixTag; idBase = A.stringReplaceAllUnchecked(id, "_", "[" + A.S(t1) + "]"); for (t1 = idBase + " (", id0 = idBase, index = 1; affixSet.tryFind$1(id0) != null;) { ++index; id0 = t1 + index + ")"; } } else id0 = id; t1 = $.AffixBuilder__sortIndex; $.AffixBuilder__sortIndex = t1 + 1; t2 = _this._rollParameter; t3 = _this._builder$_heftScale; t4 = _this._builder$_weightBonus; t5 = _this._builder$_damageScale; t6 = _this._builder$_damageBonus; t7 = _this._builder$_brand; t8 = _this._armorBonus; t9 = _this._builder$_priceBonus; t10 = _this._builder$_priceScale; t11 = type$.int_Function_int; if (t3 == null) t3 = A.affix___noScale$closure(); if (t4 == null) t4 = A.affix___noBonus$closure(); if (t5 == null) t5 = A.affix___noScale$closure(); if (t6 == null) t6 = A.affix___noBonus$closure(); if (t8 == null) t8 = A.affix___noBonus$closure(); if (t7 == null) t7 = $.$get$Element_none(); if (t10 == null) t10 = A.affix___noScale$closure(); if (t9 == null) t9 = A.affix___noBonus$closure(); affix = new A.AffixType(id0, id, t1, t2, t3, t4, A.affix___noBonus$closure(), t5, t6, t8, t7, A.LinkedHashMap_LinkedHashMap$_empty(type$.Element, t11), A.LinkedHashMap_LinkedHashMap$_empty(type$.Stat, t11), t9, t10); _this._builder$_resists.forEach$1(0, affix.get$setResist()); _this._statBonuses.forEach$1(0, affix.get$setStatBonus()); return affix; } }; A.AffixBuilder_price_closure.prototype = { call$1(__wc0_formal) { return this.bonus; }, $signature: 5 }; A.AffixBuilder_price_closure0.prototype = { call$1(__wc1_formal) { return this.scale; }, $signature: 19 }; A.AffixBuilder_parameter_closure.prototype = { call$0() { var boosted0, t1, value = $.$get$rng().inclusive$2(this.min, this._box_0.max), max = this.boostOneIn, boosted = 0; for (;;) { boosted0 = boosted + 1; if (boosted < 10) { t1 = $.$get$rng(); t1 = t1._random.nextInt$1(max) === 0; } else t1 = false; if (!t1) break; ++value; boosted = boosted0; } return value; }, $signature: 2 }; A.AffixBuilder_heft_closure.prototype = { call$1(__wc0_formal) { A._asInt(__wc0_formal); return this.scale; }, $signature: 19 }; A.AffixBuilder_weight_closure.prototype = { call$1(__wc0_formal) { A._asInt(__wc0_formal); return this.bonus; }, $signature: 5 }; A.AffixBuilder_brand_closure.prototype = { call$1(__wc0_formal) { var t1; A._asInt(__wc0_formal); t1 = this.resist; return t1 == null ? 1 : t1; }, $signature: 5 }; A.AffixBuilder_resist_closure.prototype = { call$1(__wc0_formal) { A._asInt(__wc0_formal); return 1; }, $signature: 5 }; A.fixed_closure.prototype = { call$1(__wc0_formal) { A._asInt(__wc0_formal); return this.value; }, $signature() { return this.T._eval$1("0(int)"); } }; A.scaleParam_closure.prototype = { call$1(parameter) { return this.base + A._asInt(parameter) * this.scale; }, $signature: 19 }; A.ItemQuality.prototype = { _enumToString$0() { return "ItemQuality." + this._core$_name; } }; A._BaseDrop.prototype = { _makeItem$3(lore, dropDepth, itemType) { var _0_0, prefixType, suffixType, t1, _null = null; if (itemType.isArtifact && lore != null) lore._createdArtifacts.add$1(0, itemType); _0_0 = itemType.intrinsicAffix; if (_0_0 != null) return new A.Item(itemType, _null, _null, _0_0.spawn$0(), 1); if (itemType.equipSlot == null) return new A.Item(itemType, _null, _null, _null, 1); prefixType = this._rollAffix$3($.$get$Affixes_prefixes(), itemType, dropDepth); suffixType = this._rollAffix$3($.$get$Affixes_suffixes(), itemType, dropDepth); if (prefixType != null && suffixType != null && $.$get$rng().range$1(4) !== 0) if ($.$get$rng().range$1(2) === 0) prefixType = _null; else suffixType = _null; t1 = prefixType == null ? _null : prefixType.spawn$0(); return new A.Item(itemType, t1, suffixType == null ? _null : suffixType.spawn$0(), _null, 1); }, _rollAffix$3(affixes, itemType, depth) { var t1, chance; type$.ResourceSet_AffixType._as(affixes); switch (this._quality.index) { case 0: t1 = B.Record2_LpS; break; case 1: t1 = B.Record2_yab; break; case 2: t1 = B.Record2_1_1; break; default: t1 = null; } chance = A.lerpDouble(depth, 0, 100, t1._0, t1._1); if ($.$get$rng().float$1(1) > chance) return null; return affixes.tryChooseMatching$2(depth, $.$get$Items_types().getTags$1(A.Log__categorize(itemType.quantifiableName, false, true))); } }; A._ItemDrop.prototype = { dropItem$3(lore, depth, addItem) { var t1; type$.void_Function_Item._as(addItem); t1 = this._type; if (t1.isArtifact && lore != null && lore._createdArtifacts.contains$1(0, t1)) return; addItem.call$1(this._makeItem$3(lore, depth, t1)); }, $isDrop: 1 }; A._TagDrop.prototype = { dropItem$3(lore, depth, addItem) { type$.void_Function_Item._as(addItem).call$1(this._makeItem$3(lore, depth, this._rollItemType$2(lore, depth))); }, _rollItemType$2(lore, depth) { var t1, t2, t3, artifactTries, t4; switch (this._quality.index) { case 0: t1 = 0; break; case 1: t1 = 3; break; case 2: t1 = 15; break; default: t1 = null; } for (t2 = this._drops$_tag, t3 = this._drops$_depth, artifactTries = t1;;) { t1 = $.$get$Items_types(); t1 = t1.tryChoose$3$includeParents$tag(t3 == null ? depth : t3, null, t2); t1.toString; t4 = t1.isArtifact; if (t4 && lore != null && lore._createdArtifacts.contains$1(0, t1)) continue; if (!t4 && artifactTries > 0) { --artifactTries; continue; } return t1; } }, $isDrop: 1 }; A._PercentDrop.prototype = { dropItem$3(lore, depth, addItem) { type$.void_Function_Item._as(addItem); if ($.$get$rng().range$1(100) >= this._chance) return; this._drops$_drop.dropItem$3(lore, depth, addItem); }, $isDrop: 1 }; A._AllOfDrop.prototype = { dropItem$3(lore, depth, addItem) { var t1, t2, _i; type$.void_Function_Item._as(addItem); for (t1 = this._drops$_drops, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) t1[_i].dropItem$3(lore, depth, addItem); }, $isDrop: 1 }; A._OneOfDrop.prototype = { _OneOfDrop$1(drops) { drops.forEach$1(0, new A._OneOfDrop_closure(this)); }, dropItem$3(lore, depth, addItem) { var drop; type$.void_Function_Item._as(addItem); drop = this._drops$_drop.tryChoose$1(1); if (drop == null) return; drop.dropItem$3(lore, depth, addItem); }, $isDrop: 1 }; A._OneOfDrop_closure.prototype = { call$2(drop, frequency) { var t1, _null = null; type$.Drop._as(drop); A._asDouble(frequency); t1 = this.$this._drops$_drop; t1._resource$_add$7(t1.$ti._precomputed1._as(drop), _null, _null, _null, frequency, frequency, _null); }, $signature: 50 }; A._RepeatDrop.prototype = { dropItem$3(lore, depth, addItem) { var t1, taper, t2, count, i; type$.void_Function_Item._as(addItem); t1 = this._drops$_count; taper = t1 > 3 ? 4 : 5; if (t1 > 6) taper = 3; t2 = $.$get$rng(); count = t2.triangleInt$2(t1, B.JSInt_methods._tdivFast$1(t1, 2)) + t2.taper$2(0, taper); for (t1 = this._drops$_drop, i = 0; i < count; ++i) t1.dropItem$3(lore, depth, addItem); }, $isDrop: 1 }; A.FloorDrop.prototype = {}; A.rings_closure.prototype = { call$1(affix) { affix._statBonuses.$indexSet(0, B.Stat_Intellect_3_intellect, type$.int_Function_int._as(A.fixed(2, type$.int))); return affix; }, $signature: 46 }; A.shop_closure.prototype = { call$2($name, frequency) { A._asString($name); A._asDouble(frequency); this.drops.$indexSet(0, A.parseDrop($name, null, null), frequency); }, $signature: 52 }; A.weapons_closure.prototype = { call$1(affix) { affix.parameter$3$boostOneIn$max(8, 3, 12); affix.damage$1$bonus(A.builder___intIdentity$closure()); affix._statBonuses.$indexSet(0, B.Stat_Agility_1_agility, type$.int_Function_int._as(A.fixed(2, type$.int))); affix.brand$1($.$get$Elements_dark()); return affix; }, $signature: 46 }; A._BaseBuilder0.prototype = { count$2(minOrMax, max) { var _this = this; if (max == null) { _this._countMin = 1; _this._countMax = minOrMax; } else { _this._countMin = minOrMax; _this._countMax = max; } }, count$1(minOrMax) { return this.count$2(minOrMax, null); } }; A.FamilyBuilder.prototype = {}; A.BreedBuilder.prototype = { minionBreed$1($name) { this._minion$3(new A._BreedSpawn(A.BreedRef$($name)), null, null); }, _minion$3(spawn, minOrMax, max) { if (max != null) { minOrMax.toString; spawn = new A._RepeatSpawn(minOrMax, max, spawn); } else if (minOrMax != null) spawn = new A._RepeatSpawn(1, minOrMax, spawn); B.JSArray_methods.add$1(this._minions, spawn); }, attack$3(verb, damage, element) { B.JSArray_methods.add$1(this._attacks, A.Attack$(null, verb, damage, 0, element)); }, attack$2(verb, damage) { return this.attack$3(verb, damage, null); }, drop$4$count$depthOffset$percent($name, count, depthOffset, percent) { var drop = new A._PercentDrop(percent, A.parseDrop($name, this._depth + depthOffset, null)); if (count > 1) drop = A.repeatDrop(count, drop); B.JSArray_methods.add$1(this._drops, drop); }, drop$2$percent($name, percent) { return this.drop$4$count$depthOffset$percent($name, 1, 0, percent); }, drop$2$count($name, count) { return this.drop$4$count$depthOffset$percent($name, count, 0, 100); }, drop$3$count$depthOffset($name, count, depthOffset) { return this.drop$4$count$depthOffset$percent($name, count, depthOffset, 100); }, drop$3$count$percent($name, count, percent) { return this.drop$4$count$depthOffset$percent($name, count, 0, percent); }, drop$3$depthOffset$percent($name, depthOffset, percent) { return this.drop$4$count$depthOffset$percent($name, 1, depthOffset, percent); }, dropGood$4$count$depthOffset$percent($name, count, depthOffset, percent) { var drop = new A._PercentDrop(percent, A.parseDrop($name, this._depth + depthOffset, B.ItemQuality_1)); if (count > 1) drop = A.repeatDrop(count, drop); B.JSArray_methods.add$1(this._drops, drop); }, dropGood$3$count$depthOffset($name, count, depthOffset) { return this.dropGood$4$count$depthOffset$percent($name, count, depthOffset, 100); }, dropGood$3$depthOffset$percent($name, depthOffset, percent) { return this.dropGood$4$count$depthOffset$percent($name, 1, depthOffset, percent); }, unique$1$pronoun(pronoun) { B.JSArray_methods.add$1(this._flags, "unique"); this._pronoun = pronoun; this._hasProperName = true; }, unique$0() { return this.unique$1$pronoun(null); }, whip$2$damage$rate(damage, rate) { return this._bolt$6$damage$range$rate(null, "whips", $.$get$Element_none(), damage, 2, rate); }, bolt$4$damage$range$rate(element, damage, range, rate) { var t1 = $.$get$_elementText(); this._bolt$6$damage$range$rate(t1.$index(0, element)[0], t1.$index(0, element)[1], element, damage, range, rate); }, cone$4$damage$range$rate(element, damage, range, rate) { var t1 = $.$get$_elementText(), t2 = t1.$index(0, element)[0]; t1 = t1.$index(0, element)[1]; if (range == null) range = 10; B.JSArray_methods.add$1(this._moves, new A.ConeMove(A.Attack$(new A.Noun(t2), t1, damage, range, element), rate)); }, haste$1$rate(rate) { B.JSArray_methods.add$1(this._moves, new A.HasteMove(10, 1, rate)); return null; }, haste$0() { return this.haste$1$rate(5); }, _bolt$6$damage$range$rate(noun, verb, element, damage, range, rate) { B.JSArray_methods.add$1(this._moves, new A.BoltMove(A.Attack$(noun != null ? new A.Noun(noun) : null, verb, damage, range, element), rate)); } }; A._BreedSpawn.prototype = { spawnBreed$2(depth, addMonster) { var t1; type$.void_Function_Breed._as(addMonster); t1 = this._spawns$_breed.__BreedRef__breed_F; t1 === $ && A.throwLateFieldNI("_breed"); addMonster.call$1(t1); }, $isSpawn: 1 }; A._TagSpawn.prototype = { spawnBreed$2(depth, addMonster) { var t1, tries, breed; type$.void_Function_Breed._as(addMonster); for (t1 = this._tag, tries = 0; tries < 10; ++tries) { breed = $.$get$Monsters_breeds().tryChoose$3$includeParents$tag(depth, false, t1); if (breed == null) continue; if (breed.flags.unique) continue; addMonster.call$1(breed); break; } }, $isSpawn: 1 }; A._RepeatSpawn.prototype = { spawnBreed$2(depth, addMonster) { var t1, taper, t2, count, i; type$.void_Function_Breed._as(addMonster); t1 = this._spawns$_maxCount; taper = t1 > 3 ? 4 : 5; if (t1 > 6) taper = 3; t2 = $.$get$rng(); count = t2.inclusive$2(this._minCount, t1) + t2.taper$2(0, taper); for (t1 = this._spawn, i = 0; i < count; ++i) t1.spawnBreed$2(depth, addMonster); }, $isSpawn: 1 }; A._AllOfSpawn.prototype = { spawnBreed$2(depth, addMonster) { var t1, t2, _i; type$.void_Function_Breed._as(addMonster); for (t1 = this._spawns, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) t1[_i].spawnBreed$2(depth, addMonster); }, $isSpawn: 1 }; A.AmputateMove.prototype = { get$experience() { var t1 = this._body.__BreedRef__breed_F; t1 === $ && A.throwLateFieldNI("_breed"); return t1.maxHealth * 0.5; }, shouldUse$2(game, monster) { return false; }, shouldUseOnDamage$2(monster, damage) { var t3, t1 = monster._breed, t2 = $.$get$rng(); if (t2.float$1(2) <= damage / t1.maxHealth) return true; t1 = monster._health; t3 = monster._breed; if (t2.float$1(2) <= t1 / t3.maxHealth) return true; return false; }, onGetAction$2(game, monster) { var t2, t1 = this._body.__BreedRef__breed_F; t1 === $ && A.throwLateFieldNI("_breed"); t2 = this._part.__BreedRef__breed_F; t2 === $ && A.throwLateFieldNI("_breed"); return new A.AmputateAction(t1, t2, this._amputate$_message); }, toString$0(_) { var t2, t1 = this._body.__BreedRef__breed_F; t1 === $ && A.throwLateFieldNI("_breed"); t1 = A.Log__categorize(t1._breed$_name, false, true); t2 = this._part.__BreedRef__breed_F; t2 === $ && A.throwLateFieldNI("_breed"); return "Amputate " + t1 + " + " + A.Log__categorize(t2._breed$_name, false, true); } }; A.BoltMove.prototype = { get$experience() { var t1 = this.attack; return t1.damage * t1.element.experience * (1 + t1.range / 20); }, shouldUse$2(game, monster) { var chance, target, toTarget, t1; if ((monster.blindness._turnsRemaining > 0 || monster.dazzle._turnsRemaining > 0) && $.$get$rng().float$1(1) < monster.get$sightReliance()) { chance = B.JSNumber_methods.toInt$0(A.lerpDouble(monster.get$sightReliance(), 0, 1, 0, 90)); if ($.$get$rng().range$1(100) < chance) return false; } target = game.hero._pos; toTarget = target.$sub(0, monster._pos); if (toTarget.$gt(0, this.attack.range)) { A.Debug_monsterLog(monster, "bolt move too far"); return false; } if (toTarget.$lt(0, 1.5)) { A.Debug_monsterLog(monster, "bolt move too close"); return false; } t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); if (!t1.canTarget$2(monster, target)) { A.Debug_monsterLog(monster, "bolt move can't target"); return false; } A.Debug_monsterLog(monster, "bolt move OK"); return true; }, onGetAction$2(game, monster) { return A.BoltAction$(game.hero._pos, A.Hit$_(this.attack), false, null); }, toString$0(_) { return "Bolt " + this.attack.toString$0(0) + " rate: " + this.rate; } }; A.ConeMove.prototype = { get$range() { return this.attack.range; }, get$experience() { var t1 = this.attack; return t1.damage * 3 * t1.element.experience * (1 + t1.range / 10); }, shouldUse$2(game, monster) { var chance, target, t1; if ((monster.blindness._turnsRemaining > 0 || monster.dazzle._turnsRemaining > 0) && $.$get$rng().float$1(1) < monster.get$sightReliance()) { chance = B.JSNumber_methods.toInt$0(A.lerpDouble(monster.get$sightReliance(), 0, 1, 0, 70)); if ($.$get$rng().range$1(100) < chance) return false; } target = game.hero._pos; if (target.$sub(0, monster._pos).$gt(0, this.attack.range)) { A.Debug_monsterLog(monster, "cone move too far"); return false; } t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); if (!t1.canView$2(monster, target)) { A.Debug_monsterLog(monster, "cone move can't target"); return false; } A.Debug_monsterLog(monster, "cone move OK"); return true; }, onGetAction$2(game, monster) { var t1 = monster._pos, t2 = game.hero._pos; return A.RayAction$_(A.Hit$_(this.attack), t1, t2, 0.125); }, toString$0(_) { return "Cone " + this.attack.toString$0(0) + " rate: " + this.rate; } }; A.HasteMove.prototype = { get$experience() { return this._duration * this._haste$_speed; }, shouldUse$2(game, monster) { return monster.haste._turnsRemaining <= 0; }, onGetAction$2(game, monster) { return A.HasteAction$(this._duration, this._haste$_speed); }, toString$0(_) { return "Haste " + this._haste$_speed + " for " + this._duration + " turns rate: " + this.rate; } }; A.HealMove.prototype = { get$experience() { return this._amount; }, shouldUse$2(game, monster) { var t1 = monster._health, t2 = monster._breed.maxHealth; return t1 / t2 < 0.25 || t2 - t1 >= this._amount; }, onGetAction$2(game, monster) { return A.HealAction$(this._amount, false); }, toString$0(_) { return "Heal " + this._amount + " rate: " + this.rate; } }; A.HowlMove.prototype = { get$experience() { return this._howl$_range * 0.5; }, shouldUse$2(game, monster) { var t2, t3, t4, _i, actor, t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = monster._pos; t2 = t1.tiles.$get$2(t2.get$x(), t2.get$y()); if (!(!t2._isOccluded && t2.floorIllumination + t2.actorIllumination > t2._fallOff)) return false; for (t1 = t1._actors, t2 = t1.length, t3 = monster._pos, t4 = this._howl$_range, _i = 0; _i < t2; ++_i) { actor = t1[_i]; if (actor === monster) continue; if (actor instanceof A.Monster && actor._monster$_state instanceof A.AsleepState && actor._pos.$sub(0, t3).$le(0, t4)) return true; } return false; }, onGetAction$2(game, monster) { var t1 = this._howl$_verb; if (t1 == null) t1 = "howls"; return new A.HowlAction(this._howl$_range, t1); }, toString$0(_) { return "Howl " + this._howl$_range; } }; A.MissiveMove.prototype = { get$experience() { return 0; }, shouldUse$2(game, monster) { var t1, target = game.hero._pos; if (target.$sub(0, monster._pos).get$kingLength() <= 1) return false; t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); return t1.canView$2(monster, target); }, onGetAction$2(game, monster) { return new A.MissiveAction(game.hero, this._missive); }, toString$0(_) { return this._missive.toString$0(0) + " rate: " + this.rate; } }; A.SpawnMove.prototype = { get$experience() { return 6; }, shouldUse$2(game, monster) { var t2, t3, _i, neighbor, t4, t5, t6, t7, t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = monster._pos; t2 = t1.tiles.$get$2(t2.get$x(), t2.get$y()); if (!(!t2._isOccluded && t2.floorIllumination + t2.actorIllumination > t2._fallOff)) return false; for (t2 = monster._pos.get$neighbors(), t3 = t2.length, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { neighbor = t2[_i]; if (t1.canOccupy$2(neighbor, monster._breed.motility)) { t4 = t1._actorsByTile; t5 = neighbor.x; t6 = neighbor.y; t4._checkBounds$2(t5, t6); t7 = t4._elements; t5 = t6 * t4.bounds.size.x + t5; if (!(t5 >= 0 && t5 < t7.length)) return A.ioore(t7, t5); t5 = t7[t5] == null; t4 = t5; } else t4 = false; if (t4) { t4 = t1.tiles; t5 = neighbor.x; t6 = neighbor.y; t4._checkBounds$2(t5, t6); t7 = t4._elements; t5 = t6 * t4.bounds.size.x + t5; if (!(t5 >= 0 && t5 < t7.length)) return A.ioore(t7, t5); t5 = t7[t5].substance === 0; t4 = t5; } else t4 = false; if (t4) return true; } return false; }, onGetAction$2(game, monster) { var _i, dir, t2, t3, t4, t5, t6, t7, t1 = type$.JSArray_Direction, dirs = A._setArrayType([], t1); if (this._preferStraight) for (_i = 0; _i < 8; ++_i) { dir = B.List_wXx[_i]; t2 = game.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t3 = monster._pos.$add(0, dir); if (t2.canOccupy$2(t3, monster._breed.motility)) { t4 = t2._actorsByTile; t5 = t3.x; t6 = t3.y; t4._checkBounds$2(t5, t6); t7 = t4._elements; t5 = t6 * t4.bounds.size.x + t5; if (!(t5 >= 0 && t5 < t7.length)) return A.ioore(t7, t5); t5 = t7[t5] == null; t4 = t5; } else t4 = false; if (t4) { t2 = t2.tiles; t4 = t3.x; t3 = t3.y; t2._checkBounds$2(t4, t3); t5 = t2._elements; t4 = t3 * t2.bounds.size.x + t4; if (!(t4 >= 0 && t4 < t5.length)) return A.ioore(t5, t4); t4 = t5[t4].substance === 0; t2 = t4; } else t2 = false; if (!t2) continue; t2 = new A.SpawnMove_onGetAction_checkNeighbor(game, monster, dir); if (t2.call$1(dir.get$rotate180())) B.JSArray_methods.addAll$1(dirs, A._setArrayType([dir, dir, dir, dir, dir], t1)); if (t2.call$1(dir.get$rotate180().get$rotateLeft45())) B.JSArray_methods.add$1(dirs, dir); if (t2.call$1(dir.get$rotate180().get$rotateRight45())) B.JSArray_methods.add$1(dirs, dir); } if (dirs.length === 0) for (_i = 0; _i < 8; ++_i) { dir = B.List_wXx[_i]; t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = monster._pos.$add(0, dir); if (t1.canOccupy$2(t2, monster._breed.motility)) { t3 = t1._actorsByTile; t4 = t2.x; t5 = t2.y; t3._checkBounds$2(t4, t5); t6 = t3._elements; t4 = t5 * t3.bounds.size.x + t4; if (!(t4 >= 0 && t4 < t6.length)) return A.ioore(t6, t4); t4 = t6[t4] == null; t3 = t4; } else t3 = false; if (t3) { t1 = t1.tiles; t3 = t2.x; t2 = t2.y; t1._checkBounds$2(t3, t2); t4 = t1._elements; t3 = t2 * t1.bounds.size.x + t3; if (!(t3 >= 0 && t3 < t4.length)) return A.ioore(t4, t3); t3 = t4[t3].substance === 0; t1 = t3; } else t1 = false; if (!t1) continue; B.JSArray_methods.add$1(dirs, dir); } t1 = monster._pos; t2 = $.$get$rng(); type$.List_Object._as(dirs); t2 = t2.range$1(dirs.length); if (!(t2 >= 0 && t2 < dirs.length)) return A.ioore(dirs, t2); return new A.SpawnAction(t1.$add(0, dirs[t2]), monster._breed); }, toString$0(_) { return "Spawn rate: " + this.rate; } }; A.SpawnMove_onGetAction_checkNeighbor.prototype = { call$1(neighbor) { var t2, t3, t1 = this.game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = this.monster; t3 = t2._pos.$add(0, this.dir); t3 = t1._actorsByTile.$get$2(t3.x, t3.y); return t3 != null && t3 instanceof A.Monster && t3._breed === t2._breed; }, $signature: 9 }; A.TeleportMove.prototype = { get$experience() { return this._range * 0.7; }, shouldUse$2(game, monster) { var distance; if (monster._monster$_state instanceof A.AfraidState) return true; distance = game.hero._pos.$sub(0, monster._pos).get$kingLength(); if (monster.wantsToMelee && distance <= 1) return false; return true; }, onGetAction$2(game, monster) { return A.TeleportAction$(this._range); }, toString$0(_) { return "Teleport " + this._range; } }; A.Archery.prototype = { get$maxLevel() { return 20; }, get$name() { return "Archery"; }, get$description() { return "Kill your foe without risking harm to yourself by unleashing a volley of arrows from far away."; }, levelDescription$1(level) { return "Scales strike by " + B.JSNumber_methods.toInt$0(A.lerpDouble(level, 1, 20, 0.7, 2) * 100) + "%."; }, unusableReason$1(game) { if (this._hasBow$1(game.hero)) return null; return "No bow equipped."; }, _hasBow$1(hero) { return hero.save._equipment.get$weapons().any$1(0, new A.Archery__hasBow_closure()); }, baseTrainingNeeded$1(level) { --level; return 100 * level * level * level; }, focusCost$2(hero, level) { return 21 - level; }, getRange$1(_, game) { var t1 = game.hero, hit = t1.createRangedHit$0(); hit.scaleStrike$2(A.lerpDouble(t1.save.skills.level$1(this), 1, 20, 0.7, 2), "archery"); return hit.get$range(); }, onGetTargetAction$3(game, level, target) { return new A.ArrowAction(this, game.hero.createRangedHit$0(), true, null, target); } }; A.Archery__hasBow_closure.prototype = { call$1(item) { return type$.Item._as(item).type.weaponType === "bow"; }, $signature: 4 }; A.ArrowAction.prototype = { onHitActor$2(pos, target) { var t1, t2, _this = this; _this.super$BoltAction$onHitActor(pos, target); type$.Monster._as(target); t1 = type$.Hero; t2 = _this._skill; t1._as(_this._actor).save.skills.earnPoints$2(t2, B.JSNumber_methods.ceil$0(target._breed.get$experience() / 1000)); t1._as(_this._actor).refreshSkill$1(t2); return true; } }; A._Archery_Discipline_UsableSkill.prototype = {}; A._Archery_Discipline_UsableSkill_TargetSkill.prototype = {}; A.AxeMastery.prototype = { get$name() { return "Axe Mastery"; }, get$useName() { return "Axe Sweep"; }, get$description() { return "Axes are not just for woodcutting. In the hands of a skilled user, they can cut down a swath of nearby foes as well."; }, get$weaponType() { return "axe"; }, levelDescription$1(level) { var damage = B.JSNumber_methods.toInt$0(A.lerpDouble(level, 1, 10, 1, 3) * 100); return this.super$MasteryDiscipline$levelDescription(level) + " Sweep attacks inflict " + damage + "% of the damage of a regular attack."; }, onGetDirectionAction$3(game, level, dir) { return new A.SweepAction(dir, $, A.lerpDouble(level, 1, 10, 1, 3)); } }; A.SweepAction.prototype = { get$isImmediate() { return false; }, get$weaponType() { return "axe"; }, onGenerate$0() { return new A._SyncStarIterable(this.onGenerate$body$SweepAction(), type$._SyncStarIterable_ActionResult); }, onGenerate$body$SweepAction() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 2, $async$errorStack = [], t1, t2, _i, dir, pos, t3, t4, t5, t6; return function $async$onGenerate$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) switch ($async$goto) { case 0: // Function start t1 = $async$self._axe$_dir, t2 = [t1.get$rotateLeft45(), t1, t1.get$rotateRight45()], _i = 0; case 3: // for condition if (!(_i < 3)) { // goto after for $async$goto = 5; break; } dir = t2[_i]; pos = $async$self._actor._pos.$add(0, dir); t3 = $async$self.__Action__game_F; t3 === $ && A.throwLateFieldNI("_game"); t3 = t3.__Game__stage_F; t3 === $ && A.throwLateFieldNI("_stage"); t3 = t3.tiles; t4 = pos.x; t5 = pos.y; t3._checkBounds$2(t4, t5); t6 = t3._elements; t4 = t5 * t3.bounds.size.x + t4; if (!(t4 >= 0 && t4 < t6.length)) { A.ioore(t6, t4); // goto return $async$goto = 1; break; } t4 = t6[t4]; $async$goto = !t4._isExplored ? 6 : 7; break; case 6: // then $async$goto = 8; return $async$iterator._async$_current = $async$self.fail$1("You can't see where you're swinging."), 1; case 8: // after yield // goto return $async$goto = 1; break; case 7: // join t3 = $.$get$Motility_fly(); $async$goto = (t4.type.motility._bitMask & t3._bitMask) === 0 ? 9 : 10; break; case 9: // then $async$goto = 11; return $async$iterator._async$_current = $async$self.fail$1("There isn't enough room to swing your weapon."), 1; case 11: // after yield // goto return $async$goto = 1; break; case 10: // join case 4: // for update ++_i; // goto for condition $async$goto = 3; break; case 5: // after for t1 = [t1.get$rotateLeft45(), t1, t1.get$rotateRight45()], _i = 0; case 12: // for condition if (!(_i < 3)) { // goto after for $async$goto = 14; break; } dir = t1[_i]; t2 = $async$self._actor._pos.$add(0, dir); t3 = $async$self.__Action__game_F; t3 === $ && A.throwLateFieldNI("_game"); t4 = $.$get$Element_none(); B.JSArray_methods.add$1(t3._events, new A.Event(B.EventType_slash, null, t4, null, t2, dir)); $async$goto = 15; return $async$iterator._yieldStar$1($async$self.wait$1(2)); case 15: // after yield $async$self.attack$1($async$self._actor._pos.$add(0, dir)); $async$goto = 16; return $async$iterator._yieldStar$1($async$self.wait$1(3)); case 16: // after yield case 13: // for update ++_i; // goto for condition $async$goto = 12; break; case 14: // after for case 1: // return return 0; case 2: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, toString$0(_) { return A.S(this._actor) + " slashes " + this._axe$_dir.toString$0(0); } }; A._AxeMastery_UsableMasteryDiscipline_DirectionSkill.prototype = {}; A._SweepAction_MasteryAction_GeneratorActionMixin.prototype = {}; A.BattleHardening.prototype = { get$maxLevel() { return 40; }, get$description() { return "Years of taking hits have turned your skin as hard as cured leather."; }, get$name() { return "Battle Hardening"; }, takeDamage$2(hero, damage) { var t1, t2; hero.discoverSkill$1(this); t1 = hero.save; t2 = t1.vitality._stat$_value; t2.toString; t1.skills.earnPoints$2(this, B.JSNumber_methods.ceil$0(10 * damage / B.JSNumber_methods.toInt$0(Math.pow(t2, 1.458) + 9))); hero.refreshSkill$1(this); }, modifyArmor$3(hero, level, armor) { return armor + level; }, levelDescription$1(level) { return "Increases armor by " + level + "."; }, baseTrainingNeeded$1(level) { return B.JSNumber_methods.ceil$0(60 * Math.pow(level, 1.5)); } }; A.ClubMastery.prototype = { get$name() { return "Club Mastery"; }, get$useName() { return "Club Bash"; }, get$description() { return "Bludgeons may not be the most sophisticated of weapons, but what they lack in refinement, they make up for in brute force."; }, get$weaponType() { return "club"; }, levelDescription$1(level) { return this.super$MasteryDiscipline$levelDescription(level) + " Bashes the enemy away."; }, onGetDirectionAction$3(game, level, dir) { return new A.BashAction(dir, A.lerpDouble(level, 1, 10, 1, 2)); } }; A.BashAction.prototype = { get$isImmediate() { return false; }, get$weaponType() { return "club"; }, onPerform$0() { var t2, t3, t4, dest, chance, _this = this, t1 = _this._step; if (t1 === 0) { t1 = _this._damage = _this.attack$1(_this._actor._pos.$add(0, _this._club$_dir)); if (t1 == null) return _this.fail$1("There's no one there!"); else if (t1 === 0) return B.ActionResult_null_true_true; } else if (t1 === 1) { t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t3 = _this._club$_dir; t4 = _this._actor._pos.$add(0, t3); t4 = t2._actorsByTile.$get$2(t4.x, t4.y); if (t4 == null) return B.ActionResult_null_true_true; dest = _this._actor._pos.$add(0, t3).$add(0, t3); t2 = _this._damage; t2.toString; chance = B.JSInt_methods.clamp$2(B.JSInt_methods.$tdiv(300 * t2, t4.get$maxHealth()), 5, 100); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); if (t2.canOccupy$2(dest, t4.get$motility()) && t2._actorsByTile.$get$2(dest.x, dest.y) == null && $.$get$rng().range$1(100) < chance) { t4.setPosition$2(t1, dest); t4.energy.energy = 0; _this.show$2("{1} is knocked back!", t4); _this.addEvent$3$dir$pos(B.EventType_knockBack, t3, _this._actor._pos.$add(0, t3)); } } else _this.addEvent$1(B.EventType_pause); return ++_this._step > 10 ? B.ActionResult_null_true_true : B.ActionResult_null_true_false; }, toString$0(_) { return A.S(this._actor) + " bashes " + this._club$_dir.toString$0(0); } }; A._ClubMastery_UsableMasteryDiscipline_DirectionSkill.prototype = {}; A.Discipline.prototype = { gainMessage$1(level) { return "You have reached level " + level + " in " + this.get$name() + "."; }, get$discoverMessage() { return "{1} can begin training in " + this.get$name() + "."; }, onCalculateLevel$2(hero, points) { var t1, level, t2, _this = this, training = hero.skills.points$1(_this); for (t1 = hero.heroClass, level = 1; level <= _this.get$maxLevel(); ++level) { t2 = _this.trainingNeeded$2(t1, level); t2.toString; if (training < t2) return level - 1; } return _this.get$maxLevel(); }, percentUntilNext$1(hero) { var points, t2, _this = this, t1 = hero.skills, level = _this.onCalculateLevel$2(hero, t1.points$1(_this)); if (level === _this.get$maxLevel()) return null; points = t1.points$1(_this); t1 = hero.heroClass; t2 = _this.trainingNeeded$2(t1, level); t2.toString; t1 = _this.trainingNeeded$2(t1, level + 1); t1.toString; return B.JSInt_methods.$tdiv(100 * (points - t2), t1 - t2); }, trainingNeeded$2(heroClass, level) { var profiency = heroClass.proficiency$1(this); if (profiency === 0) return null; return B.JSNumber_methods.ceil$0(this.baseTrainingNeeded$1(level) / profiency); } }; A.DualWield.prototype = { get$maxLevel() { return 10; }, get$name() { return "Dual-wield"; }, get$description() { return "Attack with a weapon in each hand as effectively as other lesser warriors do with only a single weapon in their puny arms."; }, levelDescription$1(level) { return "Total heft when dual-wielding is scaled by " + B.JSNumber_methods.toInt$0(A.lerpDouble(level, 1, 10, 1.5, 0.7) * 100) + "%."; }, baseTrainingNeeded$1(level) { --level; return 100 * level * level * level; }, dualWield$1(hero) { hero.discoverSkill$1(this); }, modifyHeft$3(hero, level, heftModifier) { if (hero.save._equipment.get$weapons().get$length(0) === 2) return heftModifier * A.lerpDouble(level, 1, 10, 1.5, 0.7); return heftModifier; }, killMonster$3(hero, action, monster) { var t1; if (!(action instanceof A.AttackAction)) return; t1 = hero.save; if (t1._equipment.get$weapons().get$length(0) !== 2) return; t1.skills.earnPoints$2(this, B.JSNumber_methods.ceil$0(monster._breed.get$experience() / 100)); hero.refreshSkill$1(this); } }; A.MasteryDiscipline.prototype = { get$maxLevel() { return 20; }, modifyHit$5(hero, monster, weapon, hit, level) { if (weapon == null || weapon.type.weaponType !== this.get$weaponType()) return; hit.scaleDamage$2(A.lerpDouble(level, 1, 20, 1, 2), "mastery"); }, levelDescription$1(level) { return "Melee attacks inflict " + B.JSNumber_methods.toInt$0((A.lerpDouble(level, 1, 20, 1, 2) - 1) * 100) + "% more damage when using a " + this.get$weaponType() + "."; }, _hasWeapon$1(hero) { return hero.save._equipment.get$weapons().any$1(0, new A.MasteryDiscipline__hasWeapon_closure(this)); }, killMonster$3(hero, action, monster) { if (!(action instanceof A.AttackAction)) return; if (!this._hasWeapon$1(hero)) return; hero.save.skills.earnPoints$2(this, B.JSNumber_methods.ceil$0(monster._breed.get$experience() / 100)); hero.refreshSkill$1(this); }, baseTrainingNeeded$1(level) { if (level === 0) return 0; if (level === 1) return 1; --level; return 100 * level * level * level; } }; A.MasteryDiscipline__hasWeapon_closure.prototype = { call$1(item) { return type$.Item._as(item).type.weaponType === this.$this.get$weaponType(); }, $signature: 4 }; A.UsableMasteryDiscipline.prototype = { unusableReason$1(game) { if (this._hasWeapon$1(game.hero)) return null; return "No " + this.get$weaponType() + " equipped."; } }; A.MasteryAction.prototype = { attack$1(pos) { var t2, t3, weapons, hits, damage, i, hit, _this = this, t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1 = t1._actorsByTile.$get$2(pos.x, pos.y); if (t1 == null) return null; t2 = type$.Hero; t3 = t2._as(_this._actor).save._equipment.get$weapons(); weapons = A.List_List$_of(t3, t3.$ti._eval$1("Iterable.E")); hits = t2._as(_this._actor).createMeleeHits$1(t1); for (t2 = _this.damageScale, damage = 0, i = 0; i < weapons.length; ++i) { if (weapons[i].type.weaponType !== _this.get$weaponType()) continue; if (!(i < hits.length)) return A.ioore(hits, i); hit = hits[i]; hit.scaleDamage$2(t2, "mastery"); damage += hit.perform$3(_this, _this._actor, t1); if (t1._health <= 0) break; } return damage; }, get$noise() { return 1; } }; A._UsableMasteryDiscipline_MasteryDiscipline_UsableSkill.prototype = {}; A.SlayDiscipline.prototype = { get$maxLevel() { return 20; }, get$description() { return "TODO: Implement description."; }, get$discoverMessage() { return "{1} are eager to learn to slay " + this._displayName.toLowerCase() + "."; }, get$name() { return "Slay " + this._displayName; }, seeBreed$2(hero, breed) { if (!$.$get$Monsters_breeds().hasTag$2(A.Log__categorize(breed._breed$_name, false, true), this._breedGroup)) return; hero.discoverSkill$1(this); }, killMonster$3(hero, action, monster) { if (!$.$get$Monsters_breeds().hasTag$2(A.Log__categorize(monster._breed._breed$_name, false, true), this._breedGroup)) return; hero.save.skills.earnPoints$2(this, B.JSNumber_methods.ceil$0(monster._breed.get$experience() / 1000)); hero.refreshSkill$1(this); }, modifyHit$5(hero, monster, weapon, hit, level) { if (monster == null) return; if (!$.$get$Monsters_breeds().hasTag$2(A.Log__categorize(monster._breed._breed$_name, false, true), this._breedGroup)) return; hit.scaleDamage$2(A.lerpDouble(level, 1, 20, 1.05, 2), "slay skill"); }, levelDescription$1(level) { return "Melee attacks inflict " + B.JSNumber_methods.toInt$0((A.lerpDouble(level, 1, 20, 1.05, 2) - 1) * 100) + "% more damage against " + this._displayName.toLowerCase() + "."; }, baseTrainingNeeded$1(level) { return 100 * level * level * level; } }; A.SpearMastery.prototype = { get$name() { return "Spear Mastery"; }, get$useName() { return "Spear Attack"; }, get$description() { return "Your diligent study of spears and polearms lets you attack at a distance when wielding one."; }, get$weaponType() { return "spear"; }, levelDescription$1(level) { var damage = B.JSNumber_methods.toInt$0(A.lerpDouble(level, 1, 10, 1, 3) * 100); return this.super$MasteryDiscipline$levelDescription(level) + " Distance spear attacks inflict " + damage + "% of the damage of a regular attack."; }, onGetDirectionAction$3(game, level, dir) { return new A.SpearAction(dir, $, A.lerpDouble(level, 1, 10, 1, 3)); } }; A.SpearAction.prototype = { get$isImmediate() { return false; }, get$weaponType() { return "spear"; }, onGenerate$0() { return new A._SyncStarIterable(this.onGenerate$body$SpearAction(), type$._SyncStarIterable_ActionResult); }, onGenerate$body$SpearAction() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 2, $async$errorStack = [], t1, t2, t3, step, pos, t4, t5, t6, t7, it; return function $async$onGenerate$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) switch ($async$goto) { case 0: // Function start t1 = $async$self._dir, t2 = t1.x, t3 = t1.y, step = 1; case 3: // for condition if (!(step <= 2)) { // goto after for $async$goto = 5; break; } pos = $async$self._actor._pos.$add(0, new A.Vec(t2 * step, t3 * step)); t4 = $async$self.__Action__game_F; t4 === $ && A.throwLateFieldNI("_game"); t4 = t4.__Game__stage_F; t4 === $ && A.throwLateFieldNI("_stage"); t4 = t4.tiles; t5 = pos.x; t6 = pos.y; t4._checkBounds$2(t5, t6); t7 = t4._elements; t5 = t6 * t4.bounds.size.x + t5; if (!(t5 >= 0 && t5 < t7.length)) { A.ioore(t7, t5); // goto return $async$goto = 1; break; } t5 = t7[t5]; $async$goto = !t5._isExplored ? 6 : 7; break; case 6: // then $async$goto = 8; return $async$iterator._async$_current = $async$self.fail$1("You can't see far enough to aim."), 1; case 8: // after yield // goto return $async$goto = 1; break; case 7: // join t4 = $.$get$Motility_fly(); $async$goto = (t5.type.motility._bitMask & t4._bitMask) === 0 ? 9 : 10; break; case 9: // then $async$goto = 11; return $async$iterator._async$_current = $async$self.fail$1("There isn't enough room to use your weapon."), 1; case 11: // after yield // goto return $async$goto = 1; break; case 10: // join case 4: // for update ++step; // goto for condition $async$goto = 3; break; case 5: // after for t4 = type$.Hero, step = 1; case 12: // for condition if (!(step <= 2)) { // goto after for $async$goto = 14; break; } t5 = $async$self._actor; pos = t5._pos.$add(0, new A.Vec(t2 * step, t3 * step)); it = t4._as(t5).save._equipment.get$weapons().get$iterator(0); if (!it.moveNext$0()) A.throwExpression(A.IterableElementError_noElement()); t5 = it.get$current().type; t6 = $async$self.__Action__game_F; t6 === $ && A.throwLateFieldNI("_game"); t7 = $.$get$Element_none(); B.JSArray_methods.add$1(t6._events, new A.Event(B.EventType_stab, null, t7, t5.appearance, pos, t1)); $async$goto = 15; return $async$iterator._async$_current = B.ActionResult_null_true_false, 1; case 15: // after yield $async$self.attack$1(pos); $async$goto = 16; return $async$iterator._async$_current = B.ActionResult_null_true_false, 1; case 16: // after yield case 13: // for update ++step; // goto for condition $async$goto = 12; break; case 14: // after for case 1: // return return 0; case 2: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, toString$0(_) { return A.S(this._actor) + " spears " + this._dir.toString$0(0); } }; A._SpearAction_MasteryAction_GeneratorActionMixin.prototype = {}; A._SpearMastery_UsableMasteryDiscipline_DirectionSkill.prototype = {}; A.Swordfighting.prototype = { get$name() { return "Swordfighting"; }, get$description() { return "The most elegant tool for the most refined of martial arts."; }, get$weaponType() { return "sword"; }, levelDescription$1(level) { return this.super$MasteryDiscipline$levelDescription(level) + " Parrying increases dodge by " + B.JSNumber_methods.round$0(A.lerpDouble(level, 1, 20, 1, 20)) + "."; }, getDefense$2(hero, level) { var t1 = hero.save._equipment.get$weapons(), t2 = t1.$ti, swords = new A.WhereIterable(t1, t2._eval$1("bool(Iterable.E)")._as(new A.Swordfighting_getDefense_closure()), t2._eval$1("WhereIterable")).get$length(0); if (swords === 0) return null; return new A.Defense(B.JSNumber_methods.round$0(A.lerpDouble(level, 1, 20, 1, 20)) * swords, "{1} parr[y|ies] {2}."); } }; A.Swordfighting_getDefense_closure.prototype = { call$1(weapon) { return type$.Item._as(weapon).type.weaponType === "sword"; }, $signature: 4 }; A.WhipMastery.prototype = { get$name() { return "Whip Mastery"; }, get$useName() { return "Whip Crack"; }, get$description() { return "Whips and flails are difficult to use well, but deadly even at a distance when mastered."; }, get$weaponType() { return "whip"; }, levelDescription$1(level) { var damage = B.JSNumber_methods.toInt$0(A.lerpDouble(level, 1, 10, 1, 3) * 100); return this.super$MasteryDiscipline$levelDescription(level) + " Ranged whip attacks inflict " + damage + "% of the damage of a regular attack."; }, getRange$1(_, game) { return 3; }, onGetTargetAction$3(game, level, target) { var t2, t3, weapons, hits, hit, i, t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1 = t1._actorsByTile.$get$2(target.get$x(), target.get$y()); t2 = game.hero; t3 = t2.save._equipment.get$weapons(); weapons = A.List_List$_of(t3, t3.$ti._eval$1("Iterable.E")); hits = t2.createMeleeHits$1(t1); hit = A._Cell$named("hit"); for (t1 = weapons.length, i = 0; i < t1; ++i) { if (weapons[i].type.weaponType !== "whip") continue; if (!(i < hits.length)) return A.ioore(hits, i); hit._value = hits[i]; break; } hit._readLocal$0().scaleDamage$2(A.lerpDouble(level, 1, 10, 1, 3), "whip mastery"); return A.BoltAction$(target, hit._readLocal$0(), true, 3); } }; A._WhipMastery_UsableMasteryDiscipline_TargetSkill.prototype = {}; A.conjuringSpells_closure.prototype = { call$3(spell, game, level) { type$.ActionSpell._as(spell); type$.Game._as(game); A._asInt(level); return A.TeleportAction$(spell.range); }, $signature: 25 }; A.conjuringSpells_closure0.prototype = { call$3(spell, game, level) { type$.ActionSpell._as(spell); type$.Game._as(game); A._asInt(level); return A.TeleportAction$(spell.range); }, $signature: 25 }; A.conjuringSpells_closure1.prototype = { call$3(spell, game, level) { type$.ActionSpell._as(spell); type$.Game._as(game); A._asInt(level); return A.TeleportAction$(spell.range); }, $signature: 25 }; A.divinationSpells_closure.prototype = { call$3(spell, game, level) { type$.ActionSpell._as(spell); type$.Game._as(game); A._asInt(level); return A.DetectAction$(A._setArrayType([B.DetectType_1], type$.JSArray_DetectType), spell.range); }, $signature: 56 }; A.sorcerySpells_closure.prototype = { call$4(spell, game, level, target) { type$.TargetSpell._as(spell); type$.Game._as(game); A._asInt(level); return A.BoltAction$(type$.Vec._as(target), A.Hit$_(A.Attack$(new A.Noun("the icicle"), "pierce", spell.damage, spell.range, $.$get$Elements_cold())), false, null); }, $signature: 57 }; A.sorcerySpells_closure0.prototype = { call$4(spell, game, level, target) { var attack, t1; type$.TargetSpell._as(spell); type$.Game._as(game); A._asInt(level); type$.Vec._as(target); attack = A.Attack$(new A.Noun("the light"), "sear", spell.damage, spell.range, $.$get$Elements_light()); t1 = game.hero._pos; return A.RayAction$_(A.Hit$_(attack), t1, target, 0.125); }, $signature: 58 }; A.sorcerySpells_closure1.prototype = { call$3(spell, game, level) { var attack; type$.ActionSpell._as(spell); type$.Game._as(game); A._asInt(level); attack = A.Attack$(new A.Noun("the wind"), "blast", spell.damage, spell.range, $.$get$Elements_air()); return A.FlowAction$(game.hero._pos, A.Hit$_(attack), $.$get$Motility_flyAndWalk(), null); }, $signature: 42 }; A.sorcerySpells_closure2.prototype = { call$4(spell, game, level, target) { var t1, attack, t2, t3, offset, $length; type$.TargetSpell._as(spell); type$.Game._as(game); A._asInt(level); t1 = type$.Vec; t1._as(target); attack = A.Attack$(new A.Noun("the fire"), "burn", spell.damage, spell.range, $.$get$Elements_fire()); t2 = game.hero._pos; t3 = A.Hit$_(attack); offset = t2.$sub(0, target); $length = Math.sqrt(offset.get$lengthSquared()); return new A.BarrierAction(target, -offset.y / $length, offset.x / $length, t3, A.LinkedHashSet_LinkedHashSet$_empty(t1)); }, $signature: 60 }; A.sorcerySpells_closure3.prototype = { call$3(spell, game, level) { var attack; type$.ActionSpell._as(spell); type$.Game._as(game); A._asInt(level); attack = A.Attack$(new A.Noun("the wave"), "inundate", spell.damage, spell.range, $.$get$Elements_water()); return A.FlowAction$(game.hero._pos, A.Hit$_(attack), new A.Motility($.$get$Motility_walk()._bitMask | $.$get$Motility_door()._bitMask | $.$get$Motility_swim()._bitMask), 2); }, $signature: 42 }; A.Spell.prototype = { gainMessage$1(level) { return "{1} have learned the spell " + this.get$name() + "."; }, get$discoverMessage() { return "{1} are not wise enough to cast " + this.get$name() + "."; }, get$maxLevel() { return 1; }, get$damage() { return 0; }, get$range() { return 0; }, onCalculateLevel$2(hero, points) { var t2, t1 = hero.heroClass; if (t1.proficiency$1(this) === 0) return 0; t2 = hero.intellect._stat$_value; t2.toString; return t2 >= this.complexity$1(t1) ? 1 : 0; }, focusCost$2(hero, level) { var cost = this.get$baseFocusCost(), t1 = hero.heroClass, t2 = this.complexity$1(t1), t3 = hero.intellect._stat$_value; t3.toString; return B.JSNumber_methods.ceil$0(cost * A.lerpDouble(t3 - B.JSInt_methods.clamp$2(t2, 0, 50), 0, 50, 1, 0.2) / t1.proficiency$1(this)); }, complexity$1(heroClass) { return B.JSNumber_methods.round$0((this.get$baseComplexity() - 9) / heroClass.proficiency$1(this)) + 9; }, getRange$1(_, game) { return this.get$range(); } }; A.ActionSpell.prototype = { get$name() { return this.name; }, get$description() { return this.description; }, get$baseComplexity() { return this.baseComplexity; }, get$baseFocusCost() { return this.baseFocusCost; }, get$damage() { return this.damage; }, get$range() { return this.range; } }; A.TargetSpell.prototype = { onGetTargetAction$3(game, level, target) { return this._getAction.call$4(this, game, level, target); }, get$name() { return this.name; }, get$description() { return this.description; }, get$baseComplexity() { return this.baseComplexity; }, get$baseFocusCost() { return this.baseFocusCost; }, get$damage() { return this.damage; }, get$range() { return this.range; } }; A._ActionSpell_Spell_ActionSkill.prototype = {}; A._Spell_Skill_UsableSkill.prototype = {}; A._TargetSpell_Spell_TargetSkill.prototype = {}; A.Region.prototype = { _enumToString$0() { return "Region." + this._core$_name; } }; A.Architect.prototype = { buildStage$1(placeHero) { return new A._SyncStarIterable(this.buildStage$body$Architect(type$.dynamic_Function_Vec._as(placeHero)), type$._SyncStarIterable_String); }, buildStage$body$Architect($async$placeHero) { var $async$self = this; return function() { var placeHero = $async$placeHero; var $async$goto = 0, $async$handler = 2, $async$errorStack = [], t1, t2, t3, t4, t5, t6, t7, t8, styles, lastFillable, i, possibleRegions, regions, architecture, unownedPassages, decorator; return function $async$buildStage$1($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) $async$outer: switch ($async$goto) { case 0: // Function start for (t1 = $async$self.stage.tiles, t2 = t1.bounds, t3 = A.RectIterator$(t2), t4 = t1._elements, t5 = t2.size.x, t6 = t4.length; t3.moveNext$0();) { t7 = t3._x; t8 = t3._y; t1._checkBounds$2(t7, t8); t7 = t8 * t5 + t7; if (!(t7 >= 0 && t7 < t6)) { A.ioore(t4, t7); // goto return $async$goto = 1; break $async$outer; } t4[t7].type = $.$get$Tiles_unformed(); } styles = A.ArchitecturalStyle_pick($async$self.depth); i = styles.length - 1; for (;;) { if (!(i >= 0)) { lastFillable = -1; break; } if (styles[i].canFill) { lastFillable = i; break; } --i; } t3 = type$.JSArray_Region; possibleRegions = A._setArrayType(B.List_FL1.slice(0), t3); regions = A._setArrayType([], t3); for (t3 = type$.Region, i = 0; i < styles.length; ++i) if (i === lastFillable || !styles[i].canFill) B.JSArray_methods.add$1(regions, B.Region_everywhere_0_everywhere); else B.JSArray_methods.add$1(regions, $.$get$rng().take$1$1(0, possibleRegions, t3)); i = 0; case 3: // for condition if (!(i < styles.length)) { // goto after for $async$goto = 5; break; } t3 = styles[i]; if (!(i < regions.length)) { A.ioore(regions, i); // goto return $async$goto = 1; break; } t7 = regions[i]; architecture = t3._factory.call$0(); architecture.__Architecture__architect_F !== $ && A.throwLateFieldAI("_architect"); architecture.__Architecture__architect_F = $async$self; architecture.__Architecture__style_F !== $ && A.throwLateFieldAI("_style"); architecture.__Architecture__style_F = t3; architecture.__Architecture__region_F !== $ && A.throwLateFieldAI("_region"); architecture.__Architecture__region_F = t7; $async$goto = 6; return $async$iterator._yieldStar$1(architecture.build$0()); case 6: // after yield case 4: // for update ++i; // goto for condition $async$goto = 3; break; case 5: // after for for (t2 = J.get$iterator$ax(t2.trace$0()); t2.moveNext$0();) { t3 = t2.get$current(); t7 = t3.get$x(); t3 = t3.get$y(); t1._checkBounds$2(t7, t3); t7 = t3 * t5 + t7; if (!(t7 >= 0 && t7 < t6)) { A.ioore(t4, t7); // goto return $async$goto = 1; break $async$outer; } t4[t7].type = $.$get$Tiles_solid(); } unownedPassages = A._setArrayType([], type$.JSArray_Vec); $async$goto = 7; return $async$iterator._yieldStar$1($async$self._fillPassages$1(unownedPassages)); case 7: // after yield $async$goto = 8; return $async$iterator._yieldStar$1($async$self._addShortcuts$1(unownedPassages)); case 8: // after yield $async$goto = 9; return $async$iterator._yieldStar$1($async$self._claimPassages$1(unownedPassages)); case 9: // after yield $async$goto = 10; return $async$iterator._async$_current = "Ready to decorate", 1; case 10: // after yield decorator = new A.Decorator($async$self, A.LinkedHashMap_LinkedHashMap$_empty(type$.nullable_Architecture, type$.List_Vec), A.LinkedHashSet_LinkedHashSet$_empty(type$.Breed)); $async$goto = 11; return $async$iterator._yieldStar$1(decorator.decorate$0()); case 11: // after yield t1 = decorator.__Decorator__heroPos_F; t1 === $ && A.throwLateFieldNI("_heroPos"); placeHero.call$1(t1); case 1: // return return 0; case 2: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, _carve$4(architecture, x, y, tile) { var t3, t4, t5, t6, t7, t8, t9, _i, dir, t10, t11, t12, t1 = this.stage.tiles, t2 = t1.$get$2(x, y); t2.type = tile == null ? $.$get$Tiles_open() : tile; ++this._carvedTiles; t2 = this._owners; t2.$set$3(x, y, architecture); for (t3 = t2.bounds, t4 = t1._elements, t5 = t1.bounds.size.x, t6 = t4.length, t7 = t2.$ti._precomputed1, t8 = t2._elements, t9 = t3.size.x, _i = 0; _i < 8; ++_i) { dir = B.List_wXx[_i]; t10 = dir.x + x; t11 = dir.y + y; if (t3.contains$1(0, new A.Vec(t10, t11))) { t1._checkBounds$2(t10, t11); t12 = t11 * t5 + t10; if (!(t12 >= 0 && t12 < t6)) return A.ioore(t4, t12); t12 = t4[t12].type !== $.$get$Tiles_unformedWet(); } else t12 = false; if (t12) { t7._as(architecture); t2._checkBounds$2(t10, t11); B.JSArray_methods.$indexSet(t8, t11 * t9 + t10, architecture); } } }, _canCarve$2(architecture, pos) { var t3, t4, t5, t6, t7, t8, t9, t10, t11, _i, here, t12, t13, t14, owner, t1 = this.stage.tiles, t2 = t1.bounds; if (!t2.contains$1(0, pos)) return false; t3 = this._owners; t4 = pos.x; t5 = pos.y; if (t3.$get$2(t4, t5) != null) return false; if (t1.$get$2(t4, t5).type === $.$get$Tiles_unformedWet()) return false; for (t4 = pos.get$neighbors(), t5 = t4.length, t6 = t3._elements, t7 = t3.bounds.size.x, t8 = t6.length, t9 = t1._elements, t10 = t2.size.x, t11 = t9.length, _i = 0; _i < t5; ++_i) { here = t4[_i]; if (!t2.contains$1(0, here)) continue; t12 = here.x; t13 = here.y; t1._checkBounds$2(t12, t13); t14 = t13 * t10 + t12; if (!(t14 >= 0 && t14 < t11)) return A.ioore(t9, t14); if (t9[t14].type === $.$get$Tiles_unformedWet()) continue; t3._checkBounds$2(t12, t13); t12 = t13 * t7 + t12; if (!(t12 >= 0 && t12 < t8)) return A.ioore(t6, t12); owner = t6[t12]; if (owner != null && owner !== architecture) return false; } return true; }, _fillPassages$1(unownedPassages) { return new A._SyncStarIterable(this._fillPassages$body$Architect(type$.List_Vec._as(unownedPassages)), type$._SyncStarIterable_String); }, _fillPassages$body$Architect($async$unownedPassages) { var $async$self = this; return function() { var unownedPassages = $async$unownedPassages; var $async$goto = 0, $async$handler = 2, $async$errorStack = [], t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, openCount, start, startDistance, t13, t14, pos, tile, distance, reachability, count, _i, count0, t1, unformed; return function $async$_fillPassages$1($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) $async$outer: switch ($async$goto) { case 0: // Function start t1 = type$.JSArray_Vec; unformed = A._setArrayType([], t1); for (t2 = $async$self.stage, t3 = t2.tiles, t4 = t3.bounds, t5 = A.RectIterator$(t4.inflate$1(-1)), t6 = t3._elements, t7 = t4.size, t8 = t7.x, t9 = t6.length, t4 = t4.pos, t10 = t4.x, t11 = t10 + t8, t4 = t4.y, t7 = t7.y, t12 = t4 + t7, openCount = 0, start = B.Vec_0_0, startDistance = 99999; t5.moveNext$0();) { t13 = t5._x; t14 = t5._y; pos = new A.Vec(t13, t14); t3._checkBounds$2(t13, t14); t13 = t14 * t8 + t13; if (!(t13 >= 0 && t13 < t9)) { A.ioore(t6, t13); // goto return $async$goto = 1; break $async$outer; } tile = t6[t13].type; if (tile === $.$get$Tiles_open()) { ++openCount; t13 = pos.$sub(0, new A.Vec(B.JSInt_methods._tdivFast$1(Math.min(t10, t11) + Math.max(t10, t11), 2), B.JSInt_methods._tdivFast$1(Math.min(t4, t12) + Math.max(t4, t12), 2))); distance = Math.abs(t13.x) + Math.abs(t13.y); if (distance < startDistance) { startDistance = distance; start = pos; } } else if (!(tile !== $.$get$Tiles_unformed() && tile !== $.$get$Tiles_unformedWet())) B.JSArray_methods.add$1(unformed, pos); } t4 = $.$get$rng(); B.JSArray_methods.shuffle$1(type$.List_Vec._as(unformed), t4._random); t4 = type$.int; t5 = t8 * t7; t10 = A.List_List$filled(t5, -2, false, t4); t11 = type$.Array2D_int; t12 = new A.Array2D(t10, new A.Rect(new A.Vec(0, 0), new A.Vec(t8, t7)), t11); reachability = new A.Reachability(t2, start, t12, new A.VecSet(new A.Array2D(A.List_List$filled(t5, 0, false, t4), new A.Rect(new A.Vec(0, 0), new A.Vec(t8, t7)), t11), t8, t7), B.List_empty0); reachability._setDistance$2(start, 0); reachability._reachability$_process$1(A._setArrayType([start], t1)); t1 = unformed.length, count = 0, _i = 0; case 3: // for condition if (!(_i < unformed.length)) { // goto after for $async$goto = 5; break; } pos = unformed[_i]; t2 = pos.get$x(); t4 = pos.get$y(); t3._checkBounds$2(t2, t4); t2 = t4 * t8 + t2; if (!(t2 >= 0 && t2 < t9)) { A.ioore(t6, t2); // goto return $async$goto = 1; break; } t2 = t6[t2]; t4 = t2.type; t7 = t4 === $.$get$Tiles_unformed(); if (!t7 && t4 !== $.$get$Tiles_unformedWet()) { // goto for update $async$goto = 4; break; } if (t7) t2.type = $.$get$Tiles_solid(); else if (t4 === $.$get$Tiles_unformedWet()) t2.type = $.$get$Tiles_solidWet(); t2 = pos.get$x(); t4 = pos.get$y(); t12._checkBounds$2(t2, t4); t2 = t4 * t8 + t2; if (!(t2 >= 0 && t2 < t5)) { A.ioore(t10, t2); // goto return $async$goto = 1; break; } t2 = t10[t2]; if (typeof t2 !== "number") { t2.$ge(); // goto return $async$goto = 1; break; } if (!(t2 >= 0)) { // goto for update $async$goto = 4; break; } reachability.fill$1(pos); if (reachability._reachedOpenCount !== openCount) { $async$self._makePassage$2(unownedPassages, pos); reachability.undoFill$0(); } count0 = count + 1; $async$goto = B.JSInt_methods.$mod(count, 20) === 0 ? 6 : 7; break; case 6: // then $async$goto = 8; return $async$iterator._async$_current = pos.toString$0(0), 1; case 8: // after yield case 7: // join count = count0; case 4: // for update unformed.length === t1 || (0, A.throwConcurrentModificationError)(unformed), ++_i; // goto for condition $async$goto = 3; break; case 5: // after for case 1: // return return 0; case 2: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, _addShortcuts$1(unownedPassages) { return new A._SyncStarIterable(this._addShortcuts$body$Architect(type$.List_Vec._as(unownedPassages)), type$._SyncStarIterable_String); }, _addShortcuts$body$Architect($async$unownedPassages) { var $async$self = this; return function() { var unownedPassages = $async$unownedPassages; var $async$goto = 0, $async$handler = 2, $async$errorStack = [], t1, t2, t3, t4, t5, t6, t7, pos, type, _i, dir, t8, t9, maxShortcuts, shortcuts, path, possibleStarts; return function $async$_addShortcuts$1($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) $async$outer: switch ($async$goto) { case 0: // Function start possibleStarts = A._setArrayType([], type$.JSArray__Path); for (t1 = $async$self.stage.tiles, t2 = t1.bounds, t3 = A.RectIterator$(t2.inflate$1(-1)), t4 = t1._elements, t2 = t2.size.x, t5 = t4.length; t3.moveNext$0();) { t6 = t3._x; t7 = t3._y; pos = new A.Vec(t6, t7); t1._checkBounds$2(t6, t7); t6 = t7 * t2 + t6; if (!(t6 >= 0 && t6 < t5)) { A.ioore(t4, t6); // goto return $async$goto = 1; break $async$outer; } type = t4[t6].type; t6 = $.$get$Tiles_open(); if (!(type === t6 || type === $.$get$Tiles_passage() || type === $.$get$Tiles_passageWet())) continue; for (_i = 0; _i < 4; ++_i) { dir = B.List_iHk[_i]; t7 = pos.$add(0, dir.get$rotateLeft90()); t8 = t7.x; t7 = t7.y; t1._checkBounds$2(t8, t7); t8 = t7 * t2 + t8; if (!(t8 >= 0 && t8 < t5)) { A.ioore(t4, t8); // goto return $async$goto = 1; break $async$outer; } type = t4[t8].type; if (!(type === t6 || type === $.$get$Tiles_passage() || type === $.$get$Tiles_passageWet())) continue; t7 = pos.$add(0, dir.get$rotateLeft45()); t8 = t7.x; t7 = t7.y; t1._checkBounds$2(t8, t7); t8 = t7 * t2 + t8; if (!(t8 >= 0 && t8 < t5)) { A.ioore(t4, t8); // goto return $async$goto = 1; break $async$outer; } type = t4[t8].type; t7 = $.$get$Tiles_solid(); if (!(type === t7 || type === $.$get$Tiles_solidWet())) continue; t8 = pos.$add(0, dir); t9 = t8.x; t8 = t8.y; t1._checkBounds$2(t9, t8); t9 = t8 * t2 + t9; if (!(t9 >= 0 && t9 < t5)) { A.ioore(t4, t9); // goto return $async$goto = 1; break $async$outer; } type = t4[t9].type; if (!(type === t7 || type === $.$get$Tiles_solidWet())) continue; t8 = pos.$add(0, dir.get$rotateRight45()); t9 = t8.x; t8 = t8.y; t1._checkBounds$2(t9, t8); t9 = t8 * t2 + t9; if (!(t9 >= 0 && t9 < t5)) { A.ioore(t4, t9); // goto return $async$goto = 1; break $async$outer; } type = t4[t9].type; if (!(type === t7 || type === $.$get$Tiles_solidWet())) continue; t7 = pos.$add(0, dir.get$rotateRight90()); t8 = t7.x; t7 = t7.y; t1._checkBounds$2(t8, t7); t8 = t7 * t2 + t8; if (!(t8 >= 0 && t8 < t5)) { A.ioore(t4, t8); // goto return $async$goto = 1; break $async$outer; } type = t4[t8].type; if (!(type === t6 || type === $.$get$Tiles_passage() || type === $.$get$Tiles_passageWet())) continue; B.JSArray_methods.add$1(possibleStarts, new A._Path(pos, dir)); } } t1 = $.$get$rng(); B.JSArray_methods.shuffle$1(type$.List__Path._as(possibleStarts), t1._random); maxShortcuts = t1.range$2(5, 40); t1 = possibleStarts.length, shortcuts = 0, _i = 0; case 3: // for condition if (!(_i < possibleStarts.length)) { // goto after for $async$goto = 5; break; } path = possibleStarts[_i]; if (!$async$self._tryShortcut$3(unownedPassages, path.pos, path.dir)) { // goto for update $async$goto = 4; break; } $async$goto = 6; return $async$iterator._async$_current = "Shortcut", 1; case 6: // after yield ++shortcuts; if (shortcuts >= maxShortcuts) { // goto after for $async$goto = 5; break; } case 4: // for update possibleStarts.length === t1 || (0, A.throwConcurrentModificationError)(possibleStarts), ++_i; // goto for condition $async$goto = 3; break; case 5: // after for case 1: // return return 0; case 2: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, _tryShortcut$3(unownedPassages, start, heading) { var tiles, pos, t1, t2, t3, t4, t5, t6, next, t7, t8, type, _i, t9; type$.List_Vec._as(unownedPassages); tiles = A._setArrayType([], type$.JSArray_Vec); pos = start.$add(0, heading); for (t1 = this.stage, t2 = t1.tiles, t3 = t2._elements, t4 = t2.bounds, t5 = t4.size.x, t6 = t3.length;; pos = next) { B.JSArray_methods.add$1(tiles, pos); next = pos.$add(0, heading); if (!t4.contains$1(0, next)) return false; t7 = next.x; t8 = next.y; t2._checkBounds$2(t7, t8); t7 = t8 * t5 + t7; if (!(t7 >= 0 && t7 < t6)) return A.ioore(t3, t7); type = t3[t7].type; if (type === $.$get$Tiles_open() || type === $.$get$Tiles_passage() || type === $.$get$Tiles_passageWet()) { t2 = tiles.length; t3 = $.$get$rng(); if (!new A._LengthPathfinder(t2 * 2 + (t3._random.nextInt$1(8) + 8), t1, start, next).search$0()) { for (t1 = tiles.length, _i = 0; _i < tiles.length; tiles.length === t1 || (0, A.throwConcurrentModificationError)(tiles), ++_i) this._makePassage$2(unownedPassages, tiles[_i]); return true; } return false; } t7 = next.$add(0, heading.get$rotateLeft90()); t8 = t7.x; t7 = t7.y; t2._checkBounds$2(t8, t7); t8 = t7 * t5 + t8; if (!(t8 >= 0 && t8 < t6)) return A.ioore(t3, t8); type = t3[t8].type; t7 = $.$get$Tiles_solid(); if (!(type === t7 || type === $.$get$Tiles_solidWet())) return false; t8 = next.$add(0, heading.get$rotateRight90()); t9 = t8.x; t8 = t8.y; t2._checkBounds$2(t9, t8); t9 = t8 * t5 + t9; if (!(t9 >= 0 && t9 < t6)) return A.ioore(t3, t9); type = t3[t9].type; if (!(type === t7 || type === $.$get$Tiles_solidWet())) return false; t7 = $.$get$rng(); t8 = tiles.length; if (t7._random.nextInt$1(100) < t8 * 10) return false; } }, _makePassage$2(unownedPassages, pos) { var t1, t2, owner; type$.List_Vec._as(unownedPassages); t1 = this.stage.tiles.$get$2(pos.get$x(), pos.get$y()); t2 = t1.type; if (t2 === $.$get$Tiles_solid()) t1.type = $.$get$Tiles_passage(); else if (t2 === $.$get$Tiles_solidWet()) t1.type = $.$get$Tiles_passageWet(); owner = this._owners.$get$2(pos.get$x(), pos.get$y()); if (owner == null) B.JSArray_methods.add$1(unownedPassages, pos); else this._claimNeighbors$2(pos, owner); }, _claimPassages$1(unownedPassages) { return new A._SyncStarIterable(this._claimPassages$body$Architect(type$.List_Vec._as(unownedPassages)), type$._SyncStarIterable_String); }, _claimPassages$body$Architect($async$unownedPassages) { var $async$self = this; return function() { var unownedPassages = $async$unownedPassages; var $async$goto = 0, $async$handler = 2, $async$errorStack = [], t1, t2, t3, t4, t5, t6, t7, t8, stillUnowned, t9, _i, pos, neighbors, t10, t11, _i0, neighbor, t12, t13, owner; return function $async$_claimPassages$1($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) $async$outer: switch ($async$goto) { case 0: // Function start t1 = $async$self._owners, t2 = t1._elements, t3 = t1.bounds.size.x, t4 = t2.length, t5 = type$.JSArray_Architecture, t6 = t1.$ti._precomputed1, t7 = type$.List_Architecture, t8 = type$.JSArray_Vec; case 3: // for condition // trivial condition stillUnowned = A._setArrayType([], t8); for (t9 = unownedPassages.length, _i = 0; _i < unownedPassages.length; unownedPassages.length === t9 || (0, A.throwConcurrentModificationError)(unownedPassages), ++_i) { pos = unownedPassages[_i]; neighbors = A._setArrayType([], t5); for (t10 = pos.get$neighbors(), t11 = t10.length, _i0 = 0; _i0 < t10.length; t10.length === t11 || (0, A.throwConcurrentModificationError)(t10), ++_i0) { neighbor = t10[_i0]; t12 = neighbor.x; t13 = neighbor.y; t1._checkBounds$2(t12, t13); t12 = t13 * t3 + t12; if (!(t12 >= 0 && t12 < t4)) { A.ioore(t2, t12); // goto return $async$goto = 1; break $async$outer; } owner = t2[t12]; if (owner != null) B.JSArray_methods.add$1(neighbors, owner); } t10 = neighbors.length; if (t10 !== 0) { t11 = $.$get$rng(); t7._as(neighbors); t10 = t11._random.nextInt$1(t10); if (!(t10 >= 0 && t10 < neighbors.length)) { A.ioore(neighbors, t10); // goto return $async$goto = 1; break $async$outer; } owner = neighbors[t10]; t6._as(owner); t10 = pos.get$x(); t11 = pos.get$y(); t1._checkBounds$2(t10, t11); B.JSArray_methods.$indexSet(t2, t11 * t3 + t10, owner); $async$self._claimNeighbors$2(pos, owner); } else B.JSArray_methods.add$1(stillUnowned, pos); } if (stillUnowned.length === 0) { // goto after for $async$goto = 5; break; } $async$goto = 6; return $async$iterator._async$_current = "Claim", 1; case 6: // after yield case 4: // for update unownedPassages = stillUnowned; // goto for condition $async$goto = 3; break; case 5: // after for case 1: // return return 0; case 2: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, _claimNeighbors$2(pos, owner) { var t1, t2, t3, t4, t5, t6, t7, _i, neighbor, t8, t9, t10; for (t1 = pos.get$neighbors(), t2 = t1.length, t3 = this._owners, t4 = t3._elements, t5 = t3.bounds.size.x, t6 = t4.length, t7 = t3.$ti._precomputed1, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { neighbor = t1[_i]; t8 = neighbor.x; t9 = neighbor.y; t3._checkBounds$2(t8, t9); t10 = t9 * t5 + t8; if (!(t10 >= 0 && t10 < t6)) return A.ioore(t4, t10); if (t4[t10] == null) { t7._as(owner); t3._checkBounds$2(t8, t9); B.JSArray_methods.$indexSet(t4, t10, owner); } } } }; A._Path.prototype = {}; A.Architecture.prototype = { get$paintStyle() { return $.$get$PaintStyle_rock(); }, spawnMonsters$1(painter) { return false; } }; A._LengthPathfinder.prototype = { processStep$1(path) { if (path.length >= this._maxLength) return false; return null; }, reachedGoal$1(path) { return true; }, stepCost$2(pos, tile) { var t1 = $.$get$Motility_doorAndWalk(); if ((tile.type.motility._bitMask & t1._bitMask) !== 0) return 1; return null; }, unreachableGoal$0() { return false; } }; A.ArchitecturalStyle.prototype = {}; A.dungeon_closure.prototype = { call$0() { return new A.Dungeon(this.shapes); }, $signature: 61 }; A.catacomb_closure.prototype = { call$0() { return new A.Catacomb(0.3, 8, 32); }, $signature: 62 }; A.cavern_closure.prototype = { call$0() { return new A.Cavern(); }, $signature: 63 }; A.lake_closure.prototype = { call$0() { return new A.Lake(); }, $signature: 64 }; A.river_closure.prototype = { call$0() { return new A.River(); }, $signature: 65 }; A.keep_closure.prototype = { call$0() { return A.Keep_Keep(5); }, $signature: 66 }; A.pit_closure.prototype = { call$0() { var t1 = A._setArrayType([], type$.JSArray_Vec); return new A.Pit(this.monsterGroup, 12, 24, t1); }, $signature: 67 }; A.Catacomb.prototype = { build$0() { return new A._SyncStarIterable(this.build$body$Catacomb(), type$._SyncStarIterable_String); }, build$body$Catacomb() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 1, $async$errorStack = [], t2, t3, maxSize, minSize, t4, possible, failed, cave, placed, t5, t6, xMax, yMax, i, t7, xMin, yMin, yMax0, xMax0, t8, t1; return function $async$build$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) switch ($async$goto) { case 0: // Function start t1 = $async$self.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI("_architect"); t2 = t1.stage.tiles.bounds.size; t3 = t2.y; t2 = t2.x; maxSize = Math.sqrt(Math.min(Math.min($async$self._catacomb$_maxSize, t3), t2)); minSize = Math.min(Math.sqrt($async$self._catacomb$_minSize), maxSize); t4 = $async$self._catacomb$_density; possible = (t2 - 2) * (t3 - 2); failed = 0; case 2: // for condition // trivial condition if (!(t1._carvedTiles / possible < t4 && failed < 100)) { // goto after for $async$goto = 3; break; } cave = A.Blob_make(B.JSNumber_methods.toInt$0(Math.pow($.$get$rng().float$2(minSize, maxSize), 2))); t5 = cave.bounds.size; t6 = t5.x; t5 = t5.y; xMax = t2 - t6; yMax = t3 - t5; i = 0; case 4: // for condition // trivial condition if (!(i < 400)) { placed = false; // goto after for $async$goto = 5; break; } t7 = $async$self.__Architecture__region_F; t7 === $ && A.throwLateFieldNI("_region"); xMin = 1; yMin = 1; switch (t7.index) { case 0: yMax0 = yMax; xMax0 = xMax; break; case 1: yMax0 = B.JSInt_methods._tdivFast$1(t3, 2) - t5; xMax0 = xMax; break; case 2: xMin = B.JSInt_methods._tdivFast$1(t2, 2); yMax0 = B.JSInt_methods._tdivFast$1(t3, 2) - t5; xMax0 = xMax; break; case 3: xMin = B.JSInt_methods._tdivFast$1(t2, 2); yMax0 = yMax; xMax0 = xMax; break; case 4: xMin = B.JSInt_methods._tdivFast$1(t2, 2); yMin = B.JSInt_methods._tdivFast$1(t3, 2); yMax0 = yMax; xMax0 = xMax; break; case 5: yMin = B.JSInt_methods._tdivFast$1(t3, 2); yMax0 = yMax; xMax0 = xMax; break; case 6: xMax0 = B.JSInt_methods._tdivFast$1(t2, 2) - t6; yMin = B.JSInt_methods._tdivFast$1(t3, 2); yMax0 = yMax; break; case 7: xMax0 = B.JSInt_methods._tdivFast$1(t2, 2) - t6; yMax0 = yMax; break; case 8: xMax0 = B.JSInt_methods._tdivFast$1(t2, 2) - t6; yMax0 = B.JSInt_methods._tdivFast$1(t3, 2) - t5; break; default: yMax0 = yMax; xMax0 = xMax; } if (xMin >= xMax0) { // goto break c$1 $async$goto = 6; break; } if (yMin >= yMax0) { // goto break c$1 $async$goto = 6; break; } t7 = $.$get$rng(); t7 = t7._random; t8 = t7.nextInt$1(xMax0 - xMin); $async$goto = $async$self._catacomb$_tryPlaceCave$3(cave, t8 + xMin, t7.nextInt$1(yMax0 - yMin) + yMin) ? 7 : 8; break; case 7: // then $async$goto = 9; return $async$iterator._async$_current = "cave", 1; case 9: // after yield placed = true; // goto after for $async$goto = 5; break; case 8: // join case 6: // break c$1 ++i; // goto for condition $async$goto = 4; break; case 5: // after for if (!placed) ++failed; // goto for condition $async$goto = 2; break; case 3: // after for // implicit return return 0; case 1: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, _catacomb$_tryPlaceCave$3(cave, x, y) { var t1, t2, t3, t4, t5, t6, t7, t8, _this = this, _s10_ = "_architect"; type$.Array2D_bool._as(cave); for (t1 = cave.bounds, t2 = A.RectIterator$(t1), t3 = cave._elements, t4 = t1.size.x, t5 = t3.length; t2.moveNext$0();) { t6 = t2._x; t7 = t2._y; cave._checkBounds$2(t6, t7); t8 = t7 * t4 + t6; if (!(t8 >= 0 && t8 < t5)) return A.ioore(t3, t8); if (t3[t8]) { t8 = _this.__Architecture__architect_F; t8 === $ && A.throwLateFieldNI(_s10_); if (!t8._canCarve$2(_this, new A.Vec(t6 + x, t7 + y))) return false; } } for (t1 = A.RectIterator$(t1); t1.moveNext$0();) { t2 = t1._x; t6 = t1._y; cave._checkBounds$2(t2, t6); t7 = t6 * t4 + t2; if (!(t7 >= 0 && t7 < t5)) return A.ioore(t3, t7); if (t3[t7]) { t7 = _this.__Architecture__architect_F; t7 === $ && A.throwLateFieldNI(_s10_); t7._carve$4(_this, t2 + x, t6 + y, null); } } return true; } }; A.Cavern.prototype = { build$0() { return new A._SyncStarIterable(this.build$body$Cavern(), type$._SyncStarIterable_String); }, build$body$Cavern() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 2, $async$errorStack = [], t2, t3, t4, t5, t6, t7, t8, cells1, cells2, pos, i, t0, t9, t10, t11, t12, t13, t14, walls, _i, here, t15, t16, t1; return function $async$build$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) $async$outer: switch ($async$goto) { case 0: // Function start t1 = $async$self.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI("_architect"); t2 = t1.stage.tiles.bounds.size; t3 = t2.x; t2 = t2.y; t4 = type$.nullable_bool; t5 = new A.Rect(new A.Vec(0, 0), new A.Vec(t3, t2)); t6 = t3 * t2; t7 = A.List_List$filled(t6, null, false, t4); t8 = type$.Array2D_nullable_bool; cells1 = new A.Array2D(t7, t5, t8); cells2 = new A.Array2D(A.List_List$filled(t6, null, false, t4), new A.Rect(new A.Vec(0, 0), new A.Vec(t3, t2)), t8); for (t2 = A.RectIterator$(t5); t2.moveNext$0();) { t4 = t2._x; t5 = t2._y; pos = new A.Vec(t4, t5); if (!t1._canCarve$2($async$self, pos)) continue; t6 = $.$get$rng().float$1(1); t8 = $async$self.__Architecture__region_F; t8 === $ && A.throwLateFieldNI("_region"); t8 = $async$self._cavern$_density$2(t8, pos); cells1._checkBounds$2(t4, t5); B.JSArray_methods.$indexSet(t7, t5 * t3 + t4, t6 < t8); } i = 0; case 3: // for condition if (!(i < 4)) { // goto after for $async$goto = 5; break; } for (t2 = cells1.bounds, t3 = t2.pos, t3 = new A.RectIterator(t2, t3.x - 1, t3.y), t4 = cells2.$ti._precomputed1, t5 = cells2._elements, t6 = cells2.bounds.size.x, t7 = cells1._elements, t8 = t2.size.x, t9 = t7.length; t3.moveNext$0();) { t10 = t3._x; t11 = t3._y; cells1._checkBounds$2(t10, t11); t12 = t11 * t8 + t10; if (!(t12 >= 0 && t12 < t9)) { A.ioore(t7, t12); // goto return $async$goto = 1; break $async$outer; } if (t7[t12] == null) continue; for (t13 = new A.Vec(t10, t11).get$neighbors(), t14 = t13.length, walls = 0, _i = 0; _i < t13.length; t13.length === t14 || (0, A.throwConcurrentModificationError)(t13), ++_i) { here = t13[_i]; if (t2.contains$1(0, here)) { t15 = here.x; t16 = here.y; cells1._checkBounds$2(t15, t16); t15 = t16 * t8 + t15; if (!(t15 >= 0 && t15 < t9)) { A.ioore(t7, t15); // goto return $async$goto = 1; break $async$outer; } t15 = !J.$eq$(t7[t15], false); } else t15 = true; if (t15) ++walls; } cells1._checkBounds$2(t10, t11); t12 = t7[t12]; t12.toString; t13 = t11 * t6 + t10; if (t12) { t12 = t4._as(walls >= 3); cells2._checkBounds$2(t10, t11); B.JSArray_methods.$indexSet(t5, t13, t12); } else { t12 = t4._as(walls >= 5); cells2._checkBounds$2(t10, t11); B.JSArray_methods.$indexSet(t5, t13, t12); } } $async$goto = 6; return $async$iterator._async$_current = "Round", 1; case 6: // after yield case 4: // for update ++i, t0 = cells2, cells2 = cells1, cells1 = t0; // goto for condition $async$goto = 3; break; case 5: // after for for (t2 = cells1.bounds, t3 = A.RectIterator$(t2), t4 = cells1._elements, t2 = t2.size.x, t5 = t4.length; t3.moveNext$0();) { t6 = t3._x; t7 = t3._y; cells1._checkBounds$2(t6, t7); t8 = t7 * t2 + t6; if (!(t8 >= 0 && t8 < t5)) { A.ioore(t4, t8); // goto return $async$goto = 1; break $async$outer; } if (J.$eq$(t4[t8], false)) t1._carve$4($async$self, t6, t7, null); } case 1: // return return 0; case 2: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, _cavern$_density$2(region, pos) { var t1, t2, distance, _this = this, _s10_ = "_architect"; switch (region.index) { case 0: return 0.45; case 1: t1 = _this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI(_s10_); return A.lerpDouble(pos.y, 0, t1.stage.tiles.bounds.size.y, 0.3, 0.7); case 2: t1 = _this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI(_s10_); t1 = t1.stage.tiles.bounds.size; t2 = t1.x; return A.lerpDouble(Math.max(t2 - pos.x - 1, pos.y), 0, Math.min(t2, t1.y), 0.3, 0.7); case 3: t1 = _this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI(_s10_); return A.lerpDouble(pos.x, 0, t1.stage.tiles.bounds.size.x, 0.3, 0.7); case 4: t1 = _this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI(_s10_); t1 = t1.stage.tiles.bounds.size; t2 = t1.x; t1 = t1.y; return A.lerpDouble(Math.max(t2 - pos.x - 1, t1 - pos.y - 1), 0, Math.min(t2, t1), 0.3, 0.7); case 5: t1 = _this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI(_s10_); return A.lerpDouble(pos.y, 0, t1.stage.tiles.bounds.size.y, 0.7, 0.3); case 6: t1 = _this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI(_s10_); t1 = t1.stage.tiles.bounds.size; t2 = t1.y; return A.lerpDouble(Math.max(pos.x, t2 - pos.y - 1), 0, Math.min(t1.x, t2), 0.3, 0.7); case 7: t1 = _this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI(_s10_); return A.lerpDouble(pos.x, 0, t1.stage.tiles.bounds.size.x, 0.7, 0.3); case 8: distance = Math.max(pos.x, pos.y); t1 = _this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI(_s10_); t1 = t1.stage.tiles.bounds.size; return A.lerpDouble(distance, 0, Math.min(t1.x, t1.y), 0.3, 0.7); } } }; A.Decorator.prototype = { decorate$0() { return new A._SyncStarIterable(this.decorate$body$Decorator(), type$._SyncStarIterable_String); }, decorate$body$Decorator() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 2, $async$errorStack = [], t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, stairCount, i, pos; return function $async$decorate$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) $async$outer: switch ($async$goto) { case 0: // Function start $async$self._findDoorways$0(); for (t1 = $async$self._architect, t2 = t1.stage, t3 = t2.tiles, t4 = t3.bounds, t5 = A.RectIterator$(t4), t1 = t1._owners, t6 = t1._elements, t7 = t1.bounds.size.x, t8 = t6.length, t9 = $async$self._tilesByArchitecture; t5.moveNext$0();) { t10 = t5._x; t11 = t5._y; t1._checkBounds$2(t10, t11); t12 = t11 * t7 + t10; if (!(t12 >= 0 && t12 < t8)) { A.ioore(t6, t12); // goto return $async$goto = 1; break $async$outer; } J.add$1$ax(t9.putIfAbsent$2(t6[t12], new A.Decorator_decorate_closure()), new A.Vec(t10, t11)); } $async$self._paintTiles$0(); $async$goto = 3; return $async$iterator._yieldStar$1($async$self._placeDecor$0()); case 3: // after yield stairCount = $.$get$rng().range$2(2, 4); for (t1 = t3._elements, t4 = t4.size.x, t5 = t1.length, i = 0; i < stairCount; ++i) { pos = t2.findOpenTile$0(); t6 = pos.x; t7 = pos.y; t3._checkBounds$2(t6, t7); t6 = t7 * t4 + t6; if (!(t6 >= 0 && t6 < t5)) { A.ioore(t1, t6); // goto return $async$goto = 1; break $async$outer; } t1[t6].type = $.$get$Tiles_stairs(); } t1 = t2.findOpenTile$0(); $async$self.__Decorator__heroPos_F !== $ && A.throwLateFieldAI("_heroPos"); $async$self.__Decorator__heroPos_F = t1; $async$goto = 4; return $async$iterator._yieldStar$1($async$self._spawnMonsters$0()); case 4: // after yield $async$goto = 5; return $async$iterator._yieldStar$1($async$self._dropItems$0()); case 5: // after yield case 1: // return return 0; case 2: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, _findDoorways$0() { var t1, t2, t3, t4, t5, t6, t7, pos, t8, _i, dir, t9, t10, t11, behind, doorway, _i0, neighbor, doorways = A._setArrayType([], type$.JSArray_Vec); for (t1 = this._architect.stage.tiles, t2 = t1.bounds, t3 = A.RectIterator$(t2.inflate$1(-1)), t4 = t1._elements, t2 = t2.size.x, t5 = t4.length; t3.moveNext$0();) { t6 = t3._x; t7 = t3._y; pos = new A.Vec(t6, t7); t1._checkBounds$2(t6, t7); t8 = t7 * t2 + t6; if (!(t8 >= 0 && t8 < t5)) return A.ioore(t4, t8); if (t4[t8].type !== $.$get$Tiles_passage()) continue; for (_i = 0; _i < 4; ++_i) { dir = B.List_iHk[_i]; t9 = pos.$add(0, dir); t10 = t9.x; t9 = t9.y; t1._checkBounds$2(t10, t9); t10 = t9 * t2 + t10; if (!(t10 >= 0 && t10 < t5)) return A.ioore(t4, t10); t10 = t4[t10].type; t9 = $.$get$Tiles_open(); if (t10 !== t9) continue; t10 = pos.$add(0, dir.get$rotate180()); t11 = t10.x; t10 = t10.y; t1._checkBounds$2(t11, t10); t11 = t10 * t2 + t11; if (!(t11 >= 0 && t11 < t5)) return A.ioore(t4, t11); behind = t4[t11].type; if (behind !== t9 && behind !== $.$get$Tiles_passage() && behind !== $.$get$Tiles_doorway()) continue; t9 = pos.$add(0, dir.get$rotateLeft90()); t10 = t9.x; t9 = t9.y; t1._checkBounds$2(t10, t9); t10 = t9 * t2 + t10; if (!(t10 >= 0 && t10 < t5)) return A.ioore(t4, t10); t10 = t4[t10].type; t9 = $.$get$Tiles_solid(); if (t10 !== t9) continue; t10 = pos.$add(0, dir.get$rotateRight90()); t11 = t10.x; t10 = t10.y; t1._checkBounds$2(t11, t10); t11 = t10 * t2 + t11; if (!(t11 >= 0 && t11 < t5)) return A.ioore(t4, t11); if (t4[t11].type !== t9) continue; t1._checkBounds$2(t6, t7); t4[t8].type = $.$get$Tiles_doorway(); B.JSArray_methods.add$1(doorways, pos); break; } } t3 = $.$get$rng(); B.JSArray_methods.shuffle$1(type$.List_Vec._as(doorways), t3._random); for (t3 = doorways.length, _i = 0; _i < doorways.length; doorways.length === t3 || (0, A.throwConcurrentModificationError)(doorways), ++_i) { doorway = doorways[_i]; t6 = doorway.get$x(); t7 = doorway.get$y(); t1._checkBounds$2(t6, t7); t6 = t7 * t2 + t6; if (!(t6 >= 0 && t6 < t5)) return A.ioore(t4, t6); t6 = t4[t6].type; t7 = $.$get$Tiles_doorway(); if (t6 !== t7) continue; for (t6 = doorway.get$cardinalNeighbors(), t8 = t6.length, _i0 = 0; _i0 < t6.length; t6.length === t8 || (0, A.throwConcurrentModificationError)(t6), ++_i0) { neighbor = t6[_i0]; t9 = neighbor.x; t10 = neighbor.y; t1._checkBounds$2(t9, t10); t9 = t10 * t2 + t9; if (!(t9 >= 0 && t9 < t5)) return A.ioore(t4, t9); if (t4[t9].type === t7) { t9 = $.$get$rng(); t9 = t9._random.nextInt$1(2) === 0 ? doorway : neighbor; t10 = t9.get$x(); t9 = t9.get$y(); t1._checkBounds$2(t10, t9); t10 = t9 * t2 + t10; if (!(t10 >= 0 && t10 < t5)) return A.ioore(t4, t10); t4[t10].type = $.$get$Tiles_passage(); } } } }, _paintTiles$0() { var t1, t2, entry, architecture, paintStyle, painter, t3, t4, t5, t6, t7, t8, t9, t10; for (t1 = this._tilesByArchitecture, t1 = new A.LinkedHashMapEntriesIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapEntriesIterable<1,2>")).get$iterator(0), t2 = this._architect; t1.moveNext$0();) { entry = t1.__js_helper$_current; architecture = entry.key; paintStyle = $.$get$PaintStyle_rock(); if (architecture != null) paintStyle = architecture.get$paintStyle(); painter = new A.Painter(this, t2, architecture); for (t3 = J.get$iterator$ax(entry.value), t4 = t2.stage.tiles, t5 = t4._elements, t6 = t4.bounds.size.x, t7 = t5.length; t3.moveNext$0();) { t8 = t3.get$current(); t9 = paintStyle.paintTile$2(painter, t8); t10 = t8.get$x(); t8 = t8.get$y(); t4._checkBounds$2(t10, t8); t10 = t8 * t6 + t10; if (!(t10 >= 0 && t10 < t7)) return A.ioore(t5, t10); t5[t10].type = t9; ++painter._painted; } } }, _placeDecor$0() { return new A._SyncStarIterable(this._placeDecor$body$Decorator(), type$._SyncStarIterable_String); }, _placeDecor$body$Decorator() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 2, $async$errorStack = [], t1, t2, t3, t4, entry, architecture, tiles, t5, painter, t6, t7, result, decorTiles, tries, tries0, decor, i, tile, max, j; return function $async$_placeDecor$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) switch ($async$goto) { case 0: // Function start t1 = $async$self._tilesByArchitecture, t1 = new A.LinkedHashMapEntriesIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapEntriesIterable<1,2>")).get$iterator(0), t2 = $async$self._architect, t3 = t2.depth, t4 = type$.List_Vec; case 3: // for condition if (!t1.moveNext$0()) { // goto after for $async$goto = 4; break; } entry = t1.__js_helper$_current; architecture = entry.key; if (architecture == null) { // goto for condition $async$goto = 3; break; } tiles = J.toList$0$ax(entry.value); t5 = $.$get$rng(); B.JSArray_methods.shuffle$1(t4._as(tiles), t5._random); painter = new A.Painter($async$self, t2, architecture); t6 = tiles.length; t7 = architecture.__Architecture__style_F; t7 === $ && A.throwLateFieldNI("_style"); t6 *= t7.decorDensity; result = B.JSNumber_methods.floor$0(t6); if (t5.float$1(1) < t6 - result) ++result; decorTiles = B.JSNumber_methods.ceil$0(t5.float$2(result * 0.8, result * 1.2)); tries = 0; case 5: // for condition // trivial condition tries0 = tries + 1; if (!(tries < decorTiles && painter._painted < decorTiles)) { // goto after for $async$goto = 6; break; } decor = A.Decor_choose(t3, t7.decorTheme); if (decor == null) { // goto break c$1 $async$goto = 7; break; } i = 0; case 8: // for condition if (!(i < tiles.length)) { // goto after for $async$goto = 10; break; } tile = tiles[i]; if (!decor.canPlace$2(painter, tile)) { // goto for update $async$goto = 9; break; } decor.place$2(painter, tile); t5 = $.$get$rng(); max = tiles.length; j = t5._random.nextInt$1(max - i) + i; t5 = tiles.length; if (!(j >= 0 && j < t5)) { A.ioore(tiles, j); // goto return $async$goto = 1; break; } t6 = tiles[j]; if (!(i < t5)) { A.ioore(tiles, i); // goto return $async$goto = 1; break; } tiles[i] = t6; tiles[j] = tile; $async$goto = 11; return $async$iterator._async$_current = "Placed decor", 1; case 11: // after yield // goto after for $async$goto = 10; break; case 9: // for update ++i; // goto for condition $async$goto = 8; break; case 10: // after for case 7: // break c$1 tries = tries0; // goto for condition $async$goto = 5; break; case 6: // after for // goto for condition $async$goto = 3; break; case 4: // after for case 1: // return return 0; case 2: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, _spawnMonsters$0() { return new A._SyncStarIterable(this._spawnMonsters$body$Decorator(), type$._SyncStarIterable_String); }, _spawnMonsters$body$Decorator() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 2, $async$errorStack = [], t1, t2, t3, t4, t5, t6, densityMap, flow, t7, t8, t9, t10, pos, distance, goalMonsters, t11, spawnedMonsters, t12, t13, t14, max, t15, group, spawned; return function $async$_spawnMonsters$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) $async$outer: switch ($async$goto) { case 0: // Function start spawned = A.LinkedHashSet_LinkedHashSet$_empty(type$.Architecture); for (t1 = $async$self._tilesByArchitecture, t1 = new A.LinkedHashMapKeyIterator(t1, t1._modifications, t1._first, A._instanceType(t1)._eval$1("LinkedHashMapKeyIterator<1>")), t2 = $async$self._architect; t1.moveNext$0();) { t3 = t1.__js_helper$_current; if (t3 == null) continue; if (t3.spawnMonsters$1(new A.Painter($async$self, t2, t3))) spawned.add$1(0, t3); } t1 = t2.stage; t3 = t1.tiles; t4 = t3.bounds; t5 = t4.size; t6 = t5.x; t5 = t5.y; densityMap = new A.DensityMap(new A.Array2D(A.List_List$filled(t6 * t5, 0, false, type$.int), new A.Rect(new A.Vec(0, 0), new A.Vec(t6, t5)), type$.Array2D_int)); t5 = $async$self.__Decorator__heroPos_F; t5 === $ && A.throwLateFieldNI("_heroPos"); flow = A.MotilityFlow$(t1, t5, $.$get$Motility_all(), false, null, null); for (t1 = A.RectIterator$(t4.inflate$1(-1)), t4 = t2._owners, t5 = t4._elements, t7 = t4.bounds.size.x, t8 = t5.length; t1.moveNext$0();) { t9 = t1._x; t10 = t1._y; pos = new A.Vec(t9, t10); t4._checkBounds$2(t9, t10); t9 = t10 * t7 + t9; if (!(t9 >= 0 && t9 < t8)) { A.ioore(t5, t9); // goto return $async$goto = 1; break $async$outer; } t9 = t5[t9]; if (t9 == null) continue; if (spawned.contains$1(0, t9)) continue; distance = flow.costAt$1(pos); if (distance == null) continue; if (distance < 10) continue; t10 = Math.sqrt(distance - 10); t9 = t9.__Architecture__style_F; t9 === $ && A.throwLateFieldNI("_style"); densityMap.$indexSet(0, pos, B.JSNumber_methods.toInt$0((4 + t10) * t9.monsterDensity)); } t1 = densityMap._possibleTiles; t9 = $.$get$rng(); goalMonsters = t1 * 0.02 * t9.float$2(1, 1.4); t1 = t3._elements, t10 = t1.length, t2 = t2.depth, t11 = type$.List_String, spawnedMonsters = 0; case 3: // for condition if (!(spawnedMonsters < goalMonsters)) { // goto after for $async$goto = 4; break; } pos = densityMap.choose$0(); if (pos == null) { // goto after for $async$goto = 4; break; } t12 = pos.x; t13 = pos.y; t4._checkBounds$2(t12, t13); t14 = t13 * t7 + t12; if (!(t14 >= 0 && t14 < t8)) { A.ioore(t5, t14); // goto return $async$goto = 1; break; } t14 = t5[t14].__Architecture__style_F; t14 === $ && A.throwLateFieldNI("_style"); t14 = t11._as(t14.monsterGroups); max = t14.length; t15 = t9._random.nextInt$1(max); if (!(t15 >= 0 && t15 < t14.length)) { A.ioore(t14, t15); // goto return $async$goto = 1; break; } group = t14[t15]; t15 = $.$get$Monsters_breeds().tryChoose$2$tag(t2, group); t15.toString; t3._checkBounds$2(t12, t13); t12 = t13 * t6 + t12; if (!(t12 >= 0 && t12 < t10)) { A.ioore(t1, t12); // goto return $async$goto = 1; break; } if ((t1[t12].type.motility._bitMask & t15.motility._bitMask) === 0) { // goto for condition $async$goto = 3; break; } if (!$async$self._canSpawn$1(t15)) { // goto for condition $async$goto = 3; break; } spawned = $async$self._spawnMonster$3(densityMap, pos, t15); $async$goto = 5; return $async$iterator._async$_current = "Spawned monster", 1; case 5: // after yield spawnedMonsters += spawned; // goto for condition $async$goto = 3; break; case 4: // after for case 1: // return return 0; case 2: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, chooseBreed$3$includeParentTags$tag(depth, includeParentTags, tag) { var t1; for (;;) { t1 = $.$get$Monsters_breeds().tryChoose$3$includeParents$tag(depth, includeParentTags, tag); t1.toString; if (this._canSpawn$1(t1)) return t1; } }, _canSpawn$1(breed) { if (!breed.flags.unique) return true; if (this._architect.lore.slain$1(breed) > 0) return false; if (this._spawnedUniques.contains$1(0, breed)) return false; return true; }, _spawnMonster$3(density, pos, breed) { var spawn, breeds, t1, t2, t3, t4, here, _null = null, _box_0 = {}, isCorpse = !breed.flags.unique && $.$get$rng().range$1(10) === 0; _box_0.count = 0; spawn = new A.Decorator__spawnMonster_spawn(_box_0, this, isCorpse, density); breeds = breed.spawnAll$0(); if (0 >= breeds.length) return A.ioore(breeds, 0); spawn.call$2(breeds[0], pos); for (t1 = A.SubListIterable$(breeds, 1, _null, A._arrayInstanceType(breeds)._precomputed1), t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = this._architect.stage, t2 = t2._eval$1("ListIterable.E"); t1.moveNext$0();) { t4 = t1._current; if (t4 == null) t4 = t2._as(t4); here = A.MotilityFlow$(t3, pos, t4.motility, _null, _null, _null).get$reachable().firstWhere$2$orElse(0, new A.Decorator__spawnMonster_closure(), new A.Decorator__spawnMonster_closure0()); if (here.$eq(0, new A.Vec(-1, -1))) break; spawn.call$2(t4, here); } return _box_0.count; }, _dropItems$0() { return new A._SyncStarIterable(this._dropItems$body$Decorator(), type$._SyncStarIterable_String); }, _dropItems$body$Decorator() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 2, $async$errorStack = [], densityMap, flow, t7, t8, t9, t10, t11, t12, t13, pos, t14, distance, goalPrice, totalPrice, items, _i, t1, t2, t3, t4, t5, t6; return function $async$_dropItems$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) $async$outer: switch ($async$goto) { case 0: // Function start t1 = $async$self._architect; t2 = t1.stage; t3 = t2.tiles; t4 = t3.bounds; t5 = t4.size; t6 = t5.x; t5 = t5.y; densityMap = new A.DensityMap(new A.Array2D(A.List_List$filled(t6 * t5, 0, false, type$.int), new A.Rect(new A.Vec(0, 0), new A.Vec(t6, t5)), type$.Array2D_int)); t5 = $async$self.__Decorator__heroPos_F; t5 === $ && A.throwLateFieldNI("_heroPos"); flow = A.MotilityFlow$(t2, t5, $.$get$Motility_doorAndWalk(), false, null, null); for (t4 = A.RectIterator$(t4.inflate$1(-1)), t5 = t3._elements, t7 = t5.length, t8 = t1._owners, t9 = t8._elements, t10 = t8.bounds.size.x, t11 = t9.length; t4.moveNext$0();) { t12 = t4._x; t13 = t4._y; pos = new A.Vec(t12, t13); t8._checkBounds$2(t12, t13); t14 = t13 * t10 + t12; if (!(t14 >= 0 && t14 < t11)) { A.ioore(t9, t14); // goto return $async$goto = 1; break $async$outer; } t14 = t9[t14]; if (t14 == null) continue; distance = flow.costAt$1(pos); if (distance == null) continue; t3._checkBounds$2(t12, t13); t12 = t13 * t6 + t12; if (!(t12 >= 0 && t12 < t7)) { A.ioore(t5, t12); // goto return $async$goto = 1; break $async$outer; } if ((t5[t12].type.motility._bitMask & $.$get$Motility_walk()._bitMask) === 0) continue; t12 = Math.sqrt(distance + 1); t14 = t14.__Architecture__style_F; t14 === $ && A.throwLateFieldNI("_style"); densityMap.$indexSet(0, pos, B.JSNumber_methods.toInt$0((10 + t12) * t14.itemDensity)); } t1 = t1.depth; goalPrice = densityMap._possibleTiles * (0.05 + (t1 - 1) * 0.05); goalPrice += $.$get$rng().float$1(goalPrice * 0.2); totalPrice = 0; case 3: // for condition if (!(totalPrice < goalPrice)) { // goto after for $async$goto = 4; break; } pos = densityMap.choose$0(); if (pos == null) { // goto after for $async$goto = 4; break; } items = t2.placeDrops$3$depth(pos, $.$get$_floorDrops().tryChoose$1(t1).drop, t1); for (t3 = items.length, _i = 0; _i < items.length; items.length === t3 || (0, A.throwConcurrentModificationError)(items), ++_i) totalPrice += Math.max(items[_i].get$price(), 1); densityMap.reduceAround$4(t2, pos, $.$get$Motility_doorAndWalk(), 3); $async$goto = 5; return $async$iterator._async$_current = "Spawned item", 1; case 5: // after yield // goto for condition $async$goto = 3; break; case 4: // after for case 1: // return return 0; case 2: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; } }; A.Decorator_decorate_closure.prototype = { call$0() { return A._setArrayType([], type$.JSArray_Vec); }, $signature: 45 }; A.Decorator__spawnMonster_spawn.prototype = { call$2(breed, pos) { var _this = this, t1 = _this.$this, t2 = t1._architect.stage; if (t2._actorsByTile.$get$2(pos.get$x(), pos.get$y()) != null) return; if (!t1._canSpawn$1(breed)) return; if (breed.flags.unique) t1._spawnedUniques.add$1(0, breed); if (_this.isCorpse) t2.placeDrops$3$depth(pos, breed.drop, breed.depth); else { t2.addActor$1(breed.spawn$1(pos)); ++_this._box_0.count; t1 = _this.density; if (t1 != null) t1.reduceAround$4(t2, pos, $.$get$Motility_all(), 5); } }, $signature: 68 }; A.Decorator__spawnMonster_closure.prototype = { call$1(__wc0_formal) { type$.Vec._as(__wc0_formal); return true; }, $signature: 1 }; A.Decorator__spawnMonster_closure0.prototype = { call$0() { return new A.Vec(-1, -1); }, $signature: 69 }; A.DensityMap.prototype = { $indexSet(_, pos, value) { var _this = this, t1 = _this._density, old = t1.$get$2(pos.get$x(), pos.get$y()); _this._total = _this._total - old + value; t1.$ti._precomputed1._as(value); t1.$set$3(pos.get$x(), pos.get$y(), value); if (old === 0 && value > 0) ++_this._possibleTiles; if (old > 0 && value === 0) --_this._possibleTiles; }, choose$0() { var n, t2, t3, t4, t5, t6, t7, pos, density, t1 = this._total; if (t1 === 0) return null; n = $.$get$rng().range$1(t1); for (t1 = this._density, t2 = t1.bounds, t3 = A.RectIterator$(t2), t4 = t1._elements, t2 = t2.size.x, t5 = t4.length; t3.moveNext$0();) { t6 = t3._x; t7 = t3._y; pos = new A.Vec(t6, t7); t1._checkBounds$2(t6, t7); t6 = t7 * t2 + t6; if (!(t6 >= 0 && t6 < t5)) return A.ioore(t4, t6); density = t4[t6]; if (n < density) return pos; n -= density; } throw A.wrapException(A.AssertionError$("Unreachable.")); }, reduceAround$4(stage, start, motility, range) { var flow, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10; this.$indexSet(0, start, 0); flow = A.MotilityFlow$(stage, start, motility, null, null, range); for (t1 = flow.get$reachable(), t2 = t1.$ti, t1 = new A._SyncStarIterator(t1._outerHelper(), t2._eval$1("_SyncStarIterator<1>")), t3 = this._density, t4 = t3._elements, t5 = t3.bounds.size.x, t6 = t4.length, t2 = t2._precomputed1; t1.moveNext$0();) { t7 = t1._async$_current; if (t7 == null) t7 = t2._as(t7); t8 = flow.costAt$1(t7); t8.toString; t9 = t7.get$x(); t10 = t7.get$y(); t3._checkBounds$2(t9, t10); t9 = t10 * t5 + t9; if (!(t9 >= 0 && t9 < t6)) return A.ioore(t4, t9); this.$indexSet(0, t7, B.JSNumber_methods.toInt$0(t4[t9] * (t8 / range))); } } }; A.Dungeon.prototype = { get$paintStyle() { return $.$get$PaintStyle_flagstone(); }, build$0() { return new A._SyncStarIterable(this.build$body$Dungeon(), type$._SyncStarIterable_String); }, build$body$Dungeon() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 1, $async$errorStack = [], t2, t3, t4, room, placed, t5, xMax, yMax, i, t6, xMin, yMin, yMax0, xMax0, t7, t1, failed; return function $async$build$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) switch ($async$goto) { case 0: // Function start t1 = $async$self._shapes; failed = 0; case 2: // for condition // trivial condition t2 = $async$self.__Architecture__architect_F; t2 === $ && A.throwLateFieldNI("_architect"); t3 = t2.stage.tiles.bounds.size; t4 = t3.x; t3 = t3.y; if (!(t2._carvedTiles / ((t4 - 2) * (t3 - 2)) < 0.25 && failed < 100)) { // goto after for $async$goto = 3; break; } room = A.Room_create(t2.depth, t1); t2 = room.bounds.size; t5 = t2.x; t2 = t2.y; xMax = t4 - t5; yMax = t3 - t2; i = 0; case 4: // for condition // trivial condition if (!(i < 400)) { placed = false; // goto after for $async$goto = 5; break; } t6 = $async$self.__Architecture__region_F; t6 === $ && A.throwLateFieldNI("_region"); xMin = 1; yMin = 1; switch (t6.index) { case 0: yMax0 = yMax; xMax0 = xMax; break; case 1: yMax0 = B.JSInt_methods._tdivFast$1(t3, 2) - t2; xMax0 = xMax; break; case 2: xMin = B.JSInt_methods._tdivFast$1(t4, 2); yMax0 = B.JSInt_methods._tdivFast$1(t3, 2) - t2; xMax0 = xMax; break; case 3: xMin = B.JSInt_methods._tdivFast$1(t4, 2); yMax0 = yMax; xMax0 = xMax; break; case 4: xMin = B.JSInt_methods._tdivFast$1(t4, 2); yMin = B.JSInt_methods._tdivFast$1(t3, 2); yMax0 = yMax; xMax0 = xMax; break; case 5: yMin = B.JSInt_methods._tdivFast$1(t3, 2); yMax0 = yMax; xMax0 = xMax; break; case 6: xMax0 = B.JSInt_methods._tdivFast$1(t4, 2) - t5; yMin = B.JSInt_methods._tdivFast$1(t3, 2); yMax0 = yMax; break; case 7: xMax0 = B.JSInt_methods._tdivFast$1(t4, 2) - t5; yMax0 = yMax; break; case 8: xMax0 = B.JSInt_methods._tdivFast$1(t4, 2) - t5; yMax0 = B.JSInt_methods._tdivFast$1(t3, 2) - t2; break; default: yMax0 = yMax; xMax0 = xMax; } t6 = $.$get$rng(); t6 = t6._random; t7 = t6.nextInt$1(xMax0 - xMin); $async$goto = $async$self._dungeon$_tryPlaceRoom$3(room, t7 + xMin, t6.nextInt$1(yMax0 - yMin) + yMin) ? 6 : 7; break; case 6: // then $async$goto = 8; return $async$iterator._async$_current = "room", 1; case 8: // after yield placed = true; // goto after for $async$goto = 5; break; case 7: // join ++i; // goto for condition $async$goto = 4; break; case 5: // after for if (!placed) ++failed; // goto for condition $async$goto = 2; break; case 3: // after for // implicit return return 0; case 1: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, _dungeon$_tryPlaceRoom$3(room, x, y) { var t1, t2, t3, t4, t5, t6, t7, t8, tile, t9, t10, _this = this, _s10_ = "_architect"; type$.Array2D_RoomTile._as(room); if (!_this.canPlaceRoom$3(room, x, y)) return false; for (t1 = room.bounds, t2 = A.RectIterator$(t1), t3 = room._elements, t1 = t1.size.x, t4 = t3.length; t2.moveNext$0();) { t5 = t2._x; t6 = t2._y; t7 = t5 + x; t8 = t6 + y; room._checkBounds$2(t5, t6); t5 = t6 * t1 + t5; if (!(t5 >= 0 && t5 < t4)) return A.ioore(t3, t5); tile = t3[t5]; t5 = tile.tile; if (!(t5 == null && tile.direction === B.Direction_0_0_0_none) && t5 !== $.$get$Tiles_solid() && tile.direction === B.Direction_0_0_0_none) { t6 = _this.__Architecture__architect_F; t6 === $ && A.throwLateFieldNI(_s10_); t6._carve$4(_this, t7, t8, t5); } else { t6 = $.$get$Tiles_solid(); if (t5 === t6) { t5 = _this.__Architecture__architect_F; t5 === $ && A.throwLateFieldNI(_s10_); t5 = t5.stage.tiles; t5._checkBounds$2(t7, t8); t9 = t5._elements; t10 = t8 * t5.bounds.size.x + t7; if (!(t10 >= 0 && t10 < t9.length)) return A.ioore(t9, t10); if (t9[t10].type === $.$get$Tiles_unformed()) { t5._checkBounds$2(t7, t8); t9[t10].type = t6; } } } } return true; } }; A.Keep.prototype = { get$paintStyle() { return $.$get$PaintStyle_granite(); }, build$0() { return new A._SyncStarIterable(this.build$body$Keep(), type$._SyncStarIterable_String); }, build$body$Keep() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 1, $async$errorStack = [], startingRooms, i, t1; return function $async$build$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) switch ($async$goto) { case 0: // Function start t1 = $async$self.__Architecture__region_F; t1 === $ && A.throwLateFieldNI("_region"); startingRooms = t1 === B.Region_everywhere_0_everywhere && $async$self._maxRooms == null ? 20 : 1; i = 0; case 2: // for condition if (!(i < startingRooms)) { // goto after for $async$goto = 4; break; } $async$goto = 5; return $async$iterator._yieldStar$1($async$self._growRooms$0()); case 5: // after yield case 3: // for update ++i; // goto for condition $async$goto = 2; break; case 4: // after for // implicit return return 0; case 1: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, spawnMonsters$1(painter) { var tiles, t3, t4, t5, _i, pos, t6, max, t7, t1 = painter._decorator, t2 = t1._tilesByArchitecture.$index(0, painter._architecture); t2.toString; t2 = J.where$1$ax(t2, new A.Keep_spawnMonsters_closure(painter)); tiles = A.List_List$_of(t2, t2.$ti._eval$1("Iterable.E")); t2 = $.$get$rng()._random; B.JSArray_methods.shuffle$1(type$.List_Vec._as(tiles), t2); for (t3 = tiles.length, t4 = painter._painter$_architect.depth, t5 = type$.List_String, _i = 0; _i < tiles.length; tiles.length === t3 || (0, A.throwConcurrentModificationError)(tiles), ++_i) { pos = tiles[_i]; if (t2.nextInt$1(20) !== 0) continue; t6 = this.__Architecture__style_F; t6 === $ && A.throwLateFieldNI("_style"); t6 = t5._as(t6.monsterGroups); max = t6.length; t7 = t2.nextInt$1(max); if (!(t7 >= 0 && t7 < t6.length)) return A.ioore(t6, t7); t1._spawnMonster$3(null, pos, t1.chooseBreed$3$includeParentTags$tag(t4, null, t6[t7])); } return true; }, _growRooms$0() { return new A._SyncStarIterable(this._growRooms$body$Keep(), type$._SyncStarIterable_String); }, _growRooms$body$Keep() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 2, $async$errorStack = [], t1, t2, t3, t4, t5, junction, t6, t7, t8; return function $async$_growRooms$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) switch ($async$goto) { case 0: // Function start if (!$async$self._tryPlaceStartingRoom$0()) { // goto return $async$goto = 1; break; } t1 = $async$self._junctions, t2 = t1._junctions, t3 = t1._byPosition, t4 = $async$self._maxRooms, t5 = t4 != null; case 3: // for condition if (!(t2.length !== 0)) { // goto after for $async$goto = 4; break; } junction = t1.takeNext$0(); t6 = junction.position; t7 = t6.$add(0, junction.direction); t8 = $async$self.__Architecture__architect_F; t8 === $ && A.throwLateFieldNI("_architect"); if (!t8._canCarve$2($async$self, t7)) { // goto for condition $async$goto = 3; break; } $async$goto = $async$self._tryAttachRoom$1(junction) ? 5 : 7; break; case 5: // then $async$goto = 8; return $async$iterator._async$_current = "Room", 1; case 8: // after yield t6 = ++$async$self._placedRooms; if (t5 && t6 >= t4) { // goto after for $async$goto = 4; break; } // goto join $async$goto = 6; break; case 7: // else if (junction.tries < 5) { t3.$indexSet(0, t6, junction); B.JSArray_methods.add$1(t2, junction); } case 6: // join // goto for condition $async$goto = 3; break; case 4: // after for case 1: // return return 0; case 2: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, _tryPlaceStartingRoom$0() { var room, i, pos, t1 = this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI("_architect"); room = A.Room_create(t1.depth, B.RoomShapes_0); for (i = 0; i < 100; ++i) { pos = this._startLocation$1(room); if (this._tryPlaceRoom$3(room, pos.x, pos.y)) return true; } return false; }, _startLocation$1(room) { var t1, t2, t3, t4, xMax, yMax, t5, yMin, xMin; type$.Array2D_RoomTile._as(room); t1 = this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI("_architect"); t1 = t1.stage.tiles.bounds.size; t2 = t1.x; t3 = room.bounds.size; t4 = t3.x; xMax = t2 - t4 - 1; t1 = t1.y; t3 = t3.y; yMax = t1 - t3 - 1; t5 = this.__Architecture__region_F; t5 === $ && A.throwLateFieldNI("_region"); t5 = t5.index; yMin = 1; switch (t5) { case 8: case 1: case 2: yMax = Math.max(1, B.JSNumber_methods.toInt$0(t1 * 0.25) - t3); break; case 6: case 5: case 4: yMin = B.JSNumber_methods.toInt$0(t1 * 0.75); break; case 0: case 3: case 7: break; } xMin = 1; switch (t5) { case 8: case 7: case 6: xMax = Math.max(1, B.JSNumber_methods.toInt$0(t2 * 0.25) - t4); break; case 2: case 3: case 4: xMin = B.JSNumber_methods.toInt$0(t2 * 0.75); break; case 0: case 1: case 5: break; } if (xMax < xMin) xMax = xMin; if (yMax < yMin) yMax = yMin; t1 = $.$get$rng(); return new A.Vec(t1.range$2(xMin, xMax), t1.range$2(yMin, yMax)); }, _regionContains$1(pos) { var _this = this, _s10_ = "_architect", diagonal = new A.Keep__regionContains_diagonal(_this), t1 = _this.__Architecture__region_F; t1 === $ && A.throwLateFieldNI("_region"); switch (t1.index) { case 0: t1 = 1; break; case 1: t1 = _this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI(_s10_); t1 = A.lerpDouble(pos.y, 0, t1.stage.tiles.bounds.size.y, 2, -3); break; case 2: t1 = _this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI(_s10_); t1 = diagonal.call$2(t1.stage.tiles.bounds.size.x - pos.x - 1, pos.y); break; case 3: t1 = _this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI(_s10_); t1 = A.lerpDouble(pos.x, 0, t1.stage.tiles.bounds.size.x, -3, 2); break; case 4: t1 = _this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI(_s10_); t1 = t1.stage.tiles.bounds.size; t1 = diagonal.call$2(t1.x - pos.x - 1, t1.y - pos.y - 1); break; case 5: t1 = _this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI(_s10_); t1 = A.lerpDouble(pos.y, 0, t1.stage.tiles.bounds.size.y, -3, 2); break; case 6: t1 = _this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI(_s10_); t1 = diagonal.call$2(pos.x, t1.stage.tiles.bounds.size.y - pos.y - 1); break; case 7: t1 = _this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI(_s10_); t1 = A.lerpDouble(pos.x, 0, t1.stage.tiles.bounds.size.x, 2, -3); break; case 8: t1 = diagonal.call$2(pos.x, pos.y); break; default: t1 = null; } return $.$get$rng().float$1(1) < t1; }, _tryAttachRoom$1(junction) { var room, t2, t3, junctions, _i, roomPos, t1 = this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI("_architect"); room = A.Room_create(t1.depth, B.RoomShapes_0); t1 = room.bounds; t2 = A._instanceType(t1); t3 = t2._eval$1("WhereIterable"); junctions = A.List_List$_of(new A.WhereIterable(t1, t2._eval$1("bool(Iterable.E)")._as(new A.Keep__tryAttachRoom_closure(room, junction.direction.get$rotate180())), t3), t3._eval$1("Iterable.E")); t1 = $.$get$rng(); B.JSArray_methods.shuffle$1(type$.List_Vec._as(junctions), t1._random); for (t1 = junctions.length, t2 = junction.position, _i = 0; _i < junctions.length; junctions.length === t1 || (0, A.throwConcurrentModificationError)(junctions), ++_i) { roomPos = t2.$sub(0, junctions[_i]); if (this._tryPlaceRoom$3(room, roomPos.x, roomPos.y)) return true; } return false; }, _tryPlaceRoom$3(room, x, y) { var junctions, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, here, tile, t11, t12, junction, _i, junction0, _this = this, _s10_ = "_architect"; type$.Array2D_RoomTile._as(room); if (!_this.canPlaceRoom$3(room, x, y)) return false; junctions = A._setArrayType([], type$.JSArray_Junction); for (t1 = room.bounds, t2 = A.RectIterator$(t1), t3 = room._elements, t1 = t1.size.x, t4 = t3.length, t5 = _this._junctions, t6 = t5._byPosition, t5 = t5._junctions; t2.moveNext$0();) { t7 = t2._x; t8 = t2._y; t9 = t7 + x; t10 = t8 + y; here = new A.Vec(t9, t10); room._checkBounds$2(t7, t8); t7 = t8 * t1 + t7; if (!(t7 >= 0 && t7 < t4)) return A.ioore(t3, t7); tile = t3[t7]; t7 = tile.direction; if (t7 !== B.Direction_0_0_0_none) { if (_this._regionContains$1(here)) B.JSArray_methods.add$1(junctions, new A.Junction(here, t7)); } else { t7 = tile.tile; if (t7 != null) t8 = t7 !== $.$get$Tiles_solid(); else t8 = false; if (t8) { t8 = _this.__Architecture__architect_F; t8 === $ && A.throwLateFieldNI(_s10_); t8._carve$4(_this, t9, t10, t7); } else { t8 = $.$get$Tiles_solid(); if (t7 === t8) { t7 = _this.__Architecture__architect_F; t7 === $ && A.throwLateFieldNI(_s10_); t7 = t7.stage.tiles; t7._checkBounds$2(t9, t10); t11 = t7._elements; t12 = t10 * t7.bounds.size.x + t9; if (!(t12 >= 0 && t12 < t11.length)) return A.ioore(t11, t12); if (t11[t12].type === $.$get$Tiles_unformed()) { t7._checkBounds$2(t9, t10); t11[t12].type = t8; } junction = t6.remove$1(0, here); if (junction != null) B.JSArray_methods.remove$1(t5, junction); } } } } t1 = $.$get$rng(); B.JSArray_methods.shuffle$1(type$.List_Junction._as(junctions), t1._random); for (t1 = junctions.length, _i = 0; _i < junctions.length; junctions.length === t1 || (0, A.throwConcurrentModificationError)(junctions), ++_i) { junction = junctions[_i]; t2 = junction.position; junction0 = t6.remove$1(0, t2); if (junction0 != null) B.JSArray_methods.remove$1(t5, junction0); t6.$indexSet(0, t2, junction); B.JSArray_methods.add$1(t5, junction); } return true; } }; A.Keep_spawnMonsters_closure.prototype = { call$1(pos) { type$.Vec._as(pos); return (this.painter._painter$_architect.stage.tiles.$get$2(pos.get$x(), pos.get$y()).type.motility._bitMask & $.$get$Motility_walk()._bitMask) !== 0; }, $signature: 1 }; A.Keep__regionContains_diagonal.prototype = { call$2(xDistance, yDistance) { var t1 = this.$this.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI("_architect"); t1 = t1.stage.tiles.bounds.size; return A.lerpDouble(xDistance + yDistance, 0, t1.x + t1.y, 2, -3); }, $signature: 70 }; A.Keep__tryAttachRoom_closure.prototype = { call$1(pos) { type$.Vec._as(pos); return this.room.$get$2(pos.get$x(), pos.get$y()).direction === this.direction; }, $signature: 1 }; A.Junction.prototype = {}; A.TakeFrom.prototype = { _enumToString$0() { return "TakeFrom." + this._core$_name; } }; A.JunctionSet.prototype = { takeNext$0() { var t1, _this = this; switch (_this._takeFrom.index) { case 0: t1 = _this._junctions; if (0 >= t1.length) return A.ioore(t1, -1); t1 = t1.pop(); break; case 1: t1 = B.JSArray_methods.removeAt$1(_this._junctions, 0); break; case 2: t1 = $.$get$rng().take$1$1(0, _this._junctions, type$.Junction); break; default: t1 = null; } _this._byPosition.remove$1(0, t1.position); ++t1.tries; return t1; } }; A.Lake.prototype = { build$0() { return new A._SyncStarIterable(this.build$body$Lake(), type$._SyncStarIterable_String); }, build$body$Lake() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 1, $async$errorStack = [], i, t1, lakeCount; return function $async$build$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) switch ($async$goto) { case 0: // Function start t1 = $.$get$rng(); lakeCount = t1.inclusive$2(1, 2); i = 0; case 2: // for condition if (!(i < lakeCount)) { // goto after for $async$goto = 4; break; } $async$self._placeLake$1(A.Blob_make(t1._random.nextInt$1(16) + 16)); $async$goto = 5; return $async$iterator._async$_current = "Placing lake", 1; case 5: // after yield case 3: // for update ++i; // goto for condition $async$goto = 2; break; case 4: // after for // implicit return return 0; case 1: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, _placeLake$1(lake) { var t1, t2, t3, t4, t5, t6, t7, t8, x, y, t9, t10, t11, t12, t13, t14, t15; type$.Array2D_bool._as(lake); t1 = $.$get$rng(); t2 = this.__Architecture__architect_F; t2 === $ && A.throwLateFieldNI("_architect"); t3 = t2.stage.tiles; t4 = t3.bounds.size; t5 = t4.x; t6 = lake.bounds; t7 = t6.size; t8 = t7.x; x = t1.range$2(0, t5 - t8); y = t1.range$2(0, t4.y - t7.y); for (t1 = A.RectIterator$(t6), t4 = lake._elements, t6 = t4.length, t7 = t3._elements, t9 = t7.length, t2 = t2._owners, t10 = t2.$ti._precomputed1, t11 = t2._elements, t12 = t2.bounds.size.x; t1.moveNext$0();) { t13 = t1._x; t14 = t1._y; lake._checkBounds$2(t13, t14); t15 = t14 * t8 + t13; if (!(t15 >= 0 && t15 < t6)) return A.ioore(t4, t15); if (t4[t15]) { t13 += x; t14 += y; t3._checkBounds$2(t13, t14); t15 = t14 * t5 + t13; if (!(t15 >= 0 && t15 < t9)) return A.ioore(t7, t15); t7[t15].type = $.$get$Tiles_unformedWet(); t10._as(this); t2._checkBounds$2(t13, t14); B.JSArray_methods.$indexSet(t11, t14 * t12 + t13, this); } } } }; A.Painter.prototype = {}; A.PaintStyle.prototype = { paintTile$2(painter, pos) { var t1, t2, _0_0, _this = this, tile = painter._painter$_architect.stage.tiles.$get$2(pos.get$x(), pos.get$y()).type; if (tile === $.$get$Tiles_open() || tile === $.$get$Tiles_passage()) return _this._floorTile$0(); if (tile === $.$get$Tiles_solid()) { t1 = _this._wall; if (t1 != null) { t2 = $.$get$rng(); type$.List_TileType._as(t1); t2 = t2.range$1(1); if (!(t2 >= 0 && t2 < 1)) return A.ioore(t1, t2); return t1[t2]; } t1 = $.$get$rng(); t2 = type$.List_TileType._as($.$get$PaintStyle__defaultWalls()); t1 = t1.range$1(3); if (!(t1 >= 0 && t1 < 3)) return A.ioore(t2, t1); return t2[t1]; } if (tile === $.$get$Tiles_doorway()) { t1 = _this._closedDoor; t2 = t1 != null; if (t2 && _this._openDoor != null) { _0_0 = $.$get$rng().range$1(6); $label0$0: { if (0 === _0_0) { t1 = _this._openDoor; if (t1 == null) t1 = type$.TileType._as(t1); break $label0$0; } if (1 === _0_0) { t1 = _this._floorTile$0(); break $label0$0; } break $label0$0; } return t1; } else if (t2) return t1; else { t1 = _this._openDoor; if (t1 != null) return t1; else return _this._floorTile$0(); } } t1 = $.$get$PaintStyle__defaultTypes(); if (t1.containsKey$1(tile)) { t2 = $.$get$rng(); t1 = t1.$index(0, tile); t1.toString; type$.List_TileType._as(t1); t2 = t2.range$1(1); if (!(t2 >= 0 && t2 < 1)) return A.ioore(t1, t2); return t1[t2]; } return tile; }, _floorTile$0() { var t2, t1 = this._floor; if (t1 != null) { t2 = $.$get$rng(); type$.List_TileType._as(t1); t2 = t2.range$1(1); if (!(t2 >= 0 && t2 < 1)) return A.ioore(t1, t2); return t1[t2]; } return $.$get$Tiles_flagstoneFloor(); } }; A.Pit.prototype = { get$paintStyle() { return $.$get$PaintStyle_stoneJail(); }, build$0() { return new A._SyncStarIterable(this.build$body$Pit(), type$._SyncStarIterable_String); }, build$body$Pit() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 2, $async$errorStack = [], max, max0, i, t1, cave, bounds, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12; return function $async$build$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) $async$outer: switch ($async$goto) { case 0: // Function start max = $async$self._minSize, max0 = $async$self._maxSize, i = 0; case 3: // for condition if (!(i < 20)) { // goto after for $async$goto = 5; break; } t1 = $.$get$rng(); cave = A.Blob_make(t1._random.nextInt$1(max0 - max) + max); t1 = $async$self.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI("_architect"); bounds = $async$self._tryPlaceCave$2(cave, t1.stage.tiles.bounds); $async$goto = bounds != null ? 6 : 7; break; case 6: // then $async$goto = 8; return $async$iterator._async$_current = "pit", 1; case 8: // after yield for (t1 = cave.bounds, t2 = t1.pos, t2 = new A.RectIterator(t1, t2.x - 1, t2.y), t3 = cave._elements, t1 = t1.size.x, t4 = t3.length, t5 = $async$self._monsterTiles, t6 = bounds.pos, t7 = t6.x, t8 = bounds.size, t9 = t7 + t8.x, t6 = t6.y, t8 = t6 + t8.y; t2.moveNext$0();) { t10 = t2._x; t11 = t2._y; cave._checkBounds$2(t10, t11); t12 = t11 * t1 + t10; if (!(t12 >= 0 && t12 < t4)) { A.ioore(t3, t12); // goto return $async$goto = 1; break $async$outer; } if (t3[t12]) B.JSArray_methods.add$1(t5, new A.Vec(t10, t11).$add(0, new A.Vec(Math.min(t7, t9), Math.min(t6, t8)))); } $async$goto = 9; return $async$iterator._yieldStar$1($async$self._placeAntechambers$1(bounds)); case 9: // after yield // goto return $async$goto = 1; break; case 7: // join case 4: // for update ++i; // goto for condition $async$goto = 3; break; case 5: // after for case 1: // return return 0; case 2: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, spawnMonsters$1(painter) { var t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, _i, pos, t13, t14, t15, t16, openNeighbors, t17, _i0, neighbor, t18, t19, t1 = painter._painter$_architect, depth = B.JSNumber_methods.ceil$0(t1.depth * $.$get$rng().float$2(1, 1.4)); for (t2 = this._monsterTiles, t3 = t2.length, t4 = this._monsterGroup, t5 = painter._decorator, t1 = t1.stage, t6 = t1._actorsByTile, t7 = t6._elements, t8 = t6.bounds.size.x, t9 = t7.length, t1 = t1.tiles, t10 = t1._elements, t11 = t1.bounds.size.x, t12 = t10.length, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { pos = t2[_i]; t13 = pos.x; t14 = pos.y; t1._checkBounds$2(t13, t14); t15 = t14 * t11 + t13; if (!(t15 >= 0 && t15 < t12)) return A.ioore(t10, t15); t15 = t10[t15].type; t16 = $.$get$Motility_walk()._bitMask; if ((t15.motility._bitMask & t16) === 0) continue; t15 = pos.get$neighbors(); t17 = t15.length; _i0 = 0; for (;;) { if (!(_i0 < t17)) { openNeighbors = true; break; } neighbor = t15[_i0]; t18 = neighbor.x; t19 = neighbor.y; t1._checkBounds$2(t18, t19); t18 = t19 * t11 + t18; if (!(t18 >= 0 && t18 < t12)) return A.ioore(t10, t18); if ((t10[t18].type.motility._bitMask & t16) === 0) { openNeighbors = false; break; } ++_i0; } if (!openNeighbors) continue; t6._checkBounds$2(t13, t14); t13 = t14 * t8 + t13; if (!(t13 >= 0 && t13 < t9)) return A.ioore(t7, t13); if (t7[t13] != null) continue; t5._spawnMonster$3(null, pos, t5.chooseBreed$3$includeParentTags$tag(depth, false, t4)); } return true; }, _tryPlaceCave$2(cave, bounds) { var t1, t2, t3, t4, t5, t6, j, t7, t8, t9, x, y; type$.Array2D_bool._as(cave); t1 = bounds.size; t2 = t1.x; t3 = cave.bounds.size; t4 = t3.x; if (t2 < t4) return null; t1 = t1.y; t3 = t3.y; if (t1 < t3) return null; for (t5 = bounds.pos, t6 = t5.y, t1 = t6 + t1, t5 = t5.x, t2 = t5 + t2, j = 0; j < 200; ++j) { t7 = $.$get$rng(); t8 = Math.min(t5, t2); t9 = Math.max(t5, t2); t7 = t7._random; x = t7.nextInt$1(t9 - t4 - t8) + t8; t8 = Math.min(t6, t1); t9 = Math.max(t6, t1); y = t7.nextInt$1(t9 - t3 - t8) + t8; if (this._tryPlaceCaveAt$3(cave, x, y)) return new A.Rect(new A.Vec(x, y), new A.Vec(t4, t3)); } return null; }, _tryPlaceCaveAt$3(cave, x, y) { var t1, t2, t3, t4, t5, t6, t7, t8, _this = this, _s10_ = "_architect"; type$.Array2D_bool._as(cave); for (t1 = cave.bounds, t2 = A.RectIterator$(t1), t3 = cave._elements, t4 = t1.size.x, t5 = t3.length; t2.moveNext$0();) { t6 = t2._x; t7 = t2._y; cave._checkBounds$2(t6, t7); t8 = t7 * t4 + t6; if (!(t8 >= 0 && t8 < t5)) return A.ioore(t3, t8); if (t3[t8]) { t8 = _this.__Architecture__architect_F; t8 === $ && A.throwLateFieldNI(_s10_); if (!t8._canCarve$2(_this, new A.Vec(t6 + x, t7 + y))) return false; } } for (t1 = A.RectIterator$(t1); t1.moveNext$0();) { t2 = t1._x; t6 = t1._y; cave._checkBounds$2(t2, t6); t7 = t6 * t4 + t2; if (!(t7 >= 0 && t7 < t5)) return A.ioore(t3, t7); if (t3[t7]) { t7 = _this.__Architecture__architect_F; t7 === $ && A.throwLateFieldNI(_s10_); t7._carve$4(_this, t2 + x, t6 + y, null); } } return true; }, _placeAntechambers$1(pitBounds) { return new A._SyncStarIterable(this._placeAntechambers$body$Pit(pitBounds), type$._SyncStarIterable_String); }, _placeAntechambers$body$Pit($async$pitBounds) { var $async$self = this; return function() { var pitBounds = $async$pitBounds; var $async$goto = 0, $async$handler = 1, $async$errorStack = [], t1, t2, t3, t4, i, t5, cave, t6, t7, t8, t9, t10, t11; return function $async$_placeAntechambers$1($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) switch ($async$goto) { case 0: // Function start t1 = pitBounds.pos, t2 = t1.x, t3 = pitBounds.size, t4 = t2 + t3.x, t1 = t1.y, t3 = t1 + t3.y, i = 0; case 2: // for condition if (!(i < 8)) { // goto after for $async$goto = 4; break; } t5 = $.$get$rng(); cave = A.Blob_make(t5._random.nextInt$1(4) + 6); t5 = cave.bounds.size; t6 = t5.x; t7 = Math.min(t2, t4) - t6; t5 = t5.y; t8 = Math.min(t1, t3) - t5; t9 = Math.max(t2, t4); t10 = Math.max(t1, t3); t11 = $async$self.__Architecture__architect_F; t11 === $ && A.throwLateFieldNI("_architect"); $async$goto = $async$self._tryPlaceCave$2(cave, A.Rect_intersect(new A.Rect(new A.Vec(t7, t8), new A.Vec(t9 + t6 - t7, t10 + t5 - t8)), t11.stage.tiles.bounds.inflate$1(-1))) != null ? 5 : 6; break; case 5: // then $async$goto = 7; return $async$iterator._async$_current = "antechamber", 1; case 7: // after yield case 6: // join case 3: // for update ++i; // goto for condition $async$goto = 2; break; case 4: // after for // implicit return return 0; case 1: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; } }; A.Reachability.prototype = { fill$1(pos) { var t2, t3, t4, t5, t6, t7, t8, t9, t10, pos0, t11, t12, distance, t13, _i, neighbor, t14, t15, t16, neighborDistance, border, _this = this, queue = A.ListQueue$(type$.Vec), t1 = _this._affected; ++t1._sentinel; t2 = t1._vec_set$_values; t3 = t2.bounds.size; t4 = t3.x; t1._xMin = t4; t1._xMax = 0; t1._yMin = t3.y; t1._yMax = 0; t3 = queue.$ti._precomputed1; queue._add$1(t3._as(pos)); t1.add$1(0, pos); t5 = _this._distances; _this._beforeFill = A._setArrayType([new A._FillStep(pos, t5.$get$2(pos.get$x(), pos.get$y()))], type$.JSArray__FillStep); for (t6 = t2._elements, t7 = t6.length, t8 = t5._elements, t9 = t5.bounds.size.x, t10 = t8.length; !queue.get$isEmpty(0);) { pos0 = queue.removeFirst$0(); t11 = pos0.get$x(); t12 = pos0.get$y(); t5._checkBounds$2(t11, t12); t11 = t12 * t9 + t11; if (!(t11 >= 0 && t11 < t10)) return A.ioore(t8, t11); distance = t8[t11]; for (t11 = pos0.get$cardinalNeighbors(), t12 = t11.length, t13 = distance + 1, _i = 0; _i < t11.length; t11.length === t12 || (0, A.throwConcurrentModificationError)(t11), ++_i) { neighbor = t11[_i]; t14 = neighbor.x; t15 = neighbor.y; t5._checkBounds$2(t14, t15); t16 = t15 * t9 + t14; if (!(t16 >= 0 && t16 < t10)) return A.ioore(t8, t16); neighborDistance = t8[t16]; if (neighborDistance === -1) continue; t5._checkBounds$2(t14, t15); if (neighborDistance !== t13) continue; t2._checkBounds$2(t14, t15); t14 = t15 * t4 + t14; if (!(t14 >= 0 && t14 < t7)) return A.ioore(t6, t14); if (J.$eq$(t6[t14], t1._sentinel)) continue; if (_this._hasOtherPath$1(neighbor)) continue; queue._add$1(t3._as(neighbor)); t1.add$1(0, neighbor); B.JSArray_methods.add$1(_this._beforeFill, new A._FillStep(neighbor, neighborDistance)); } } _this._setDistance$2(pos, -1); border = _this._findBorder$1(pos); if (border._collection$_length === 0) for (t1 = t1.get$iterator(0), t2 = t1.$ti._precomputed1; t1.moveNext$0();) { t3 = t1.__interceptors$_current; _this._setDistance$2(t3 == null ? t2._as(t3) : t3, -1); } else { for (t1 = t1.get$iterator(0), t2 = t1.$ti._precomputed1; t1.moveNext$0();) { t3 = t1.__interceptors$_current; _this._setDistance$2(t3 == null ? t2._as(t3) : t3, -2); } _this._setDistance$2(pos, -1); _this._reachability$_process$1(border); } }, undoFill$0() { var t1, t2, _i, step; for (t1 = this._beforeFill, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { step = t1[_i]; this._setDistance$2(step.pos, step.distance); } this._beforeFill = B.List_empty0; }, _hasOtherPath$1(pos) { var t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, _i, neighbor, t14, t15, t16, t1 = this._distances, distance = t1.$get$2(pos.get$x(), pos.get$y()); for (t2 = pos.get$cardinalNeighbors(), t3 = t2.length, t4 = this._affected, t5 = t4._vec_set$_values, t6 = t5._elements, t7 = t5.bounds.size.x, t8 = t6.length, t9 = this.stage.tiles.bounds, t10 = t1._elements, t11 = t1.bounds.size.x, t12 = t10.length, t13 = distance - 1, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { neighbor = t2[_i]; if (!t9.contains$1(0, neighbor)) continue; t14 = neighbor.x; t15 = neighbor.y; t5._checkBounds$2(t14, t15); t16 = t15 * t7 + t14; if (!(t16 >= 0 && t16 < t8)) return A.ioore(t6, t16); if (!J.$eq$(t6[t16], t4._sentinel)) { t1._checkBounds$2(t14, t15); t14 = t15 * t11 + t14; if (!(t14 >= 0 && t14 < t12)) return A.ioore(t10, t14); t14 = J.$eq$(t10[t14], t13); } else t14 = false; if (t14) return true; } return false; }, _findBorder$1(start) { var t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, _i, neighbor, t14, t15, t16, border = A.LinkedHashSet_LinkedHashSet$_empty(type$.Vec); for (t1 = this._affected, t2 = t1.get$iterator(0), t3 = this._distances, t4 = t3._elements, t5 = t3.bounds.size.x, t6 = t4.length, t7 = t1._vec_set$_values, t8 = t7._elements, t9 = t7.bounds.size.x, t10 = t8.length, t11 = t2.$ti._precomputed1; t2.moveNext$0();) { t12 = t2.__interceptors$_current; if (t12 == null) t12 = t11._as(t12); if (t12.$eq(0, start)) continue; for (t12 = t12.get$cardinalNeighbors(), t13 = t12.length, _i = 0; _i < t12.length; t12.length === t13 || (0, A.throwConcurrentModificationError)(t12), ++_i) { neighbor = t12[_i]; t14 = neighbor.x; t15 = neighbor.y; t3._checkBounds$2(t14, t15); t16 = t15 * t5 + t14; if (!(t16 >= 0 && t16 < t6)) return A.ioore(t4, t16); t16 = t4[t16]; if (typeof t16 !== "number") return t16.$ge(); if (t16 >= 0) { t7._checkBounds$2(t14, t15); t14 = t15 * t9 + t14; if (!(t14 >= 0 && t14 < t10)) return A.ioore(t8, t14); t14 = !J.$eq$(t8[t14], t1._sentinel); } else t14 = false; if (t14) border.add$1(0, neighbor); } } return border; }, _reachability$_process$1(starting) { var frontier, t1, t2, t3, t4, t5, t6, t7, t8, t9, pos, t10, t11, parentDistance, distance, _i, here, t12, t13, t14, _this = this; type$.Iterable_Vec._as(starting); frontier = new A.BucketQueue(A._setArrayType([], type$.JSArray_nullable_Queue_Vec), type$.BucketQueue_Vec); for (t1 = J.get$iterator$ax(starting), t2 = _this._distances, t3 = t2._elements, t4 = t2.bounds, t5 = t4.size.x, t6 = t3.length; t1.moveNext$0();) { t7 = t1.get$current(); t8 = t7.get$x(); t9 = t7.get$y(); t2._checkBounds$2(t8, t9); t8 = t9 * t5 + t8; if (!(t8 >= 0 && t8 < t6)) return A.ioore(t3, t8); frontier.add$2(0, t7, t3[t8]); } for (t1 = _this.stage.tiles, t7 = t1._elements, t8 = t1.bounds.size.x, t9 = t7.length;;) { pos = frontier.removeNext$0(); if (pos == null) break; t10 = pos.get$x(); t11 = pos.get$y(); t2._checkBounds$2(t10, t11); t10 = t11 * t5 + t10; if (!(t10 >= 0 && t10 < t6)) return A.ioore(t3, t10); parentDistance = t3[t10]; for (t10 = pos.get$cardinalNeighbors(), t11 = t10.length, distance = parentDistance + 1, _i = 0; _i < t10.length; t10.length === t11 || (0, A.throwConcurrentModificationError)(t10), ++_i) { here = t10[_i]; if (!t4.contains$1(0, here)) continue; t12 = here.x; t13 = here.y; t2._checkBounds$2(t12, t13); t14 = t13 * t5 + t12; if (!(t14 >= 0 && t14 < t6)) return A.ioore(t3, t14); if (!J.$eq$(t3[t14], -2)) continue; t1._checkBounds$2(t12, t13); t12 = t13 * t8 + t12; if (!(t12 >= 0 && t12 < t9)) return A.ioore(t7, t12); if ((t7[t12].type.motility._bitMask & $.$get$Motility_walk()._bitMask) !== 0) { _this._setDistance$2(here, distance); frontier.add$2(0, here, distance); } else _this._setDistance$2(here, -1); } } }, _setDistance$2(pos, distance) { var t1, _this = this; if (_this.stage.tiles.$get$2(pos.get$x(), pos.get$y()).type === $.$get$Tiles_open()) { t1 = _this._distances.$get$2(pos.get$x(), pos.get$y()); if (typeof t1 !== "number") return t1.$ge(); if (t1 >= 0) --_this._reachedOpenCount; if (distance >= 0) ++_this._reachedOpenCount; } t1 = _this._distances; t1.$ti._precomputed1._as(distance); t1.$set$3(pos.get$x(), pos.get$y(), distance); } }; A._FillStep.prototype = {}; A.River.prototype = { build$0() { return new A._SyncStarIterable(this.build$body$River(), type$._SyncStarIterable_String); }, build$body$River() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 1, $async$errorStack = [], t2, south, east, northish, southish, eastish, westish, northSouth, eastWest, _0_0, t3, t4, mid, t1; return function $async$build$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) switch ($async$goto) { case 0: // Function start t1 = $async$self.__Architecture__architect_F; t1 === $ && A.throwLateFieldNI("_architect"); t2 = t1.stage.tiles.bounds.size; south = t2.y + 2; east = t2.x + 2; northish = new A.River_build_northish($async$self); southish = new A.River_build_southish($async$self); eastish = new A.River_build_eastish($async$self); westish = new A.River_build_westish($async$self); northSouth = new A.River_build_northSouth($async$self); eastWest = new A.River_build_eastWest($async$self); t2 = $.$get$rng(); _0_0 = t2.range$1(6); $label0$0: { if (0 === _0_0) { t3 = new A._Record_2(A._RiverPoint$(-2, northSouth.call$0(), null, null), A._RiverPoint$(east, northSouth.call$0(), null, null)); break $label0$0; } if (1 === _0_0) { t3 = new A._Record_2(A._RiverPoint$(eastWest.call$0(), -2, null, null), A._RiverPoint$(eastWest.call$0(), south, null, null)); break $label0$0; } if (2 === _0_0) { t3 = new A._Record_2(A._RiverPoint$(westish.call$0(), -2, null, null), A._RiverPoint$(east, southish.call$0(), null, null)); break $label0$0; } if (3 === _0_0) { t3 = new A._Record_2(A._RiverPoint$(east, northish.call$0(), null, null), A._RiverPoint$(westish.call$0(), south, null, null)); break $label0$0; } if (4 === _0_0) { t3 = new A._Record_2(A._RiverPoint$(eastish.call$0(), south, null, null), A._RiverPoint$(-2, northish.call$0(), null, null)); break $label0$0; } if (5 === _0_0) { t3 = new A._Record_2(A._RiverPoint$(-2, southish.call$0(), null, null), A._RiverPoint$(eastish.call$0(), -2, null, null)); break $label0$0; } t3 = A.throwExpression(A.StateError$("Unreachable")); } t4 = t1.stage.tiles.bounds.size.x; t1 = t1.stage.tiles.bounds.size.y; mid = A._RiverPoint$(t2.float$2(t4 * 0.4, t4 * 0.6), t2.float$2(t1 * 0.4, t1 * 0.6), null, null); $async$self._displace$2(t3._0, mid); $async$self._displace$2(mid, t3._1); // implicit return return 0; case 1: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, _displace$2(start, end) { var t5, t6, t7, t8, shoreRandomness, mid, x1, y1, x2, y2, t9, shoreRadiusSquared, waterRadiusSquared, t10, y, yy, t11, t12, t13, x, xx, lengthSquared, t14, _this = this, t1 = start.x, t2 = end.x, h = t1 - t2, t3 = start.y, t4 = end.y, v = t3 - t4, $length = Math.sqrt(h * h + v * v); if ($length > 1) { t5 = $.$get$rng(); t6 = $length / 2; t7 = t5.float$1(t6); t8 = $length / 4; t6 = t5.float$1(t6); shoreRandomness = Math.min(2, t8); mid = A._RiverPoint$((t1 + t2) / 2 + t7 - t8, (t3 + t4) / 2 + t6 - t8, B.JSNumber_methods.clamp$2((start.shoreRadius + end.shoreRadius) / 2 + t5.float$2(-shoreRandomness, shoreRandomness), 0, 4), (start.waterRadius + end.waterRadius) / 2); _this._displace$2(start, mid); _this._displace$2(mid, end); return; } t2 = start.waterRadius; t4 = start.shoreRadius + t2; x1 = B.JSNumber_methods.floor$0(t1 - t4); y1 = B.JSNumber_methods.floor$0(t3 - t4); x2 = B.JSNumber_methods.ceil$0(t1 + t4); y2 = B.JSNumber_methods.ceil$0(t3 + t4); t5 = _this.__Architecture__architect_F; t5 === $ && A.throwLateFieldNI("_architect"); t6 = t5.stage.tiles; t7 = t6.bounds.size; t8 = t7.x; t9 = t8 - 2; x1 = B.JSInt_methods.clamp$2(x1, 1, t9); t7 = t7.y - 2; y1 = B.JSInt_methods.clamp$2(y1, 1, t7); x2 = B.JSInt_methods.clamp$2(x2, 1, t9); y2 = B.JSInt_methods.clamp$2(y2, 1, t7); shoreRadiusSquared = t4 * t4; waterRadiusSquared = t2 * t2; for (t2 = t6._elements, t4 = t2.length, t5 = t5._owners, t7 = t5.$ti._precomputed1, t9 = t5._elements, t10 = t5.bounds.size.x, y = y1; y <= y2; ++y) for (yy = t3 - y, t11 = yy * yy, t12 = y * t8, t13 = y * t10, x = x1; x <= x2; ++x) { xx = t1 - x; lengthSquared = xx * xx + t11; if (lengthSquared <= waterRadiusSquared) { t6._checkBounds$2(x, y); t14 = t12 + x; if (!(t14 >= 0 && t14 < t4)) return A.ioore(t2, t14); t2[t14].type = $.$get$Tiles_unformedWet(); t7._as(_this); t5._checkBounds$2(x, y); B.JSArray_methods.$indexSet(t9, t13 + x, _this); } else if (lengthSquared <= shoreRadiusSquared) { t6._checkBounds$2(x, y); t14 = t12 + x; if (!(t14 >= 0 && t14 < t4)) return A.ioore(t2, t14); if (t2[t14].type === $.$get$Tiles_unformed()) { t6._checkBounds$2(x, y); t2[t14].type = $.$get$Tiles_open(); t7._as(_this); t5._checkBounds$2(x, y); B.JSArray_methods.$indexSet(t9, t13 + x, _this); } } } } }; A.River_build_northish.prototype = { call$0() { var t1 = $.$get$rng(), t2 = this.$this.__Architecture__architect_F; t2 === $ && A.throwLateFieldNI("_architect"); t2 = t2.stage.tiles.bounds.size.y; return t1.float$2(t2 * 0.2, t2 * 0.4); }, $signature: 6 }; A.River_build_southish.prototype = { call$0() { var t1 = $.$get$rng(), t2 = this.$this.__Architecture__architect_F; t2 === $ && A.throwLateFieldNI("_architect"); t2 = t2.stage.tiles.bounds.size.y; return t1.float$2(t2 * 0.6, t2 * 0.8); }, $signature: 6 }; A.River_build_eastish.prototype = { call$0() { var t1 = $.$get$rng(), t2 = this.$this.__Architecture__architect_F; t2 === $ && A.throwLateFieldNI("_architect"); t2 = t2.stage.tiles.bounds.size.x; return t1.float$2(t2 * 0.6, t2 * 0.8); }, $signature: 6 }; A.River_build_westish.prototype = { call$0() { var t1 = $.$get$rng(), t2 = this.$this.__Architecture__architect_F; t2 === $ && A.throwLateFieldNI("_architect"); t2 = t2.stage.tiles.bounds.size.x; return t1.float$2(t2 * 0.2, t2 * 0.4); }, $signature: 6 }; A.River_build_northSouth.prototype = { call$0() { var t1 = $.$get$rng(), t2 = this.$this.__Architecture__architect_F; t2 === $ && A.throwLateFieldNI("_architect"); t2 = t2.stage.tiles.bounds.size.y; return t1.float$2(t2 * 0.2, t2 * 0.8); }, $signature: 6 }; A.River_build_eastWest.prototype = { call$0() { var t1 = $.$get$rng(), t2 = this.$this.__Architecture__architect_F; t2 === $ && A.throwLateFieldNI("_architect"); t2 = t2.stage.tiles.bounds.size.x; return t1.float$2(t2 * 0.2, t2 * 0.8); }, $signature: 6 }; A._RiverPoint.prototype = { toString$0(_) { return A.S(this.x) + "," + A.S(this.y) + " (" + A.S(this.waterRadius) + ")"; } }; A.RoomArchitecture.prototype = { canPlaceRoom$3(room, x, y) { var t1, t2, t3, t4, t5, t6, t7, t8, tile, t9, _s10_ = "_architect"; type$.Array2D_RoomTile._as(room); for (t1 = room.bounds, t2 = A.RectIterator$(t1), t3 = room._elements, t1 = t1.size.x, t4 = t3.length; t2.moveNext$0();) { t5 = t2._x; t6 = t2._y; t7 = t5 + x; t8 = t6 + y; room._checkBounds$2(t5, t6); t5 = t6 * t1 + t5; if (!(t5 >= 0 && t5 < t4)) return A.ioore(t3, t5); tile = t3[t5]; t5 = tile.tile; t6 = t5 == null; if (!(t6 && tile.direction === B.Direction_0_0_0_none)) { t9 = this.__Architecture__architect_F; t9 === $ && A.throwLateFieldNI(_s10_); t9 = !t9.stage.tiles.bounds.contains$1(0, new A.Vec(t7, t8)); } else t9 = false; if (t9) return false; if (!(t6 && tile.direction === B.Direction_0_0_0_none) && t5 !== $.$get$Tiles_solid() && tile.direction === B.Direction_0_0_0_none) { t5 = this.__Architecture__architect_F; t5 === $ && A.throwLateFieldNI(_s10_); t8 = !t5._canCarve$2(this, new A.Vec(t7, t8)); t5 = t8; } else t5 = false; if (t5) return false; } return true; } }; A.RoomShapes.prototype = { _enumToString$0() { return "RoomShapes." + this._core$_name; } }; A.Room__calculateEdges_isFloor.prototype = { call$1(dir) { var t2, here = this.pos.$add(0, type$.Direction._as(dir)), t1 = this.room; if (!t1.bounds.contains$1(0, here)) return false; t1 = t1.$get$2(here.x, here.y); t2 = t1.tile; return !(t2 == null && t1.direction === B.Direction_0_0_0_none) && t2 !== $.$get$Tiles_solid() && t1.direction === B.Direction_0_0_0_none; }, $signature: 9 }; A.RoomTile.prototype = {}; A.RoomSize.prototype = { _enumToString$0() { return "RoomSize." + this._core$_name; } }; A.Town.prototype = { buildStage$1(placeHero) { return new A._SyncStarIterable(this.buildStage$body$Town(type$.dynamic_Function_Vec._as(placeHero)), type$._SyncStarIterable_String); }, buildStage$body$Town($async$placeHero) { var $async$self = this; return function() { var placeHero = $async$placeHero; var $async$goto = 0, $async$handler = 2, $async$errorStack = [], t1, t2, t3, t4, t5, t6, t7, t8, entrances, i, x, y, t9, door, t10; return function $async$buildStage$1($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) $async$outer: switch ($async$goto) { case 0: // Function start for (t1 = $async$self.stage.tiles, t2 = t1.bounds, t3 = A.RectIterator$(t2), t4 = t1._elements, t5 = t2.size.x, t6 = t4.length; t3.moveNext$0();) { t7 = t3._x; t8 = t3._y; t1._checkBounds$2(t7, t8); t7 = t8 * t5 + t7; if (!(t7 >= 0 && t7 < t6)) { A.ioore(t4, t7); // goto return $async$goto = 1; break $async$outer; } t4[t7].type = $.$get$Tiles_flagstoneFloor(); } for (t3 = J.get$iterator$ax(t2.trace$0()); t3.moveNext$0();) { t7 = t3.get$current(); t8 = t7.get$x(); t7 = t7.get$y(); t1._checkBounds$2(t8, t7); t8 = t7 * t5 + t8; if (!(t8 >= 0 && t8 < t6)) { A.ioore(t4, t8); // goto return $async$goto = 1; break $async$outer; } t4[t8].type = $.$get$Tiles_flagstoneWall(); } entrances = [$.$get$Tiles_dungeonEntrance(), $.$get$Tiles_home(), $.$get$Tiles_shop1(), $.$get$Tiles_shop2(), $.$get$Tiles_shop3(), $.$get$Tiles_shop4(), $.$get$Tiles_shop5(), $.$get$Tiles_shop6()]; for (i = 0; i < 8; ++i) { x = B.JSInt_methods.$mod(i, 4) * 13 + 5; t3 = B.JSInt_methods._tdivFast$1(i, 4); y = t3 * 14 + 6; for (t7 = new A.RectIterator(new A.Rect(new A.Vec(x, y), new A.Vec(11, 8)), x - 1, y); t7.moveNext$0();) { t8 = t7._x; t9 = t7._y; t1._checkBounds$2(t8, t9); t8 = t9 * t5 + t8; if (!(t8 >= 0 && t8 < t6)) { A.ioore(t4, t8); // goto return $async$goto = 1; break $async$outer; } t4[t8].type = $.$get$Tiles_flagstoneWall(); } t7 = x + 11; t8 = y + 8; if ((t3 & 1) === 1) { t3 = Math.min(x, t7); t8 = Math.min(y, t8); t8 = new A.Vec(t3, t8).$add(0, new A.Vec(Math.max(x, t7), t8)); door = new A.Vec(B.JSInt_methods._tdivFast$1(t8.x, 2), B.JSInt_methods._tdivFast$1(t8.y, 2)); } else { t3 = Math.min(x, t7); t8 = Math.max(y, t8); t8 = new A.Vec(t3, t8).$add(0, new A.Vec(Math.max(x, t7), t8)); door = new A.Vec(B.JSInt_methods._tdivFast$1(t8.x, 2), B.JSInt_methods._tdivFast$1(t8.y, 2) + -1); } t3 = door.x; t7 = door.y; t1._checkBounds$2(t3, t7); t8 = t7 * t5; t9 = t8 + t3; if (!(t9 >= 0 && t9 < t6)) { A.ioore(t4, t9); // goto return $async$goto = 1; break $async$outer; } t4[t9].type = entrances[i]; t9 = t3 + -1; t1._checkBounds$2(t9, t7); t9 = t8 + t9; if (!(t9 >= 0 && t9 < t6)) { A.ioore(t4, t9); // goto return $async$goto = 1; break $async$outer; } t9 = t4[t9]; t10 = $.$get$Tiles_wallTorch(); t9.type = t10; ++t3; t1._checkBounds$2(t3, t7); t3 = t8 + t3; if (!(t3 >= 0 && t3 < t6)) { A.ioore(t4, t3); // goto return $async$goto = 1; break $async$outer; } t4[t3].type = t10; } for (t3 = A.RectIterator$(t2); t3.moveNext$0();) { t7 = t3._x; t8 = t3._y; t1._checkBounds$2(t7, t8); t7 = t8 * t5 + t7; if (!(t7 >= 0 && t7 < t6)) { A.ioore(t4, t7); // goto return $async$goto = 1; break $async$outer; } t7 = t4[t7]; t7.updateExplored$1$force(true); t8 = $.$get$Motility_fly(); if ((t7.type.motility._bitMask & t8._bitMask) !== 0) t7._appliedEmanation = B.JSInt_methods.clamp$2(t7._appliedEmanation + 64, 0, 192); } placeHero.call$1(t2.get$center()); case 1: // return return 0; case 2: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; } }; A.Tiles_closedChest_closure.prototype = { call$1(pos) { return new A.OpenChestAction(pos); }, $signature: 72 }; A.Tiles_closedBarrel_closure.prototype = { call$1(pos) { return new A.OpenBarrelAction(pos); }, $signature: 73 }; A.Tiles_braziers_closure.prototype = { call$2(tile, n) { tile._emanation = 192 - n * 12; return tile._tiles$_motility$1($.$get$Motility_fly()); }, $signature: 74 }; A.TileBuilder.prototype = { blend$3(amount, fore, $back) { var t1, i, glyph, t2, t3; for (t1 = this.glyphs, i = 0; i < t1.length; ++i) { glyph = t1[i]; t2 = glyph.fore.blend$2(fore, amount); t3 = glyph.back.blend$2($back, amount); B.JSArray_methods.$indexSet(t1, i, new A.Glyph(glyph.char, t2, t3)); } return this; }, animate$4(count, maxMix, fore, $back) { var t2, t3, t4, i, mixedFore, mixedBack, t1 = this.glyphs, glyph = B.JSArray_methods.get$first(t1); for (t2 = glyph.fore, t3 = glyph.back, t4 = glyph.char, i = 1; i < count; ++i) { mixedFore = t2.blend$2(fore, A.lerpDouble(i, 0, count, 0, maxMix)); mixedBack = t3.blend$2($back, A.lerpDouble(i, 0, count, 0, maxMix)); B.JSArray_methods.add$1(t1, new A.Glyph(t4, mixedFore, mixedBack)); } return this; }, emanate$1(emanation) { this._emanation = emanation; return this; }, to$1(portal) { this._portal = portal; return this; }, onOperate$1(onOperate) { this._onOperate = type$.Action_Function_Vec._as(onOperate); return this; }, door$0() { return this._tiles$_motility$1($.$get$Motility_door()); }, obstacle$0() { return this._tiles$_motility$1($.$get$Motility_fly()); }, open$0() { return this._tiles$_motility$1($.$get$Motility_flyAndWalk()); }, solid$0() { return this._tiles$_motility$1($.$get$Motility_none()); }, _tiles$_motility$1(motility) { var t2, t3, t4, _this = this, t1 = _this.glyphs; if (t1.length === 1) t1 = B.JSArray_methods.get$first(t1); t2 = _this._portal; t3 = _this._emanation; t4 = _this._onOperate; return new A.TileType(_this.name, t2, t3, t1, motility, t4); } }; A.Debug_monsterLog_closure.prototype = { call$0() { return A._MonsterLog$(this.monster); }, $signature: 24 }; A.Debug_monsterStat_closure.prototype = { call$0() { return A._MonsterLog$(this.monster); }, $signature: 24 }; A.Debug_monsterStat_closure0.prototype = { call$0() { return A.ListQueue$(type$.num); }, $signature: 76 }; A.Debug_monsterReason_closure.prototype = { call$0() { return A._MonsterLog$(this.monster); }, $signature: 24 }; A._MonsterLog.prototype = { toString$0(_) { var state, statNames, $length, t3, _i, $name, t4, values, t5, t6, showBar, t7, i, t8, _this = this, buffer = new A.StringBuffer(""), t1 = _this.monster, t2 = A.Log__categorize(t1._breed._breed$_name, false, true); buffer._contents = t2; t1 = t1._monster$_state; if (t1 instanceof A.AfraidState) state = "afraid"; else state = t1 instanceof A.AwakeState ? "awake" : "asleep"; buffer._contents = t2 + (" (" + state + ")\n"); t1 = _this.stats; t2 = A._instanceType(t1)._eval$1("LinkedHashMapKeysIterable<1>"); statNames = A.List_List$_of(new A.LinkedHashMapKeysIterable(t1, t2), t2._eval$1("Iterable.E")); B.JSArray_methods.sort$0(statNames); $length = B.JSArray_methods.fold$1$2(statNames, 0, new A._MonsterLog_toString_closure(), type$.int); for (t2 = statNames.length, t3 = _this.statReason, _i = 0; _i < statNames.length; statNames.length === t2 || (0, A.throwConcurrentModificationError)(statNames), ++_i) { $name = statNames[_i]; t4 = B.JSString_methods.padRight$1($name, $length) + " "; values = t1.$index(0, $name); for (t5 = A._instanceType(values), t6 = new A._ListQueueIterator(values, values._tail, values._modificationCount, values._head, t5._eval$1("_ListQueueIterator<1>")), t5 = t5._precomputed1, showBar = false; t6.moveNext$0();) { t7 = t6._collection$_current; i = B.JSInt_methods.clamp$2(B.JSNumber_methods.ceil$0((t7 == null ? t5._as(t7) : t7) * 9), 0, 8); if (!(i >= 0 && i < 9)) return A.ioore(" \u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588", i); t4 += " \u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588"[i]; if (i > 0) showBar = true; } if (!values.get$isEmpty(0)) { t6 = values._head; t7 = values._tail; if (t6 === t7) A.throwExpression(A.IterableElementError_noElement()); t6 = values._table; t8 = t6.length; t7 = (t7 - 1 & t8 - 1) >>> 0; if (!(t7 >= 0 && t7 < t8)) return A.ioore(t6, t7); t7 = t6[t7]; t4 += " " + B.JSString_methods.padLeft$1(J.toStringAsFixed$1$n(t7 == null ? t5._as(t7) : t7, 4), 6); } if (t3.$index(0, $name) != null) { t4 += " " + A.S(t3.$index(0, $name)); showBar = true; } if (showBar) buffer._contents += (t4.charCodeAt(0) == 0 ? t4 : t4) + "\n"; } t1 = buffer._contents = A.StringBuffer__writeAll(buffer._contents, _this.log, "\n"); return t1.charCodeAt(0) == 0 ? t1 : t1; } }; A._MonsterLog_toString_closure.prototype = { call$2($length, $name) { return Math.max(A._asInt($length), A._asString($name).length); }, $signature: 23 }; A.Action.prototype = { get$isImmediate() { return true; }, bind$3$consumesEnergy(game, actor, consumesEnergy) { var t1, _this = this; _this._actor = actor; t1 = actor._pos; _this.__Action__pos_F !== $ && A.throwLateFieldAI("_pos"); _this.__Action__pos_F = t1; _this.__Action__game_F !== $ && A.throwLateFieldAI("_game"); _this.__Action__game_F = game; _this.__Action__consumesEnergy_F !== $ && A.throwLateFieldAI("_consumesEnergy"); _this.__Action__consumesEnergy_F = consumesEnergy !== false; }, addAction$2(action, actor) { var t1, t2, t3; if (actor == null) { t1 = this._actor; t1.toString; } else t1 = actor; t2 = this.__Action__pos_F; t2 === $ && A.throwLateFieldNI("_pos"); t3 = this.__Action__game_F; t3 === $ && A.throwLateFieldNI("_game"); action._actor = t1; action.__Action__pos_F !== $ && A.throwLateFieldAI("_pos"); action.__Action__pos_F = t2; action.__Action__game_F !== $ && A.throwLateFieldAI("_game"); action.__Action__game_F = t3; action.__Action__consumesEnergy_F !== $ && A.throwLateFieldAI("_consumesEnergy"); action.__Action__consumesEnergy_F = false; if (action.get$isImmediate()) B.JSArray_methods.add$1(t3._reactions, action); else { t1 = t3._actions; t1._add$1(t1.$ti._precomputed1._as(action)); } }, addAction$1(action) { return this.addAction$2(action, null); }, addEvent$6$actor$dir$element$other$pos(type, actor, dir, element, other, pos) { var t2, t1 = this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = element == null ? $.$get$Element_none() : element; B.JSArray_methods.add$1(t1._events, new A.Event(type, actor, t2, other, pos, dir)); }, addEvent$3$dir$pos(type, dir, pos) { return this.addEvent$6$actor$dir$element$other$pos(type, null, dir, null, null, pos); }, addEvent$1(type) { var _null = null; return this.addEvent$6$actor$dir$element$other$pos(type, _null, _null, _null, _null, _null); }, addEvent$4$actor$element$other(type, actor, element, other) { return this.addEvent$6$actor$dir$element$other$pos(type, actor, null, element, other, null); }, addEvent$2$actor(type, actor) { var _null = null; return this.addEvent$6$actor$dir$element$other$pos(type, actor, _null, _null, _null, _null); }, addEvent$3$actor$pos(type, actor, pos) { return this.addEvent$6$actor$dir$element$other$pos(type, actor, null, null, null, pos); }, addEvent$4$dir$element$pos(type, dir, element, pos) { return this.addEvent$6$actor$dir$element$other$pos(type, null, dir, element, null, pos); }, addEvent$3$element$pos(type, element, pos) { return this.addEvent$6$actor$dir$element$other$pos(type, null, null, element, null, pos); }, addEvent$3$other$pos(type, other, pos) { return this.addEvent$6$actor$dir$element$other$pos(type, null, null, null, other, pos); }, addEvent$2$pos(type, pos) { var _null = null; return this.addEvent$6$actor$dir$element$other$pos(type, _null, _null, _null, _null, pos); }, addEvent$3$actor$other(type, actor, other) { return this.addEvent$6$actor$dir$element$other$pos(type, actor, null, null, other, null); }, get$noise() { return 0.2; }, log$3(message, noun1, noun2) { var t1 = this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1.hero.save.log._log$_add$5(B.LogType_0, message, noun1, noun2, null); }, show$4(message, noun1, noun2, noun3) { var t2, t3, t1 = this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t3 = this.__Action__pos_F; t3 === $ && A.throwLateFieldNI("_pos"); t3 = t2.tiles.$get$2(t3.get$x(), t3.get$y()); if (!t3._isOccluded && t3.floorIllumination + t3.actorIllumination > t3._fallOff || this._actor instanceof A.Hero) t1.hero.save.log._log$_add$5(B.LogType_0, message, noun1, noun2, noun3); }, show$2(message, noun1) { return this.show$4(message, noun1, null, null); }, show$3(message, noun1, noun2) { return this.show$4(message, noun1, noun2, null); }, show$1(message) { return this.show$4(message, null, null, null); }, succeed$3(message, noun1, noun2) { if (message != null) this.show$4(message, noun1, noun2, null); return B.ActionResult_null_true_true; }, succeed$2(message, noun1) { return this.succeed$3(message, noun1, null); }, succeed$0() { return this.succeed$3(null, null, null); }, fail$3(message, noun1, noun2) { var t2, _this = this, t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = _this.__Action__pos_F; t2 === $ && A.throwLateFieldNI("_pos"); t2 = t1.tiles.$get$2(t2.get$x(), t2.get$y()); t1 = !t2._isOccluded && t2.floorIllumination + t2.actorIllumination > t2._fallOff || _this._actor instanceof A.Hero; if (t1) { t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1.hero.save.log._log$_add$5(B.LogType_1, message, noun1, noun2, null); } return B.ActionResult_null_false_true; }, fail$1(message) { return this.fail$3(message, null, null); }, fail$2(message, noun1) { return this.fail$3(message, noun1, null); }, alternate$1(action) { var t2, t3, t1 = this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = this._actor; t2.toString; t3 = this.__Action__consumesEnergy_F; t3 === $ && A.throwLateFieldNI("_consumesEnergy"); action.bind$3$consumesEnergy(t1, t2, t3); return new A.ActionResult(action, false, true); } }; A.ActionResult.prototype = {}; A.FocusAction.prototype = { onPerform$0() { var _this = this, t1 = type$.Hero._as(_this._actor), t2 = t1._focus, t3 = _this._action$_focus; if (t2 < t3) return _this.fail$1("You aren't focused enough."); t1._focus = t2 - t3; return _this.alternate$1(_this._action); } }; A.GeneratorActionMixin.prototype = { get$_action$_iterator() { var t1, t2, _this = this, value = _this.GeneratorActionMixin___GeneratorActionMixin__iterator_FI; if (value === $) { t1 = _this.onGenerate$0(); t2 = t1._outerHelper(); _this.GeneratorActionMixin___GeneratorActionMixin__iterator_FI !== $ && A.throwLateFieldADI("_iterator"); value = _this.GeneratorActionMixin___GeneratorActionMixin__iterator_FI = new A._SyncStarIterator(t2, t1.$ti._eval$1("_SyncStarIterator<1>")); } return value; }, onPerform$0() { var t2, t1 = this.get$_action$_iterator(); if (!t1.moveNext$0()) return B.ActionResult_null_true_true; t2 = t1._async$_current; return t2 == null ? t1.$ti._precomputed1._as(t2) : t2; }, wait$1($frames) { var __wc0_formal, _list = J.JSArray_JSArray$allocateGrowable($frames, type$.ActionResult); for (__wc0_formal = 0; __wc0_formal < $frames; ++__wc0_formal) _list[__wc0_formal] = B.ActionResult_null_true_false; return _list; } }; A.AttackAction.prototype = { onPerform$0() { var t1, t2, t3, _i, _this = this; for (t1 = _this.defender, t2 = _this._actor.createMeleeHits$1(t1), t3 = t2.length, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { t2[_i].perform$3(_this, _this._actor, t1); if (t1._health <= 0) break; } return B.ActionResult_null_true_true; }, get$noise() { return 1; }, toString$0(_) { return A.S(this._actor) + " attacks " + this.defender.toString$0(0); } }; A.ItemAction.prototype = { removeItem$0() { var t1, _this = this; switch (_this.location) { case B.ItemLocation_ybX: t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.removeItem$2(_this.item, _this._actor._pos); break; case B.ItemLocation_Inventory: B.JSArray_methods.remove$1(type$.Hero._as(_this._actor).save._inventory._items, _this.item); break; case B.ItemLocation_Equipment: t1 = _this.item; type$.Hero._as(_this._actor).save._equipment.remove$1(0, t1); if (t1.type.emanationLevel > 0) { t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.get$_lighting()._actorLightDirty = true; } break; default: throw A.wrapException(A.StateError$("Invalid location.")); } }, countChanged$0() { switch (this.location) { case B.ItemLocation_ybX: break; case B.ItemLocation_Inventory: type$.Hero._as(this._actor).save._inventory.countChanged$0(); break; case B.ItemLocation_Equipment: type$.Hero._as(this._actor); break; default: throw A.wrapException(A.StateError$("Invalid location.")); } } }; A.PickUpAction.prototype = { onPerform$0() { var t4, _this = this, _s38_ = "{1} [don't|doesn't] have room for {2}.", t1 = type$.Hero, t2 = _this.item, result = t1._as(_this._actor).save._inventory.tryAdd$1(t2), t3 = result.added; if (t3 === 0) return _this.fail$3(_s38_, _this._actor, t2); _this.show$3("{1} pick[s] up {2}.", _this._actor, t2.clone$1(t3)); t3 = result.remaining; t4 = _this._actor; if (t3 === 0) { t3 = _this.__Action__game_F; t3 === $ && A.throwLateFieldNI("_game"); t3 = t3.__Game__stage_F; t3 === $ && A.throwLateFieldNI("_stage"); t3.removeItem$2(t2, t4._pos); } else _this.show$3(_s38_, t4, t2.clone$1(t3)); t1 = t1._as(_this._actor); t3 = _this.__Action__game_F; t3 === $ && A.throwLateFieldNI("_game"); t1.pickUp$2(t3, t2); return B.ActionResult_null_true_true; } }; A.DropAction.prototype = { onPerform$0() { var _this = this, t1 = _this._item$_count, dropped = _this.item; if (t1 === dropped._count) _this.removeItem$0(); else { dropped = dropped.splitStack$1(t1); _this.countChanged$0(); } t1 = _this._actor; if (_this.location === B.ItemLocation_Equipment) { _this.show$3("{1} take[s] off and drop[s] {2}.", t1, dropped); type$.Hero._as(_this._actor).refreshProperties$0(); } else _this.show$3("{1} drop[s] {2}.", t1, dropped); t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.addItem$2(dropped, _this._actor._pos); return B.ActionResult_null_true_true; } }; A.EquipAction.prototype = { onPerform$0() { var equipped, equipped0, unequipped, t2, _i, unequippedItem, t3, result, t4, t5, t6, t7, t8, t9, _this = this, _s5_ = "_game", _s6_ = "_stage", t1 = _this.location; if (t1 === B.ItemLocation_Equipment) return _this.alternate$1(new A.UnequipAction(t1, _this.item)); t1 = type$.Hero; equipped = _this.item; if (!t1._as(_this._actor).save._equipment.canEquip$1(equipped)) return _this.fail$3("{1} cannot equip {2}.", _this._actor, equipped); if (equipped._count === 1) { _this.removeItem$0(); equipped0 = equipped; } else { equipped0 = equipped.splitStack$1(1); _this.countChanged$0(); } unequipped = t1._as(_this._actor).save._equipment.equip$1(equipped0); for (t2 = unequipped.length, _i = 0; _i < unequipped.length; unequipped.length === t2 || (0, A.throwConcurrentModificationError)(unequipped), ++_i) { unequippedItem = unequipped[_i]; t3 = unequippedItem._count; result = t1._as(_this._actor).save._inventory.tryAdd$2$wasUnequipped(unequippedItem, true); t4 = _this._actor; if (result.remaining === 0) { t5 = _this.__Action__game_F; t5 === $ && A.throwLateFieldNI(_s5_); t6 = t5.__Game__stage_F; t6 === $ && A.throwLateFieldNI(_s6_); t7 = _this.__Action__pos_F; t7 === $ && A.throwLateFieldNI("_pos"); t6 = t6.tiles; t8 = t7.get$x(); t7 = t7.get$y(); t6._checkBounds$2(t8, t7); t9 = t6._elements; t8 = t7 * t6.bounds.size.x + t8; if (!(t8 >= 0 && t8 < t9.length)) return A.ioore(t9, t8); t8 = t9[t8]; if (!t8._isOccluded && t8.floorIllumination + t8.actorIllumination > t8._fallOff || _this._actor instanceof A.Hero) t5.hero.save.log._log$_add$5(B.LogType_0, "{1} unequip[s] {2}.", t4, new A.Item(unequippedItem.type, unequippedItem.prefix, unequippedItem.suffix, unequippedItem.intrinsicAffix, t3), null); } else { t3 = _this.__Action__game_F; t3 === $ && A.throwLateFieldNI(_s5_); t5 = t3.__Game__stage_F; t5 === $ && A.throwLateFieldNI(_s6_); t5.addItem$2(unequippedItem, t4._pos); t4 = _this._actor; t5 = t3.__Game__stage_F; t5 === $ && A.throwLateFieldNI(_s6_); t6 = _this.__Action__pos_F; t6 === $ && A.throwLateFieldNI("_pos"); t5 = t5.tiles; t7 = t6.get$x(); t6 = t6.get$y(); t5._checkBounds$2(t7, t6); t8 = t5._elements; t7 = t6 * t5.bounds.size.x + t7; if (!(t7 >= 0 && t7 < t8.length)) return A.ioore(t8, t7); t7 = t8[t7]; if (!t7._isOccluded && t7.floorIllumination + t7.actorIllumination > t7._fallOff || _this._actor instanceof A.Hero) t3.hero.save.log._log$_add$5(B.LogType_0, string$._1___d, t4, unequippedItem, null); } } _this.show$3("{1} equip[s] {2}.", _this._actor, equipped0); if (equipped.type.emanationLevel > 0) { t2 = _this.__Action__game_F; t2 === $ && A.throwLateFieldNI(_s5_); t2 = t2.__Game__stage_F; t2 === $ && A.throwLateFieldNI(_s6_); t2.get$_lighting()._actorLightDirty = true; } t1._as(_this._actor).refreshProperties$0(); return B.ActionResult_null_true_true; } }; A.UnequipAction.prototype = { onPerform$0() { var t2, result, t3, t4, _this = this, t1 = _this.item, copy = t1.clone$0(); _this.removeItem$0(); t2 = type$.Hero; result = t2._as(_this._actor).save._inventory.tryAdd$2$wasUnequipped(t1, true); t3 = _this._actor; if (result.remaining === 0) _this.show$3("{1} unequip[s] {2}.", t3, copy); else { t4 = _this.__Action__game_F; t4 === $ && A.throwLateFieldNI("_game"); t4 = t4.__Game__stage_F; t4 === $ && A.throwLateFieldNI("_stage"); t4.addItem$2(t1, t3._pos); _this.show$3(string$._1___d, _this._actor, t1); } t2._as(_this._actor).refreshProperties$0(); return B.ActionResult_null_true_true; } }; A.UseAction.prototype = { onPerform$0() { var t3, t4, _this = this, t1 = _this.item, t2 = t1.type.use; if (t2 == null) return _this.fail$2("{1} can't be used.", t1); --t1._count; t2 = t2.createAction.call$0(); if (t1._count === 0) _this.removeItem$0(); else _this.countChanged$0(); if (_this.location === B.ItemLocation_ybX) { t3 = type$.Hero._as(_this._actor); t4 = _this.__Action__game_F; t4 === $ && A.throwLateFieldNI("_game"); t3.pickUp$2(t4, t1); } type$.Hero._as(_this._actor).save.lore.useItem$1(t1); return _this.alternate$1(t2); } }; A.DestroyActionMixin.prototype = { _destroy$4(element, items, isHeld, removeItem) { var t1, t2, t3, fuel, _i, item, t4, chance, destroyedCount, i, t5, t6, t7, t8, t9, _this = this, _null = null; type$.Iterable_Item._as(items); type$.void_Function_Item._as(removeItem); t1 = A.List_List$_of(items, A._instanceType(items)._eval$1("Iterable.E")); t2 = t1.length; t3 = "{1} " + element.destroyMessage + "!"; fuel = 0; _i = 0; for (; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { item = t1[_i]; t4 = item.type; chance = t4.destroyChance.$index(0, element); if (chance == null) chance = 0; if (isHeld) chance = Math.min(30, B.JSInt_methods._tdivFast$1(chance, 2)); if (chance === 0) continue; for (destroyedCount = 0, i = 0; t5 = item._count, i < t5; ++i) { t5 = $.$get$rng(); if (t5._random.nextInt$1(100) < chance) ++destroyedCount; } if (destroyedCount === t5) { t5 = _this.__Action__game_F; t5 === $ && A.throwLateFieldNI("_game"); t6 = t5.__Game__stage_F; t6 === $ && A.throwLateFieldNI("_stage"); t7 = _this.__Action__pos_F; t7 === $ && A.throwLateFieldNI("_pos"); t6 = t6.tiles; t8 = t7.get$x(); t7 = t7.get$y(); t6._checkBounds$2(t8, t7); t9 = t6._elements; t8 = t7 * t6.bounds.size.x + t8; if (!(t8 >= 0 && t8 < t9.length)) return A.ioore(t9, t8); t8 = t9[t8]; if (!t8._isOccluded && t8.floorIllumination + t8.actorIllumination > t8._fallOff || _this._actor instanceof A.Hero) t5.hero.save.log._log$_add$5(B.LogType_0, t3, item, _null, _null); removeItem.call$1(item); } else if (destroyedCount > 0) { item._count = t5 - destroyedCount; t5 = _this.__Action__game_F; t5 === $ && A.throwLateFieldNI("_game"); t6 = t5.__Game__stage_F; t6 === $ && A.throwLateFieldNI("_stage"); t7 = _this.__Action__pos_F; t7 === $ && A.throwLateFieldNI("_pos"); t6 = t6.tiles; t8 = t7.get$x(); t7 = t7.get$y(); t6._checkBounds$2(t8, t7); t9 = t6._elements; t8 = t7 * t6.bounds.size.x + t8; if (!(t8 >= 0 && t8 < t9.length)) return A.ioore(t9, t8); t8 = t9[t8]; if (!t8._isOccluded && t8.floorIllumination + t8.actorIllumination > t8._fallOff || _this._actor instanceof A.Hero) t5.hero.save.log._log$_add$5(B.LogType_0, t3, new A.Item(t4, item.prefix, item.suffix, item.intrinsicAffix, destroyedCount), _null, _null); } fuel += t4.fuel * destroyedCount; } return fuel; }, destroyFloorItems$2(pos, element) { var t1 = this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); return this._destroy$4(element, t1.itemsAt$1(pos), false, new A.DestroyActionMixin_destroyFloorItems_closure(this, pos)); }, destroyHeldItems$1(element) { var fuel, t3, _this = this, t1 = {}, t2 = _this._actor; if (!(t2 instanceof A.Hero)) return 0; if (t2.resistance$1(element) > 0) return 0; t2 = type$.Hero; fuel = _this._destroy$4(element, t2._as(_this._actor).save._inventory, true, new A.DestroyActionMixin_destroyHeldItems_closure(_this)); t1.anyEquipmentDestroyed = false; t3 = _this._destroy$4(element, t2._as(_this._actor).save._equipment, true, new A.DestroyActionMixin_destroyHeldItems_closure0(t1, _this)); if (t1.anyEquipmentDestroyed) t2._as(_this._actor).refreshProperties$0(); return fuel + t3; } }; A.DestroyActionMixin_destroyFloorItems_closure.prototype = { call$1(item) { var t1 = this.$this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.removeItem$2(item, this.pos); }, $signature: 10 }; A.DestroyActionMixin_destroyHeldItems_closure.prototype = { call$1(item) { B.JSArray_methods.remove$1(type$.Hero._as(this.$this._actor).save._inventory._items, item); }, $signature: 10 }; A.DestroyActionMixin_destroyHeldItems_closure0.prototype = { call$1(item) { type$.Hero._as(this.$this._actor).save._equipment.remove$1(0, item); this._box_0.anyEquipmentDestroyed = true; }, $signature: 10 }; A.LosAction.prototype = { get$_los() { var iterator, _this = this, value = _this.__LosAction__los_FI; if (value === $) { iterator = A._LineIterator__LineIterator(_this._actor._pos, _this._los$_target); iterator.moveNext$0(); _this.__LosAction__lastPos_A = _this._actor._pos; _this.__LosAction__los_FI !== $ && A.throwLateFieldADI("_los"); _this.__LosAction__los_FI = iterator; value = iterator; } return value; }, get$isImmediate() { return false; }, onPerform$0() { var t3, t4, _this = this, _s8_ = "_lastPos", t1 = _this.get$_los(), pos = t1._line$_current, t2 = _this.__Action__game_F; t2 === $ && A.throwLateFieldNI("_game"); t3 = t2.__Game__stage_F; t3 === $ && A.throwLateFieldNI("_stage"); t3 = t3.tiles.$get$2(pos.get$x(), pos.get$y()); t4 = $.$get$Motility_fly(); if ((t3.type.motility._bitMask & t4._bitMask) === 0 || pos.$sub(0, _this._actor._pos).$gt(0, _this.get$range())) { t1 = _this.__LosAction__lastPos_A; t1 === $ && A.throwLateFieldNI(_s8_); _this.onEnd$1(t1); return _this.succeed$0(); } t3 = _this.__LosAction__lastPos_A; t3 === $ && A.throwLateFieldNI(_s8_); _this.onStep$2(t3, pos); t2 = t2.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t2 = t2._actorsByTile.$get$2(pos.get$x(), pos.get$y()); if (t2 != null && t2 !== _this._actor) if (_this.onHitActor$2(pos, t2)) return B.ActionResult_null_true_true; if (pos.$eq(0, _this._los$_target)) if (_this.onTarget$1(pos)) return B.ActionResult_null_true_true; _this.__LosAction__lastPos_A = pos; t1.moveNext$0(); return B.ActionResult_null_true_false; }, onHitActor$2(pos, target) { return true; }, onEnd$1(pos) { }, onTarget$1(pos) { return false; } }; A.TossAction.prototype = { onPerform$0() { var _this = this, tossed = _this.item; if (tossed.type.toss == null) return _this.fail$2("{1} can't be thrown.", tossed); if (tossed._count === 1) _this.removeItem$0(); else { tossed = tossed.splitStack$1(1); _this.countChanged$0(); } return _this.alternate$1(new A.TossLosAction(tossed, _this._toss$_hit, _this._toss$_target)); } }; A.TossLosAction.prototype = { get$range() { return this._toss$_hit.get$range(); }, onStep$2(previous, pos) { this.addEvent$3$other$pos(B.EventType_toss, this._toss$_item, pos); }, onHitActor$2(pos, target) { var _this = this; if (_this._toss$_hit.perform$3(_this, _this._actor, target) === 0) { _this._missed = true; return false; } _this._endThrow$1(pos); return true; }, onEnd$1(pos) { this._endThrow$1(pos); }, onTarget$1(pos) { if (this._missed) return false; this._endThrow$1(pos); return true; }, _endThrow$1(pos) { var t3, _this = this, t1 = _this._toss$_item, toss = t1.type.toss, t2 = toss.use; if (t2 != null) { _this.addAction$1(t2.call$1(pos)); return; } t2 = $.$get$rng(); t3 = toss.breakage; if (t2.range$1(100) < t3) { _this.show$2("{1} breaks!", t1); return; } t2 = _this.__Action__game_F; t2 === $ && A.throwLateFieldNI("_game"); t2 = t2.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t2.addItem$2(t1, pos); } }; A.WalkAction.prototype = { onPerform$0() { var pos, t2, t3, t4, tile, t5, t6, _i, item, t7, min, max, value, t8, t9, t10, t11, _this = this, _s6_ = "_stage", t1 = _this._walk$_dir; if (t1 === B.Direction_0_0_0_none) return _this.alternate$1(A.RestAction$()); pos = _this._actor._pos.$add(0, t1); t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI(_s6_); t3 = pos.x; t4 = pos.y; t2 = t2._actorsByTile.$get$2(t3, t4); if (t2 != null && t2 !== _this._actor) return _this.alternate$1(new A.AttackAction(t2)); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI(_s6_); tile = t2.tiles.$get$2(t3, t4).type; t2 = tile.onOperate; if (t2 != null) { t5 = tile.motility; t6 = $.$get$Motility_door(); if (t5.$eq(0, t6) && (_this._actor.get$motility()._bitMask & t6._bitMask) !== 0 || (t5._bitMask & _this._actor.get$motility()._bitMask) === 0) return _this.alternate$1(t2.call$1(pos)); } t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI(_s6_); if (!t2.canOccupy$2(pos, _this._actor.get$motility())) { if (_this._actor instanceof A.Hero) { t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI(_s6_); t1.exploreAt$3$force(t3, t4, true); } return _this.fail$2("{1} hit[s] the " + tile.name + ".", _this._actor); } _this._actor.setPosition$2(t1, pos); if (_this._actor instanceof A.Hero) { t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI(_s6_); t2 = t2.itemsAt$1(pos); t2 = A.List_List$_of(t2, A._instanceType(t2)._eval$1("Iterable.E")); t3 = t2.length; t4 = type$.Hero; t5 = t1.hero.save.log; t6 = t1._events; _i = 0; for (; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { item = t2[_i]; t7 = t4._as(_this._actor); if (!(t7._behavior instanceof A.ActionBehavior)) t7._behavior = null; if (item.type.isTreasure) { min = B.JSNumber_methods.ceil$0(item.get$price() * 0.5); max = B.JSNumber_methods.ceil$0(item.get$price() * 1.5); t7 = $.$get$rng(); value = t7._random.nextInt$1(max - min) + min; t7 = t4._as(_this._actor); t7.save.gold += value; t8 = t1.__Game__stage_F; t8 === $ && A.throwLateFieldNI(_s6_); t9 = _this.__Action__pos_F; t9 === $ && A.throwLateFieldNI("_pos"); t8 = t8.tiles; t10 = t9.get$x(); t9 = t9.get$y(); t8._checkBounds$2(t10, t9); t11 = t8._elements; t10 = t9 * t8.bounds.size.x + t10; if (!(t10 >= 0 && t10 < t11.length)) return A.ioore(t11, t10); t10 = t11[t10]; if (!t10._isOccluded && t10.floorIllumination + t10.actorIllumination > t10._fallOff || _this._actor instanceof A.Hero) t5._log$_add$5(B.LogType_0, "{1} pick[s] up {2} worth " + value + " gold.", t7, item, null); t7 = t1.__Game__stage_F; t7 === $ && A.throwLateFieldNI(_s6_); t7.removeItem$2(item, pos); t7 = _this._actor; t8 = t7._pos; t9 = $.$get$Element_none(); B.JSArray_methods.add$1(t6, new A.Event(B.EventType_gold, t7, t9, item, t8, null)); } else { t8 = t1.__Game__stage_F; t8 === $ && A.throwLateFieldNI(_s6_); t9 = _this.__Action__pos_F; t9 === $ && A.throwLateFieldNI("_pos"); t8 = t8.tiles; t10 = t9.get$x(); t9 = t9.get$y(); t8._checkBounds$2(t10, t9); t11 = t8._elements; t10 = t9 * t8.bounds.size.x + t10; if (!(t10 >= 0 && t10 < t11.length)) return A.ioore(t11, t10); t10 = t11[t10]; if (!t10._isOccluded && t10.floorIllumination + t10.actorIllumination > t10._fallOff || _this._actor instanceof A.Hero) t5._log$_add$5(B.LogType_0, "{1} [are|is] standing on {2}.", t7, item, null); } } t4._as(_this._actor).regenerateFocus$1(1); } return _this.succeed$0(); }, toString$0(_) { return A.S(this._actor) + " walks " + this._walk$_dir.toString$0(0); } }; A.OpenDoorAction.prototype = { onPerform$0() { var t2, t3, _this = this, t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t3 = _this.pos; t2.tiles.$get$2(t3.get$x(), t3.get$y()).type = _this.openDoor; t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.tileOpacityChanged$0(); t1 = _this._actor; if (t1 instanceof A.Hero) t1.regenerateFocus$1(1); return _this.succeed$2("{1} open[s] the door.", _this._actor); } }; A.CloseDoorAction.prototype = { onPerform$0() { var t2, t3, _this = this, _s6_ = "_stage", t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI(_s6_); t3 = _this.doorPos; t2 = t2._actorsByTile.$get$2(t3.get$x(), t3.get$y()); if (t2 != null) return _this.fail$2("{1} [are|is] in the way!", t2); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI(_s6_); t2.tiles.$get$2(t3.get$x(), t3.get$y()).type = _this.closedDoor; t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI(_s6_); t1.tileOpacityChanged$0(); t1 = _this._actor; if (t1 instanceof A.Hero) t1.regenerateFocus$1(1); return _this.succeed$2("{1} close[s] the door.", _this._actor); } }; A.RestAction.prototype = { onPerform$0() { var _0_0, t1, hero, t2, actor, _this = this, _null = null; $label0$0: { _0_0 = _this._actor; t1 = _0_0 instanceof A.Hero; hero = t1 ? _0_0 : _null; if (t1) { t1 = hero._stomach; if (t1 > 0) { t1 = B.JSInt_methods.clamp$2(t1 - 1, 0, 400); hero._stomach = t1; if (t1 === 0) { t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1.hero.save.log._log$_add$5(B.LogType_0, "You are getting hungry.", _null, _null, _null); } if (hero.poison._turnsRemaining <= 0) hero._health = B.JSInt_methods.clamp$2(hero._health + 1, 0, hero.get$maxHealth()); } hero.regenerateFocus$1(2); break $label0$0; } t1 = false; if (_0_0 instanceof A.Actor) { t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = _0_0._pos; t2 = t1.tiles.$get$2(t2.get$x(), t2.get$y()); t1 = !(!t2._isOccluded && t2.floorIllumination + t2.actorIllumination > t2._fallOff) && _0_0.poison._turnsRemaining <= 0; actor = _0_0; } else actor = _null; if (t1) actor._health = B.JSInt_methods.clamp$2(actor._health + 1, 0, actor.get$maxHealth()); } return _this.succeed$0(); }, get$noise() { return 0.05; } }; A.Actor.prototype = { get$pronoun() { return B.Pronoun_it_it_its; }, needsInput$1(game) { return false; }, get$defenses() { return new A._SyncStarIterable(this.defenses$body$Actor(), type$._SyncStarIterable_Defense); }, defenses$body$Actor() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 1, $async$errorStack = [], dodge; return function $async$get$defenses($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) switch ($async$goto) { case 0: // Function start dodge = $async$self.get$baseDodge(); if ($async$self.blindness._turnsRemaining > 0 || $async$self.dazzle._turnsRemaining > 0) dodge = B.JSInt_methods._tdivFast$1(dodge, 2); $async$goto = dodge !== 0 ? 2 : 3; break; case 2: // then $async$goto = 4; return $async$iterator._async$_current = new A.Defense(dodge, "{1} dodge[s] {2}."), 1; case 4: // after yield case 3: // join $async$goto = 5; return $async$iterator._yieldStar$1($async$self.onGetDefenses$0()); case 5: // after yield // implicit return return 0; case 1: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, setPosition$2(game, to) { var from, t1, actor, t2, _this = this; if (_this._pos.$eq(0, to)) return; from = _this._pos; if (_this.get$emanationLevel() > 0) { t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.get$_lighting()._actorLightDirty = true; } _this.onChangePosition$3(game, from, to); t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1 = t1._actorsByTile; actor = t1.$get$2(from.get$x(), from.get$y()); t2 = t1.$ti._precomputed1; t2._as(null); t1.$set$3(from.get$x(), from.get$y(), null); t2._as(actor); t1.$set$3(to.get$x(), to.get$y(), actor); _this._pos = to; }, onChangePosition$3(game, from, to) { }, createMeleeHits$1(defender) { var t1, _i, hits = this.onCreateMeleeHits$1(defender); for (t1 = hits.length, _i = 0; _i < hits.length; hits.length === t1 || (0, A.throwConcurrentModificationError)(hits), ++_i) this.modifyHit$2(hits[_i], B.HitType_0); return hits; }, modifyHit$2(hit, type) { var t1; if (this.blindness._turnsRemaining > 0 || this.dazzle._turnsRemaining > 0) { switch (type.index) { case 0: t1 = 0.5; break; case 1: t1 = 0.3; break; case 2: t1 = 0.2; break; default: t1 = null; } hit.scaleStrike$2(t1, "blindness"); } this.onModifyHit$2(hit, type); }, onModifyHit$2(hit, type) { }, resistance$1(element) { var result = this.onGetResistance$1(element), resistance = this.resistanceCondition$1(element); return resistance._turnsRemaining > 0 ? result + resistance._intensity : result; }, resistanceCondition$1(element) { var t1 = this._resistances, t2 = t1.$index(0, element); if (t2 == null) { t2 = new A.ResistCondition(element); t1.$indexSet(0, element, t2); t1 = t2; } else t1 = t2; return t1; }, takeDamage$4(action, damage, attackNoun, attacker) { var _this = this; _this._health = B.JSInt_methods.clamp$2(_this._health - damage, 0, _this.get$maxHealth()); _this.onTakeDamage$3(action, attacker, damage); if (_this._health > 0) return false; action.addEvent$2$actor(B.EventType_die, _this); action.show$3("{1} kill[s] {2}.", attackNoun, _this); if (attacker != null) attacker.onKilled$2(action, _this); _this.onDied$2(action, attackNoun); return true; }, takeDamage$3(action, damage, attackNoun) { return this.takeDamage$4(action, damage, attackNoun, null); }, onGiveDamage$3(action, defender, damage) { }, onTakeDamage$3(action, attacker, damage) { }, onDied$2(action, attackNoun) { }, onKilled$2(action, defender) { }, onFinishTurn$1(action) { }, finishTurn$1(action) { var t1, t2, _i, condition, t3, _this = this; _this.energy.energy -= 240; t1 = A._setArrayType([_this.haste, _this.cold, _this.poison, _this.blindness, _this.dazzle, _this.perception], type$.JSArray_Condition); t2 = _this._resistances; B.JSArray_methods.addAll$1(t1, new A.LinkedHashMapValuesIterable(t2, A._instanceType(t2)._eval$1("LinkedHashMapValuesIterable<2>"))); for (t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { condition = t1[_i]; t3 = condition._turnsRemaining; if (t3 > 0) { --t3; condition._turnsRemaining = t3; if (t3 > 0) condition.onUpdate$1(action); else { condition.onDeactivate$1(action); condition._intensity = 0; } } } if (_this._health > 0) _this.onFinishTurn$1(action); }, toString$0(_) { return this.get$nounText(); }, $isNoun: 1 }; A.Attack.prototype = { toString$0(_) { var result = B.JSInt_methods.toString$0(this.damage), t1 = this.element; if (t1 !== $.$get$Element_none()) result = t1.toString$0(0) + " " + result; t1 = this.range; return t1 > 0 ? result + ("@" + t1) : result; } }; A.HitType.prototype = { _enumToString$0() { return "HitType." + this._core$_name; } }; A.Bonus.prototype = {}; A.Scale.prototype = {}; A.Hit.prototype = { get$range() { var t1 = this._attack.range; if (t1 === 0) return 0; return Math.max(1, B.JSNumber_methods.round$0(t1 * this._rangeScale)); }, get$_strikeScale() { return B.JSArray_methods.fold$1$2(this._strikeScales, 1, new A.Hit__strikeScale_closure(), type$.double); }, get$_combat$_strikeBonus() { return B.JSArray_methods.fold$1$2(this._strikeBonuses, 1, new A.Hit__strikeBonus_closure(), type$.double); }, get$_combat$_damageScale() { return B.JSArray_methods.fold$1$2(this._damageScales, 1, new A.Hit__damageScale_closure(), type$.double); }, get$_combat$_damageBonus() { return B.JSArray_methods.fold$1$2(this._damageBonuses, 1, new A.Hit__damageBonus_closure(), type$.double); }, get$element() { var t1 = this._brand; if (t1 !== $.$get$Element_none()) return t1; return this._attack.element; }, get$averageDamage() { return this._attack.damage * this.get$_combat$_damageScale() + this.get$_combat$_damageBonus(); }, addStrike$2(bonus, reason) { if (bonus === 0) return; B.JSArray_methods.add$1(this._strikeBonuses, new A.Bonus(bonus)); }, scaleStrike$2(factor, reason) { if (factor === 1) return; B.JSArray_methods.add$1(this._strikeScales, new A.Scale(factor)); }, addDamage$2(offset, reason) { if (offset === 0) return; B.JSArray_methods.add$1(this._damageBonuses, new A.Bonus(offset)); }, scaleDamage$2(factor, reason) { if (factor === 1) return; B.JSArray_methods.add$1(this._damageScales, new A.Scale(factor)); }, perform$4$canMiss(action, attacker, defender, canMiss) { var t1, t2, canSeeDefender, t3, attackNoun, defenderNoun, strike, defenses, _i, defense, armor, resistance, damageCents, armorScale, damage, sideEffect, _this = this, _s5_ = "_game", _s6_ = "_stage", _s9_ = "something", canSeeAttacker = true; if (!(attacker instanceof A.Hero)) { if (attacker != null) { t1 = action.__Action__game_F; t1 === $ && A.throwLateFieldNI(_s5_); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI(_s6_); t2 = attacker._pos; t2 = t1.tiles.$get$2(t2.get$x(), t2.get$y()); t1 = !t2._isOccluded && t2.floorIllumination + t2.actorIllumination > t2._fallOff; } else t1 = false; if (!t1) if (!(defender instanceof A.Hero && _this._attack.noun != null)) { t1 = action.__Action__game_F; t1 === $ && A.throwLateFieldNI(_s5_); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI(_s6_); t2 = defender._pos; t2 = t1.tiles.$get$2(t2.get$x(), t2.get$y()); canSeeAttacker = !t2._isOccluded && t2.floorIllumination + t2.actorIllumination > t2._fallOff && _this._attack.noun != null; } } t1 = defender instanceof A.Hero; if (t1) canSeeDefender = true; else { t2 = action.__Action__game_F; t2 === $ && A.throwLateFieldNI(_s5_); t2 = t2.__Game__stage_F; t2 === $ && A.throwLateFieldNI(_s6_); t3 = defender._pos; t3 = t2.tiles.$get$2(t3.get$x(), t3.get$y()); canSeeDefender = !t3._isOccluded && t3.floorIllumination + t3.actorIllumination > t3._fallOff; } if (canSeeAttacker) { t2 = _this._attack.noun; if (t2 == null) t2 = attacker; t2.toString; attackNoun = t2; } else attackNoun = new A.Noun(_s9_); defenderNoun = canSeeDefender ? defender : new A.Noun(_s9_); if (t1) if (!(defender._behavior instanceof A.ActionBehavior)) defender._behavior = null; if (canMiss !== false) { t1 = $.$get$rng(); strike = t1.inclusive$2(1, 100) * _this.get$_strikeScale() + _this.get$_combat$_strikeBonus(); t2 = defender.get$defenses(); defenses = A.List_List$_of(t2, t2.$ti._eval$1("Iterable.E")); B.JSArray_methods.shuffle$1(type$.List_Defense._as(defenses), t1._random); for (t1 = defenses.length, _i = 0; _i < t1; ++_i) { defense = defenses[_i]; strike -= defense.amount; if (strike < 0) { if (canSeeAttacker || canSeeDefender) { t1 = action.__Action__game_F; t1 === $ && A.throwLateFieldNI(_s5_); t1.hero.save.log._log$_add$5(B.LogType_0, defense.message, defenderNoun, attackNoun, null); } return 0; } } } armor = defender.get$armor(); resistance = defender.resistance$1(_this.get$element()); action.__Action__game_F === $ && A.throwLateFieldNI(_s5_); t1 = _this._attack; damageCents = B.JSNumber_methods.toInt$0((t1.damage * _this.get$_combat$_damageScale() + _this.get$_combat$_damageBonus()) * (1 / (1 + resistance)) * 100); armorScale = A.getArmorMultiplier(armor); damage = B.JSNumber_methods.round$0($.$get$rng().triangleInt$2(damageCents, B.JSInt_methods._tdivFast$1(damageCents, 2)) * armorScale / 100); if (damage === 0) { if (canSeeAttacker || canSeeDefender) action.log$3("{1} do[es] no damage to {2}.", attackNoun, defenderNoun); return 0; } if (attacker != null) attacker.onGiveDamage$3(action, defender, damage); if (defender.takeDamage$4(action, damage, attackNoun, attacker)) return damage; if (resistance <= 0) { sideEffect = _this.get$element().attackAction.call$1(damage); if (sideEffect != null) action.addAction$2(sideEffect, defender); } action.addEvent$4$actor$element$other(B.EventType_hit, defender, _this.get$element(), damage); if (canSeeAttacker || canSeeDefender) action.log$3("{1} " + t1.verb + " {2}.", attackNoun, defenderNoun); return damage; }, perform$3(action, attacker, defender) { return this.perform$4$canMiss(action, attacker, defender, null); } }; A.Hit__strikeScale_closure.prototype = { call$2(total, scale) { return A._asDouble(total) * type$.Scale._as(scale).amount; }, $signature: 38 }; A.Hit__strikeBonus_closure.prototype = { call$2(total, bonus) { return A._asDouble(total) + type$.Bonus._as(bonus).amount; }, $signature: 37 }; A.Hit__damageScale_closure.prototype = { call$2(total, scale) { return A._asDouble(total) * type$.Scale._as(scale).amount; }, $signature: 38 }; A.Hit__damageBonus_closure.prototype = { call$2(total, bonus) { return A._asDouble(total) + type$.Bonus._as(bonus).amount; }, $signature: 37 }; A.Defense.prototype = {}; A.Condition.prototype = { onUpdate$1(action) { } }; A.HasteCondition.prototype = { onDeactivate$1(action) { action.show$2("{1} slow[s] back down.", action._actor); } }; A.ColdCondition.prototype = { onDeactivate$1(action) { action.show$2("{1} warm[s] back up.", action._actor); } }; A.PoisonCondition.prototype = { onUpdate$1(action) { if (!action._actor.takeDamage$3(action, this._intensity, new A.Noun("the poison"))) action.show$2("{1} [are|is] hurt by poison!", action._actor); }, onDeactivate$1(action) { action.show$2("{1} [are|is] no longer poisoned.", action._actor); } }; A.BlindnessCondition.prototype = { onDeactivate$1(action) { var t1, t2; action.show$2("{1} can see clearly again.", action._actor); t1 = action._actor; t2 = action.__Action__game_F; t2 === $ && A.throwLateFieldNI("_game"); if (t1 === t2.hero) { t1 = t2.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.get$_lighting()._visibilityDirty = true; } } }; A.ResistCondition.prototype = { onDeactivate$1(action) { action.show$2("{1} feel[s] susceptible to " + this._condition$_element.toString$0(0) + ".", action._actor); } }; A.PerceiveCondition.prototype = { onDeactivate$1(action) { action.show$2("{1} no longer perceive[s] monsters.", action._actor); } }; A.Element.prototype = { toString$0(_) { return this.name; } }; A.Element_closure.prototype = { call$1(__wc0_formal) { A._asInt(__wc0_formal); return null; }, $signature: 36 }; A.Element_closure0.prototype = { call$4(__wc1_formal, __wc2_formal, __wc3_formal, __wc4_formal) { type$.Vec._as(__wc1_formal); type$.Hit._as(__wc2_formal); A._asNum(__wc3_formal); A._asInt(__wc4_formal); return null; }, $signature: 81 }; A.Energy.prototype = {}; A.Game.prototype = { generate$0() { return new A._SyncStarIterable(this.generate$body$Game(), type$._SyncStarIterable_String); }, generate$body$Game() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 1, $async$errorStack = [], heroPos, t1, t2; return function $async$generate$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) switch ($async$goto) { case 0: // Function start heroPos = A._Cell$named("heroPos"); t1 = $async$self.hero; t2 = $async$self.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); $async$goto = 2; return $async$iterator._yieldStar$1($async$self.content.buildStage$4(t1.save.lore, t2, $async$self.depth, new A.Game_generate_closure(heroPos))); case 2: // after yield $async$goto = 3; return $async$iterator._async$_current = "Calculating visibility", 1; case 3: // after yield t1.setPosition$2($async$self, type$.Vec._as(heroPos._readLocal$0())); t2.get$_lighting().refresh$0(); // implicit return return 0; case 1: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, update$0() { var t1, t2, t3, t4, t5, t6, madeProgress, t7, t8, action, result, action0, result0, t9, actor, speed, t10, _this = this, _s15_ = "_consumesEnergy"; for (t1 = _this._actions, t2 = _this.hero, t3 = _this._substanceEnergy, t4 = _this._events, t5 = _this._reactions, t6 = t1.$ti._precomputed1, madeProgress = false;;) { for (; !t1.get$isEmpty(0); madeProgress = true) { t7 = t1._head; if (t7 === t1._tail) A.throwExpression(A.IterableElementError_noElement()); t8 = t1._table; if (!(t7 < t8.length)) return A.ioore(t8, t7); action = t8[t7]; if (action == null) action = t6._as(action); result = action.onPerform$0(); for (; action0 = result.alternative, action0 != null; action = action0) { t1.removeFirst$0(); t6._as(action0); t7 = t1._head; t8 = t1._table; t7 = (t7 - 1 & t8.length - 1) >>> 0; t1._head = t7; B.JSArray_methods.$indexSet(t8, t7, action0); if (t1._head === t1._tail) t1._grow$0(); ++t1._modificationCount; result = action0.onPerform$0(); } while (t7 = t5.length, t7 !== 0) { if (0 >= t7) return A.ioore(t5, -1); result0 = t5.pop().onPerform$0(); while (t7 = result0.alternative, t7 != null) result0 = t7.onPerform$0(); } t7 = _this.__Game__stage_F; t7 === $ && A.throwLateFieldNI("_stage"); t7.get$_lighting().refresh$0(); if (result.done) { t1.removeFirst$0(); if (result.succeeded) { t8 = action.__Action__consumesEnergy_F; t8 === $ && A.throwLateFieldNI(_s15_); } else t8 = false; if (t8) { action._actor.finishTurn$1(action); t7._currentActorIndex = B.JSInt_methods.$mod(t7._currentActorIndex + 1, t7._actors.length); } if (action._actor === t2) { t1 = A._setArrayType([], type$.JSArray_Event); B.JSArray_methods.addAll$1(t1, t4); B.JSArray_methods.clear$0(t4); return new A.GameResult(t1, true); } } if (t4.length !== 0) { t1 = A._setArrayType([], type$.JSArray_Event); B.JSArray_methods.addAll$1(t1, t4); B.JSArray_methods.clear$0(t4); return new A.GameResult(t1, true); } } if (_this._substanceIndex != null) _this._updateSubstances$0(); while (t1._head === t1._tail) { t7 = _this.__Game__stage_F; t7 === $ && A.throwLateFieldNI("_stage"); t8 = t7._actors; t9 = t7._currentActorIndex; if (!(t9 >= 0 && t9 < t8.length)) return A.ioore(t8, t9); actor = t8[t9]; t9 = actor.energy; if (t9.energy >= 240 && actor.needsInput$1(_this)) { t1 = A._setArrayType([], type$.JSArray_Event); B.JSArray_methods.addAll$1(t1, t4); B.JSArray_methods.clear$0(t4); return new A.GameResult(t1, madeProgress); } if (t9.energy < 240) { speed = actor.get$baseSpeed() + actor.haste._intensity - actor.cold._intensity; t10 = t9.energy; if (!(speed >= 0 && speed < 13)) return A.ioore(B.List_mRN, speed); t10 += B.List_mRN[speed]; t9.energy = t10; t10 = t10 >= 240; t9 = t10; } else t9 = true; if (t9) { if (actor.needsInput$1(_this)) { t1 = A._setArrayType([], type$.JSArray_Event); B.JSArray_methods.addAll$1(t1, t4); B.JSArray_methods.clear$0(t4); return new A.GameResult(t1, madeProgress); } action = actor.onGetAction$1(_this); action._actor = actor; t7 = actor._pos; action.__Action__pos_F !== $ && A.throwLateFieldAI("_pos"); action.__Action__pos_F = t7; action.__Action__game_F !== $ && A.throwLateFieldAI("_game"); action.__Action__game_F = _this; action.__Action__consumesEnergy_F !== $ && A.throwLateFieldAI(_s15_); action.__Action__consumesEnergy_F = true; t1._add$1(t6._as(action)); } else t7._currentActorIndex = B.JSInt_methods.$mod(t7._currentActorIndex + 1, t8.length); if (actor === t2) { t7 = t3.energy += 60; if (t7 >= 240) { t3.energy = t7 - 240; _this._substanceIndex = 0; _this._updateSubstances$0(); } } } } }, heroCanPerceive$1(actor) { var t2, t1 = this.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = actor._pos; t2 = t1.tiles.$get$2(t2.get$x(), t2.get$y()); if (!t2._isOccluded && t2.floorIllumination + t2.actorIllumination > t2._fallOff) return true; t1 = this.hero; t2 = t1.perception; if (t2._turnsRemaining > 0 && t1._pos.$sub(0, actor._pos).$lt(0, t2._intensity)) return true; return false; }, _updateSubstances$0() { var t3, pos, action, _this = this, t1 = _this._substanceUpdateOrder, t2 = _this.content; for (;;) { t3 = _this._substanceIndex; t3.toString; if (!(t3 < t1.length)) break; pos = t1[t3]; t3 = _this.__Game__stage_F; t3 === $ && A.throwLateFieldNI("_stage"); action = t2.updateSubstance$2(t3, pos); t3 = _this._substanceIndex; t3.toString; _this._substanceIndex = t3 + 1; if (action != null) { action.__Action__pos_F !== $ && A.throwLateFieldAI("_pos"); action.__Action__pos_F = pos; action.__Action__game_F !== $ && A.throwLateFieldAI("_game"); action.__Action__game_F = _this; action.__Action__consumesEnergy_F !== $ && A.throwLateFieldAI("_consumesEnergy"); action.__Action__consumesEnergy_F = false; t1 = _this._actions; t1._add$1(t1.$ti._precomputed1._as(action)); return; } } _this._substanceIndex = null; } }; A.Game_generate_closure.prototype = { call$1(pos) { this.heroPos._value = pos; }, $signature: 82 }; A.GameResult.prototype = {}; A.Event.prototype = {}; A.EventType.prototype = { toString$0(_) { return this._game$_name; } }; A.Log.prototype = { gain$2(message, noun1) { this._log$_add$5(B.LogType_3, message, noun1, null, null); }, gain$1(message) { return this.gain$2(message, null); }, debug$2(message, noun1) { this._log$_add$5(B.LogType_5, message, noun1, null, null); }, debug$1(message) { return this.debug$2(message, null); }, _log$_add$5(type, message, noun1, noun2, noun3) { var t1, last; message = this._format$4(message, noun1, noun2, noun3); t1 = this.messages; if (t1.length !== 0) { last = B.JSArray_methods.get$last(t1); if (last.text === message) { ++last.count; return; } } B.JSArray_methods.add$1(t1, new A.Message(type, message, 1)); if (t1.length > 100) B.JSArray_methods.removeAt$1(t1, 0); }, _format$4(text, noun1, noun2, noun3) { var result, i, noun, t1, t2, nouns = [noun1, noun2, noun3]; for (result = text, i = 1; i <= 3; ++i) { noun = nouns[i - 1]; if (noun != null) { t1 = "{" + i; t2 = noun.get$nounText(); result = A.stringReplaceAllUnchecked(result, t1 + "}", t2); t2 = noun.get$pronoun(); result = A.stringReplaceAllUnchecked(result, t1 + " he}", t2.subjective); t2 = noun.get$pronoun(); result = A.stringReplaceAllUnchecked(result, t1 + " him}", t2.objective); t2 = noun.get$pronoun(); result = A.stringReplaceAllUnchecked(result, t1 + " his}", t2.possessive); } } if (noun1 != null) { t1 = noun1.get$pronoun(); result = A.Log__categorize(result, false, t1 === B.Pronoun_you_you_your || t1 === B.Pronoun_they_them_their); } if (0 >= result.length) return A.ioore(result, 0); return result[0].toUpperCase() + B.JSString_methods.substring$1(result, 1); } }; A.Log_wordWrap_finishWord.prototype = { call$1(end) { var t3, t1 = this._box_0, t2 = t1.wordStart; if (t2 === -1) return; t3 = t1.line; if (t3.length !== 0) t3 = t1.line = t3 + " "; t1.line = t3 + B.JSString_methods.substring$2(this.text, t2, end); t1.wordStart = -1; }, $signature: 83 }; A.Log_wordWrap_finishLine.prototype = { call$0() { var t1 = this._box_0; B.JSArray_methods.add$1(this.lines, t1.line); t1.line = ""; }, $signature: 0 }; A.Noun.prototype = { get$pronoun() { return B.Pronoun_it_it_its; }, toString$0(_) { return this.nounText; }, get$nounText() { return this.nounText; } }; A.Pronoun.prototype = { toString$0(_) { return this.subjective + "/" + this.objective; } }; A.LogType.prototype = { _enumToString$0() { return "LogType." + this._core$_name; } }; A.Message.prototype = {}; A.hashPoint_hashInt.prototype = { call$1(n) { n = ((B.JSInt_methods._shrOtherPositive$1(n, 16) ^ n) >>> 0) * 73244475 >>> 0; n = ((n >>> 16 ^ n) >>> 0) * 73244475 >>> 0; return (n >>> 16 ^ n) >>> 0; }, $signature: 5 }; A.ResourceSet.prototype = { get$all() { var t1 = this._resources, t2 = A._instanceType(t1)._eval$1("LinkedHashMapValuesIterable<2>"), t3 = this.$ti._precomputed1; return A.MappedIterable_MappedIterable(new A.LinkedHashMapValuesIterable(t1, t2), t2._bind$1(t3)._eval$1("1(Iterable.E)")._as(new A.ResourceSet_all_closure(this)), t2._eval$1("Iterable.E"), t3); }, _resource$_add$7(object, $name, startDepth, endDepth, startFrequency, endFrequency, tags) { var t2, t3, t4, _i, tagName, tag, _this = this, t1 = _this.$ti; t1._precomputed1._as(object); if ($name == null) $name = B.JSInt_methods.toString$0(_this._resources.__js_helper$_length); if (startDepth == null) startDepth = 1; if (endDepth == null) endDepth = startDepth; if (startFrequency == null) startFrequency = 1; if (endFrequency == null) endFrequency = startFrequency; t2 = _this._resources; if (t2.containsKey$1($name)) throw A.wrapException(A.ArgumentError$('Already have a resource named "' + $name + '".', null)); t3 = A.LinkedHashSet_LinkedHashSet$_empty(t1._eval$1("_Tag<1>")); t2.$indexSet(0, $name, new A._Resource(object, startDepth, endDepth, startFrequency, endFrequency, t3, t1._eval$1("_Resource<1>"))); if (tags != null && tags !== "") for (t1 = tags.split(" "), t2 = t1.length, t4 = _this._tags, _i = 0; _i < t2; ++_i) { tagName = t1[_i]; tag = t4.$index(0, tagName); if (tag == null) throw A.wrapException(A.ArgumentError$('Unknown tag "' + tagName + '".', null)); t3.add$1(0, tag); } }, defineTags$1(paths) { var t1, t2, t3, t4, _i, t5, t6, $parent, _i0, $name, tag; for (t1 = paths.split(" "), t2 = t1.length, t3 = this._tags, t4 = this.$ti._eval$1("_Tag<1>"), _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) for (t5 = t1[_i].split("/"), t6 = t5.length, $parent = null, _i0 = 0; _i0 < t6; ++_i0, $parent = tag) { $name = t5[_i0]; tag = t3.$index(0, $name); if (tag == null) { tag = new A._Tag($name, $parent, t4); t3.$indexSet(0, $name, tag); } } }, find$1($name) { var resource = this._resources.$index(0, $name); if (resource == null) throw A.wrapException(A.ArgumentError$('Unknown resource "' + $name + '".', null)); return resource.object; }, tryFind$1($name) { var resource = this._resources.$index(0, $name); if (resource == null) return null; return resource.object; }, hasTag$2($name, tagName) { var tag, resource = this._resources.$index(0, $name); if (resource == null) throw A.wrapException(A.ArgumentError$('Unknown resource "' + $name + '".', null)); tag = this._tags.$index(0, tagName); if (tag == null) throw A.wrapException(A.ArgumentError$('Unknown tag "' + tagName + '".', null)); return resource._tags.any$1(0, new A.ResourceSet_hasTag_closure(this, tag)); }, getTags$1($name) { var t1, t2, resource = this._resources.$index(0, $name); if (resource == null) throw A.wrapException(A.ArgumentError$('Unknown resource "' + $name + '".', null)); t1 = resource._tags; t2 = A._instanceType(t1); return new A.EfficientLengthMappedIterable(t1, t2._eval$1("String(1)")._as(new A.ResourceSet_getTags_closure(this)), t2._eval$1("EfficientLengthMappedIterable<1,String>")); }, tryChoose$3$includeParents$tag(depth, includeParents, tag) { var t2, goalTag, label, _this = this, t1 = {}; t1.includeParents = includeParents; t2 = includeParents == null ? t1.includeParents = true : includeParents; if (tag == null) return _this._runQuery$3("", depth, new A.ResourceSet_tryChoose_closure(_this)); goalTag = _this._tags.$index(0, tag); label = goalTag.name; if (!t2) label += " (only)"; return _this._runQuery$3(label, depth, new A.ResourceSet_tryChoose_closure0(t1, _this, goalTag)); }, tryChoose$1(depth) { return this.tryChoose$3$includeParents$tag(depth, null, null); }, tryChoose$2$tag(depth, tag) { return this.tryChoose$3$includeParents$tag(depth, null, tag); }, tryChooseMatching$2(depth, tags) { var t1, t2, t3, tagObjects, tagNames, _this = this; type$.Iterable_String._as(tags); t1 = _this.$ti._eval$1("_Tag<1>"); t2 = tags.$ti; t3 = t2._eval$1("Iterable.E"); tagObjects = A.MappedIterable_MappedIterable(tags, t2._bind$1(t1)._eval$1("1(Iterable.E)")._as(new A.ResourceSet_tryChooseMatching_closure(_this)), t3, t1); tagNames = A.List_List$_of(tags, t3); B.JSArray_methods.sort$0(tagNames); return _this._runQuery$3(B.JSArray_methods.join$1(tagNames, "|") + " (match)", depth, new A.ResourceSet_tryChooseMatching_closure0(_this, tagObjects)); }, _runQuery$3($name, depth, scale) { var key, t2, query, resources, chances, t3, totalChance, t4, chance, t1 = this.$ti; t1._eval$1("double(_Resource<1>)")._as(scale); key = new A._QueryKey($name, depth); t2 = this._queries; query = t2.$index(0, key); if (query == null) { resources = A._setArrayType([], t1._eval$1("JSArray<_Resource<1>>")); chances = A._setArrayType([], type$.JSArray_double); for (t3 = this._resources, t3 = new A.LinkedHashMapValueIterator(t3, t3._modifications, t3._first, A._instanceType(t3)._eval$1("LinkedHashMapValueIterator<2>")), totalChance = 0; t3.moveNext$0();) { t4 = t3.__js_helper$_current; chance = scale.call$1(t4); if (chance === 0) continue; totalChance += Math.max(1e-7, chance * (t4.frequencyAtDepth$1(depth) * t4.chanceAtDepth$1(depth))); B.JSArray_methods.add$1(resources, t4); B.JSArray_methods.add$1(chances, totalChance); } query = new A._ResourceQuery(resources, chances, totalChance, t1._eval$1("_ResourceQuery<1>")); t2.$indexSet(0, key, query); } return query.choose$0(); } }; A.ResourceSet_all_closure.prototype = { call$1(resource) { return this.$this.$ti._eval$1("_Resource<1>")._as(resource).object; }, $signature() { return this.$this.$ti._eval$1("1(_Resource<1>)"); } }; A.ResourceSet_hasTag_closure.prototype = { call$1(thisTag) { return this.$this.$ti._eval$1("_Tag<1>")._as(thisTag).contains$1(0, this.tag); }, $signature() { return this.$this.$ti._eval$1("bool(_Tag<1>)"); } }; A.ResourceSet_getTags_closure.prototype = { call$1(tag) { return this.$this.$ti._eval$1("_Tag<1>")._as(tag).name; }, $signature() { return this.$this.$ti._eval$1("String(_Tag<1>)"); } }; A.ResourceSet_tryChoose_closure.prototype = { call$1(__wc0_formal) { this.$this.$ti._eval$1("_Resource<1>")._as(__wc0_formal); return 1; }, $signature() { return this.$this.$ti._eval$1("double(_Resource<1>)"); } }; A.ResourceSet_tryChoose_closure0.prototype = { call$1(resource) { var thisTag, t1, t2, t3, t4, scale, t5, t6; for (thisTag = this.goalTag, t1 = this._box_0, t2 = this.$this.$ti._eval$1("_Resource<1>")._as(resource)._tags, t3 = A._instanceType(t2), t4 = t3._eval$1("_LinkedHashSetIterator<1>"), t3 = t3._precomputed1, scale = 1; thisTag != null; thisTag = thisTag.parent) { for (t5 = new A._LinkedHashSetIterator(t2, t2._collection$_modifications, t4), t5._collection$_cell = t2._collection$_first; t5.moveNext$0();) { t6 = t5._collection$_current; if ((t6 == null ? t3._as(t6) : t6).contains$1(0, thisTag)) return scale; } t5 = t1.includeParents; t5.toString; if (!t5) break; scale /= 10; } return 0; }, $signature() { return this.$this.$ti._eval$1("double(_Resource<1>)"); } }; A.ResourceSet_tryChooseMatching_closure.prototype = { call$1($name) { var tag; A._asString($name); tag = this.$this._tags.$index(0, $name); if (tag == null) throw A.wrapException(A.ArgumentError$('Unknown tag "' + $name + '".', null)); return tag; }, $signature() { return this.$this.$ti._eval$1("_Tag<1>(String)"); } }; A.ResourceSet_tryChooseMatching_closure0.prototype = { call$1(resource) { var t2, t3, t4, t5, t1 = this.$this; for (t2 = t1.$ti._eval$1("_Resource<1>")._as(resource)._tags, t2 = A._LinkedHashSetIterator$(t2, t2._collection$_modifications, A._instanceType(t2)._precomputed1), t3 = this.tagObjects, t4 = t2.$ti._precomputed1; t2.moveNext$0();) { t5 = t2._collection$_current; if (t3.any$1(0, new A.ResourceSet_tryChooseMatching__closure(t1, t5 == null ? t4._as(t5) : t5))) return 1; } return 0; }, $signature() { return this.$this.$ti._eval$1("double(_Resource<1>)"); } }; A.ResourceSet_tryChooseMatching__closure.prototype = { call$1(tag) { return this.$this.$ti._eval$1("_Tag<1>")._as(tag).contains$1(0, this.resourceTag); }, $signature() { return this.$this.$ti._eval$1("bool(_Tag<1>)"); } }; A._Resource.prototype = { frequencyAtDepth$1(depth) { var _this = this, t1 = _this.startDepth, t2 = _this.endDepth; if (t1 === t2) return _this.startFrequency; return A.lerpDouble(depth, t1, t2, _this.startFrequency, _this.endFrequency); }, chanceAtDepth$1(depth) { var relative, deviation, t1 = this.startDepth; if (depth < t1) { relative = t1 - depth; deviation = 0.6 + depth * 0.2; return Math.exp(-0.5 * relative * relative / (deviation * deviation)); } else { t1 = this.endDepth; if (depth > t1) { relative = depth - t1; deviation = 1 + depth * 0.1; return Math.exp(-0.5 * relative * relative / (deviation * deviation)); } else return 1; } } }; A._Tag.prototype = { contains$1(_, tag) { var thisTag; this.$ti._as(tag); for (thisTag = this; thisTag != null; thisTag = thisTag.parent) if (tag === thisTag) return true; return false; }, toString$0(_) { var t1 = this.parent; if (t1 == null) return this.name; return t1.toString$0(0) + "/" + this.name; } }; A._QueryKey.prototype = { get$hashCode(_) { return B.JSString_methods.get$hashCode(this.name) ^ B.JSInt_methods.get$hashCode(this.depth); }, $eq(_, other) { if (other == null) return false; type$._QueryKey._as(other); return this.name === other.name && this.depth === other.depth; }, toString$0(_) { return this.name + " (" + this.depth + ")"; } }; A._ResourceQuery.prototype = { choose$0() { var t, t2, last, t3, t4, first, middle, t5, t1 = this.resources; if (t1.length === 0) return null; t = $.$get$rng().float$1(this.totalChance); t2 = t1.length; last = t2 - 1; for (t3 = this.chances, t4 = t3.length, first = 0;;) { middle = B.JSInt_methods._tdivFast$1(first + last, 2); if (middle > 0) { t5 = middle - 1; if (!(t5 < t4)) return A.ioore(t3, t5); t5 = t < t3[t5]; } else t5 = false; if (t5) last = middle - 1; else { if (!(middle >= 0 && middle < t4)) return A.ioore(t3, middle); if (t < t3[middle]) { if (!(middle < t2)) return A.ioore(t1, middle); return t1[middle].object; } else first = middle + 1; } } } }; A.MapExtensions_get_pairs_closure.prototype = { call$1(entry) { this.K._eval$1("@<0>")._bind$1(this.V)._eval$1("MapEntry<1,2>")._as(entry); return new A._Record_2(entry.key, entry.value); }, $signature() { return this.K._eval$1("@<0>")._bind$1(this.V)._eval$1("+(1,2)(MapEntry<1,2>)"); } }; A.VecSet.prototype = { get$iterator(_) { var y, t1, t2, t3, t4, x, t5, t6, _this = this, result = A._setArrayType([], type$.JSArray_Vec); for (y = _this._yMin, t1 = _this._vec_set$_values, t2 = t1._elements, t3 = t1.bounds.size.x, t4 = t2.length; y <= _this._yMax; ++y) for (x = _this._xMin, t5 = y * t3; x <= _this._xMax; ++x) { t1._checkBounds$2(x, y); t6 = t5 + x; if (!(t6 >= 0 && t6 < t4)) return A.ioore(t2, t6); if (J.$eq$(t2[t6], _this._sentinel)) B.JSArray_methods.add$1(result, new A.Vec(x, y)); } return new J.ArrayIterator(result, result.length, type$.ArrayIterator_Vec); }, add$1(_, pos) { var _this = this, t1 = _this._vec_set$_values, t2 = t1.$ti._precomputed1._as(_this._sentinel); t1.$set$3(pos.get$x(), pos.get$y(), t2); _this._xMin = Math.min(_this._xMin, pos.get$x()); _this._xMax = Math.max(_this._xMax, pos.get$x()); _this._yMin = Math.min(_this._yMin, pos.get$y()); _this._yMax = Math.max(_this._yMax, pos.get$y()); } }; A.Behavior.prototype = {}; A.ActionBehavior.prototype = { canPerform$2(game, hero) { return true; }, getAction$1(hero) { hero._behavior = null; return this.action; } }; A.RestBehavior.prototype = { canPerform$2(game, hero) { var t1 = hero._health, t2 = hero.save.vitality._stat$_value; t2.toString; if (t1 === B.JSNumber_methods.toInt$0(Math.pow(t2, 1.458) + 9)) return false; if (hero._stomach === 0) { game.hero.save.log._log$_add$5(B.LogType_0, "You must eat before you can rest.", null, null, null); return false; } return true; }, getAction$1(hero) { return A.RestAction$(); } }; A.RunBehavior.prototype = { canPerform$2(game, hero) { var t1, dirs, openDirs, t2, t3, nextLeft, nextRight, _this = this, _s6_ = "_stage"; if (_this.firstStep) return true; t1 = _this.openLeft; if (t1 == null) { t1 = _this.direction; dirs = A._setArrayType([t1.get$rotateLeft45(), t1, t1.get$rotateRight45()], type$.JSArray_Direction); if (B.JSArray_methods.contains$1(B.List_iHk, _this.direction)) { B.JSArray_methods.add$1(dirs, _this.direction.get$rotateLeft90()); B.JSArray_methods.add$1(dirs, _this.direction.get$rotateRight90()); } openDirs = new A.WhereIterable(dirs, type$.bool_Function_Direction._as(new A.RunBehavior_canPerform_closure(_this, game, hero)), type$.WhereIterable_Direction); if (!openDirs.get$iterator(0).moveNext$0()) return false; if (openDirs.get$length(0) === 1) { _this.openRight = _this.openLeft = false; _this.direction = openDirs.get$first(0); } else { t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI(_s6_); t2 = _this.direction.get$rotateLeft45(); t2 = hero._pos.$add(0, t2); t3 = t1.tiles; if (t3.bounds.contains$1(0, t2) && (t3.$get$2(t2.x, t2.y).type.motility._bitMask & $.$get$Motility_doorAndWalk()._bitMask) !== 0) { t2 = _this.direction.get$rotateLeft90(); t2 = hero._pos.$add(0, t2); t3 = t1.tiles; t2 = t3.bounds.contains$1(0, t2) && (t3.$get$2(t2.x, t2.y).type.motility._bitMask & $.$get$Motility_doorAndWalk()._bitMask) !== 0; } else t2 = false; _this.openLeft = t2; t2 = _this.direction.get$rotateRight45(); t2 = hero._pos.$add(0, t2); t3 = t1.tiles; if (t3.bounds.contains$1(0, t2) && (t3.$get$2(t2.x, t2.y).type.motility._bitMask & $.$get$Motility_doorAndWalk()._bitMask) !== 0) { t2 = _this.direction.get$rotateRight90(); t2 = hero._pos.$add(0, t2); t1 = t1.tiles; t1 = t1.bounds.contains$1(0, t2) && (t1.$get$2(t2.x, t2.y).type.motility._bitMask & $.$get$Motility_doorAndWalk()._bitMask) !== 0; } else t1 = false; _this.openRight = t1; } } else { if (!t1) { t1 = _this.openRight; t1.toString; t1 = !t1; } else t1 = false; if (t1) { t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI(_s6_); if (!_this._runInPassage$2(t1, hero)) return false; } else { t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI(_s6_); t2 = _this.direction.get$rotateLeft45(); t2 = hero._pos.$add(0, t2); t1 = t1.tiles; t3 = t1.bounds; nextLeft = t3.contains$1(0, t2) && (t1.$get$2(t2.x, t2.y).type.motility._bitMask & $.$get$Motility_doorAndWalk()._bitMask) !== 0; t2 = _this.direction.get$rotateRight45(); t2 = hero._pos.$add(0, t2); nextRight = t3.contains$1(0, t2) && (t1.$get$2(t2.x, t2.y).type.motility._bitMask & $.$get$Motility_doorAndWalk()._bitMask) !== 0; if (!(_this.openLeft === nextLeft && _this.openRight === nextRight)) return false; } } t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI(_s6_); return _this._shouldKeepRunning$2(t1, hero); }, getAction$1(hero) { this.firstStep = false; return A.WalkAction$(this.direction); }, _runInPassage$2(stage, hero) { var t2, t3, t4, t5, _i, firstDir, firstPos, t6, t7, possibleSecondDirs, _i0, secondPos, _0_0, _this = this, dirsToNear = A._setArrayType([], type$.JSArray_Direction), dirsToFar = A.LinkedHashSet_LinkedHashSet$_empty(type$.Direction), farPositions = A.LinkedHashSet_LinkedHashSet$_empty(type$.Vec), t1 = _this.direction, possibleFirstDirs = [t1.get$rotateLeft90(), t1.get$rotateLeft45(), t1, t1.get$rotateRight45(), t1.get$rotateRight90()]; for (t1 = stage.tiles, t2 = t1.bounds, t3 = t1._elements, t4 = t2.size.x, t5 = t3.length, _i = 0; _i < 5; ++_i) { firstDir = possibleFirstDirs[_i]; firstPos = hero._pos.$add(0, firstDir); if (t2.contains$1(0, firstPos)) { t6 = firstPos.x; t7 = firstPos.y; t1._checkBounds$2(t6, t7); t6 = t7 * t4 + t6; if (!(t6 >= 0 && t6 < t5)) return A.ioore(t3, t6); t6 = (t3[t6].type.motility._bitMask & $.$get$Motility_doorAndWalk()._bitMask) !== 0; } else t6 = false; if (!t6) continue; B.JSArray_methods.add$1(dirsToNear, firstDir); possibleSecondDirs = [firstDir.get$rotateLeft45(), firstDir, firstDir.get$rotateRight45()]; for (_i0 = 0; _i0 < 3; ++_i0) { secondPos = firstPos.$add(0, possibleSecondDirs[_i0]); if (t2.contains$1(0, secondPos)) { t6 = secondPos.x; t7 = secondPos.y; t1._checkBounds$2(t6, t7); t6 = t7 * t4 + t6; if (!(t6 >= 0 && t6 < t5)) return A.ioore(t3, t6); t6 = (t3[t6].type.motility._bitMask & $.$get$Motility_doorAndWalk()._bitMask) !== 0; } else t6 = false; if (!t6) continue; dirsToFar.add$1(0, firstDir); farPositions.add$1(0, secondPos); } } _0_0 = dirsToFar._collection$_length; if (0 === _0_0 && dirsToNear.length === 1) { _this.direction = B.JSArray_methods.get$first(dirsToNear); return true; } if (1 === _0_0) { _this.direction = dirsToFar.get$first(0); return true; } if (2 === _0_0 && farPositions._collection$_length === 1) if (dirsToFar.contains$1(0, _this.direction)) return true; else if (dirsToFar.contains$1(0, _this.direction.get$rotateLeft45()) && dirsToFar.contains$1(0, _this.direction.get$rotateLeft90())) { _this.direction = _this.direction.get$rotateLeft45(); return true; } else if (dirsToFar.contains$1(0, _this.direction.get$rotateRight45()) && dirsToFar.contains$1(0, _this.direction.get$rotateRight90())) { _this.direction = _this.direction.get$rotateRight45(); return true; } return false; }, _shouldKeepRunning$2(stage, hero) { var t1, t2, t3, t4, _this = this, pos = hero._pos.$add(0, _this.direction); if (!(stage.canOccupy$2(pos, $.$get$Motility_doorAndWalk()) && stage._actorsByTile.$get$2(pos.x, pos.y) == null)) return false; t1 = stage.tiles; t2 = pos.x; t3 = pos.y; if (t1.$get$2(t2, t3).type.motility.$eq(0, $.$get$Motility_door())) return false; t4 = new A.RunBehavior__shouldKeepRunning_actorAt(stage); if (t4.call$1(pos)) return false; if (t4.call$1(pos.$add(0, _this.direction.get$rotateLeft90()))) return false; if (t4.call$1(pos.$add(0, _this.direction.get$rotateLeft45()))) return false; if (t4.call$1(pos.$add(0, _this.direction))) return false; if (t4.call$1(pos.$add(0, _this.direction.get$rotateRight45()))) return false; if (t4.call$1(pos.$add(0, _this.direction.get$rotateRight90()))) return false; if (t1.$get$2(t2, t3).substance > 0) return false; return true; } }; A.RunBehavior_canPerform_closure.prototype = { call$1(dir) { var t1, t2; type$.Direction._as(dir); t1 = this.game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = this.hero._pos.$add(0, dir); t1 = t1.tiles; return t1.bounds.contains$1(0, t2) && (t1.$get$2(t2.x, t2.y).type.motility._bitMask & $.$get$Motility_doorAndWalk()._bitMask) !== 0; }, $signature: 9 }; A.RunBehavior__shouldKeepRunning_actorAt.prototype = { call$1(pos) { var t1 = this.stage, t2 = pos.x, t3 = pos.y, t4 = t1.tiles.$get$2(t2, t3); return !t4._isOccluded && t4.floorIllumination + t4.actorIllumination > t4._fallOff && t1._actorsByTile.$get$2(t2, t3) != null; }, $signature: 1 }; A.Hero.prototype = { get$nounText() { return "you"; }, get$pronoun() { return B.Pronoun_you_you_your; }, get$maxHealth() { var t1 = this.save.vitality._stat$_value; t1.toString; return B.JSNumber_methods.toInt$0(Math.pow(t1, 1.458) + 9); }, get$motility() { return $.$get$Motility_doorAndWalk(); }, get$emanationLevel() { return this.save.get$emanationLevel(); }, get$appearance() { return "hero"; }, needsInput$1(game) { var _this = this, t1 = _this._behavior; if (t1 != null && !t1.canPerform$2(game, _this)) _this._behavior = null; return _this._behavior == null; }, get$armor() { return this.save.get$armor(); }, _gainItemSkills$2(game, item) { var t1, t2, t3, t4, t5, t6, t7, _i, skill, t8, level, _null = null; for (t1 = item.type.skills, t2 = t1.length, t3 = this.save, t4 = t3.heroClass._proficiency, t5 = t3.skills, t6 = game.hero.save.log, t7 = t5._points, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { skill = t1[_i]; t8 = t4.$index(0, skill); if ((t8 == null ? 1 : t8) !== 0 && t5.discover$1(skill)) { t8 = t7.$index(0, skill); level = skill.onCalculateLevel$2(t3, t8 == null ? 0 : t8); if (t5.gain$2(skill, level)) t6._log$_add$5(B.LogType_3, skill.gainMessage$1(level), this, _null, _null); else t6._log$_add$5(B.LogType_3, skill.get$discoverMessage(), this, _null, _null); } } }, get$baseSpeed() { return 6; }, get$baseDodge() { var t1 = this.save.agility._stat$_value; t1.toString; return 20 + A.Agility_dodgeBonusAt(t1); }, onGetDefenses$0() { return new A._SyncStarIterable(this.onGetDefenses$body$Hero(), type$._SyncStarIterable_Defense); }, onGetDefenses$body$Hero() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 1, $async$errorStack = [], t1, t2, t3, t4, defense, t5; return function $async$onGetDefenses$0($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) switch ($async$goto) { case 0: // Function start t1 = $async$self.save, t2 = B.JSArray_methods.get$iterator(t1._equipment.slots), t3 = new A.WhereTypeIterator(t2, type$.WhereTypeIterator_Item), t4 = type$.Item; case 2: // for condition if (!t3.moveNext$0()) { // goto after for $async$goto = 3; break; } defense = t4._as(t2.get$current()).type.defense; $async$goto = defense != null ? 4 : 5; break; case 4: // then $async$goto = 6; return $async$iterator._async$_current = defense, 1; case 6: // after yield case 5: // join // goto for condition $async$goto = 2; break; case 3: // after for t1 = t1.skills, t2 = t1.get$acquired(), t3 = J.get$iterator$ax(t2._iterable), t2 = new A.WhereIterator(t3, t2._f, t2.$ti._eval$1("WhereIterator<1>")), t1 = t1._levels; case 7: // for condition if (!t2.moveNext$0()) { // goto after for $async$goto = 8; break; } t4 = t3.get$current(); t5 = t1.$index(0, t4); defense = t4.getDefense$2($async$self, t5 == null ? 0 : t5); $async$goto = defense != null ? 9 : 10; break; case 9: // then $async$goto = 11; return $async$iterator._async$_current = defense, 1; case 11: // after yield case 10: // join // goto for condition $async$goto = 7; break; case 8: // after for // implicit return return 0; case 1: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, onGetAction$1(game) { return this._behavior.getAction$1(this); }, onCreateMeleeHits$1(defender) { var t1, t2, t3, t4, t5, hits, t6, t7, t8, _i, t9, weapon, hit, t10, t11, level, _this = this, attacks = A._setArrayType([], type$.JSArray_Record_2_nullable_Item_and_Attack); for (t1 = _this.save, t2 = t1._equipment.get$weapons(), t3 = J.get$iterator$ax(t2._iterable), t2 = new A.WhereIterator(t3, t2._f, t2.$ti._eval$1("WhereIterator<1>")); t2.moveNext$0();) { t4 = t3.get$current(); t5 = t4.type.attack; if (t5.range <= 0) B.JSArray_methods.add$1(attacks, new A._Record_2(t4, t5)); } if (attacks.length === 0) B.JSArray_methods.add$1(attacks, new A._Record_2(null, A.Attack$(_this, "punch[es]", 3, null, null))); hits = A._setArrayType([], type$.JSArray_Hit); for (t2 = attacks.length, t3 = t1.skills, t4 = type$.nullable_Monster, t5 = t3._levels, t6 = type$.JSArray_Scale, t7 = type$.JSArray_Bonus, t1 = t1.agility, t8 = _this._heftDamageScale, _i = 0; _i < attacks.length; attacks.length === t2 || (0, A.throwConcurrentModificationError)(attacks), ++_i) { t9 = attacks[_i]; weapon = t9._0; hit = new A.Hit(t9._1, A._setArrayType([], t6), A._setArrayType([], t7), A._setArrayType([], t6), A._setArrayType([], t7), $.$get$Element_none()); B.JSArray_methods.add$1(hits, hit); t9 = t1._stat$_value; t9.toString; hit.addStrike$2(A.Agility_strikeBonusAt(t9), "agility"); for (t9 = t3.get$acquired(), t10 = J.get$iterator$ax(t9._iterable), t9 = new A.WhereIterator(t10, t9._f, t9.$ti._eval$1("WhereIterator<1>")); t9.moveNext$0();) { t11 = t10.get$current(); level = t5.$index(0, t11); if (level == null) level = 0; t11.modifyHit$5(_this, t4._as(defender), weapon, hit, level); } hit.scaleDamage$2(1 + _this._fury * 0.1, "fury"); if (weapon != null) { t9 = t8._stat$_value; t9.toString; hit.scaleDamage$2(t9, "heft"); weapon.modifyHit$1(hit); } } return hits; }, createRangedHit$0() { var hit, t1 = this.save._equipment.get$weapons(), weapons = A.List_List$_of(t1, t1.$ti._eval$1("Iterable.E")), i = B.JSArray_methods.indexWhere$1(weapons, new A.Hero_createRangedHit_closure()); if (!(i >= 0 && i < weapons.length)) return A.ioore(weapons, i); t1 = weapons[i].type.attack; t1.toString; hit = A.Hit$_(t1); t1 = this._heftDamageScale._stat$_value; t1.toString; hit.scaleDamage$2(t1, "heft"); this.modifyHit$2(hit, B.HitType_1); return hit; }, onModifyHit$2(hit, type) { var t1, t2, t3, t4; switch (type.index) { case 0: break; case 1: break; case 2: t1 = this.save.strength._stat$_value; t1.toString; hit._rangeScale *= A.Strength_tossRangeScaleAt(t1); break; } for (t1 = B.JSArray_methods.get$iterator(this.save._equipment.slots), t2 = new A.WhereTypeIterator(t1, type$.WhereTypeIterator_Item), t3 = type$.Item; t2.moveNext$0();) { t4 = t3._as(t1.get$current()); if (t4.type.weaponType == null) t4.modifyHit$1(hit); } }, onGetResistance$1(element) { return this.save.equipmentResistance$1(element); }, onGiveDamage$3(action, defender, damage) { this._turnsSinceGaveDamage = 0; }, onTakeDamage$3(action, attacker, damage) { var t1, t2, _i; for (t1 = this._allSkills, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) t1[_i].takeDamage$2(this, damage); }, onKilled$2(action, defender) { var _i, t1, t2, t3, _this = this; type$.Monster._as(defender); _i = _this._turnsSinceGaveDamage = 0; if (!_this._seenMonsters.contains$1(0, defender)) return; t1 = _this.save; t1.lore.slay$1(defender._breed); for (t2 = t1.skills.get$discovered(), t3 = t2.length; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) t2[_i].killMonster$3(_this, action, defender); t1.experience = t1.experience + defender._breed.get$experience(); _this.refreshProperties$0(); }, onDied$2(action, attackNoun) { action.show$3("{1} [were|was] slain by {2}.", this, attackNoun); }, onFinishTurn$1(action) { var t1, t2, _this = this; _this._lastNoise = action.get$noise(); t1 = _this._turnsSinceGaveDamage; if (t1 === 0) ++_this._fury; else if (t1 > 1) _this._fury = _this._fury - (t1 - 1); t1 = _this._fury; t2 = _this.save.strength._stat$_value; t2.toString; _this._fury = B.JSInt_methods.clamp$2(t1, 0, A.Strength_maxFuryAt(t2)); ++_this._turnsSinceGaveDamage; }, onChangePosition$3(game, from, to) { var t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.get$_lighting()._visibilityDirty = true; }, rest$0() { var t1, t2, t3, _this = this, _null = null; if (_this.poison._turnsRemaining > 0) { _this.save.log._log$_add$5(B.LogType_1, "You cannot rest while poison courses through your veins!", _null, _null, _null); return false; } t1 = _this._health; t2 = _this.save; t3 = t2.vitality._stat$_value; t3.toString; if (t1 === B.JSNumber_methods.toInt$0(Math.pow(t3, 1.458) + 9)) { t2.log._log$_add$5(B.LogType_0, "You are fully rested.", _null, _null, _null); return false; } if (_this._stomach === 0) { t2.log._log$_add$5(B.LogType_1, "You are too hungry to rest.", _null, _null, _null); return false; } _this._behavior = new A.RestBehavior(); return true; }, seeMonster$1(monster) { var t1, t2, _i, _this = this; if (_this._seenMonsters.add$1(0, monster)) { t1 = _this.save.lore; t1.seeBreed$1(monster._breed); if (t1.seenBreed$1(monster._breed) === 1) for (t1 = _this._allSkills, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) t1[_i].seeBreed$2(_this, monster._breed); } }, regenerateFocus$1($focus) { var t1 = this._focus, t2 = this.save.intellect._stat$_value; t2.toString; this._focus = B.JSInt_methods.clamp$2(t1 + $focus, 0, A.Intellect_maxFocusAt(t2)); }, refreshProperties$0() { var t3, t4, t5, weapons, t6, _i, t7, heftModifier, t8, t9, totalHeft, heftScale, _this = this, t1 = _this.save, t2 = t1.strength; t2.refresh$1(t1); t1.agility.refresh$1(t1); t3 = t1.vitality; t3.refresh$1(t1); t4 = t1.intellect; t4.refresh$1(t1); t5 = t1._equipment.get$weapons(); weapons = A.List_List$_of(t5, t5.$ti._eval$1("Iterable.E")); if (weapons.length > 1) for (t5 = _this._allSkills, t6 = t5.length, _i = 0; _i < t5.length; t5.length === t6 || (0, A.throwConcurrentModificationError)(t5), ++_i) t5[_i].dualWield$1(_this); for (t1 = t1.skills, t5 = t1.get$acquired(), t6 = J.get$iterator$ax(t5._iterable), t5 = new A.WhereIterator(t6, t5._f, t5.$ti._eval$1("WhereIterator<1>")), t7 = t1._levels, heftModifier = 1; t5.moveNext$0();) { t8 = t6.get$current(); t9 = t7.$index(0, t8); heftModifier = t8.modifyHeft$3(_this, t9 == null ? 0 : t9, heftModifier); } for (t5 = weapons.length, totalHeft = 0, _i = 0; _i < weapons.length; weapons.length === t5 || (0, A.throwConcurrentModificationError)(weapons), ++_i) totalHeft += weapons[_i].get$heft(); heftScale = t2.heftScale$1(B.JSNumber_methods.round$0(totalHeft * heftModifier)); _this._heftDamageScale.update$2(heftScale, new A.Hero_refreshProperties_closure(_this, weapons, heftScale)); B.JSArray_methods.forEach$1(t1.get$discovered(), _this.get$refreshSkill()); t1 = _this._health; t3 = t3._stat$_value; t3.toString; _this._health = B.JSInt_methods.clamp$2(B.JSInt_methods.clamp$2(t1, 0, B.JSNumber_methods.toInt$0(Math.pow(t3, 1.458) + 9)), 0, _this.get$maxHealth()); t3 = _this._focus; t4 = t4._stat$_value; t4.toString; _this._focus = B.JSInt_methods.clamp$2(t3, 0, A.Intellect_maxFocusAt(t4)); t4 = _this._fury; t2 = t2._stat$_value; t2.toString; _this._fury = B.JSInt_methods.clamp$2(t4, 0, A.Strength_maxFuryAt(t2)); }, pickUp$2(game, item) { this.save.lore.findItem$1(item); this._gainItemSkills$2(game, item); this.refreshProperties$0(); }, discoverSkill$1(skill) { var t1 = this.save; if (t1.heroClass.proficiency$1(skill) === 0) return; if (!t1.skills.discover$1(skill)) return; t1.log.gain$2(skill.get$discoverMessage(), this); }, refreshSkill$1(skill) { var t1, t2, level; type$.Skill._as(skill); t1 = this.save; t2 = t1.skills; level = skill.onCalculateLevel$2(t1, t2.points$1(skill)); if (t2.gain$2(skill, level)) t1.log.gain$2(skill.gainMessage$1(level), this); } }; A.Hero_createRangedHit_closure.prototype = { call$1(weapon) { return type$.Item._as(weapon).type.attack.range > 0; }, $signature: 4 }; A.Hero_refreshProperties_closure.prototype = { call$1(previous) { var _this = this, _null = null, weaponList = B.JSArray_methods.join$1(_this.weapons, " and "), t1 = _this.heftScale; if (t1 < 1 && previous >= 1) _this.$this.save.log._log$_add$5(B.LogType_1, "You are too weak to effectively wield " + weaponList + ".", _null, _null, _null); else if (t1 >= 1 && previous < 1) _this.$this.save.log._log$_add$5(B.LogType_0, "You feel comfortable wielding " + weaponList + ".", _null, _null, _null); }, $signature: 85 }; A.HeroClass.prototype = { proficiency$1(skill) { var t1 = this._proficiency.$index(0, skill); return t1 == null ? 1 : t1; } }; A.HeroSave.prototype = { get$emanationLevel() { var t1, t2, t3, level; for (t1 = B.JSArray_methods.get$iterator(this._equipment.slots), t2 = new A.WhereTypeIterator(t1, type$.WhereTypeIterator_Item), t3 = type$.Item, level = 0; t2.moveNext$0();) level += t3._as(t1.get$current()).type.emanationLevel; return level; }, get$armor() { var t1, t2, t3, total, t4, t5; for (t1 = B.JSArray_methods.get$iterator(this._equipment.slots), t2 = new A.WhereTypeIterator(t1, type$.WhereTypeIterator_Item), t3 = type$.Item, total = 0; t2.moveNext$0();) { t4 = t3._as(t1.get$current()); total += t4.type.armor + t4.get$armorModifier(); } for (t1 = this.skills, t2 = t1.get$acquired(), t3 = J.get$iterator$ax(t2._iterable), t2 = new A.WhereIterator(t3, t2._f, t2.$ti._eval$1("WhereIterator<1>")), t1 = t1._levels; t2.moveNext$0();) { t4 = t3.get$current(); t5 = t1.$index(0, t4); total = t4.modifyArmor$3(this, t5 == null ? 0 : t5, total); } return total; }, get$weight() { var t1, t2, t3, total; for (t1 = B.JSArray_methods.get$iterator(this._equipment.slots), t2 = new A.WhereTypeIterator(t1, type$.WhereTypeIterator_Item), t3 = type$.Item, total = 0; t2.moveNext$0();) total += t3._as(t1.get$current()).get$weight(); return total; }, equipmentResistance$1(element) { var t1, t2, t3, resistance; for (t1 = B.JSArray_methods.get$iterator(this._equipment.slots), t2 = new A.WhereTypeIterator(t1, type$.WhereTypeIterator_Item), t3 = type$.Item, resistance = 0; t2.moveNext$0();) resistance += t3._as(t1.get$current()).resistance$1(element); return resistance; }, statBonus$1(stat) { var t1, t2, t3, bonus, t4, t5, _i; for (t1 = B.JSArray_methods.get$iterator(this._equipment.slots), t2 = new A.WhereTypeIterator(t1, type$.WhereTypeIterator_Item), t3 = type$.Item, bonus = 0; t2.moveNext$0();) for (t4 = t3._as(t1.get$current()).get$affixes(), t5 = t4.length, _i = 0; _i < t4.length; t4.length === t5 || (0, A.throwConcurrentModificationError)(t4), ++_i) bonus += t4[_i].statBonus$1(stat); return bonus; }, set$maxDepth(maxDepth) { this.maxDepth = A._asInt(maxDepth); } }; A.Lore.prototype = { get$allSlain() { var t1 = this._slainBreeds; return new A.LinkedHashMapValuesIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapValuesIterable<2>")).fold$1$2(0, 0, new A.Lore_allSlain_closure(), type$.int); }, seeBreed$1(breed) { var t2, t1 = this._seenBreeds; t1.putIfAbsent$2(breed, new A.Lore_seeBreed_closure()); t2 = t1.$index(0, breed); t2.toString; t1.$indexSet(0, breed, t2 + 1); }, slay$1(breed) { var t2, t1 = this._slainBreeds; t1.putIfAbsent$2(breed, new A.Lore_slay_closure()); t2 = t1.$index(0, breed); t2.toString; t1.$indexSet(0, breed, t2 + 1); }, findItem$1(item) { var t3, _i, t4, t5, t1 = this._foundItems, t2 = item.type; t1.putIfAbsent$2(t2, new A.Lore_findItem_closure()); t3 = t1.$index(0, t2); t3.toString; t1.$indexSet(0, t2, t3 + 1); for (t1 = item.get$affixes(), t2 = t1.length, t3 = this._foundAffixes, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { t4 = t1[_i].type; t3.putIfAbsent$2(t4, new A.Lore_findItem_closure0()); t5 = t3.$index(0, t4); t5.toString; t3.$indexSet(0, t4, t5 + 1); } }, useItem$1(item) { var t3, t1 = this._usedItems, t2 = item.type; t1.putIfAbsent$2(t2, new A.Lore_useItem_closure()); t3 = t1.$index(0, t2); t3.toString; t1.$indexSet(0, t2, t3 + 1); }, seenBreed$1(breed) { var t1 = this._seenBreeds.$index(0, breed); return t1 == null ? 0 : t1; }, slain$1(breed) { var t1 = this._slainBreeds.$index(0, breed); return t1 == null ? 0 : t1; }, foundItems$1(type) { var t1 = this._foundItems.$index(0, type); return t1 == null ? 0 : t1; } }; A.Lore_allSlain_closure.prototype = { call$2(a, b) { return A._asInt(a) + A._asInt(b); }, $signature: 31 }; A.Lore_seeBreed_closure.prototype = { call$0() { return 0; }, $signature: 2 }; A.Lore_slay_closure.prototype = { call$0() { return 0; }, $signature: 2 }; A.Lore_findItem_closure.prototype = { call$0() { return 0; }, $signature: 2 }; A.Lore_findItem_closure0.prototype = { call$0() { return 0; }, $signature: 2 }; A.Lore_useItem_closure.prototype = { call$0() { return 0; }, $signature: 2 }; A.Race.prototype = {}; A.Skill.prototype = { get$useName() { return this.get$name(); }, takeDamage$2(hero, damage) { }, seeBreed$2(hero, breed) { }, killMonster$3(hero, action, monster) { }, dualWield$1(hero) { }, modifyHit$5(hero, monster, weapon, hit, level) { }, modifyArmor$3(hero, level, armor) { return armor; }, getDefense$2(hero, level) { return null; }, modifyHeft$3(hero, level, heftModifier) { return heftModifier; }, compareTo$1(_, other) { return B.JSInt_methods.compareTo$1(this._sortOrder, type$.Skill._as(other)._sortOrder); }, $isComparable: 1 }; A.UsableSkill.prototype = { focusCost$2(hero, level) { return 0; }, unusableReason$1(game) { return null; }, _wrapActionCost$3(hero, level, action) { if (this.focusCost$2(hero, level) > 0) return new A.FocusAction(this.focusCost$2(hero, level), action); return action; }, $isComparable: 1, $isSkill: 1 }; A.ActionSkill.prototype = { getAction$2(game, level) { return this._wrapActionCost$3(game.hero.save, level, this._getAction.call$3(this, game, level)); } }; A.TargetSkill.prototype = { getTargetAction$3(game, level, target) { return this._wrapActionCost$3(game.hero.save, level, this.onGetTargetAction$3(game, level, target)); } }; A.DirectionSkill.prototype = {}; A.SkillSet.prototype = { get$discovered() { var t1 = this._levels, t2 = A._instanceType(t1)._eval$1("LinkedHashMapKeysIterable<1>"); t1 = A.List_List$_of(new A.LinkedHashMapKeysIterable(t1, t2), t2._eval$1("Iterable.E")); B.JSArray_methods.sort$0(t1); return t1; }, get$acquired() { var t1 = this._levels, t2 = A._instanceType(t1)._eval$1("LinkedHashMapKeysIterable<1>"); return new A.WhereIterable(new A.LinkedHashMapKeysIterable(t1, t2), t2._eval$1("bool(Iterable.E)")._as(new A.SkillSet_acquired_closure(this)), t2._eval$1("WhereIterable")); }, level$1(skill) { var t1 = this._levels.$index(0, skill); return t1 == null ? 0 : t1; }, points$1(skill) { var t1 = this._points.$index(0, skill); return t1 == null ? 0 : t1; }, earnPoints$2(skill, points) { this._points.$indexSet(0, skill, points + this.points$1(skill)); }, discover$1(skill) { var t1 = this._levels; if (t1.containsKey$1(skill)) return false; t1.$indexSet(0, skill, 0); return true; }, gain$2(skill, level) { var t1; level = Math.min(level, skill.get$maxLevel()); t1 = this._levels; if (t1.$index(0, skill) === level) return false; if (level === 0 && !t1.containsKey$1(skill)) return false; t1.$indexSet(0, skill, level); return true; }, isAcquired$1(skill) { var t1 = this._levels; if (t1.containsKey$1(skill)) { t1 = t1.$index(0, skill); t1.toString; t1 = t1 > 0; } else t1 = false; return t1; } }; A.SkillSet_acquired_closure.prototype = { call$1(skill) { var t1 = this.$this._levels.$index(0, type$.Skill._as(skill)); t1.toString; return t1 > 0; }, $signature: 86 }; A.Property.prototype = { update$2(value, onChange) { var t1 = A._instanceType(this); t1._eval$1("Property.T")._as(value); t1._eval$1("@(Property.T)")._as(onChange); t1 = this._stat$_value; if (t1 === value) return; this._stat$_value = value; if (t1 != null) onChange.call$1(t1); } }; A.Stat.prototype = { _enumToString$0() { return "Stat." + this._core$_name; } }; A.StatBase.prototype = { _statOffset$1(hero) { return 0; }, refresh$2(hero, newBaseValue) { var newValue, _this = this; if (newBaseValue != null) _this._baseValue = newBaseValue; newValue = B.JSInt_methods.clamp$2(_this._baseValue + _this._statOffset$1(hero) + hero.statBonus$1(_this.get$_stat()), 1, 50); _this.update$2(newValue, new A.StatBase_refresh_closure(_this, newValue, hero)); }, refresh$1(hero) { return this.refresh$2(hero, null); }, experienceCost$1(save) { var t1 = save.strength._baseValue, t2 = save.agility._baseValue, t3 = save.vitality._baseValue, t4 = save.intellect._baseValue, t5 = save.race._statScales.$index(0, this.get$_stat()); t5.toString; return B.JSNumber_methods.toInt$0(100 * (1 / t5) * Math.pow(A.lerpDouble(t1 + t2 + t3 + t4, 40, 200, 1, 20), 3)); }, toString$0(_) { return this.get$_stat().name; } }; A.StatBase_refresh_closure.prototype = { call$1(previous) { var gain = this.newValue - A._asInt(previous), t1 = this.$this, t2 = this.hero.log; if (gain > 0) t2.gain$1("You feel " + t1.get$_gainAdjective() + "! Your " + t1.get$_stat().name + " increased by " + gain + "."); else t2._log$_add$5(B.LogType_1, "You feel " + t1.get$_loseAdjective() + "! Your " + t1.get$_stat().name + " decreased by " + -gain + ".", null, null, null); }, $signature: 36 }; A.Strength.prototype = { get$_stat() { return B.Stat_Strength_0_strength; }, get$_gainAdjective() { return "mighty"; }, get$_loseAdjective() { return "weak"; }, _statOffset$1(hero) { return -hero.get$weight(); }, heftScale$1(heft) { var relative, t1 = this._stat$_value; t1.toString; relative = B.JSNumber_methods.clamp$2(t1 - heft, -10, 50); if (relative < 0) return A.lerpDouble(relative, -10, -1, 0, 0.6); else return A.lerpDouble(relative, 0, 50, 1, 2); } }; A.Agility.prototype = { get$_stat() { return B.Stat_Agility_1_agility; }, get$_gainAdjective() { return "dextrous"; }, get$_loseAdjective() { return "clumsy"; } }; A.Vitality.prototype = { get$_stat() { return B.Stat_Fortitude_2_fortitude; }, get$_gainAdjective() { return "tough"; }, get$_loseAdjective() { return "sickly"; } }; A.Intellect.prototype = { get$_stat() { return B.Stat_Intellect_3_intellect; }, get$_gainAdjective() { return "smart"; }, get$_loseAdjective() { return "stupid"; } }; A.Affix.prototype = { get$strikeBonus() { return this.type._strikeBonus.call$1(this.parameter); }, get$damageScale() { return this.type._damageScale.call$1(this.parameter); }, get$damageBonus() { return this.type._damageBonus.call$1(this.parameter); }, resistance$1(element) { var resist = this.type._resists.$index(0, element); if (resist == null) return 0; return resist.call$1(this.parameter); }, statBonus$1(stat) { var bonus = this.type._affix$_statBonuses.$index(0, stat); if (bonus == null) return 0; return bonus.call$1(this.parameter); }, toString$0(_) { return this.type.id + " " + this.parameter; } }; A.AffixType.prototype = { spawn$0() { var t1 = this._affix$_rollParameter; t1 = t1 == null ? null : t1.call$0(); return new A.Affix(this, t1 == null ? 0 : t1); }, setResist$2(element, power) { this._resists.$indexSet(0, type$.Element._as(element), type$.int_Function_int._as(power)); }, setStatBonus$2(stat, bonus) { this._affix$_statBonuses.$indexSet(0, type$.Stat._as(stat), type$.int_Function_int._as(bonus)); }, toString$0(_) { return this.id; } }; A.Equipment.prototype = { get$location() { return B.ItemLocation_Equipment; }, get$weapons() { var t1 = type$.WhereTypeIterable_Item; return new A.WhereIterable(new A.WhereTypeIterable(this.slots, t1), t1._eval$1("bool(Iterable.E)")._as(new A.Equipment_weapons_closure()), t1._eval$1("WhereIterable")); }, get$length(_) { return B.JSArray_methods.fold$1$2(this.slots, 0, new A.Equipment_length_closure(), type$.int); }, clone$0() { var t2, i, t3, t4, t5, t1 = A.List_List$filled(9, null, false, type$.nullable_Item); for (t2 = this.slots, i = 0; i < 9; ++i) { t3 = t2[i]; if (t3 != null) { t4 = t3.type; t5 = t3._count; B.JSArray_methods.$indexSet(t1, i, new A.Item(t4, t3.prefix, t3.suffix, t3.intrinsicAffix, t5)); } } return new A.Equipment(t1); }, canEquip$1(item) { return B.JSArray_methods.any$1(B.List_5L9, new A.Equipment_canEquip_closure(item)); }, countChanged$0() { }, equip$1(item) { var handSlots, heldSlots, i, t3, t4, unequipped, _i, slot, usedSlot, t1 = item.type, t2 = t1.equipSlot; if (t2 === "hand") { t2 = type$.JSArray_int; handSlots = A._setArrayType([], t2); heldSlots = A._setArrayType([], t2); for (t2 = this.slots, i = 0; i < 9; ++i) if (B.List_5L9[i] === "hand") { B.JSArray_methods.add$1(handSlots, i); if (t2[i] != null) B.JSArray_methods.add$1(heldSlots, i); } t3 = heldSlots.length; if (t3 === 0) { if (0 >= handSlots.length) return A.ioore(handSlots, 0); B.JSArray_methods.$indexSet(t2, handSlots[0], item); return B.List_empty3; } if (t3 === 1) { if (0 >= t3) return A.ioore(heldSlots, 0); t4 = heldSlots[0]; if (!(t4 < 9)) return A.ioore(t2, t4); t4 = t2[t4].type.isTwoHanded; } else t4 = false; if (t4) { if (0 >= t3) return A.ioore(heldSlots, 0); t1 = heldSlots[0]; if (!(t1 < 9)) return A.ioore(t2, t1); t1 = t2[t1]; t1.toString; if (0 >= handSlots.length) return A.ioore(handSlots, 0); B.JSArray_methods.$indexSet(t2, handSlots[0], item); return A._setArrayType([t1], type$.JSArray_Item); } if (t1.isTwoHanded) { unequipped = A._setArrayType([], type$.JSArray_Item); for (t1 = heldSlots.length, _i = 0; _i < heldSlots.length; heldSlots.length === t1 || (0, A.throwConcurrentModificationError)(heldSlots), ++_i) { slot = heldSlots[_i]; if (!(slot < 9)) return A.ioore(t2, slot); t3 = t2[slot]; t3.toString; B.JSArray_methods.add$1(unequipped, t3); B.JSArray_methods.$indexSet(t2, slot, null); } if (0 >= handSlots.length) return A.ioore(handSlots, 0); B.JSArray_methods.$indexSet(t2, handSlots[0], item); return unequipped; } if (t3 === 2) { if (0 >= t3) return A.ioore(heldSlots, 0); t1 = heldSlots[0]; if (!(t1 < 9)) return A.ioore(t2, t1); t3 = t2[t1]; t3.toString; B.JSArray_methods.$indexSet(t2, t1, item); return A._setArrayType([t3], type$.JSArray_Item); } if (0 >= t3) return A.ioore(heldSlots, 0); t1 = heldSlots[0]; t3 = handSlots.length; if (0 >= t3) return A.ioore(handSlots, 0); t4 = handSlots[0]; if (t1 === t4) { if (1 >= t3) return A.ioore(handSlots, 1); B.JSArray_methods.$indexSet(t2, handSlots[1], item); } else B.JSArray_methods.$indexSet(t2, t4, item); return B.List_empty3; } for (t1 = this.slots, usedSlot = -1, i = 0; i < 9; ++i) if (B.List_5L9[i] === t2) { if (t1[i] == null) { B.JSArray_methods.$indexSet(t1, i, item); return B.List_empty3; } usedSlot = i; } if (!(usedSlot >= 0 && usedSlot < 9)) return A.ioore(t1, usedSlot); t2 = t1[usedSlot]; t2.toString; unequipped = A._setArrayType([t2], type$.JSArray_Item); B.JSArray_methods.$indexSet(t1, usedSlot, item); return unequipped; }, remove$1(_, item) { var t1, i; for (t1 = this.slots, i = 0; i < 9; ++i) if (t1[i] === item) { B.JSArray_methods.$indexSet(t1, i, null); break; } }, get$iterator(_) { return new A.WhereTypeIterator(B.JSArray_methods.get$iterator(this.slots), type$.WhereTypeIterator_Item); }, get$slotTypes() { return B.List_5L9; }, get$slots() { return this.slots; } }; A.Equipment_weapons_closure.prototype = { call$1(item) { return type$.Item._as(item).type.weaponType != null; }, $signature: 4 }; A.Equipment_length_closure.prototype = { call$2(count, item) { A._asInt(count); return count + (type$.nullable_Item._as(item) == null ? 0 : 1); }, $signature: 89 }; A.Equipment_canEquip_closure.prototype = { call$1(slot) { return this.item.type.equipSlot === A._asString(slot); }, $signature: 90 }; A._Equipment_IterableBase_ItemCollection.prototype = {}; A.ItemLocation.prototype = {}; A.ItemCollection.prototype = { get$slotTypes() { return B.List_empty2; }, get$slots() { return this; } }; A.Inventory.prototype = { get$length(_) { return this._items.length; }, clone$0() { var t1 = this._items, t2 = A._arrayInstanceType(t1); return A.Inventory$(this.location, this._capacity, new A.MappedListIterable(t1, t2._eval$1("Item(1)")._as(new A.Inventory_clone_closure()), t2._eval$1("MappedListIterable<1,Item>"))); }, remove$1(_, item) { B.JSArray_methods.remove$1(this._items, item); }, canAdd$1(item) { var t2, remaining, _i, existing, t1 = this._capacity; if (t1 != null) { t2 = this._items.length; t1 = t2 < t1; } else t1 = true; if (t1) return true; remaining = item._count; for (t1 = this._items, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { existing = t1[_i]; if (existing.canStack$1(item)) { remaining -= existing.type.maxStack - existing._count; if (remaining <= 0) return true; } } return false; }, tryAdd$2$wasUnequipped(item, wasUnequipped) { var t1, t2, t3, _i, t4, adding = item._count; for (t1 = this._items, t2 = t1.length, t3 = adding, _i = 0; t4 = t1.length, _i < t4; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { t1[_i].stack$1(item); t3 = item._count; if (t3 === 0) return new A.AddItemResult(adding, 0); } t2 = this._capacity; if (t2 != null) t2 = t4 >= t2; else t2 = false; if (t2) return new A.AddItemResult(adding - t3, t3); B.JSArray_methods.add$1(t1, item); B.JSArray_methods.sort$0(t1); if (wasUnequipped) this._lastUnequipped = item; return new A.AddItemResult(adding, 0); }, tryAdd$1(item) { return this.tryAdd$2$wasUnequipped(item, false); }, countChanged$0() { var _i, t1 = this._items, items = A._setArrayType(t1.slice(0), A._arrayInstanceType(t1)); B.JSArray_methods.clear$0(t1); for (t1 = items.length, _i = 0; _i < items.length; items.length === t1 || (0, A.throwConcurrentModificationError)(items), ++_i) this.tryAdd$1(items[_i]); }, get$iterator(_) { var t1 = this._items; return new J.ArrayIterator(t1, t1.length, A._arrayInstanceType(t1)._eval$1("ArrayIterator<1>")); }, get$location() { return this.location; } }; A.Inventory_clone_closure.prototype = { call$1(item) { return type$.Item._as(item).clone$0(); }, $signature: 92 }; A.AddItemResult.prototype = {}; A._Inventory_IterableMixin_ItemCollection.prototype = {}; A.Item.prototype = { get$affixes() { var _1_0, _2_0, t1 = A._setArrayType([], type$.JSArray_Affix), _0_0 = this.prefix; if (_0_0 != null) t1.push(_0_0); _1_0 = this.suffix; if (_1_0 != null) t1.push(_1_0); _2_0 = this.intrinsicAffix; if (_2_0 != null) t1.push(_2_0); return t1; }, get$element() { var t2, _i, result1, result = $.$get$Element_none(), t1 = this.type.attack, result0 = t1 != null ? t1.element : result; for (t1 = this.get$affixes(), t2 = t1.length, _i = 0; _i < t2; ++_i) { result1 = t1[_i].type.brand; if (result1 !== result) result0 = result1; } return result0; }, get$strikeBonus() { return B.JSArray_methods.fold$1$2(this.get$affixes(), 0, new A.Item_strikeBonus_closure(), type$.int); }, get$damageScale() { return B.JSArray_methods.fold$1$2(this.get$affixes(), 1, new A.Item_damageScale_closure(), type$.double); }, get$damageBonus() { return B.JSArray_methods.fold$1$2(this.get$affixes(), 0, new A.Item_damageBonus_closure(), type$.int); }, get$armorModifier() { return B.JSArray_methods.fold$1$2(this.get$affixes(), 0, new A.Item_armorModifier_closure(), type$.int); }, get$nounText() { var text, t2, quantity, t1 = this.type; if (t1.isArtifact) return A.Log__categorize(t1.quantifiableName, false, true); text = this.get$quantifiableName(); t1 = this._count; t2 = t1 === 1; if (t2) if (B.JSString_methods.startsWith$1(text, "(a) ")) { text = B.JSString_methods.substring$1(text, 4); quantity = "a"; } else { if (0 >= text.length) return A.ioore(text, 0); quantity = B.JSString_methods.contains$1("aeiouAEIOU", text[0]) ? "an" : "a"; } else quantity = B.JSInt_methods.toString$0(t1); return quantity + " " + A.Log__categorize(text, true, t2); }, get$quantifiableName() { return B.JSArray_methods.fold$1$2(this.get$affixes(), this.type.quantifiableName, new A.Item_quantifiableName_closure(), type$.String); }, get$pronoun() { return B.Pronoun_it_it_its; }, get$price() { var t1, t2, _i, affix, _this = this, price = _this.type.price, affixScale = 1 + _this.get$affixes().length; for (t1 = _this.get$affixes(), t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { affix = t1[_i]; price *= affix.type._priceScale.call$1(affix.parameter) * affixScale; } for (t1 = _this.get$affixes(), t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { affix = t1[_i]; price += affix.type._priceBonus.call$1(affix.parameter) * affixScale; } return B.JSNumber_methods.ceil$0(price); }, get$weight() { return Math.max(0, B.JSArray_methods.fold$1$2(this.get$affixes(), this.type.weight, new A.Item_weight_closure(), type$.int)); }, get$heft() { return B.JSNumber_methods.round$0(B.JSArray_methods.fold$1$2(this.get$affixes(), this.type.heft, new A.Item_heft_closure(), type$.double)); }, modifyHit$1(hit) { var t1, t2, _i, affix, t3, t4, t5, t6, _s1_ = "_"; for (t1 = this.get$affixes(), t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { affix = t1[_i]; t3 = affix.type; t4 = affix.parameter; t5 = t3._strikeBonus.call$1(t4); t6 = t3._nameTemplate; hit.addStrike$2(t5, A.stringReplaceAllUnchecked(t6, _s1_, _s1_)); t5 = t3._damageScale.call$1(t4); hit.scaleDamage$2(t5, A.stringReplaceAllUnchecked(t6, _s1_, _s1_)); t3 = t3._damageBonus.call$1(t4); hit.addDamage$2(t3, A.stringReplaceAllUnchecked(t6, _s1_, _s1_)); } t1 = this.get$element(); if (t1 !== $.$get$Element_none()) hit._brand = t1; }, resistance$1(element) { return B.JSArray_methods.fold$1$2(this.get$affixes(), 0, new A.Item_resistance_closure(element), type$.int); }, compareTo$1(_, other) { var t1, t2, i, affix, _this = this; type$.Item._as(other); t1 = _this.type.sortIndex; t2 = other.type.sortIndex; if (t1 !== t2) return B.JSInt_methods.compareTo$1(t1, t2); if (_this.get$affixes().length !== other.get$affixes().length) return B.JSInt_methods.compareTo$1(_this.get$affixes().length, other.get$affixes().length); for (i = 0; i < _this.get$affixes().length; ++i) { t1 = _this.get$affixes(); if (!(i < t1.length)) return A.ioore(t1, i); affix = t1[i]; t1 = other.get$affixes(); if (!(i < t1.length)) return A.ioore(t1, i); t2 = affix.type.sortIndex; t1 = t1[i].type.sortIndex; if (t2 !== t1) return B.JSInt_methods.compareTo$1(t2, t1); } t1 = _this._count; t2 = other._count; if (t1 !== t2) return B.JSInt_methods.compareTo$1(t2, t1); return 0; }, clone$1(count) { var _this = this, t1 = count == null ? _this._count : count; return new A.Item(_this.type, _this.prefix, _this.suffix, _this.intrinsicAffix, t1); }, clone$0() { return this.clone$1(null); }, canStack$1(item) { if (this.type !== item.type) return false; if (this.get$affixes().length !== 0) return false; if (item.get$affixes().length !== 0) return false; return true; }, stack$1(item) { var total, t1, _this = this; if (!_this.canStack$1(item)) return; total = _this._count + item._count; t1 = _this.type.maxStack; if (total <= t1) { _this._count = total; item._count = 0; } else { _this._count = t1; item._count = total - t1; } }, splitStack$1(count) { this._count -= count; return this.clone$1(count); }, toString$0(_) { return this.get$nounText(); }, $isComparable: 1, $isNoun: 1 }; A.Item_strikeBonus_closure.prototype = { call$2(bonus, affix) { return A._asInt(bonus) + type$.Affix._as(affix).get$strikeBonus(); }, $signature: 14 }; A.Item_damageScale_closure.prototype = { call$2(bonus, affix) { return A._asDouble(bonus) * type$.Affix._as(affix).get$damageScale(); }, $signature: 41 }; A.Item_damageBonus_closure.prototype = { call$2(bonus, affix) { return A._asInt(bonus) + type$.Affix._as(affix).get$damageBonus(); }, $signature: 14 }; A.Item_armorModifier_closure.prototype = { call$2(bonus, affix) { A._asInt(bonus); type$.Affix._as(affix); return bonus + affix.type._affix$_armorBonus.call$1(affix.parameter); }, $signature: 14 }; A.Item_quantifiableName_closure.prototype = { call$2($name, affix) { A._asString($name); type$.Affix._as(affix); return A.stringReplaceAllUnchecked(affix.type._nameTemplate, "_", $name); }, $signature: 95 }; A.Item_weight_closure.prototype = { call$2(weight, affix) { A._asInt(weight); type$.Affix._as(affix); return weight + affix.type._weightBonus.call$1(affix.parameter); }, $signature: 14 }; A.Item_heft_closure.prototype = { call$2(heft, affix) { A._asDouble(heft); type$.Affix._as(affix); return heft * affix.type._heftScale.call$1(affix.parameter); }, $signature: 41 }; A.Item_resistance_closure.prototype = { call$2(resistance, affix) { return A._asInt(resistance) + type$.Affix._as(affix).resistance$1(this.element); }, $signature: 14 }; A.ItemUse.prototype = {}; A.Toss.prototype = {}; A.ItemType.prototype = { toString$0(_) { return A.Log__categorize(this.quantifiableName, false, true); } }; A.Recipe.prototype = { _missingIngredients$1(items) { var t1, t2, t3, t4, t5, t6, _i, ingredient; type$.Iterable_Item._as(items); t1 = A.LinkedHashMap_LinkedHashMap$of(this.ingredients, type$.ItemType, type$.int); for (t2 = items._items, t3 = A._arrayInstanceType(t2), t2 = new J.ArrayIterator(t2, t2.length, t3._eval$1("ArrayIterator<1>")), t3 = t3._precomputed1; t2.moveNext$0();) { t4 = t2.__interceptors$_current; if (t4 == null) t4 = t3._as(t4); t5 = t4.type; if (!t1.containsKey$1(t5)) return null; t6 = t1.$index(0, t5); t6.toString; t1.$indexSet(0, t5, t6 - t4._count); } t2 = A._instanceType(t1)._eval$1("LinkedHashMapKeysIterable<1>"); t2 = A.List_List$_of(new A.LinkedHashMapKeysIterable(t1, t2), t2._eval$1("Iterable.E")); t3 = t2.length; _i = 0; for (; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { ingredient = t2[_i]; t4 = t1.$index(0, ingredient); t4.toString; if (t4 <= 0) t1.remove$1(0, ingredient); } return t1; } }; A.Shop.prototype = { create$0() { var inventory = A.Inventory$(new A.ItemLocation(this.name), 26, null); this.update$1(inventory); return inventory; }, update$1(inventory) { var t2, t3, t4, item, count, tries, tries0, i, i0, previous, t1 = $.$get$rng(), remainCount = B.JSNumber_methods.toInt$0(t1.float$2(5.2, 10.4)); for (t2 = inventory._items, t3 = t1._random; t4 = t2.length, t4 > remainCount;) { t4 = t3.nextInt$1(t4); if (!(t4 >= 0 && t4 < t2.length)) return A.ioore(t2, t4); item = t2[t4]; B.JSArray_methods.removeAt$1(t2, t4); if (inventory._lastUnequipped === item) inventory._lastUnequipped = null; } count = B.JSNumber_methods.toInt$0(t1.float$2(7.8, 18.2)); t1 = this._drop; t3 = inventory.get$tryAdd(); tries = 0; for (;;) { if (t2.length < count) { tries0 = tries + 1; t4 = tries < 100; tries = tries0; } else t4 = false; if (!t4) break; t1.dropItem$3(null, 1, t3); for (i = 1; i < t2.length; ++i) { i0 = i - 1; previous = t2[i0]; item = t2[i]; if (previous.type === item.type && previous.get$affixes().length === 0 && item.get$affixes().length === 0) { if (!(i < t2.length)) return A.ioore(t2, i); item = t2[i]; B.JSArray_methods.removeAt$1(t2, i); if (inventory._lastUnequipped === item) inventory._lastUnequipped = null; i = i0; } } } } }; A.BreedRef.prototype = {}; A.Breed.prototype = { get$experience() { var t1, t2, _i, t3, attackTotal, attack, t4, moveTotal, moveRateTotal, move, t5, scale, _this = this, totalDodge = _this.dodge; for (t1 = _this.defenses, t2 = t1.length, _i = 0; _i < t2; ++_i) totalDodge += t1[_i].amount; t1 = 6 + _this.speed; if (!(t1 >= 0 && t1 < 13)) return A.ioore(B.List_mRN, t1); t1 = B.List_mRN[t1]; for (t2 = _this.attacks, t3 = t2.length, attackTotal = 0, _i = 0; _i < t3; ++_i) { attack = t2[_i]; attackTotal += attack.damage * attack.element.experience; } for (t2 = _this.moves, t4 = t2.length, moveTotal = 0, moveRateTotal = 0, _i = 0; _i < t2.length; t2.length === t4 || (0, A.throwConcurrentModificationError)(t2), ++_i) { move = t2[_i]; t5 = move.rate; moveTotal += move.get$experience() / t5; moveRateTotal += 1 / t5; } t2 = _this.flags; scale = t2.berzerk ? 1.1 : 1; if (t2.cowardly) scale *= 0.9; if (t2.fearless) scale *= 1.05; if (t2.immobile) scale *= 0.7; if (t2.protective) scale *= 1.1; return B.JSNumber_methods.ceil$0(_this.maxHealth * (1 + totalDodge / 100) * t1 * (attackTotal / t3 * (1 - moveRateTotal) + moveTotal) * scale * A.lerpDouble(_this.meander, 0, 100, 1, 0.7) / 40); }, spawn$2(pos, $parent) { var generation = $parent != null ? $parent.generation + 1 : 1, t1 = pos.get$x(), t2 = pos.get$y(), t3 = new A.Monster(this, generation, new A.AsleepState(), A.LinkedHashMap_LinkedHashMap$_empty(type$.Move, type$.num), $.$get$rng().range$2(60, 200), new A.Energy(), new A.HasteCondition(), new A.ColdCondition(), new A.PoisonCondition(), new A.BlindnessCondition(), new A.BlindnessCondition(), new A.PerceiveCondition(), A.LinkedHashMap_LinkedHashMap$_empty(type$.Element, type$.ResistCondition), new A.Vec(t1, t2)); t3.Monster$4(this, t1, t2, generation); return t3; }, spawn$1(pos) { return this.spawn$2(pos, null); }, spawnAll$0() { var i, t1, _this = this, breeds = A._setArrayType([], type$.JSArray_Breed), count = $.$get$rng().inclusive$2(_this.countMin, _this.countMax); for (i = 0; i < count; ++i) B.JSArray_methods.add$1(breeds, _this); t1 = _this.minions; if (t1 != null) t1.spawnBreed$2(B.JSNumber_methods.floor$0(_this.depth * 0.9), type$.void_Function_Breed._as(B.JSArray_methods.get$add(breeds))); return breeds; }, toString$0(_) { return A.Log__categorize(this._breed$_name, false, true); } }; A.SpawnLocation.prototype = { _enumToString$0() { return "SpawnLocation." + this._core$_name; } }; A.BreedFlags.prototype = { toString$0(_) { var _this = this, t1 = A._setArrayType([], type$.JSArray_String); if (_this.berzerk) t1.push("berzerk"); if (_this.cowardly) t1.push("cowardly"); if (_this.fearless) t1.push("fearless"); if (_this.immobile) t1.push("immobile"); if (_this.protective) t1.push("protective"); if (_this.unique) t1.push("unique"); return B.JSArray_methods.join$1(t1, " "); } }; A.Monster.prototype = { get$motility() { return this._breed.motility; }, get$appearance() { return this._breed.appearance; }, get$nounText() { var t1 = this._breed, t2 = t1._breed$_name; return t1.hasProperName ? A.Log__categorize(t2, false, true) : "the " + A.Log__categorize(t2, false, true); }, get$pronoun() { return this._breed.pronoun; }, get$maxHealth() { return this._breed.maxHealth; }, get$armor() { return 0; }, get$emanationLevel() { return this._breed.emanationLevel; }, get$sightReliance() { var t1 = this._breed, t2 = t1.vision, senses = t2 + t1.hearing; if (senses === 0) return 0; return t2 / senses; }, Monster$4(_breed, x, y, generation) { var t1, t2, t3, _i, _this = this; _this._health = B.JSInt_methods.clamp$2(_this._breed.maxHealth, 0, _this.get$maxHealth()); t1 = _this._monster$_state; t1.__MonsterState__monster_F !== $ && A.throwLateFieldAI("_monster"); t1.__MonsterState__monster_F = _this; t1 = _this._breed; if (t1.flags.cowardly) _this._frightenThreshold *= 0.7; for (t1 = t1.moves, t2 = t1.length, t3 = _this._recharges, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) t3.$indexSet(0, t1[_i], 0); }, useMove$1(move) { var t3, t1 = this._recharges, t2 = t1.$index(0, move); t2.toString; t3 = move.rate; t1.$indexSet(0, move, t2 + $.$get$rng().float$2(t3, t3 * 1.3)); }, get$baseSpeed() { return 6 + this._breed.speed; }, get$baseDodge() { return this._breed.dodge; }, onGetDefenses$0() { return this._breed.defenses; }, onGetAction$1(game) { var t1, t2, t3, _i, move, t4, awareness, fearDecay, notice, _0_0, _this = this, _null = null, _s14_ = "{1} is afraid!"; for (t1 = _this._breed.moves, t2 = t1.length, t3 = _this._recharges, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { move = t1[_i]; t4 = t3.$index(0, move); t4.toString; t3.$indexSet(0, move, Math.max(0, t4 - 1)); } awareness = 0 + _this._seeHero$1(game) + _this._hearHero$1(game); t1 = _this._alertness * 0.75 + awareness * 0.2; _this._alertness = t1; _this._alertness = B.JSNumber_methods.clamp$2(t1, 0, 1); t1 = _this._pos; fearDecay = 5 + t1.$sub(0, game.hero._pos).get$kingLength(); t2 = game.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t1 = t2.tiles.$get$2(t1.get$x(), t1.get$y()); if (!(!t1._isOccluded && t1.floorIllumination + t1.actorIllumination > t1._fallOff)) fearDecay = 5 + fearDecay * 2; _this._modifyFear$1(-(2 + fearDecay * _this._health / _this._breed.maxHealth)); _this._fear = B.JSNumber_methods.clamp$2(_this._fear, 0, _this._frightenThreshold); notice = Math.max(awareness, _this._alertness); A.Debug_monsterStat(_this, "aware", awareness, _null); A.Debug_monsterStat(_this, "alert", _this._alertness, _null); A.Debug_monsterStat(_this, "notice", notice, _null); A.Debug_monsterStat(_this, "fear", _this._fear / _this._frightenThreshold, _null); _0_0 = _this._monster$_state; t1 = _0_0 instanceof A.AsleepState; if (t1 && _this._fear > _this._frightenThreshold) { _this._resetCharges$0(); return A.ChangeMonsterStateAction$(_s14_, new A.AfraidState(), B.EventType_frighten); } if (t1) { t1 = $.$get$rng(); t2 = _this._awakenPercent$1(notice); t2 = t1.range$1(100) < t2; t1 = t2; } else t1 = false; if (t1) { _this._alertness = 1; _this._resetCharges$0(); return A.ChangeMonsterStateAction$("{1} wakes up!", new A.AwakeState(), B.EventType_awaken); } t1 = _0_0 instanceof A.AwakeState; if (t1 && _this._fear > _this._frightenThreshold) return A.ChangeMonsterStateAction$(_s14_, new A.AfraidState(), B.EventType_frighten); if (t1 && notice < 0.01) { _this._alertness = 0; return A.ChangeMonsterStateAction$("{1} falls asleep.", new A.AsleepState(), _null); } if (_0_0 instanceof A.AfraidState && _this._fear <= 0) return A.ChangeMonsterStateAction$("{1} find[s] {1 his} courage.", new A.AwakeState(), _null); return _this._monster$_state.getAction$1(game); }, _awakenPercent$1(notice) { var normal; if (notice < 0.1) return 0; if (notice > 0.8) return 100; normal = A.lerpDouble(notice, 0.1, 0.8, 0, 1); return B.JSNumber_methods.round$0(A.lerpDouble(normal * normal * normal, 0, 1, 5, 100)); }, _seeHero$1(game) { var heroPos, t1, illumination, distance, visibility, _this = this, _s3_ = "see"; if (_this._breed.vision === 0) { A.Debug_monsterStat(_this, _s3_, 0, "sightless"); return 0; } heroPos = game.hero._pos; t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); if (!t1.canView$2(_this, heroPos)) { A.Debug_monsterStat(_this, _s3_, 0, "out of sight"); return 0; } t1 = t1.tiles.$get$2(heroPos.get$x(), heroPos.get$y()); illumination = t1.floorIllumination + t1.actorIllumination; if (illumination === 0) { A.Debug_monsterStat(_this, _s3_, 0, "hero in dark"); return 0; } distance = heroPos.$sub(0, _this._pos).get$kingLength(); t1 = _this._breed.vision; if (distance >= t1) { A.Debug_monsterStat(_this, _s3_, 0, "too far"); return 0; } visibility = (t1 - distance) / t1; A.Debug_monsterStat(_this, _s3_, illumination * visibility, null); return illumination / 64 * visibility; }, _hearHero$1(game) { var t1, t2, volume, _this = this; if (_this._breed.hearing === 0) { A.Debug_monsterStat(_this, "hear", 0, "deaf"); return 0; } t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = _this._pos; t1 = t1.get$_sound(); t2 = t1._volume$1(t1._heroAuditoryDistance$1(t2)); t1 = game.hero._lastNoise; volume = t2 * t1 * _this._breed.hearing / 10; A.Debug_monsterStat(_this, "hear", volume, "noise " + A.S(t1) + ", volume " + A.S(volume)); return volume; }, _modifyFear$1(offset) { var t1, _this = this; if (_this._health <= 0) return; t1 = _this._breed.flags; if (t1.fearless) return; if (t1.immobile) return; _this._fear = Math.max(0, _this._fear + offset); }, onCreateMeleeHits$1(defender) { var t1 = $.$get$rng(), t2 = type$.List_Attack._as(this._breed.attacks); t1 = t1.range$1(t2.length); if (!(t1 >= 0 && t1 < t2.length)) return A.ioore(t2, t1); return A._setArrayType([A.Hit$_(t2[t1])], type$.JSArray_Hit); }, onGetResistance$1(element) { return 0; }, onGiveDamage$3(action, defender, damage) { var t2, fear, t1 = action.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = t1.hero.save.vitality._stat$_value; t2.toString; fear = 100 * damage / B.JSNumber_methods.toInt$0(Math.pow(t2, 1.458) + 9); this._modifyFear$1(-fear); t2 = t1.hero.save.vitality._stat$_value; t2.toString; A.Debug_monsterReason(this, "fear", "hit for " + damage + "/" + B.JSNumber_methods.toInt$0(Math.pow(t2, 1.458) + 9) + " decrease by " + A.S(fear)); this._updateWitnesses$2(t1, new A.Monster_onGiveDamage_closure(action, damage)); }, _viewHeroDamage$2(action, damage) { var fear, _this = this; if (_this._monster$_state instanceof A.AsleepState) return; fear = 50 * damage / _this._breed.maxHealth; _this._modifyFear$1(-fear); A.Debug_monsterReason(_this, "fear", "witness " + damage + "/" + _this._breed.maxHealth + " decrease by " + A.S(fear)); }, onTakeDamage$3(action, attacker, damage) { var t1, fear, t2, t3, t4, moves, _this = this; _this._alertness = 1; t1 = _this._breed; fear = 100 * damage / t1.maxHealth; if (t1.flags.berzerk) fear *= -3; _this._modifyFear$1(fear); A.Debug_monsterReason(_this, "fear", "hit for " + damage + "/" + _this._breed.maxHealth + " increases by " + A.S(fear)); t1 = action.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); _this._updateWitnesses$2(t1, new A.Monster_onTakeDamage_closure(_this, action, damage)); t2 = _this._breed.moves; t3 = A._arrayInstanceType(t2); t4 = t3._eval$1("WhereIterable<1>"); moves = A.List_List$_of(new A.WhereIterable(t2, t3._eval$1("bool(1)")._as(new A.Monster_onTakeDamage_closure0(_this, damage)), t4), t4._eval$1("Iterable.E")); t2 = moves.length; if (t2 !== 0) { t3 = $.$get$rng(); type$.List_Move._as(moves); t2 = t3.range$1(t2); if (!(t2 >= 0 && t2 < moves.length)) return A.ioore(moves, t2); t2 = moves[t2]; _this.useMove$1(t2); action.addAction$2(t2.onGetAction$2(t1, _this), _this); } }, _viewMonsterDamage$3(action, monster, damage) { var t1, fear, t2, _this = this; if (_this._monster$_state instanceof A.AsleepState) return; t1 = _this._breed; fear = 50 * damage / t1.maxHealth; t2 = t1.flags; if (t2.protective && monster._breed === t1) fear *= -2; else if (t2.berzerk) fear *= -1; _this._modifyFear$1(fear); A.Debug_monsterReason(_this, "fear", "witness " + damage + "/" + _this._breed.maxHealth + " increase by " + A.S(fear)); }, onDied$2(action, attackNoun) { var t2, t3, t4, items, _i, item, t5, t6, _this = this, _s6_ = "_stage", t1 = action.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI(_s6_); t3 = _this._pos; t4 = _this._breed; items = t2.placeDrops$3$depth(t3, t4.drop, t4.depth); for (t2 = items.length, _i = 0; _i < items.length; items.length === t2 || (0, A.throwConcurrentModificationError)(items), ++_i) { item = items[_i]; t3 = t1.__Game__stage_F; t3 === $ && A.throwLateFieldNI(_s6_); t4 = action.__Action__pos_F; t4 === $ && A.throwLateFieldNI("_pos"); t3 = t3.tiles; t5 = t4.get$x(); t4 = t4.get$y(); t3._checkBounds$2(t5, t4); t6 = t3._elements; t5 = t4 * t3.bounds.size.x + t5; if (!(t5 >= 0 && t5 < t6.length)) return A.ioore(t6, t5); t5 = t6[t5]; if (!t5._isOccluded && t5.floorIllumination + t5.actorIllumination > t5._fallOff || action._actor instanceof A.Hero) t1.hero.save.log._log$_add$5(B.LogType_0, "{1} drop[s] {2}.", _this, item, null); } t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI(_s6_); t1.removeActor$1(_this); }, onChangePosition$3(game, from, to) { var t2, t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = t1.tiles.$get$2(from.get$x(), from.get$y()); if (!(!t2._isOccluded && t2.floorIllumination + t2.actorIllumination > t2._fallOff)) { t2 = t1.tiles.$get$2(to.get$x(), to.get$y()); t2 = !t2._isOccluded && t2.floorIllumination + t2.actorIllumination > t2._fallOff; } else t2 = true; if (t2) { t2 = game.hero; if (!(t2._behavior instanceof A.ActionBehavior)) t2._behavior = null; } t2 = t1.tiles.$get$2(from.get$x(), from.get$y()); if (!(!t2._isOccluded && t2.floorIllumination + t2.actorIllumination > t2._fallOff)) { t1 = t1.tiles.$get$2(to.get$x(), to.get$y()); t1 = !t1._isOccluded && t1.floorIllumination + t1.actorIllumination > t1._fallOff; } else t1 = false; if (t1) game.hero.seeMonster$1(this); }, _updateWitnesses$2(game, callback) { var t1, t2, t3, _i, other, t4, t5; type$.void_Function_Monster._as(callback); t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = t1._actors; t3 = t2.length; _i = 0; for (; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { other = t2[_i]; if (other === this) continue; if (!(other instanceof A.Monster)) continue; t4 = other._pos; t5 = this._pos; t4 = t4.$sub(0, t5); if (Math.max(Math.abs(t4.x), Math.abs(t4.y)) > 20) continue; if (t1.canView$2(other, t5)) callback.call$1(other); } }, _resetCharges$0() { var t1, t2, t3, _i, move; for (t1 = this._breed.moves, t2 = t1.length, t3 = this._recharges, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { move = t1[_i]; t3.$indexSet(0, move, $.$get$rng().float$1(move.rate / 2)); } } }; A.Monster_onGiveDamage_closure.prototype = { call$1(witness) { witness._viewHeroDamage$2(this.action, this.damage); }, $signature: 34 }; A.Monster_onTakeDamage_closure.prototype = { call$1(witness) { witness._viewMonsterDamage$3(this.action, this.$this, this.damage); }, $signature: 34 }; A.Monster_onTakeDamage_closure0.prototype = { call$1(move) { return type$.Move._as(move).shouldUseOnDamage$2(this.$this, this.damage); }, $signature: 47 }; A.ChangeMonsterStateAction.prototype = { onPerform$0() { var _0_0, t1, t2, _this = this; _this.show$2(_this._monster$_message, _this._actor); _0_0 = _this._event; if (_0_0 != null) _this.addEvent$2$actor(_0_0, _this._actor); t1 = type$.Monster._as(_this._actor); t2 = t1._monster$_state = _this._monster$_state; t2.__MonsterState__monster_F !== $ && A.throwLateFieldAI("_monster"); t2.__MonsterState__monster_F = t1; t1 = _this.__Action__game_F; t1 === $ && A.throwLateFieldNI("_game"); return _this.alternate$1(t2.getAction$1(t1)); } }; A.MonsterPathfinder.prototype = { processStep$1(path) { var t2, _this = this, t1 = _this._nearest; if (t1 != null) { t2 = _this.end; t2 = _this.heuristic$2(path.pos, t2) < _this.heuristic$2(t1.pos, t2); } else t2 = true; if (t2) t1 = _this._nearest = path; if (path.length >= _this._monster._breed.tracking) return t1.startDirection; return null; }, heuristic$2(pos, end) { var diagonal, t1 = end.$sub(0, pos), t2 = Math.abs(t1.x); t1 = Math.abs(t1.y); diagonal = Math.min(t2, t1); return (Math.max(t2, t1) - diagonal) * 10 + diagonal * 11; }, stepCost$2(pos, tile) { var firstStep, t1, t2, _this = this, _null = null; if (tile.substance !== 0) return _null; firstStep = pos.$sub(0, _this.start).get$kingLength() === 1; if (_this.stage._actorsByTile.$get$2(pos.x, pos.y) != null) { if (firstStep) return _null; return 60; } t1 = tile.type.motility; t2 = $.$get$Motility_door(); if (t1.$eq(0, t2)) if ((_this._monster._breed.motility._bitMask & t2._bitMask) !== 0) return 20; else if (firstStep) return _null; else return 80; if ((t1._bitMask & _this._monster._breed.motility._bitMask) !== 0) return 10; return _null; }, reachedGoal$1(path) { return path.startDirection; }, unreachableGoal$0() { var t1 = this._nearest; if (t1 == null) return null; return t1.startDirection; } }; A.MonsterState.prototype = { _monster_states$_meander$2(game, dir) { var meander, dirs, i, t2, t1 = this.__MonsterState__monster_F; t1 === $ && A.throwLateFieldNI("_monster"); meander = t1._breed.meander; if (t1.blindness._turnsRemaining > 0 || t1.dazzle._turnsRemaining > 0) meander += B.JSNumber_methods.toInt$0(t1.get$sightReliance() * 50); else if (t1._pos.$add(0, dir).$eq(0, game.hero._pos)) meander = meander / 4 | 0; meander = Math.min(meander, 90); if (!($.$get$rng().range$1(100) < meander)) return dir; if (dir === B.Direction_0_0_0_none) dirs = B.List_wXx; else { dirs = A._setArrayType([], type$.JSArray_Direction); for (i = 0; i < 3; ++i) { B.JSArray_methods.add$1(dirs, dir.get$rotateLeft45()); B.JSArray_methods.add$1(dirs, dir.get$rotateRight45()); } for (i = 0; i < 2; ++i) { B.JSArray_methods.add$1(dirs, dir.get$rotateLeft90()); B.JSArray_methods.add$1(dirs, dir.get$rotateRight90()); } B.JSArray_methods.add$1(dirs, dir.get$rotateLeft90().get$rotateLeft45()); B.JSArray_methods.add$1(dirs, dir.get$rotateRight90().get$rotateRight45()); } t1 = A._arrayInstanceType(dirs); t2 = t1._eval$1("WhereIterable<1>"); dirs = A.List_List$_of(new A.WhereIterable(dirs, t1._eval$1("bool(1)")._as(new A.MonsterState__meander_closure(this, game)), t2), t2._eval$1("Iterable.E")); t1 = dirs.length; if (t1 === 0) return dir; t2 = $.$get$rng(); type$.List_Direction._as(dirs); t1 = t2.range$1(t1); if (!(t1 >= 0 && t1 < dirs.length)) return A.ioore(dirs, t1); return dirs[t1]; } }; A.MonsterState__meander_closure.prototype = { call$1(dir) { var t1, here, t2, t3; type$.Direction._as(dir); t1 = this.$this.__MonsterState__monster_F; t1 === $ && A.throwLateFieldNI("_monster"); here = t1._pos.$add(0, dir); t2 = this.game; t3 = t2.__Game__stage_F; t3 === $ && A.throwLateFieldNI("_stage"); if (!(t3.canOccupy$2(here, t1._breed.motility) && t3.tiles.$get$2(here.x, here.y).substance === 0)) return false; t1 = t3._actorsByTile.$get$2(here.x, here.y); return t1 == null || t1 === t2.hero; }, $signature: 9 }; A.AsleepState.prototype = { getAction$1(game) { return A.RestAction$(); } }; A.AwakeState.prototype = { getAction$1(game) { var t1, t2, t3, t4, moves, toHero, rangedDamage, rangedAttacks, _i, move, meleeDamage, meleeAttacks, caution, meleeDir, rangedDir, walkDir, _this = this, $escape = _this._escapeSubstance$1(game); if ($escape !== B.Direction_0_0_0_none) return A.WalkAction$($escape); t1 = _this.__MonsterState__monster_F; t1 === $ && A.throwLateFieldNI("_monster"); t2 = t1._breed.moves; t3 = A._arrayInstanceType(t2); t4 = t3._eval$1("WhereIterable<1>"); moves = A.List_List$_of(new A.WhereIterable(t2, t3._eval$1("bool(1)")._as(new A.AwakeState_getAction_closure(_this, game)), t4), t4._eval$1("Iterable.E")); t2 = moves.length; if (t2 !== 0) { t3 = $.$get$rng(); type$.List_Move._as(moves); t2 = t3.range$1(t2); if (!(t2 >= 0 && t2 < moves.length)) return A.ioore(moves, t2); t2 = moves[t2]; t1.useMove$1(t2); return t2.onGetAction$2(game, t1); } t2 = t1._breed; if (t2.flags.immobile) { toHero = game.hero._pos.$sub(0, t1._pos); if (toHero.get$kingLength() !== 1) return A.RestAction$(); return A.WalkAction$(toHero.get$nearestDirection()); } t1.wantsToMelee = true; for (t3 = t2.moves, t4 = t3.length, rangedDamage = 0, rangedAttacks = 0, _i = 0; _i < t4; ++_i) { move = t3[_i]; if (!(move instanceof A.BoltMove)) continue; rangedDamage += move.attack.damage / move.rate; ++rangedAttacks; } if (rangedAttacks !== 0) { for (t3 = t2.attacks, t4 = t3.length, meleeDamage = 0, meleeAttacks = 0, _i = 0; _i < t4; ++_i) { meleeDamage += t3[_i].damage; ++meleeAttacks; } if (meleeAttacks > 0) meleeDamage /= meleeAttacks; rangedDamage /= rangedAttacks; caution = 100 * rangedDamage / (rangedDamage + meleeDamage) + t1._fear + 100 * (1 - t1._health / t2.maxHealth); if (t1._pos.$sub(0, game.hero._pos).$le(0, 1)) t1.wantsToMelee = caution < 60; else t1.wantsToMelee = caution < 30; } meleeDir = _this._findMeleePath$1(game); rangedDir = rangedAttacks > 0 ? _this._findRangedPath$1(game) : null; if (t1.wantsToMelee) walkDir = meleeDir == null ? rangedDir : meleeDir; else walkDir = rangedDir == null ? meleeDir : rangedDir; return A.WalkAction$(_this._monster_states$_meander$2(game, walkDir == null ? B.Direction_0_0_0_none : walkDir)); }, _escapeSubstance$1(game) { var t2, t3, t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = this.__MonsterState__monster_F; t2 === $ && A.throwLateFieldNI("_monster"); t3 = t2._pos; if (t1.tiles.$get$2(t3.get$x(), t3.get$y()).substance === 0) return B.Direction_0_0_0_none; return A.MotilityFlow$(t1, t2._pos, t2._breed.motility, null, true, null).directionToBestWhere$1(new A.AwakeState__escapeSubstance_closure(game)); }, _findRangedPath$1(game) { var t1, t2, t3, _i, move, isValidRangedPosition, bestDistance, best, dir, pos, t4, t5, t6, t7, bestDistance0, _box_0 = {}; _box_0.maxRange = 9999; t1 = this.__MonsterState__monster_F; t1 === $ && A.throwLateFieldNI("_monster"); t2 = t1._breed.moves; t3 = t2.length; _i = 0; for (; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { move = t2[_i]; if (move.get$range() > 0 && move.get$range() < _box_0.maxRange) _box_0.maxRange = move.get$range(); } isValidRangedPosition = new A.AwakeState__findRangedPath_isValidRangedPosition(_box_0, this, game); if (isValidRangedPosition.call$1(t1._pos)) { bestDistance = t1._pos.$sub(0, game.hero._pos).get$kingLength(); best = B.Direction_0_0_0_none; } else { best = null; bestDistance = 0; } for (t2 = game.hero, _i = 0; _i < 8; ++_i) { dir = B.List_wXx[_i]; pos = t1._pos.$add(0, dir); t3 = game.__Game__stage_F; t3 === $ && A.throwLateFieldNI("_stage"); if (t3.canOccupy$2(pos, t1._breed.motility)) { t4 = t3._actorsByTile; t5 = pos.x; t6 = pos.y; t4._checkBounds$2(t5, t6); t7 = t4._elements; t5 = t6 * t4.bounds.size.x + t5; if (!(t5 >= 0 && t5 < t7.length)) return A.ioore(t7, t5); t5 = t7[t5] == null; t4 = t5; } else t4 = false; if (t4) { t3 = t3.tiles; t4 = pos.x; t5 = pos.y; t3._checkBounds$2(t4, t5); t6 = t3._elements; t4 = t5 * t3.bounds.size.x + t4; if (!(t4 >= 0 && t4 < t6.length)) return A.ioore(t6, t4); t4 = t6[t4].substance === 0; t3 = t4; } else t3 = false; if (!t3) continue; if (!isValidRangedPosition.call$1(pos)) continue; t3 = pos.$sub(0, t2._pos); bestDistance0 = Math.max(Math.abs(t3.x), Math.abs(t3.y)); if (bestDistance0 > bestDistance) { bestDistance = bestDistance0; best = dir; } } if (best != null) return best; t2 = game.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); dir = A.MotilityFlow$(t2, t1._pos, t1._breed.motility, null, true, _box_0.maxRange).directionToBestWhere$1(isValidRangedPosition); if (dir !== B.Direction_0_0_0_none) { A.Debug_monsterLog(t1, "ranged position " + dir.toString$0(0)); return dir; } A.Debug_monsterLog(t1, "no good ranged position"); return null; }, _findMeleePath$1(game) { var t1, t2, losDir = this._findLosWalkPath$1(game); if (losDir != null) return losDir; t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = this.__MonsterState__monster_F; t2 === $ && A.throwLateFieldNI("_monster"); return new A.MonsterPathfinder(t2, t1, t2._pos, t1.game.hero._pos).search$0(); }, _findLosWalkPath$1(game) { var t2, t3, first, $length, pos, t4, t5, t6, t7, t8, step, _null = null, t1 = this.__MonsterState__monster_F; t1 === $ && A.throwLateFieldNI("_monster"); t2 = game.hero; t3 = A._LineIterator__LineIterator(t1._pos, t2._pos); first = _null; $length = 1; while (t3.moveNext$0(), true) { pos = t3._line$_current; if (first == null) first = pos; t4 = game.__Game__stage_F; t4 === $ && A.throwLateFieldNI("_stage"); t5 = t4.tiles; t6 = pos.get$x(); t7 = pos.get$y(); t5._checkBounds$2(t6, t7); t8 = t5._elements; t6 = t7 * t5.bounds.size.x + t6; if (!(t6 >= 0 && t6 < t8.length)) return A.ioore(t8, t6); if (t8[t6].substance > 0) return _null; if (!t4.canOccupy$2(pos, t1._breed.motility)) return _null; t4 = t4._actorsByTile; t5 = pos.get$x(); t6 = pos.get$y(); t4._checkBounds$2(t5, t6); t7 = t4._elements; t5 = t6 * t4.bounds.size.x + t5; if (!(t5 >= 0 && t5 < t7.length)) return A.ioore(t7, t5); t5 = t7[t5]; if (t5 != null && !(t5 instanceof A.Hero)) return _null; ++$length; if ($length >= t1._breed.tracking) return _null; if (pos.$eq(0, t2._pos)) break; } step = first.$sub(0, t1._pos); t1 = step.y; if (t1 === -1) { t1 = step.x; if (t1 === -1) return B.Direction_m1_m1_8_nw; else if (t1 === 0) return B.Direction_0_m1_1_n; else return B.Direction_1_m1_2_ne; } else if (t1 === 0) if (step.x === -1) return B.Direction_m1_0_7_w; else return B.Direction_1_0_3_e; else { t1 = step.x; if (t1 === -1) return B.Direction_m1_1_6_sw; else if (t1 === 0) return B.Direction_0_1_5_s; else return B.Direction_1_1_4_se; } }, _hasLosFrom$2(game, from) { var t1, t2, step, t3, t4, t5, t6, t7; for (t1 = game.hero, t2 = A._LineIterator__LineIterator(from, t1._pos); t2.moveNext$0(), true;) { step = t2._line$_current; if (step.$eq(0, t1._pos)) return true; t3 = game.__Game__stage_F; t3 === $ && A.throwLateFieldNI("_stage"); t4 = t3.tiles; t5 = step.get$x(); t6 = step.get$y(); t4._checkBounds$2(t5, t6); t7 = t4._elements; t5 = t6 * t4.bounds.size.x + t5; if (!(t5 >= 0 && t5 < t7.length)) return A.ioore(t7, t5); t5 = t7[t5]; t7 = $.$get$Motility_fly(); if ((t5.type.motility._bitMask & t7._bitMask) === 0) return false; t3 = t3._actorsByTile; t4 = step.get$x(); t5 = step.get$y(); t3._checkBounds$2(t4, t5); t6 = t3._elements; t4 = t5 * t3.bounds.size.x + t4; if (!(t4 >= 0 && t4 < t6.length)) return A.ioore(t6, t4); t4 = t6[t4]; if (t4 != null) { t3 = this.__MonsterState__monster_F; t3 === $ && A.throwLateFieldNI("_monster"); t3 = t4 !== t3; } else t3 = false; if (t3) return false; } throw A.wrapException(A.AssertionError$("Unreachable.")); } }; A.AwakeState_getAction_closure.prototype = { call$1(move) { var t1; type$.Move._as(move); t1 = this.$this.__MonsterState__monster_F; t1 === $ && A.throwLateFieldNI("_monster"); return t1._recharges.$index(0, move) === 0 && move.shouldUse$2(this.game, t1); }, $signature: 47 }; A.AwakeState__escapeSubstance_closure.prototype = { call$1(pos) { var t1 = this.game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); return t1.tiles.$get$2(pos.x, pos.y).substance === 0; }, $signature: 1 }; A.AwakeState__findRangedPath_isValidRangedPosition.prototype = { call$1(pos) { var t2, t3, _this = this, t1 = _this.game, toHero = pos.$sub(0, t1.hero._pos); if (toHero.$gt(0, _this._box_0.maxRange)) return false; if (toHero.get$kingLength() <= 2) return false; t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t2 = t2._actorsByTile.$get$2(pos.get$x(), pos.get$y()); if (t2 != null) { t3 = _this.$this.__MonsterState__monster_F; t3 === $ && A.throwLateFieldNI("_monster"); t3 = t2 !== t3; t2 = t3; } else t2 = false; if (t2) return false; return _this.$this._hasLosFrom$2(t1, pos); }, $signature: 1 }; A.AfraidState.prototype = { getAction$1(game) { var t2, t3, t4, dir, farther, state, _this = this, t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = _this.__MonsterState__monster_F; t2 === $ && A.throwLateFieldNI("_monster"); t3 = t2._pos; if (t1.tiles.$get$2(t3.get$x(), t3.get$y())._isOccluded) return A.RestAction$(); t3 = t2._pos; t4 = t2._breed; dir = A.MotilityFlow$(t1, t3, t4.motility, null, true, t4.tracking).directionToBestWhere$1(new A.AfraidState_getAction_closure(game)); if (dir !== B.Direction_0_0_0_none) { A.Debug_monsterLog(t2, "fleeing " + dir.toString$0(0) + " out of sight"); return A.WalkAction$(_this._monster_states$_meander$2(game, dir)); } t1 = type$.WhereIterable_Direction; farther = new A.WhereIterable(B.List_wXx, type$.bool_Function_Direction._as(new A.AfraidState_getAction_closure0(_this, game, t2._pos.$sub(0, game.hero._pos).get$kingLength())), t1); if (!farther.get$isEmpty(0)) { t3 = $.$get$rng(); t1 = A.List_List$_of(farther, t1._eval$1("Iterable.E")); type$.List_Direction._as(t1); t3 = t3.range$1(t1.length); if (!(t3 >= 0 && t3 < t1.length)) return A.ioore(t1, t3); dir = t1[t3]; A.Debug_monsterLog(t2, "fleeing " + dir.toString$0(0) + " away from hero"); return A.WalkAction$(_this._monster_states$_meander$2(game, dir)); } state = t2._monster$_state = new A.AwakeState(); state.__MonsterState__monster_F = t2; return state.getAction$1(game); } }; A.AfraidState_getAction_closure.prototype = { call$1(pos) { var t1 = this.game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); return t1.tiles.$get$2(pos.x, pos.y)._isOccluded; }, $signature: 1 }; A.AfraidState_getAction_closure0.prototype = { call$1(dir) { var t1, here, t2, t3; type$.Direction._as(dir); t1 = this.$this.__MonsterState__monster_F; t1 === $ && A.throwLateFieldNI("_monster"); here = t1._pos.$add(0, dir); t2 = this.game; t3 = t2.__Game__stage_F; t3 === $ && A.throwLateFieldNI("_stage"); if (!(t3.canOccupy$2(here, t1._breed.motility) && t3._actorsByTile.$get$2(here.x, here.y) == null && t3.tiles.$get$2(here.x, here.y).substance === 0)) return false; return here.$sub(0, t2.hero._pos).get$kingLength() > this.heroDistance; }, $signature: 9 }; A.Move.prototype = { get$range() { return 0; }, shouldUse$2(game, monster) { return true; }, shouldUseOnDamage$2(monster, damage) { return false; } }; A.RangedMove.prototype = { get$range() { return this.attack.range; } }; A.BucketQueue.prototype = { add$2(_, value, cost) { var t2, t3, bucket, _this = this, t1 = _this.$ti._precomputed1; t1._as(value); _this._bucket = Math.min(_this._bucket, cost); t2 = _this._buckets; t3 = cost + 1; if (t2.length <= t3) B.JSArray_methods.set$length(t2, t3); if (!(cost >= 0 && cost < t2.length)) return A.ioore(t2, cost); bucket = t2[cost]; if (bucket == null) { bucket = A.ListQueue$(t1); B.JSArray_methods.$indexSet(t2, cost, bucket); } bucket._add$1(bucket.$ti._precomputed1._as(value)); }, removeNext$0() { var t2, t3, t4, t1 = this._buckets; for (;;) { t2 = this._bucket; t3 = t1.length; if (t2 < t3) { if (!(t2 >= 0)) return A.ioore(t1, t2); t4 = t1[t2]; t4 = t4 == null ? null : t4._head === t4._tail; t4 = t4 !== false; } else t4 = false; if (!t4) break; this._bucket = t2 + 1; } if (t2 >= t3) return null; if (!(t2 >= 0)) return A.ioore(t1, t2); return t1[t2].removeFirst$0(); } }; A.Flow.prototype = { Flow$3$maxDistance(stage, _start, maxDistance) { var width, height, t2, left, $top, right, bottom, start, _this = this, _s7_ = "_offset", t1 = _this.stage.tiles; if (maxDistance == null) { _this.__Flow__offset_F !== $ && A.throwLateFieldAI(_s7_); _this.__Flow__offset_F = new A.Vec(1, 1); t1 = t1.bounds.size; width = t1.x - 2; height = t1.y - 2; } else { t2 = _this._start; left = Math.max(1, t2.get$x() - maxDistance); $top = Math.max(1, t2.get$y() - maxDistance); t1 = t1.bounds.size; right = Math.min(t1.x - 1, t2.get$x() + maxDistance + 1); bottom = Math.min(t1.y - 1, t2.get$y() + maxDistance + 1); _this.__Flow__offset_F !== $ && A.throwLateFieldAI(_s7_); _this.__Flow__offset_F = new A.Vec(left, $top); width = right - left; height = bottom - $top; } t1 = type$.Array2D_int; t1 = t1._as(new A.Array2D(A.List_List$filled(width * height, -2, false, type$.int), new A.Rect(new A.Vec(0, 0), new A.Vec(width, height)), t1)); _this.__Flow__costs_F !== $ && A.throwLateFieldAI("_costs"); _this.__Flow__costs_F = t1; t2 = _this.__Flow__offset_F; t2 === $ && A.throwLateFieldNI(_s7_); start = _this._start.$sub(0, t2); _this._open.add$2(0, start, 0); t1.$set$3(start.x, start.y, 0); }, get$reachable() { return new A._SyncStarIterable(this.reachable$body$Flow(), type$._SyncStarIterable_Vec); }, reachable$body$Flow() { var $async$self = this; return function() { var $async$goto = 0, $async$handler = 2, $async$errorStack = [], t1, i, t2, t3; return function $async$get$reachable($async$iterator, $async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$errorStack.push($async$result); $async$goto = $async$handler; } for (;;) $async$outer: switch ($async$goto) { case 0: // Function start t1 = $async$self._found, i = 0; case 3: // for condition // trivial condition while (i >= t1.length) if (!$async$self._processNext$0()) { // goto return $async$goto = 1; break $async$outer; } t2 = t1[i]; t3 = $async$self.__Flow__offset_F; t3 === $ && A.throwLateFieldNI("_offset"); $async$goto = 6; return $async$iterator._async$_current = t2.$add(0, t3), 1; case 6: // after yield case 4: // for update ++i; // goto for condition $async$goto = 3; break; case 5: // after for case 1: // return return 0; case 2: // rethrow return $async$iterator._datum = $async$errorStack.at(-1), 3; } }; }; }, bestWhere$1(predicate) { var t2, results = this._findAllBestWhere$1(type$.bool_Function_Vec._as(predicate)), t1 = results.length; if (t1 === 0) return null; t2 = $.$get$rng(); type$.List_Vec._as(results); t1 = t2.range$1(t1); if (!(t1 >= 0 && t1 < results.length)) return A.ioore(results, t1); t1 = results[t1]; t2 = this.__Flow__offset_F; t2 === $ && A.throwLateFieldNI("_offset"); return t1.$add(0, t2); }, costAt$1(pos) { var t2, t3, t4, t5, distance, t1 = this.__Flow__offset_F; t1 === $ && A.throwLateFieldNI("_offset"); pos = pos.$sub(0, t1); t1 = this.__Flow__costs_F; t1 === $ && A.throwLateFieldNI("_costs"); if (!t1.bounds.contains$1(0, pos)) return null; t2 = pos.x; t3 = pos.y; for (;;) { t1._checkBounds$2(t2, t3); t4 = t1._elements; t5 = t3 * t1.bounds.size.x + t2; if (!(t5 >= 0 && t5 < t4.length)) return A.ioore(t4, t5); if (!(J.$eq$(t4[t5], -2) && this._processNext$0())) break; } distance = t1.$get$2(t2, t3); if (distance === -2 || distance === -1) return null; return distance; }, directionToBestWhere$1(predicate) { var t2, directions = this._directionsTo$1(this._findAllBestWhere$1(type$.bool_Function_Vec._as(predicate))), t1 = directions.length; if (t1 === 0) return B.Direction_0_0_0_none; t2 = $.$get$rng(); type$.List_Direction._as(directions); t1 = t2.range$1(t1); if (!(t1 >= 0 && t1 < directions.length)) return A.ioore(directions, t1); return directions[t1]; }, _findAllBestWhere$1(predicate) { var goals, t1, lowestCost, i, pos, t2, t3, t4, t5, cost, _this = this; type$.bool_Function_Vec._as(predicate); goals = A._setArrayType([], type$.JSArray_Vec); for (t1 = _this._found, lowestCost = null, i = 0;; ++i) { while (i >= t1.length) if (!_this._processNext$0()) return goals; pos = t1[i]; t2 = _this.__Flow__offset_F; t2 === $ && A.throwLateFieldNI("_offset"); if (!predicate.call$1(pos.$add(0, t2))) continue; t2 = _this.__Flow__costs_F; t2 === $ && A.throwLateFieldNI("_costs"); t3 = pos.x; t4 = pos.y; t2._checkBounds$2(t3, t4); t5 = t2._elements; t3 = t4 * t2.bounds.size.x + t3; if (!(t3 >= 0 && t3 < t5.length)) return A.ioore(t5, t3); cost = t5[t3]; if (lowestCost == null || cost === lowestCost) B.JSArray_methods.add$1(goals, pos); else break; lowestCost = cost; } return goals; }, _directionsTo$1(goals) { var t1, directions = A.LinkedHashSet_LinkedHashSet$_empty(type$.Direction); B.JSArray_methods.forEach$1(type$.List_Vec._as(goals), new A.Flow__directionsTo_walkBack(this, A.LinkedHashSet_LinkedHashSet$_empty(type$.Vec), directions)); t1 = A.List_List$_of(directions, directions.$ti._precomputed1); return t1; }, _processNext$0() { var t1, start = this._open.removeNext$0(); if (start == null) return false; t1 = this.__Flow__costs_F; t1 === $ && A.throwLateFieldNI("_costs"); t1 = new A.Flow__processNext_processNeighbor(this, start, t1.$get$2(start.get$x(), start.get$y())); t1.call$2(B.Direction_0_m1_1_n, false); t1.call$2(B.Direction_0_1_5_s, false); t1.call$2(B.Direction_1_0_3_e, false); t1.call$2(B.Direction_m1_0_7_w, false); t1.call$2(B.Direction_m1_m1_8_nw, true); t1.call$2(B.Direction_1_m1_2_ne, true); t1.call$2(B.Direction_m1_1_6_sw, true); t1.call$2(B.Direction_1_1_4_se, true); return true; } }; A.Flow__directionsTo_walkBack.prototype = { call$1(pos) { var t1, t2, t3, _i, dir, here, t4, t5, t6, t7, t8, t9, t10, _this = this; type$.Vec._as(pos); t1 = _this.walked; if (t1.contains$1(0, pos)) return; t1.add$1(0, pos); for (t1 = _this.$this, t2 = t1._start, t3 = _this.directions, _i = 0; _i < 8; ++_i) { dir = B.List_wXx[_i]; here = pos.$add(0, dir); t4 = t1.__Flow__costs_F; t4 === $ && A.throwLateFieldNI("_costs"); t5 = t4.bounds; if (!t5.contains$1(0, here)) continue; t6 = t1.__Flow__offset_F; t6 === $ && A.throwLateFieldNI("_offset"); if (here.$eq(0, t2.$sub(0, t6))) t3.add$1(0, dir.get$rotate180()); else { t6 = here.x; t7 = here.y; t4._checkBounds$2(t6, t7); t8 = t4._elements; t5 = t5.size.x; t9 = t7 * t5 + t6; t10 = t8.length; if (!(t9 >= 0 && t9 < t10)) return A.ioore(t8, t9); t9 = t8[t9]; if (typeof t9 !== "number") return t9.$ge(); if (t9 >= 0) { t4._checkBounds$2(t6, t7); t6 = pos.get$x(); t7 = pos.get$y(); t4._checkBounds$2(t6, t7); t6 = t7 * t5 + t6; if (!(t6 >= 0 && t6 < t10)) return A.ioore(t8, t6); t6 = t8[t6]; if (typeof t6 !== "number") return A.iae(t6); t6 = t9 < t6; t4 = t6; } else t4 = false; if (t4) _this.call$1(here); } } }, $signature: 12 }; A.Flow__processNext_processNeighbor.prototype = { call$2(dir, isDiagonal) { var t3, t4, t5, t6, t7, relative, total, here = this.start.$add(0, dir), t1 = this.$this, t2 = t1.__Flow__costs_F; t2 === $ && A.throwLateFieldNI("_costs"); if (!t2.bounds.contains$1(0, here)) return; t3 = here.x; t4 = here.y; if (!J.$eq$(t2.$get$2(t3, t4), -2)) return; t5 = t1.__Flow__offset_F; t5 === $ && A.throwLateFieldNI("_offset"); t6 = here.$add(0, t5); t6 = t1.stage.tiles.$get$2(t6.x, t6.y); t7 = this.parentCost; relative = t1.tileCost$4(t7, here.$add(0, t5), t6, isDiagonal); t5 = t2.$ti; if (relative == null) t2.$set$3(t3, t4, t5._precomputed1._as(-1)); else { total = t7 + relative; t2.$set$3(t3, t4, t5._precomputed1._as(total)); B.JSArray_methods.add$1(t1._found, here); t1._open.add$2(0, here, total); } }, $signature: 98 }; A.MotilityFlow.prototype = { tileCost$4(parentCost, pos, tile, isDiagonal) { var t1, _this = this, _null = null; if ((tile.type.motility._bitMask & _this._flow0$_motility._bitMask) === 0) return _null; if (_this._avoidSubstances && tile.substance > 0) return _null; if (_this._avoidActors && _this.stage._actorsByTile.$get$2(pos.x, pos.y) != null) return _null; t1 = _this._flow0$_maxDistance; if (t1 != null) t1 = parentCost >= t1; else t1 = false; if (t1) return _null; return 1; } }; A.Fov.prototype = { refresh$1(pos) { var octant, t1 = this._fov$_stage; if (t1.game.hero.blindness._turnsRemaining > 0) { this._hideAll$0(); return; } for (octant = 0; octant < 8; ++octant) this._refreshOctant$2(pos, octant); t1.setVisibility$3(pos, false, 0); }, _hideAll$0() { var t1, t2; for (t1 = this._fov$_stage, t2 = A.RectIterator$(t1.tiles.bounds); t2.moveNext$0();) t1.setVisibility$3(new A.Vec(t2._x, t2._y), true, 0); t1.setVisibility$3(t1.game.hero._pos, false, 0); }, _refreshOctant$2(start, octant) { var t1, rowInc, colInc, t2, bounds, t3, t4, t5, t6, t7, fullShadow, row, pos, t8, row0, pastMaxDistance, col, t9, t10, distance, fallOff, normalized, projection, _this = this; if (!(octant < 8)) return A.ioore($.Fov__octantCoordinates, octant); t1 = $.Fov__octantCoordinates[octant]; rowInc = t1[0]; colInc = t1[1]; _this._shadows = A._setArrayType([], type$.JSArray__Shadow); t1 = _this._fov$_stage; t2 = t1.tiles; bounds = t2.bounds; for (t3 = t2._elements, t4 = bounds.size.x, t5 = t3.length, t6 = rowInc.x, t7 = rowInc.y, fullShadow = false, row = 1;; row = row0) { pos = start.$add(0, new A.Vec(t6 * row, t7 * row)); if (!bounds.contains$1(0, pos)) break; for (t8 = row + 2, row0 = row + 1, pastMaxDistance = false, col = 0; col <= row; ++col) { if (fullShadow || pastMaxDistance) t1.setVisibility$3(pos, true, 255); else { t9 = start.$sub(0, pos); t10 = t9.x; t9 = t9.y; distance = Math.sqrt(t10 * t10 + t9 * t9); if (distance > 24) { pastMaxDistance = true; fallOff = 255; } else { normalized = distance / 24; fallOff = B.JSNumber_methods.toInt$0(normalized * normalized * 255); } projection = new A._Shadow(col / t8, (col + 1) / row0); t1.setVisibility$3(pos, _this._isInShadow$1(projection), fallOff); t9 = pos.x; t10 = pos.y; t2._checkBounds$2(t9, t10); t9 = t10 * t4 + t9; if (!(t9 >= 0 && t9 < t5)) return A.ioore(t3, t9); t9 = t3[t9]; t10 = $.$get$Motility_fly(); if ((t9.type.motility._bitMask & t10._bitMask) === 0) fullShadow = _this._addShadow$1(projection); } pos = pos.$add(0, colInc); if (!bounds.contains$1(0, pos)) break; } } }, _isInShadow$1(projection) { var t1, t2, t3, t4, _i, shadow; for (t1 = this._shadows, t2 = t1.length, t3 = projection.start, t4 = projection.end, _i = 0; _i < t2; ++_i) { shadow = t1[_i]; if (shadow.start <= t3 && shadow.end >= t4) return true; } return false; }, _addShadow$1(shadow) { var t1, t2, t3, index, t4, t5, overlapsPrev; for (t1 = this._shadows, t2 = t1.length, t3 = shadow.start, index = 0; t4 = index < t2, t4; ++index) if (t1[index].start > t3) break; if (index > 0) { t5 = index - 1; if (!(t5 < t2)) return A.ioore(t1, t5); overlapsPrev = t1[t5].end > t3; } else overlapsPrev = false; if (t4 && t1[index].start < shadow.end) if (overlapsPrev) { t3 = index - 1; if (!(t3 >= 0 && t3 < t2)) return A.ioore(t1, t3); t3 = t1[t3]; t4 = t3.end; if (!(index < t2)) return A.ioore(t1, index); t3.end = Math.max(t4, t1[index].end); B.JSArray_methods.removeAt$1(this._shadows, index); } else { if (!(index < t2)) return A.ioore(t1, index); t1 = t1[index]; t1.start = Math.min(t1.start, t3); } else if (overlapsPrev) { t3 = index - 1; if (!(t3 >= 0 && t3 < t2)) return A.ioore(t1, t3); t3 = t1[t3]; t3.end = Math.max(t3.end, shadow.end); } else { A._arrayInstanceType(t1)._precomputed1._as(shadow); t1.$flags & 1 && A.throwUnsupportedOperation(t1, "insert", 2); if (index > t2) A.throwExpression(A.RangeError$value(index, null)); t1.splice(index, 0, shadow); } t1 = this._shadows; t2 = t1.length; if (t2 === 1) { if (0 >= t2) return A.ioore(t1, 0); t1 = t1[0]; t1 = t1.start === 0 && t1.end === 1; } else t1 = false; return t1; } }; A._Shadow.prototype = { toString$0(_) { return "(" + A.S(this.start) + "-" + A.S(this.end) + ")"; } }; A.Lighting.prototype = { refresh$0() { var _this = this; if (_this._floorLightDirty) _this._lightFloor$0(); if (_this._actorLightDirty) _this._lightActors$0(); if (_this._visibilityDirty) _this._fov.refresh$1(_this._stage.game.hero._pos); if (_this._floorLightDirty || _this._actorLightDirty || _this._visibilityDirty) { _this._mergeLayers$0(); _this._lightWalls$0(); _this._updateExplored$0(); } _this._visibilityDirty = _this._actorLightDirty = _this._floorLightDirty = false; }, _lightFloor$0() { var t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, y, t13, t14, x, pos, t15, emanation, t16, t17, itemEmanation, t18, _this = this, t1 = _this._queue; B.JSArray_methods.clear$0(t1._buckets); for (t2 = _this._stage, t3 = t2.tiles, t4 = t3.bounds.size, t5 = t4.y, t4 = t4.x, t6 = _this._floorLight, t7 = t6.$ti._precomputed1, t8 = t6._elements, t9 = t6.bounds.size.x, t2 = t2._itemsByTile, t10 = t3._elements, t11 = t10.length, t12 = type$.JSArray_Item, y = 0; y < t5; ++y) for (t13 = y * t9, t14 = y * t4, x = 0; x < t4; ++x) { pos = new A.Vec(x, y); t3._checkBounds$2(x, y); t15 = t14 + x; if (!(t15 >= 0 && t15 < t11)) return A.ioore(t10, t15); t15 = t10[t15]; emanation = B.JSInt_methods.clamp$2(t15.type.emanation + t15._appliedEmanation, 0, 192); t16 = t2.$index(0, pos); if (t16 == null) { t16 = A._setArrayType([], t12); t16 = new A.Inventory(B.ItemLocation_ybX, t16, null); } t16 = t16._items; t17 = A._arrayInstanceType(t16); t16 = new J.ArrayIterator(t16, t16.length, t17._eval$1("ArrayIterator<1>")); t17 = t17._precomputed1; itemEmanation = 0; while (t16.moveNext$0()) { t18 = t16.__interceptors$_current; itemEmanation = Math.max(itemEmanation, (t18 == null ? t17._as(t18) : t18).type.emanationLevel); } emanation += A.Lighting_emanationForLevel(itemEmanation) / 2 | 0; if (t15.element.emanates && t15.substance > 0) emanation += A.Lighting_emanationForLevel(7); t15 = t13 + x; if (emanation > 0) { emanation = Math.min(emanation, 192); t7._as(emanation); t6._checkBounds$2(x, y); B.JSArray_methods.$indexSet(t8, t15, emanation); t1.add$2(0, pos, 255 - emanation); } else { t7._as(0); t6._checkBounds$2(x, y); B.JSArray_methods.$indexSet(t8, t15, 0); } } _this._process$2(t6, 21); }, _lightActors$0() { var t4, t5, t6, t7, _i, actor, emanation, t8, t9, _this = this, t1 = _this._actorLight, t2 = t1.$ti._precomputed1, t3 = t1._elements; B.JSArray_methods.fillRange$3(t3, 0, t3.length, t2._as(0)); t4 = _this._queue; B.JSArray_methods.clear$0(t4._buckets); for (t5 = _this._stage._actors, t6 = t5.length, t7 = t1.bounds.size.x, _i = 0; _i < t5.length; t5.length === t6 || (0, A.throwConcurrentModificationError)(t5), ++_i) { actor = t5[_i]; emanation = A.Lighting_emanationForLevel(actor.get$emanationLevel()); if (emanation > 0) { t8 = actor._pos; t2._as(emanation); t9 = t8.get$x(); t8 = t8.get$y(); t1._checkBounds$2(t9, t8); B.JSArray_methods.$indexSet(t3, t8 * t7 + t9, emanation); t4.add$2(0, actor._pos, 255 - emanation); } } _this._process$2(t1, 42); }, _mergeLayers$0() { var t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, y, t14, t15, t16, x, t17, t18; for (t1 = this._stage.tiles, t2 = t1.bounds.size, t3 = t2.y, t2 = t2.x, t4 = this._floorLight, t5 = t4._elements, t6 = t4.bounds.size.x, t7 = t5.length, t8 = this._actorLight, t9 = t8._elements, t10 = t8.bounds.size.x, t11 = t9.length, t12 = t1._elements, t13 = t12.length, y = 0; y < t3; ++y) for (t14 = y * t6, t15 = y * t10, t16 = y * t2, x = 0; x < t2; ++x) { t1._checkBounds$2(x, y); t17 = t16 + x; if (!(t17 >= 0 && t17 < t13)) return A.ioore(t12, t17); t17 = t12[t17]; t18 = $.$get$Motility_fly(); if ((t17.type.motility._bitMask & t18._bitMask) === 0) continue; t4._checkBounds$2(x, y); t18 = t14 + x; if (!(t18 >= 0 && t18 < t7)) return A.ioore(t5, t18); t17.floorIllumination = J.clamp$2$n(t5[t18], 0, 255); t8._checkBounds$2(x, y); t18 = t15 + x; if (!(t18 >= 0 && t18 < t11)) return A.ioore(t9, t18); t17.actorIllumination = J.clamp$2$n(t9[t18], 0, 255); } }, _lightWalls$0() { var t1, t2, t3, t4, t5, y, t6, x, _box_0, t7, t8, checkNeighbor, _i; for (t1 = this._stage.tiles, t2 = t1.bounds.size, t3 = t2.y, t2 = t2.x, t4 = t1._elements, t5 = t4.length, y = 0; y < t3; ++y) for (t6 = y * t2, x = 0; x < t2; ++x) { _box_0 = {}; t1._checkBounds$2(x, y); t7 = t6 + x; if (!(t7 >= 0 && t7 < t5)) return A.ioore(t4, t7); t7 = t4[t7]; t8 = $.$get$Motility_fly(); if ((t7.type.motility._bitMask & t8._bitMask) !== 0) continue; _box_0.actorIllumination = _box_0.floorIllumination = 0; _box_0.openNeighbor = false; checkNeighbor = new A.Lighting__lightWalls_checkNeighbor(_box_0, this, x, y); for (_i = 0; _i < 4; ++_i) checkNeighbor.call$1(B.List_iHk[_i]); if (!_box_0.openNeighbor) for (_i = 0; _i < 4; ++_i) checkNeighbor.call$1(B.List_d2u[_i]); t7.floorIllumination = _box_0.floorIllumination; t7.actorIllumination = _box_0.actorIllumination; } }, _updateExplored$0() { var t1, t2, t3, y, x; for (t1 = this._stage, t2 = t1.tiles.bounds.size, t3 = t2.y, t2 = t2.x, y = 0; y < t3; ++y) for (x = 0; x < t2; ++x) t1.exploreAt$2(x, y); t2 = t1.game.hero._pos; t1.exploreAt$3$force(t2.get$x(), t2.get$y(), true); }, _process$2(tiles, attenuate) { var diagonalAttenuate, t1, t2, t3, t4, pos, t5, t6; type$.Array2D_int._as(tiles); diagonalAttenuate = B.JSNumber_methods.ceil$0(attenuate * 1.5); for (t1 = tiles._elements, t2 = tiles.bounds.size.x, t3 = t1.length, t4 = this._queue;;) { pos = t4.removeNext$0(); if (pos == null) break; t5 = pos.get$x(); t6 = pos.get$y(); tiles._checkBounds$2(t5, t6); t5 = t6 * t2 + t5; if (!(t5 >= 0 && t5 < t3)) return A.ioore(t1, t5); t5 = new A.Lighting__process_checkNeighbor(this, pos, t1[t5], tiles, attenuate); t5.call$2(B.Direction_0_m1_1_n, attenuate); t5.call$2(B.Direction_0_1_5_s, attenuate); t5.call$2(B.Direction_1_0_3_e, attenuate); t5.call$2(B.Direction_m1_0_7_w, attenuate); t5.call$2(B.Direction_1_m1_2_ne, diagonalAttenuate); t5.call$2(B.Direction_1_1_4_se, diagonalAttenuate); t5.call$2(B.Direction_m1_m1_8_nw, diagonalAttenuate); t5.call$2(B.Direction_m1_1_6_sw, diagonalAttenuate); } } }; A.Lighting__lightWalls_checkNeighbor.prototype = { call$1(offset) { var t1, t2, neighborTile, _this = this, neighborX = _this.x + offset.x, neighborY = _this.y + offset.y; if (neighborX < 0) return; t1 = _this.$this._stage.tiles; t2 = t1.bounds.size; if (neighborX >= t2.x) return; if (neighborY < 0) return; if (neighborY >= t2.y) return; neighborTile = t1.$get$2(neighborX, neighborY); if (neighborTile._isOccluded) return; t1 = $.$get$Motility_fly(); if ((neighborTile.type.motility._bitMask & t1._bitMask) === 0) return; t1 = _this._box_0; t1.openNeighbor = true; t1.floorIllumination = Math.max(t1.floorIllumination, neighborTile.floorIllumination); t1.actorIllumination = Math.max(t1.actorIllumination, neighborTile.actorIllumination); }, $signature: 12 }; A.Lighting__process_checkNeighbor.prototype = { call$2(dir, attenuation) { var t3, t4, t5, illumination, _this = this, neighborPos = _this.pos.$add(0, dir), t1 = _this.$this, t2 = t1._stage.tiles; if (!t2.bounds.contains$1(0, neighborPos)) return; t3 = neighborPos.x; t4 = neighborPos.y; t2 = t2.$get$2(t3, t4); t5 = $.$get$Motility_fly(); if ((t2.type.motility._bitMask & t5._bitMask) === 0) return; illumination = _this.parentLight - attenuation; t2 = _this.tiles; t5 = t2.$get$2(t3, t4); if (typeof t5 !== "number") return t5.$ge(); if (t5 >= illumination) return; t2.$set$3(t3, t4, t2.$ti._precomputed1._as(illumination)); if (illumination <= _this.attenuate) return; t1._queue.add$2(0, neighborPos, 255 - illumination); }, $signature: 99 }; A.Path.prototype = { toString$0(_) { return this.startDirection.toString$0(0) + " pos:" + this.pos.toString$0(0) + " cost:" + this.cost; }, get$length(receiver) { return this.length; } }; A.Pathfinder.prototype = { search$0() { var t3, t4, t5, t6, path, t7, result, t8, t9, t10, t11, _i, dir, neighbor, t12, t13, cost, _this = this, paths = new A.BucketQueue(A._setArrayType([], type$.JSArray_nullable_Queue_Path), type$.BucketQueue_Path), explored = A.LinkedHashSet_LinkedHashSet$_empty(type$.Vec), t1 = _this.start, t2 = _this.end; paths.add$2(0, new A.Path(B.Direction_0_0_0_none, t1, 0, 0), _this.heuristic$2(t1, t2)); for (t1 = _this.stage.tiles, t3 = t1._elements, t4 = t1.bounds, t5 = t4.size.x, t6 = t3.length;;) { path = paths.removeNext$0(); if (path == null) break; t7 = path.pos; if (t7.$eq(0, t2)) return _this.reachedGoal$1(path); if (!explored.add$1(0, t7)) continue; result = _this.processStep$1(path); if (result != null) return result; for (t8 = path.length + 1, t9 = path.cost, t10 = path.startDirection, t11 = t10 === B.Direction_0_0_0_none, _i = 0; _i < 8; ++_i) { dir = B.List_wXx[_i]; neighbor = t7.$add(0, dir); if (explored.contains$1(0, neighbor)) continue; if (!t4.contains$1(0, neighbor)) continue; t12 = neighbor.x; t13 = neighbor.y; t1._checkBounds$2(t12, t13); t12 = t13 * t5 + t12; if (!(t12 >= 0 && t12 < t6)) return A.ioore(t3, t12); cost = _this.stepCost$2(neighbor, t3[t12]); if (cost == null) continue; t12 = t11 ? dir : t10; t13 = t9 + cost; paths.add$2(0, new A.Path(t12, neighbor, t8, t13), t13 + _this.heuristic$2(neighbor, t2)); } } return _this.unreachableGoal$0(); }, heuristic$2(pos, end) { return end.$sub(0, pos).get$kingLength(); } }; A.Sound.prototype = { volumeBetween$2(from, to) { if (to.$sub(0, from).get$kingLength() > 16) return 0; return this._volume$1(new A._SoundPathfinder(this._sound$_stage, from, to).search$0()); }, _heroAuditoryDistance$1(pos) { var t1; if (this._sound$_stage.game.hero._pos.$sub(0, pos).get$kingLength() > 16) return 16; this._refresh$0(); t1 = this._flow.costAt$1(pos); return t1 == null ? 16 : t1; }, _volume$1(auditoryDistance) { var volume = (16 - auditoryDistance) / 16; return volume * volume; }, _refresh$0() { var t2, t3, _this = this, t1 = _this._flow; if (t1 != null && _this._sound$_stage.game.hero._pos.$eq(0, t1._start)) return; t1 = _this._sound$_stage; t2 = t1.game.hero._pos; t3 = new A._SoundFlow(t1, t2, new A.BucketQueue(A._setArrayType([], type$.JSArray_nullable_Queue_Vec), type$.BucketQueue_Vec), A._setArrayType([], type$.JSArray_Vec)); t3.Flow$3$maxDistance(t1, t2, null); _this._flow = t3; } }; A._SoundFlow.prototype = { tileCost$4(parentCost, pos, tile, isDiagonal) { var t1, t2, _null = null; if (parentCost >= 16) return _null; t1 = pos.x; if (t1 < 1) return _null; t2 = this.stage.tiles.bounds.size; if (t1 >= t2.x - 1) return _null; t1 = pos.y; if (t1 < 1) return _null; if (t1 >= t2.y - 1) return _null; return A._tileCost(tile); } }; A._SoundPathfinder.prototype = { processStep$1(path) { if (path.cost > 16) return 16; return null; }, stepCost$2(pos, tile) { return A._tileCost(tile); }, reachedGoal$1(path) { return path.cost; }, unreachableGoal$0() { return 16; } }; A.Stage.prototype = { get$_lighting() { var t1, t2, t3, t4, t5, t6, t7, _this = this, value = _this.__Stage__lighting_FI; if (value === $) { t1 = A._setArrayType([], type$.JSArray_nullable_Queue_Vec); t2 = _this.tiles.bounds.size; t3 = t2.x; t2 = t2.y; t4 = type$.int; t5 = t3 * t2; t6 = A.List_List$filled(t5, 0, false, t4); t7 = type$.Array2D_int; t4 = A.List_List$filled(t5, 0, false, t4); _this.__Stage__lighting_FI !== $ && A.throwLateFieldADI("_lighting"); value = _this.__Stage__lighting_FI = new A.Lighting(_this, new A.Array2D(t6, new A.Rect(new A.Vec(0, 0), new A.Vec(t3, t2)), t7), new A.Array2D(t4, new A.Rect(new A.Vec(0, 0), new A.Vec(t3, t2)), t7), new A.Fov(_this, B.List_empty), new A.BucketQueue(t1, type$.BucketQueue_Vec)); } return value; }, get$_sound() { var value = this.__Stage__sound_FI; return value === $ ? this.__Stage__sound_FI = new A.Sound(this) : value; }, canView$2(actor, target) { var t1, t2, t3, t4, t5, step, t6, t7; for (t1 = A._LineIterator__LineIterator(actor._pos, target), t2 = this.tiles, t3 = t2._elements, t4 = t2.bounds.size.x, t5 = t3.length; t1.moveNext$0(), true;) { step = t1._line$_current; if (step.$eq(0, target)) return true; t6 = step.get$x(); t7 = step.get$y(); t2._checkBounds$2(t6, t7); t6 = t7 * t4 + t6; if (!(t6 >= 0 && t6 < t5)) return A.ioore(t3, t6); t6 = t3[t6]; t7 = $.$get$Motility_fly(); if ((t6.type.motility._bitMask & t7._bitMask) === 0) return false; } throw A.wrapException(A.AssertionError$("Unreachable.")); }, canTarget$2(actor, target) { var t1, t2, t3, t4, t5, t6, t7, t8, t9, step, t10, t11; for (t1 = A._LineIterator__LineIterator(actor._pos, target), t2 = this.tiles, t3 = t2._elements, t4 = t2.bounds.size.x, t5 = t3.length, t6 = this._actorsByTile, t7 = t6._elements, t8 = t6.bounds.size.x, t9 = t7.length; t1.moveNext$0(), true;) { step = t1._line$_current; if (step.$eq(0, target)) return true; t10 = step.get$x(); t11 = step.get$y(); t6._checkBounds$2(t10, t11); t10 = t11 * t8 + t10; if (!(t10 >= 0 && t10 < t9)) return A.ioore(t7, t10); if (t7[t10] != null) return false; t10 = step.get$x(); t11 = step.get$y(); t2._checkBounds$2(t10, t11); t10 = t11 * t4 + t10; if (!(t10 >= 0 && t10 < t5)) return A.ioore(t3, t10); t10 = t3[t10]; t11 = $.$get$Motility_fly(); if ((t10.type.motility._bitMask & t11._bitMask) === 0) return false; } throw A.wrapException(A.AssertionError$("Unreachable.")); }, canOccupy$2(pos, motility) { var t1, t2; if (pos.get$x() < 0) return false; t1 = this.tiles; t2 = t1.bounds.size; if (pos.get$x() >= t2.x) return false; if (pos.get$y() < 0) return false; if (pos.get$y() >= t2.y) return false; return (t1.$get$2(pos.get$x(), pos.get$y()).type.motility._bitMask & motility._bitMask) !== 0; }, addActor$1(actor) { var t1, t2; B.JSArray_methods.add$1(this._actors, actor); t1 = this._actorsByTile; t2 = actor._pos; t1.$ti._precomputed1._as(actor); t1.$set$3(t2.get$x(), t2.get$y(), actor); }, removeActor$1(actor) { var _this = this, t1 = _this._actors, index = B.JSArray_methods.indexOf$1(t1, actor), t2 = _this._currentActorIndex; if (t2 > index) _this._currentActorIndex = t2 - 1; B.JSArray_methods.removeAt$1(t1, index); if (_this._currentActorIndex >= t1.length) _this._currentActorIndex = 0; t1 = _this._actorsByTile; t2 = actor._pos; t1.$ti._precomputed1._as(null); t1.$set$3(t2.get$x(), t2.get$y(), null); }, placeDrops$3$depth(pos, drop, depth) { var items = A._setArrayType([], type$.JSArray_Item); drop.dropItem$3(this.game.hero.save.lore, depth, new A.Stage_placeDrops_closure(this, items, A.MotilityFlow$(this, pos, $.$get$Motility_walk(), false, null, null), pos)); return items; }, addItem$2(item, pos) { this._itemsByTile.putIfAbsent$2(pos, new A.Stage_addItem_closure()).tryAdd$1(item); if (item.type.emanationLevel > 0) this.get$_lighting()._floorLightDirty = true; }, itemsAt$1(pos) { var t1 = this._itemsByTile.$index(0, pos); return t1 == null ? A.Inventory$(B.ItemLocation_ybX, null, null) : t1; }, removeItem$2(item, pos) { var t1 = this._itemsByTile, inventory = t1.$index(0, pos); B.JSArray_methods.remove$1(inventory._items, item); if (item.type.emanationLevel > 0) this.get$_lighting()._floorLightDirty = true; if (!inventory.get$iterator(0).moveNext$0()) t1.remove$1(0, pos); }, forEachItem$1(callback) { this._itemsByTile.forEach$1(0, new A.Stage_forEachItem_closure(type$.void_Function_Item_Vec._as(callback))); }, tileOpacityChanged$0() { var t1 = this.get$_lighting(); t1._visibilityDirty = t1._actorLightDirty = t1._floorLightDirty = true; this.get$_sound()._flow = null; }, exploreAt$3$force(x, y, force) { var t1, tile = this.tiles.$get$2(x, y); if (tile.updateExplored$1$force(force)) if (!tile._isOccluded && tile.floorIllumination + tile.actorIllumination > tile._fallOff) { t1 = this._actorsByTile.$get$2(x, y); if (t1 != null && t1 instanceof A.Monster) this.game.hero.seeMonster$1(t1); } }, exploreAt$2(x, y) { return this.exploreAt$3$force(x, y, null); }, setVisibility$3(pos, isOccluded, fallOff) { var t1, tile = this.tiles.$get$2(pos.get$x(), pos.get$y()); tile._isOccluded = isOccluded; tile._fallOff = fallOff; if (!isOccluded && tile.floorIllumination + tile.actorIllumination > fallOff) { t1 = this._actorsByTile.$get$2(pos.get$x(), pos.get$y()); if (t1 != null && t1 instanceof A.Monster) this.game.hero.seeMonster$1(t1); } }, findOpenTile$0() { var t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, pos; for (t1 = this._actorsByTile, t2 = t1._elements, t3 = t1.bounds.size.x, t4 = t2.length, t5 = this.tiles, t6 = t5._elements, t7 = t5.bounds, t8 = t7.size, t9 = t8.x, t10 = t6.length, t7 = t7.pos, t11 = t7.x, t12 = t11 + t9, t13 = Math.min(t11, t12), t12 = Math.max(t11, t12);;) { t11 = $.$get$rng(); t11 = t11._random; t14 = t11.nextInt$1(t12 - t13) + t13; t15 = t7.y; t16 = t15 + t8.y; t17 = Math.min(t15, t16); t16 = Math.max(t15, t16); t11 = t11.nextInt$1(t16 - t17) + t17; pos = new A.Vec(t14, t11); t5._checkBounds$2(t14, t11); t15 = t11 * t9 + t14; if (!(t15 >= 0 && t15 < t10)) return A.ioore(t6, t15); if ((t6[t15].type.motility._bitMask & $.$get$Motility_walk()._bitMask) === 0) continue; t1._checkBounds$2(t14, t11); t11 = t11 * t3 + t14; if (!(t11 >= 0 && t11 < t4)) return A.ioore(t2, t11); if (t2[t11] != null) continue; return pos; } } }; A.Stage_closure.prototype = { call$1(__wc0_formal) { return new A.Tile($.$get$TileType_uninitialized(), $.$get$Element_none()); }, $signature: 100 }; A.Stage_placeDrops_closure.prototype = { call$1(item) { var t1, t2, itemPos, allowed, t3, _this = this; B.JSArray_methods.add$1(_this.items, item); t1 = _this.flow; t2 = _this.$this; itemPos = t1.bestWhere$1(new A.Stage_placeDrops__closure(t2)); if (itemPos == null) { t1 = t1.get$reachable(); t1 = A.TakeIterable_TakeIterable(t1, 10, t1.$ti._eval$1("Iterable.E")); allowed = A.List_List$_of(t1, A._instanceType(t1)._eval$1("Iterable.E")); t1 = allowed.length; if (t1 !== 0) { t3 = $.$get$rng(); type$.List_nullable_Vec._as(allowed); t1 = t3.range$1(t1); if (!(t1 >= 0 && t1 < allowed.length)) return A.ioore(allowed, t1); itemPos = allowed[t1]; } else itemPos = _this.pos; } itemPos.toString; t2.addItem$2(item, itemPos); }, $signature: 10 }; A.Stage_placeDrops__closure.prototype = { call$1(pos) { var t1; if ($.$get$rng().range$1(5) === 0) return true; t1 = this.$this; return t1._actorsByTile.$get$2(pos.x, pos.y) == null && !t1._itemsByTile.containsKey$1(pos); }, $signature: 1 }; A.Stage_addItem_closure.prototype = { call$0() { return A.Inventory$(B.ItemLocation_ybX, null, null); }, $signature: 101 }; A.Stage_forEachItem_closure.prototype = { call$2(pos, inventory) { var t1, t2, t3, t4; type$.Vec._as(pos); for (t1 = type$.Inventory._as(inventory)._items, t2 = A._arrayInstanceType(t1), t1 = new J.ArrayIterator(t1, t1.length, t2._eval$1("ArrayIterator<1>")), t3 = this.callback, t2 = t2._precomputed1; t1.moveNext$0();) { t4 = t1.__interceptors$_current; t3.call$2(t4 == null ? t2._as(t4) : t4, pos); } }, $signature: 102 }; A.Motility.prototype = { get$hashCode(_) { return this._bitMask; }, $eq(_, other) { if (other == null) return false; if (other instanceof A.Motility) return this._bitMask === other._bitMask; return false; }, $or(_, other) { return new A.Motility(this._bitMask | other._bitMask); }, toString$0(_) { var t1 = A._setArrayType([], type$.JSArray_String), t2 = this._bitMask; if ((t2 & $.$get$Motility_door()._bitMask) !== 0) t1.push("door"); if ((t2 & $.$get$Motility_fly()._bitMask) !== 0) t1.push("fly"); if ((t2 & $.$get$Motility_swim()._bitMask) !== 0) t1.push("swim"); if ((t2 & $.$get$Motility_walk()._bitMask) !== 0) t1.push("walk"); return B.JSArray_methods.join$1(t1, "|"); } }; A.TilePortal.prototype = { toString$0(_) { return this.name; } }; A.TileType.prototype = {}; A.Tile.prototype = { addEmanation$1(offset) { this._appliedEmanation = B.JSInt_methods.clamp$2(this._appliedEmanation + offset, 0, 192); }, updateExplored$1$force(force) { var t1, _this = this; if (force !== true) t1 = !_this._isOccluded && _this.floorIllumination + _this.actorIllumination > _this._fallOff; else t1 = true; if (t1 && !_this._isExplored) return _this._isExplored = true; return false; } }; A.ConfirmPopup.prototype = { get$message() { return A._setArrayType([this._confirm_popup$_message], type$.JSArray_String); }, get$helpKeys() { return B.Map_Am2t0; }, handleInput$1(input) { if (input === B.Input_cancel) { this._ui.pop$0(); return true; } return false; }, keyDown$3$alt$shift(keyCode, alt, shift) { if (shift || alt) return false; switch (keyCode) { case 78: this._ui.pop$0(); break; case 89: this._ui.pop$1(this._result); break; } return true; } }; A.DirectionDialog.prototype = { get$isTransparent() { return true; }, handleInput$1(input) { var _this = this; switch (input) { case B.Input_cancel: _this._select$1(B.Direction_0_0_0_none); break; case B.Input_nw: _this._select$1(B.Direction_m1_m1_8_nw); break; case B.Input_n: _this._select$1(B.Direction_0_m1_1_n); break; case B.Input_ne: _this._select$1(B.Direction_1_m1_2_ne); break; case B.Input_w: _this._select$1(B.Direction_m1_0_7_w); break; case B.Input_e: _this._select$1(B.Direction_1_0_3_e); break; case B.Input_sw: _this._select$1(B.Direction_m1_1_6_sw); break; case B.Input_s: _this._select$1(B.Direction_0_1_5_s); break; case B.Input_se: _this._select$1(B.Direction_1_1_4_se); break; } return true; }, update$0() { var t1 = (this._animateOffset + 1) % 40; this._animateOffset = t1; if (B.JSInt_methods.$mod(t1, 5) === 0) this.dirty$0(); }, render$1(terminal) { var t1 = new A.DirectionDialog_render_draw(this, terminal); t1.call$3(0, B.Direction_0_m1_1_n, "|"); t1.call$3(1, B.Direction_1_m1_2_ne, "/"); t1.call$3(2, B.Direction_1_0_3_e, "-"); t1.call$3(3, B.Direction_1_1_4_se, "\\"); t1.call$3(4, B.Direction_0_1_5_s, "|"); t1.call$3(5, B.Direction_m1_1_6_sw, "/"); t1.call$3(6, B.Direction_m1_0_7_w, "-"); t1.call$3(7, B.Direction_m1_m1_8_nw, "\\"); t1 = type$.String; A.Draw_helpKeys(terminal, A.LinkedHashMap_LinkedHashMap$_literal(["\u2195\u2194", this.get$helpText(), "`", "Cancel"], t1, t1), this.get$query()); }, _select$1(dir) { var t1 = this.tryDirection$1(dir), t2 = this._ui; if (t1) t2.pop$1(dir); else t2.pop$1(B.Direction_0_0_0_none); } }; A.DirectionDialog_render_draw.prototype = { call$3(frame, dir, char) { var t4, t5, glyph, items, t1 = this.$this, t2 = t1._gameScreen, t3 = t2.game, pos = t3.hero._pos.$add(0, dir); t3 = t3.__Game__stage_F; t3 === $ && A.throwLateFieldNI("_stage"); t4 = pos.x; t5 = pos.y; if (!t1.canTarget$1(t3.tiles.$get$2(t4, t5))) return; if (B.JSInt_methods._tdivFast$1(t1._animateOffset, 5) === frame) glyph = A.Glyph$(char, B.Color_222_156_33, B.Color_77_29_21); else { t1 = t3._actorsByTile.$get$2(t4, t5); if (t1 != null) glyph = type$.Glyph._as(t1.get$appearance()); else { items = t3.itemsAt$1(pos); if (!items.get$isEmpty(0)) glyph = items.get$first(0).type.appearance; else { t1 = t3.tiles.$get$2(t4, t5); if (t1._isExplored) type$.Glyph._as(t1.type.appearance); else A.Glyph$fromCharCode(32, null, null); glyph = type$.Glyph._as(t3.tiles.$get$2(t4, t5).type.appearance); } } glyph = A.Glyph$fromCharCode(glyph.char, B.Color_222_156_33, B.Color_77_29_21); } t1 = t2.__GameScreen__stagePanel_F; t1 === $ && A.throwLateFieldNI("_stagePanel"); t1.drawStageGlyph$4(this.terminal, t4, t5, glyph); }, $signature: 103 }; A.SkillDirectionDialog.prototype = { get$query() { return "Which direction?"; }, get$helpText() { return "Choose direction"; }, canTarget$1(tile) { return true; }, tryDirection$1(direction) { this._onSelect.call$1(direction); return true; } }; A.OperateDialog.prototype = { get$query() { return "Operate what?"; }, get$helpText() { return "Choose direction"; }, canTarget$1(tile) { return tile.type.onOperate != null; }, tryDirection$1(direction) { var t1 = this._gameScreen.game, t2 = t1.hero, pos = t2._pos.$add(0, direction); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1 = t1.tiles.$get$2(pos.x, pos.y).type.onOperate; if (t1 != null) { t2._behavior = new A.ActionBehavior(type$.Action._as(t1.call$1(pos))); return true; } else { t2.save.log._log$_add$5(B.LogType_1, "There is nothing to operate there.", null, null, null); return false; } } }; A.Draw_helpKeys_closure.prototype = { call$2(key, text) { var t1, t2; A._asString(key); A._asString(text); t1 = this._box_0; t2 = t1.helpTextLength; if (t2 > 0) t2 = t1.helpTextLength = t2 + 2; t1.helpTextLength = t2 + (key.length + text.length + 3); }, $signature: 32 }; A.Draw_helpKeys_closure0.prototype = { call$2(key, text) { var t1, t2, t3, x; A._asString(key); A._asString(text); t1 = this._box_0; if (!t1.first) { t2 = this.terminal; t2.writeAt$4(t1.x, t2._display._glyphs.bounds.size.y - 1, ", ", B.Color_38_42_66); t1.x += 2; } t2 = this.terminal; t3 = t2._display._glyphs.bounds.size.y - 1; t2.writeAt$4(t1.x, t3, "[", B.Color_38_42_66); t2.writeAt$4(++t1.x, t3, key, B.Color_222_156_33); x = t1.x + key.length; t1.x = x; t2.writeAt$4(x, t3, "] ", B.Color_38_42_66); t2.writeAt$4(t1.x += 2, t3, text, B.Color_132_126_135); t1.x = t1.x + text.length; t1.first = false; }, $signature: 32 }; A.ElementEffect.prototype = { update$1(game) { var _this = this; if ($.$get$rng().range$1(_this._age + 2) === 0) ++_this._age; return _this._age < _this._sequence.length; }, render$2(game, drawGlyph) { var t1, t2, t3, t4, t5; type$.void_Function_int_int_Glyph._as(drawGlyph); t1 = this._effect$_pos; t2 = t1.get$x(); t1 = t1.get$y(); t3 = $.$get$rng(); t4 = this._sequence; t5 = this._age; if (!(t5 < t4.length)) return A.ioore(t4, t5); t5 = type$.List_Glyph._as(t4[t5]); t3 = t3.range$1(t5.length); if (!(t3 >= 0 && t3 < t5.length)) return A.ioore(t5, t3); drawGlyph.call$3(t2, t1, t5[t3]); }, $isEffect: 1 }; A.FrameEffect.prototype = { update$1(game) { var t2, t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = this.pos; t2 = t1.tiles.$get$2(t2.get$x(), t2.get$y()); if (!(!t2._isOccluded && t2.floorIllumination + t2.actorIllumination > t2._fallOff)) return false; return --this.life >= 0; }, render$2(game, drawGlyph) { var t1 = this.pos; type$.void_Function_int_int_Glyph._as(drawGlyph).call$3(t1.get$x(), t1.get$y(), A.Glyph$(this.char, this.color, null)); }, $isEffect: 1 }; A.ItemEffect.prototype = { update$1(game) { var t2, t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = this.pos; t2 = t1.tiles.$get$2(t2.get$x(), t2.get$y()); if (!(!t2._isOccluded && t2.floorIllumination + t2.actorIllumination > t2._fallOff)) return false; return --this._life >= 0; }, render$2(game, drawGlyph) { var t1 = this.pos; type$.void_Function_int_int_Glyph._as(drawGlyph).call$3(t1.get$x(), t1.get$y(), this.item.type.appearance); }, $isEffect: 1 }; A.DamageEffect.prototype = { update$1(game) { var t1 = this._blinks; return ++this._effect$_frame < t1 * B.JSNumber_methods.round$0(A.lerpDouble(t1, 1, 10, 16, 8)); }, render$2(game, drawGlyph) { var t1, _this = this; type$.void_Function_int_int_Glyph._as(drawGlyph); t1 = _this._blinks; if (B.JSInt_methods.$mod(_this._effect$_frame, B.JSNumber_methods.round$0(A.lerpDouble(t1, 1, 10, 16, 8))) < B.JSInt_methods._tdivFast$1(B.JSNumber_methods.round$0(A.lerpDouble(t1, 1, 10, 16, 8)), 2)) { t1 = _this.actor; drawGlyph.call$3(t1._pos.get$x(), t1._pos.get$y(), A.Glyph$("*", A.elementColor(_this.element), null)); } }, $isEffect: 1 }; A.ParticleEffect.prototype = { update$1(game) { var t2, t3, _this = this, t1 = _this.x + _this.h; _this.x = t1; t2 = _this.y + _this.v; _this.y = t2; t1 = B.JSNumber_methods.toInt$0(t1); t2 = B.JSNumber_methods.toInt$0(t2); t3 = game.__Game__stage_F; t3 === $ && A.throwLateFieldNI("_stage"); t3 = t3.tiles; if (!t3.bounds.contains$1(0, new A.Vec(t1, t2))) return false; t1 = t3.$get$2(t1, t2); t2 = $.$get$Motility_fly(); if ((t1.type.motility._bitMask & t2._bitMask) === 0) return false; return _this.life-- > 0; }, render$2(game, drawGlyph) { type$.void_Function_int_int_Glyph._as(drawGlyph).call$3(B.JSNumber_methods.toInt$0(this.x), B.JSNumber_methods.toInt$0(this.y), A.Glyph$("\u2022", this.color, null)); }, $isEffect: 1 }; A.TeleportEffect.prototype = { update$1(game) { var pull, t3, t4, _this = this, t1 = _this.age, friction = 1 - t1 * 0.015, t2 = _this.h *= friction; _this.v *= friction; pull = t1 * 0.003; t1 = _this.target; _this.h = t2 + (t1.get$x() - _this.x) * pull; t2 = _this.v; t3 = t1.get$y(); t4 = _this.y; t3 = t2 + (t3 - t4) * pull; _this.v = t3; t2 = _this.x + _this.h; _this.x = t2; t3 = t4 + t3; _this.y = t3; ++_this.age; return new A.Vec(B.JSNumber_methods.toInt$0(t2), B.JSNumber_methods.toInt$0(t3)).$sub(0, t1).$gt(0, 1); }, render$2(game, drawGlyph) { var t1, t2, t3, char, _this = this; type$.void_Function_int_int_Glyph._as(drawGlyph); t1 = B.JSNumber_methods.toInt$0(_this.x); t2 = B.JSNumber_methods.toInt$0(_this.y); t3 = game.__Game__stage_F; t3 === $ && A.throwLateFieldNI("_stage"); if (!t3.tiles.bounds.contains$1(0, new A.Vec(t1, t2))) return; char = _this._getChar$2(_this.h, _this.v); t3 = $.$get$rng(); type$.List_Color._as($.TeleportEffect__colors); t3 = t3.range$1(4); if (!(t3 >= 0 && t3 < 4)) return A.ioore($.TeleportEffect__colors, t3); drawGlyph.call$3(t1, t2, A.Glyph$fromCharCode(char, $.TeleportEffect__colors[t3], null)); }, _getChar$2(x, y) { var t1, _s17_ = "|\\\\--//||\\\\--//||"; if (new A.Vec(B.JSNumber_methods.toInt$0(x * 10), B.JSNumber_methods.toInt$0(y * 10)).$lt(0, 5)) return 8226; t1 = B.JSNumber_methods.floor$0(Math.atan2(x, y) / 6.283185307179586 * 16 + 8); if (!(t1 >= 0 && t1 < 17)) return A.ioore(_s17_, t1); return _s17_.charCodeAt(t1); }, $isEffect: 1 }; A.HealEffect.prototype = { update$1(game) { return this.frame++ < 24; }, render$2(game, drawGlyph) { var t1, t2, t3, $back, _null = null; type$.void_Function_int_int_Glyph._as(drawGlyph); t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = this.x; t3 = this.y; if (t1.tiles.$get$2(t2, t3)._isOccluded) return; $back = [B.Color_20_19_31, B.Color_15_130_148, B.Color_64_163_229, B.Color_129_231_235][B.JSInt_methods.$mod(B.JSInt_methods._tdivFast$1(this.frame, 4), 4)]; drawGlyph.call$3(t2 - 1, t3, A.Glyph$("-", $back, _null)); drawGlyph.call$3(t2 + 1, t3, A.Glyph$("-", $back, _null)); drawGlyph.call$3(t2, t3 - 1, A.Glyph$("|", $back, _null)); drawGlyph.call$3(t2, t3 + 1, A.Glyph$("|", $back, _null)); }, $isEffect: 1 }; A.DetectEffect.prototype = { update$1(game) { return --this.life >= 0; }, render$2(game, drawGlyph) { var radius, glyph, t1, t2; type$.void_Function_int_int_Glyph._as(drawGlyph); radius = B.JSInt_methods._tdivFast$1(this.life, 4); if (!(radius >= 0 && radius < 5)) return A.ioore($.DetectEffect__colors, radius); glyph = A.Glyph$("*", $.DetectEffect__colors[radius], null); t1 = A._CircleIterator__CircleIterator(new A.Circle(this.pos, radius), true); t2 = t1._boundsIterator; while (t1.moveNext$0()) drawGlyph.call$3(t2._x, t2._y, glyph); }, $isEffect: 1 }; A.MapEffect.prototype = { update$1(game) { return --this.life >= 0; }, render$2(game, drawGlyph) { var t1, t2, glyph, _this = this; type$.void_Function_int_int_Glyph._as(drawGlyph); t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = _this.pos; glyph = type$.Glyph._as(t1.tiles.$get$2(t2.get$x(), t2.get$y()).type.appearance); t1 = _this._maxLife; glyph = A.Glyph$fromCharCode(glyph.char, glyph.fore.blend$2(B.Color_222_156_33, _this.life / t1), glyph.back.blend$2(B.Color_142_82_55, _this.life / t1)); drawGlyph.call$3(t2.get$x(), t2.get$y(), glyph); }, $isEffect: 1 }; A.TreasureEffect.prototype = { update$1(game) { var t1 = this._life; if ((t1 & 1) === 0) if (--this._effect$_y < 0) return false; --t1; this._life = t1; return t1 >= 0; }, render$2(game, drawGlyph) { type$.void_Function_int_int_Glyph._as(drawGlyph).call$3(this._effect$_x, this._effect$_y, this._effect$_item.type.appearance); }, $isEffect: 1 }; A.HowlEffect.prototype = { update$1(game) { return ++this._age < 24; }, render$2(game, drawGlyph) { var pos, t1, t2, t3, t4; type$.void_Function_int_int_Glyph._as(drawGlyph); pos = this._effect$_actor._pos; if ((B.JSInt_methods._tdivFast$1(this._age, 6) & 1) === 0) { drawGlyph.call$3(pos.get$x(), pos.get$y(), $.$get$HowlEffect_bang()); drawGlyph.call$3(pos.get$x() - 1, pos.get$y(), $.$get$HowlEffect_greater()); drawGlyph.call$3(pos.get$x() + 1, pos.get$y(), $.$get$HowlEffect_less()); } else { t1 = pos.get$x(); t2 = pos.get$y(); t3 = $.$get$HowlEffect_backslash(); drawGlyph.call$3(t1 - 1, t2 - 1, t3); t2 = pos.get$x(); t1 = pos.get$y(); t4 = $.$get$HowlEffect_slash(); drawGlyph.call$3(t2 - 1, t1 + 1, t4); drawGlyph.call$3(pos.get$x() + 1, pos.get$y() - 1, t4); drawGlyph.call$3(pos.get$x() + 1, pos.get$y() + 1, t3); t3 = pos.get$x(); t4 = pos.get$y(); t1 = $.$get$HowlEffect_dash(); drawGlyph.call$3(t3 - 1, t4, t1); drawGlyph.call$3(pos.get$x() + 1, pos.get$y(), t1); } }, $isEffect: 1 }; A.BlinkEffect.prototype = { update$1(game) { var t2, t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = this._effect$_actor._pos; t2 = t1.tiles.$get$2(t2.get$x(), t2.get$y()); if (!(!t2._isOccluded && t2.floorIllumination + t2.actorIllumination > t2._fallOff)) return false; return ++this._age < 24 * this._blinks; }, render$2(game, drawGlyph) { var pos; type$.void_Function_int_int_Glyph._as(drawGlyph); pos = this._effect$_actor._pos; if ((B.JSInt_methods._tdivFast$1(this._age, 12) & 1) === 1) drawGlyph.call$3(pos.get$x(), pos.get$y(), this._glyph); }, $isEffect: 1 }; A.ExitPopup.prototype = { get$width() { return 38; }, get$height() { return 19; }, get$helpKeys() { var t1 = type$.String; return A.LinkedHashMap_LinkedHashMap$_literal(["OK", "Return to town"], t1, t1); }, ExitPopup$2(_previous, _game, _box_0) { var t2, t3, t4, t5, t6, slain, t1 = this._exit_popup$_game; _box_0.y = 5; t2 = new A.ExitPopup_add(_box_0, this); t3 = t1.hero.save; t4 = this._exit_popup$_previous; t2.call$3("Gold", B.Color_222_156_33, t3.gold - t4.gold); t2.call$3("Experience", B.Color_22_117_38, t3.experience - t4.experience); ++_box_0.y; t5 = t3.strength._stat$_value; t5.toString; t6 = t4.strength._stat$_value; t6.toString; t2.call$3("Strength", B.Color_21_87_194, t5 - t6); t6 = t3.agility._stat$_value; t6.toString; t5 = t4.agility._stat$_value; t5.toString; t2.call$3("Agility", B.Color_21_87_194, t6 - t5); t5 = t3.vitality._stat$_value; t5.toString; t6 = t4.vitality._stat$_value; t6.toString; t2.call$3("Vitality", B.Color_21_87_194, t5 - t6); t6 = t3.intellect._stat$_value; t6.toString; t5 = t4.intellect._stat$_value; t5.toString; t2.call$3("Intellect", B.Color_21_87_194, t6 - t5); _box_0.y += 3; slain = t3.lore.get$allSlain() - t4.lore.get$allSlain(); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1 = t1._actors; t4 = A._arrayInstanceType(t1); t2.call$4$total("Monsters", B.Color_204_35_57, slain, slain + new A.WhereIterable(t1, t4._eval$1("bool(1)")._as(new A.ExitPopup_closure()), t4._eval$1("WhereIterable<1>")).get$length(0)); }, get$isTransparent() { return true; }, handleInput$1(input) { var t1; if (input !== B.Input_ok) return false; t1 = this._exit_popup$_game; t1.hero.save.set$maxDepth(Math.max(this._exit_popup$_previous.maxDepth, t1.depth)); this._ui.pop$0(); return true; }, update$0() { var t1, t2, _i; for (t1 = this._exit_popup$_values, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) if (t1[_i].update$0()) this.dirty$0(); }, renderPopup$1(terminal) { var t1, t2, t3, t4, _i, value, t5, t6, t7, number, t8, total, t9; terminal.writeAt$4(1, 1, "You survived depth " + this._exit_popup$_game.depth + "!", B.Color_132_126_135); terminal.writeAt$4(1, 3, "You gained:", B.Color_132_126_135); terminal.writeAt$4(1, 15, "You slayed:", B.Color_132_126_135); for (t1 = this._exit_popup$_values, t2 = t1.length, t3 = terminal.size.x, t4 = t3 - 1, t3 -= 4, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { value = t1[_i]; t5 = value.y; terminal.writeAt$4(5, t5, "................................", B.Color_38_42_66); t6 = value.value === 0; t7 = t6 ? B.Color_38_42_66 : B.Color_226_223_240; terminal.writeAt$4(5, t5, value.name + ":", t7); number = B.JSInt_methods.toString$0(value.current); t7 = value.total; t8 = number.length; if (t7 != null) { total = B.JSInt_methods.toString$0(t7); t6 = total.length; t7 = t4 - t6; t9 = value.color; terminal.writeAt$4(t7, t5, total, t9); terminal.writeAt$4(t7 - 3, t5, " / ", t9); terminal.writeAt$4(t3 - t6 - t8, t5, number, t9); } else { t6 = t6 ? B.Color_38_42_66 : value.color; terminal.writeAt$4(t4 - t8, t5, number, t6); } } } }; A.ExitPopup_add.prototype = { call$4$total(label, color, change, total) { B.JSArray_methods.add$1(this.$this._exit_popup$_values, new A._AnimatedValue(this._box_0.y++, label, change, color, total)); }, call$3(label, color, change) { return this.call$4$total(label, color, change, null); }, $signature: 105 }; A.ExitPopup_closure.prototype = { call$1(actor) { return !(type$.Actor._as(actor) instanceof A.Hero); }, $signature: 106 }; A._AnimatedValue.prototype = { update$0() { var _this = this, t1 = _this.current, t2 = _this.value; if (t1 >= t2) return false; if (t2 > 200) { t1 += $.$get$rng().round$1(0, t2 / 200); _this.current = t1; if (t1 > t2) _this.current = t2; } else _this.current = t1 + 1; return true; } }; A.ExperienceDialog.prototype = { get$_selectedStat() { var t1, _this = this, _0_0 = _this._selectedStatIndex; $label0$0: { if (0 === _0_0) { t1 = _this._save.strength; break $label0$0; } if (1 === _0_0) { t1 = _this._save.agility; break $label0$0; } if (2 === _0_0) { t1 = _this._save.vitality; break $label0$0; } if (3 === _0_0) { t1 = _this._save.intellect; break $label0$0; } t1 = A.throwExpression(A.ArgumentError$(null, null)); } return t1; }, get$_canRaiseStat() { var stat = this.get$_selectedStat(), t1 = this._save, cost = stat.experienceCost$1(t1); return stat._baseValue < 40 && t1.experience >= cost; }, handleInput$1(input) { switch (input) { case B.Input_n: this._changeSelection$1(-1); return true; case B.Input_s: this._changeSelection$1(1); return true; case B.Input_cancel: this._ui.pop$0(); return true; } return false; }, keyDown$3$alt$shift(keyCode, alt, shift) { var stat, t1, _this = this; if (shift || alt) return false; switch (keyCode) { case 82: if (_this.get$_canRaiseStat()) { stat = _this.get$_selectedStat(); t1 = _this._save; t1.experience = t1.experience - stat.experienceCost$1(t1); stat.refresh$2(t1, stat._baseValue + 1); _this.dirty$0(); } return true; } return false; }, render$1(terminal) { var t1, t2, panelTerminal, _this = this, _null = null; terminal.fill$4(0, 0, terminal.get$width(), terminal.get$height()); A.Draw_frame(terminal, _null, 3, _null, false, 40, _null, _null); terminal.writeAt$4(2, 1, "Available experience", B.Color_132_126_135); t1 = _this._save; terminal.writeAt$4(31, 1, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(t1.experience), 8), B.Color_226_223_240); _this._drawStatsList$1(new A.PortTerminal(new A.Vec(40, 11), 0, 3, terminal)); t2 = terminal._display._glyphs.bounds.size; panelTerminal = new A.PortTerminal(new A.Vec(t2.x - 40, t2.y), 40, 0, terminal); switch (_this._selectedStatIndex) { case 0: _this._drawStrengthPanel$1(panelTerminal); break; case 1: _this._drawAgilityPanel$1(panelTerminal); break; case 2: _this._drawVitalityPanel$1(panelTerminal); break; case 3: _this._drawIntellectPanel$1(panelTerminal); break; } t2 = type$.String; t2 = A.LinkedHashMap_LinkedHashMap$_empty(t2, t2); t2.$indexSet(0, "\u2195", "Change selection"); if (_this.get$_canRaiseStat()) t2.$indexSet(0, "R", "Raise " + _this.get$_selectedStat().get$_stat().name); t2.$indexSet(0, "`", "Exit"); A.Draw_helpKeys(terminal, t2, "You can spend " + t1.experience + " experience"); }, _drawStatsList$1(terminal) { var t1, stats, i, _i, stat, y, t2, nameColor, detailColor, cost, _null = null; A.Draw_frame(terminal, _null, _null, "Stats", false, _null, _null, _null); terminal.writeAt$4(27, 1, "Cur Cost", B.Color_132_126_135); t1 = this._save; stats = [t1.strength, t1.agility, t1.vitality, t1.intellect]; for (i = 0, _i = 0; _i < 4; ++_i) { stat = stats[_i]; y = i * 2 + 3; t2 = stat === B.JSArray_methods.get$first(stats) ? B.Color_38_42_66 : B.Color_20_19_31; terminal.writeAt$4(2, y - 1, "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500", t2); if (i === this._selectedStatIndex) { nameColor = B.Color_222_156_33; detailColor = B.Color_222_156_33; } else { nameColor = B.Color_226_223_240; detailColor = B.Color_132_126_135; } terminal.writeAt$4(2, y, stat.get$_stat().name, nameColor); t2 = stat._stat$_value; t2.toString; terminal.writeAt$4(27, y, B.JSString_methods.padLeft$1(B.JSNumber_methods.toString$0(t2), 3), detailColor); cost = stat.experienceCost$1(t1); t2 = B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(cost), 8); terminal.writeAt$4(31, y, t2, cost <= t1.experience ? detailColor : B.Color_38_42_66); ++i; } terminal.drawGlyph$3(1, this._selectedStatIndex * 2 + 3, A.Glyph$fromCharCode(9658, B.Color_222_156_33, _null)); }, _drawStrengthPanel$1(terminal) { this._drawStatPanel$4(terminal, this._save.strength, A._setArrayType(["Max Fury", "Toss range scale"], type$.JSArray_String), new A.ExperienceDialog__drawStrengthPanel_closure()); }, _drawAgilityPanel$1(terminal) { this._drawStatPanel$4(terminal, this._save.agility, A._setArrayType(["Dodge bonus", "Strike bonus"], type$.JSArray_String), new A.ExperienceDialog__drawAgilityPanel_closure()); }, _drawVitalityPanel$1(terminal) { this._drawStatPanel$4(terminal, this._save.vitality, A._setArrayType(["Max health"], type$.JSArray_String), new A.ExperienceDialog__drawVitalityPanel_closure()); }, _drawIntellectPanel$1(terminal) { this._drawStatPanel$4(terminal, this._save.intellect, A._setArrayType(["Max focus"], type$.JSArray_String), new A.ExperienceDialog__drawIntellectPanel_closure()); }, _drawStatPanel$4(terminal, stat, labels, describe) { var t1, modifiers, t2, weightOffset, y, _i, _null = null; type$.List_String._as(labels); type$.List_String_Function_int._as(describe); A.Draw_frame(terminal, _null, _null, stat.get$_stat().name, true, _null, _null, _null); t1 = stat._stat$_value; t1.toString; modifiers = t1 - stat._baseValue; terminal.writeAt$4(1, 2, "Base value:", B.Color_38_42_66); terminal.writeAt$4(15, 2, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(stat._baseValue), 3), B.Color_132_126_135); t2 = this._save; if (stat === t2.strength) { weightOffset = B.JSInt_methods.toInt$0(-t2.get$weight()); modifiers = t1 - stat._baseValue + weightOffset; terminal.writeAt$4(1, 3, "Weight offset:", B.Color_38_42_66); terminal.writeAt$4(15, 3, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(weightOffset), 3), B.Color_132_126_135); y = 4; } else y = 3; terminal.writeAt$4(1, y, "Modifiers:", B.Color_38_42_66); terminal.writeAt$4(15, y, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(modifiers), 3), B.Color_132_126_135); ++y; terminal.writeAt$4(1, y, "Current value:", B.Color_38_42_66); terminal.writeAt$4(15, y, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(t1), 3), B.Color_226_223_240); for (t2 = labels.length, y = 9, _i = 0; _i < labels.length; labels.length === t2 || (0, A.throwConcurrentModificationError)(labels), ++_i) { terminal.writeAt$4(1, y, labels[_i] + ":", B.Color_38_42_66); ++y; } terminal.writeAt$4(24, 7, "Current", B.Color_132_126_135); terminal.writeAt$4(24, 8, "\u2500\u2500\u2500\u2500\u2500\u2500\u2500", B.Color_38_42_66); for (t2 = J.get$iterator$ax(describe.call$1(t1)), y = 9; t2.moveNext$0();) { terminal.writeAt$3(24, y, B.JSString_methods.padLeft$1(t2.get$current(), 7)); ++y; } if (t1 < 40) { terminal.writeAt$4(32, 7, " Next", B.Color_132_126_135); terminal.writeAt$4(32, 8, "\u2500\u2500\u2500\u2500\u2500\u2500\u2500", B.Color_38_42_66); for (t1 = J.get$iterator$ax(describe.call$1(t1 + 1)), y = 9; t1.moveNext$0();) { terminal.writeAt$3(32, y, B.JSString_methods.padLeft$1(t1.get$current(), 7)); ++y; } } }, _changeSelection$1(offset) { this._selectedStatIndex = B.JSInt_methods.clamp$2(this._selectedStatIndex + offset, 0, 3); this.dirty$0(); } }; A.ExperienceDialog__drawStrengthPanel_closure.prototype = { call$1(value) { var t1 = B.JSNumber_methods.toInt$0(A.Strength_tossRangeScaleAt(value) * 100); return A._setArrayType([B.JSInt_methods.toString$0(A.Strength_maxFuryAt(value)), "" + t1 + "%"], type$.JSArray_String); }, $signature: 18 }; A.ExperienceDialog__drawAgilityPanel_closure.prototype = { call$1(value) { return A._setArrayType([B.JSInt_methods.toString$0(A.Agility_dodgeBonusAt(value)), B.JSInt_methods.toString$0(A.Agility_strikeBonusAt(value))], type$.JSArray_String); }, $signature: 18 }; A.ExperienceDialog__drawVitalityPanel_closure.prototype = { call$1(value) { return A._setArrayType([B.JSInt_methods.toString$0(B.JSNumber_methods.toInt$0(Math.pow(value, 1.458) + 9))], type$.JSArray_String); }, $signature: 18 }; A.ExperienceDialog__drawIntellectPanel_closure.prototype = { call$1(value) { return A._setArrayType([B.JSInt_methods.toString$0(A.Intellect_maxFocusAt(value))], type$.JSArray_String); }, $signature: 18 }; A.ForfeitPopup.prototype = { get$message() { if (this._isTown) return B.List_64O; return B.List_Jzc; }, get$helpKeys() { return B.Map_Am2t0; }, handleInput$1(input) { if (input === B.Input_cancel) { this._ui.pop$1(false); return true; } return false; }, keyDown$3$alt$shift(keyCode, alt, shift) { if (shift || alt) return false; switch (keyCode) { case 78: this._ui.pop$1(false); break; case 89: this._ui.pop$1(true); break; } return true; }, update$0() { return false; } }; A.GameOverScreen.prototype = { handleInput$1(input) { switch (input) { case B.Input_cancel: this._ui.pop$0(); return true; } return false; }, render$1(terminal) { var t1 = this._hero.permadeath ? "Create a new hero" : "Try again", t2 = type$.String; A.Draw_dialog(terminal, 60, 40, new A.GameOverScreen_render_closure(this), A.LinkedHashMap_LinkedHashMap$_literal(["`", t1], t2, t2), "You have died"); } }; A.GameOverScreen_render_closure.prototype = { call$1(terminal) { var t2, i, lines, j, t1 = terminal.size, y = t1.y - 1; for (t2 = this.$this._hero.log.messages, i = t2.length - 1, t1 = t1.x; i >= 0; --i) { if (!(i < t2.length)) return A.ioore(t2, i); lines = A.Log_wordWrap(t1, t2[i].text); for (j = lines.length - 1; j >= 0; --j) { if (!(j < lines.length)) return A.ioore(lines, j); terminal.writeAt$3(0, y, lines[j]); --y; if (y < 0) break; } if (y < 0) break; } }, $signature: 30 }; A.GameScreen.prototype = { targetActor$1(value) { var _this = this; if (_this._targetActor != value) _this.dirty$0(); _this._targetActor = value; _this._game_screen$_target = null; }, targetFloor$1(pos) { var _this = this; if (_this._targetActor != null || !J.$eq$(_this._game_screen$_target, pos)) _this.dirty$0(); _this._targetActor = null; _this._game_screen$_target = pos; }, get$currentTarget() { var actor = this.get$currentTargetActor(), t1 = actor == null ? null : actor._pos; return t1 == null ? this._game_screen$_target : t1; }, get$currentTargetActor() { var t1, t2, _this = this, actor = _this._targetActor; if (actor != null) if (actor._health <= 0 || !_this.game.heroCanPerceive$1(actor)) _this._targetActor = null; t1 = _this._targetActor; if (t1 != null) return t1; t1 = _this._game_screen$_target; if (t1 != null) { t2 = _this.game.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); return t2._actorsByTile.$get$2(t1.get$x(), t1.get$y()); } return null; }, get$heroColor() { var hero = this.game.hero, t1 = hero._health, t2 = hero.save.vitality, t3 = t2._stat$_value; t3.toString; if (t1 < B.JSNumber_methods.toInt$0(Math.pow(t3, 1.458) + 9) / 4) return B.Color_204_35_57; if (hero.poison._turnsRemaining > 0) return B.Color_22_117_38; if (hero.cold._turnsRemaining > 0) return B.Color_64_163_229; t1 = hero._health; t2 = t2._stat$_value; t2.toString; if (t1 < B.JSNumber_methods.toInt$0(Math.pow(t2, 1.458) + 9) / 2) return B.Color_255_122_105; return B.Color_226_223_240; }, handleInput$1(input) { var t1, t2, t3, t4, t5, items, unequipped, _this = this, _null = null, action = _null; switch (input) { case B.Input_quit: t1 = _this.game; t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t3 = t1.hero; t4 = t3._pos; if (t2.tiles.$get$2(t4.get$x(), t4.get$y()).type.portal === B.TilePortal_exit) { t2 = _this._ui; t2.toString; t2.push$1(A.ExitPopup$(_this._previousSave, t1)); } else { t3.save.log._log$_add$5(B.LogType_1, "You are not standing on an exit.", _null, _null, _null); _this.dirty$0(); } break; case B.Input_forfeit: _this._ui.push$1(new A.ForfeitPopup(_this.game.depth === 0)); break; case B.Input_selectSkill: t1 = _this._ui; t1.toString; t2 = new A.SelectSkillDialog(_this, A._setArrayType([], type$.JSArray_UsableSkill)); t2.SelectSkillDialog$1(_this); t1.push$1(t2); break; case B.Input_editSkills: t1 = _this._ui; t1.toString; t1.push$1(A.SkillDialog_SkillDialog(_this.game.hero.save)); break; case B.Input_spendExperience: _this._ui.push$1(new A.ExperienceDialog(_this.game.hero.save)); break; case B.Input_heroInfo: t1 = _this._ui; t1.toString; t2 = _this.game; t3 = t2.content; t2 = t2.hero.save; if ($.HeroInfoDialog__screens.length === 0) { t4 = new A.HeroMonsterLoreDialog(A._setArrayType([], type$.JSArray_Breed), B._Sort_401, t3, t2); t4._listBreeds$0(); t5 = new A.HeroItemLoreDialog(A._setArrayType([], type$.JSArray_ItemType), B._Sort_tJq, t3, t2); t5._listItems$0(); B.JSArray_methods.addAll$1($.HeroInfoDialog__screens, A._setArrayType([new A.HeroEquipmentDialog(t3, t2), new A.HeroResistancesDialog(t3, t2), t4, t5], type$.JSArray_HeroInfoDialog)); } t1.push$1(B.JSArray_methods.get$first($.HeroInfoDialog__screens)); break; case B.Input_drop: _this._ui.push$1(new A.DropDialog(_this, B.ItemLocation_Inventory)); break; case B.Input_use: _this._ui.push$1(new A.UseDialog(_this, B.ItemLocation_Inventory)); break; case B.Input_toss: _this._ui.push$1(new A.TossDialog(_this, B.ItemLocation_Inventory)); break; case B.Input_rest: if (!_this.game.hero.rest$0()) _this.dirty$0(); break; case B.Input_operate: _this._operate$0(); break; case B.Input_pickUp: t1 = _this.game; t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t1 = t1.hero; items = t2.itemsAt$1(t1._pos); t2 = items._items.length; if (t2 > 1) _this._ui.push$1(new A.PickUpDialog(_this, B.ItemLocation_ybX)); else if (t2 === 1) t1._behavior = new A.ActionBehavior(A.PickUpAction$(items.get$first(0))); else { t1.save.log._log$_add$5(B.LogType_1, "There is nothing here.", _null, _null, _null); _this.dirty$0(); } break; case B.Input_equip: _this._ui.push$1(new A.EquipDialog(_this, B.ItemLocation_Inventory)); break; case B.Input_nw: action = A.WalkAction$(B.Direction_m1_m1_8_nw); break; case B.Input_n: action = A.WalkAction$(B.Direction_0_m1_1_n); break; case B.Input_ne: action = A.WalkAction$(B.Direction_1_m1_2_ne); break; case B.Input_w: action = A.WalkAction$(B.Direction_m1_0_7_w); break; case B.Input_ok: action = A.WalkAction$(B.Direction_0_0_0_none); break; case B.Input_e: action = A.WalkAction$(B.Direction_1_0_3_e); break; case B.Input_sw: action = A.WalkAction$(B.Direction_m1_1_6_sw); break; case B.Input_s: action = A.WalkAction$(B.Direction_0_1_5_s); break; case B.Input_se: action = A.WalkAction$(B.Direction_1_1_4_se); break; case B.Input_runNW: _this.game.hero._behavior = new A.RunBehavior(B.Direction_m1_m1_8_nw); break; case B.Input_runN: _this.game.hero._behavior = new A.RunBehavior(B.Direction_0_m1_1_n); break; case B.Input_runNE: _this.game.hero._behavior = new A.RunBehavior(B.Direction_1_m1_2_ne); break; case B.Input_runW: _this.game.hero._behavior = new A.RunBehavior(B.Direction_m1_0_7_w); break; case B.Input_runE: _this.game.hero._behavior = new A.RunBehavior(B.Direction_1_0_3_e); break; case B.Input_runSW: _this.game.hero._behavior = new A.RunBehavior(B.Direction_m1_1_6_sw); break; case B.Input_runS: _this.game.hero._behavior = new A.RunBehavior(B.Direction_0_1_5_s); break; case B.Input_runSE: _this.game.hero._behavior = new A.RunBehavior(B.Direction_1_1_4_se); break; case B.Input_fireNW: _this._fireTowards$1(B.Direction_m1_m1_8_nw); break; case B.Input_fireN: _this._fireTowards$1(B.Direction_0_m1_1_n); break; case B.Input_fireNE: _this._fireTowards$1(B.Direction_1_m1_2_ne); break; case B.Input_fireW: _this._fireTowards$1(B.Direction_m1_0_7_w); break; case B.Input_fireE: _this._fireTowards$1(B.Direction_1_0_3_e); break; case B.Input_fireSW: _this._fireTowards$1(B.Direction_m1_1_6_sw); break; case B.Input_fireS: _this._fireTowards$1(B.Direction_0_1_5_s); break; case B.Input_fireSE: _this._fireTowards$1(B.Direction_1_1_4_se); break; case B.Input_fire: t1 = _this._lastSkill; t2 = type$.TargetSkill; if (t2._is(t1)) if (_this.get$currentTargetActor() != null) _this._fireAtTarget$1(t2._as(_this._lastSkill)); else _this._openTargetDialog$1(t1); else if (type$.DirectionSkill._is(t1)) _this._ui.push$1(new A.SkillDirectionDialog(_this.get$_fireTowards(), _this)); else { t2 = _this.game; t3 = t2.hero; if (t1 instanceof A.ActionSpell) t3._behavior = new A.ActionBehavior(t1.getAction$2(t2, t3.save.skills.level$1(t1))); else { t3.save.log._log$_add$5(B.LogType_1, "No skill selected.", _null, _null, _null); _this.dirty$0(); } } break; case B.Input_swap: t1 = _this.game.hero.save; unequipped = t1._inventory._lastUnequipped; if (unequipped == null) { t1.log._log$_add$5(B.LogType_1, "You aren't holding an unequipped item to swap.", _null, _null, _null); _this.dirty$0(); } else action = A.EquipAction$(B.ItemLocation_Inventory, unequipped); break; case B.Input_wizard: t1 = _this._ui; t1.toString; t2 = type$.JSArray_Record_4_String_and_int_and_String_and_void_Function; t3 = A._setArrayType([], t2); t4 = new A.WizardDialog(t3, _this.game); B.JSArray_methods.addAll$1(t3, A._setArrayType([new A._Record_4(["m", 77, "Map Dungeon", t4.get$_mapDungeon()]), new A._Record_4(["i", 73, "Illuminate Dungeon", t4.get$_illuminateDungeon()]), new A._Record_4(["d", 68, "Drop Item", t4.get$_dropItem()]), new A._Record_4(["s", 83, "Spawn Monster", t4.get$_wizard_dialog$_spawnMonster()]), new A._Record_4(["x", 88, "Gain Experience", t4.get$_gainExperience()]), new A._Record_4(["t", 84, "Train Discipline", t4.get$_trainDiscipline()]), new A._Record_4(["k", 75, "Kill All Monsters", t4.get$_killAllMonsters()]), new A._Record_4(["o", 79, "Toggle Show All Monsters", t4.get$_toggleShowAllMonsters()]), new A._Record_4(["a", 65, "Toggle Show Monster Alertness", t4.get$_toggleAlertness()]), new A._Record_4(["v", 86, "Toggle Show Hero Volume", t4.get$_toggleShowHeroVolume()])], t2)); t1.push$1(t4); break; } if (action != null) _this.game.hero._behavior = new A.ActionBehavior(action); return true; }, activate$2(popped, result) { var t3, t4, game, _this = this, t1 = _this.game, t2 = t1.hero; if (!t2.needsInput$1(t1)) _this._pause = 10; if (popped instanceof A.ExitPopup) { t2 = t2.save; t2.shops.forEach$1(0, new A.GameScreen_activate_closure()); t3 = _this._game_screen$_storage; t3.save$0(); t4 = _this._ui; t4.toString; t4.goTo$1(A.GameScreen_GameScreen$town(t3, t1.content, t2, false)); } else if (popped instanceof A.SelectDepthPopup && A._isInt(result)) { _this._game_screen$_storage.save$0(); t3 = _this._ui; t3.toString; game = A.Game$(t1.content, result, t2.save, null, null); t2 = game.generate$0(); t3.push$1(new A.LoadingDialog(game, new A._SyncStarIterator(t2._outerHelper(), t2.$ti._eval$1("_SyncStarIterator<1>")))); } else if (popped instanceof A.LoadingDialog) { t1 = _this._ui; t1.toString; t1.goTo$1(A.GameScreen$(_this._game_screen$_storage, type$.Game._as(result))); } else if (popped instanceof A.ForfeitPopup && J.$eq$(result, true)) { t2 = _this._game_screen$_storage; if (t1.depth > 0) { t3 = _this._ui; t3.toString; t3.goTo$1(A.GameScreen_GameScreen$town(t2, t1.content, _this._previousSave, false)); } else { t2.save$0(); _this._ui.pop$0(); } } else if (popped instanceof A.TownScreen) _this._game_screen$_storage.save$0(); else if (popped instanceof A.ItemDialog) { if (t1.depth === 0) _this._game_screen$_storage.save$0(); } else if (!(popped instanceof A.SkillTypeDialog)) if (popped instanceof A.SelectSkillDialog && result != null) if (type$.TargetSkill._is(result)) _this._openTargetDialog$1(result); else if (type$.DirectionSkill._is(result)) _this._ui.push$1(new A.SkillDirectionDialog(new A.GameScreen_activate_closure0(_this, result), _this)); else if (result instanceof A.ActionSpell) { _this._lastSkill = result; t2._behavior = new A.ActionBehavior(result.getAction$2(t1, t2.save.skills.level$1(result))); } }, update$0() { var t1, result, t2, t3, _this = this; if (_this._enterPortal$0()) return; t1 = _this._pause; if (t1 > 0) { _this._pause = t1 - 1; return; } t1 = _this.game; result = t1.update$0(); t1 = t1.hero; if (t1._health <= 0) { t2 = _this._ui; t2.toString; t3 = _this._game_screen$_storage; t1 = t1.save; if (t1.permadeath) t3.remove$1(0, t1); else t3.replace$1(_this._previousSave); t3.save$0(); t2.goTo$1(new A.GameOverScreen(t1)); return; } t1 = _this.__GameScreen__stagePanel_F; t1 === $ && A.throwLateFieldNI("_stagePanel"); t2 = result.events; if (t1.update$1(t2)) _this.dirty$0(); if (result.madeProgress || t2.length !== 0) _this.dirty$0(); }, resize$1(size) { var leftWidth, t1, centerWidth, t2, width, logHeight, _this = this; if (size.$gt(0, 160)) leftWidth = 29; else leftWidth = size.$gt(0, 150) ? 25 : 21; t1 = size.x; centerWidth = t1 - leftWidth; t2 = _this.itemPanel; t2._bounds = null; if (t1 >= 80) { width = Math.min(50, 20 + B.JSInt_methods._tdivFast$1(t1 - 80, 2)); t2._bounds = new A.Rect(new A.Vec(t1 - width, 0), new A.Vec(width, size.y)); centerWidth -= width; } t1 = _this.__GameScreen__sidebarPanel_F; t1 === $ && A.throwLateFieldNI("_sidebarPanel"); t2 = size.y; t1._bounds = new A.Rect(new A.Vec(0, 0), new A.Vec(leftWidth, t2)); logHeight = Math.min(3 + B.JSInt_methods._tdivFast$1(t2 - 30, 2), 10); _this._logPanel._bounds = new A.Rect(new A.Vec(leftWidth, 0), new A.Vec(centerWidth, logHeight)); t1 = _this.__GameScreen__stagePanel_F; t1 === $ && A.throwLateFieldNI("_stagePanel"); t1._bounds = new A.Rect(new A.Vec(leftWidth, logHeight), new A.Vec(centerWidth, t2 - logHeight)); }, render$1(terminal) { var t1, _this = this; terminal.fill$4(0, 0, terminal.get$width(), terminal.get$height()); t1 = _this.__GameScreen__stagePanel_F; t1 === $ && A.throwLateFieldNI("_stagePanel"); t1.render$1(terminal); _this._logPanel.render$1(terminal); t1 = _this.__GameScreen__sidebarPanel_F; t1 === $ && A.throwLateFieldNI("_sidebarPanel"); t1.render$1(terminal); _this.itemPanel.render$1(terminal); }, _enterPortal$0() { var t3, portal, _this = this, t1 = _this.game, t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t1 = t1.hero; t3 = t1._pos; portal = t2.tiles.$get$2(t3.get$x(), t3.get$y()).type.portal; if (portal == _this._game_screen$_portal) return false; _this._game_screen$_portal = portal; switch (portal) { case B.TilePortal_dungeon: t2 = _this._ui; t2.toString; t1 = t1.save; t3 = new A.SelectDepthPopup(t1); t3._select_depth_popup$_depth = Math.min(100, t1.maxDepth + 1); t2.push$1(t3); break; case B.TilePortal_home: _this._ui.push$1(new A._HomeScreen(_this)); break; case B.TilePortal_cvm4: _this._enterShop$1(0); break; case B.TilePortal_cvm3: _this._enterShop$1(1); break; case B.TilePortal_cvm2: _this._enterShop$1(2); break; case B.TilePortal_cvm1: _this._enterShop$1(3); break; case B.TilePortal_cvm0: _this._enterShop$1(4); break; case B.TilePortal_cvm: _this._enterShop$1(5); break; case B.TilePortal_cvm5: _this._enterShop$1(6); break; case B.TilePortal_cvm6: _this._enterShop$1(7); break; case B.TilePortal_cvm7: _this._enterShop$1(8); break; } return true; }, _operate$0() { var t1, t2, t3, t4, _i, pos, t5, t6, t7, t8, _this = this, operable = A._setArrayType([], type$.JSArray_Vec); for (t1 = _this.game, t2 = t1.hero, t3 = t2._pos.get$neighbors(), t4 = t3.length, _i = 0; _i < t3.length; t3.length === t4 || (0, A.throwConcurrentModificationError)(t3), ++_i) { pos = t3[_i]; t5 = t1.__Game__stage_F; t5 === $ && A.throwLateFieldNI("_stage"); t5 = t5.tiles; t6 = pos.x; t7 = pos.y; t5._checkBounds$2(t6, t7); t8 = t5._elements; t6 = t7 * t5.bounds.size.x + t6; if (!(t6 >= 0 && t6 < t8.length)) return A.ioore(t8, t6); if (t8[t6].type.onOperate != null) B.JSArray_methods.add$1(operable, pos); } t3 = operable.length; if (t3 === 0) { t2.save.log._log$_add$5(B.LogType_1, "You are not next to anything to operate.", null, null, null); _this.dirty$0(); } else if (t3 === 1) { pos = B.JSArray_methods.get$first(operable); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2._behavior = new A.ActionBehavior(type$.Action._as(t1.tiles.$get$2(pos.get$x(), pos.get$y()).type.onOperate.call$1(pos))); } else _this._ui.push$1(new A.OperateDialog(_this)); }, _openTargetDialog$1(skill) { var _this = this, t1 = _this._ui; t1.toString; t1.push$1(A.TargetDialog$(_this, skill.getRange$1(0, _this.game), new A.GameScreen__openTargetDialog_closure(_this, skill))); }, _fireAtTarget$1(skill) { var t4, _this = this, t1 = _this.game, t2 = t1.hero, t3 = J.$eq$(_this.get$currentTarget(), t2._pos); if (t3) { t2.save.log._log$_add$5(B.LogType_1, "You can't target yourself.", null, null, null); _this.dirty$0(); return; } _this._lastSkill = skill; t3 = t2.save.skills.level$1(skill); t4 = _this.get$currentTarget(); t4.toString; t2._behavior = new A.ActionBehavior(skill.getTargetAction$3(t1, t3, t4)); }, _fireTowards$1(dir) { var t1, t2, t3, t4, t5, pos, previous, step, t6, t7, t8, t9, _this = this, _null = null; if (dir === B.Direction_0_0_0_none) return; t1 = _this._lastSkill; if (type$.DirectionSkill._is(t1)) { t2 = _this.game; t3 = t2.hero; t4 = t3.save; t5 = t4.skills.level$1(t1); t3._behavior = new A.ActionBehavior(t1._wrapActionCost$3(t4, t5, t1.onGetDirectionAction$3(t2, t5, dir))); } else if (type$.TargetSkill._is(t1)) { t2 = _this.game; t3 = t2.hero; pos = t3._pos.$add(0, dir); previous = A._Cell$named("previous"); for (t4 = A._LineIterator__LineIterator(t3._pos, pos); t4.moveNext$0(), true;) { step = t4._line$_current; t5 = t2.__Game__stage_F; t5 === $ && A.throwLateFieldNI("_stage"); t6 = t5._actorsByTile; t7 = step.get$x(); t8 = step.get$y(); t6._checkBounds$2(t7, t8); t9 = t6._elements; t7 = t8 * t6.bounds.size.x + t7; if (!(t7 >= 0 && t7 < t9.length)) return A.ioore(t9, t7); t7 = t9[t7]; if (t7 != null) { if (_this._targetActor !== t7) _this.dirty$0(); _this._targetActor = t7; _this._game_screen$_target = null; break; } t5 = t5.tiles; t6 = step.get$x(); t7 = step.get$y(); t5._checkBounds$2(t6, t7); t8 = t5._elements; t6 = t7 * t5.bounds.size.x + t6; if (!(t6 >= 0 && t6 < t8.length)) return A.ioore(t8, t6); t6 = t8[t6]; t8 = $.$get$Motility_fly(); if ((t6.type.motility._bitMask & t8._bitMask) === 0) { t4 = previous._value; if (t4 === previous) A.throwExpression(A.LateError$localNI(previous._name)); type$.nullable_Vec._as(t4); if (_this._targetActor != null || !J.$eq$(_this._game_screen$_target, t4)) _this.dirty$0(); _this._targetActor = null; _this._game_screen$_target = t4; break; } if (step.$sub(0, t3._pos).$ge(0, t1.getRange$1(0, t2))) { if (_this._targetActor != null || !J.$eq$(_this._game_screen$_target, step)) _this.dirty$0(); _this._targetActor = null; _this._game_screen$_target = step; break; } previous._value = step; } t4 = t3.save; if (_this.get$currentTarget() != null) { t4 = t4.skills.level$1(t1); t5 = _this.get$currentTarget(); t5.toString; t3._behavior = new A.ActionBehavior(t1.getTargetAction$3(t2, t4, t5)); } else { t1 = t2.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t3 = t3._pos.$add(0, dir); t4.log._log$_add$5(B.LogType_1, "There is a " + t1.tiles.$get$2(t3.x, t3.y).type.name + " in the way.", _null, _null, _null); _this.dirty$0(); } } else { t2 = _this.game.hero; if (t1 instanceof A.ActionSpell) { t2.save.log._log$_add$5(B.LogType_1, t1.get$useName() + " does not take a direction.", _null, _null, _null); _this.dirty$0(); } else { t2.save.log._log$_add$5(B.LogType_1, "No skill selected.", _null, _null, _null); _this.dirty$0(); } } }, _enterShop$1(index) { var t1 = this.game.hero.save.shops, t2 = A._instanceType(t1)._eval$1("LinkedHashMapKeysIterable<1>"), shops = A.List_List$_of(new A.LinkedHashMapKeysIterable(t1, t2), t2._eval$1("Iterable.E")); if (index >= shops.length) return; t2 = this._ui; t2.toString; t1 = t1.$index(0, shops[index]); t1.toString; t2.push$1(new A._ShopScreen(t1, this)); } }; A.GameScreen_activate_closure.prototype = { call$2(shop, inventory) { type$.Shop._as(shop).update$1(type$.Inventory._as(inventory)); }, $signature: 110 }; A.GameScreen_activate_closure0.prototype = { call$1(dir) { var t1 = this.$this; t1._lastSkill = this.result; t1._fireTowards$1(dir); }, $signature: 29 }; A.GameScreen__openTargetDialog_closure.prototype = { call$1(__wc0_formal) { return this.$this._fireAtTarget$1(this.skill); }, $signature: 12 }; A.HeroEquipmentDialog.prototype = { get$name() { return "Equipment"; }, render$1(terminal) { var writeLine, writeScale, writeBonus, element, t1, baseDamage, totalDamageScale, totalDamageBonus, totalStrikeBonus, totalArmor, totalArmorBonus, _i, item, t2, t3; this.super$HeroInfoDialog$render(terminal); writeLine = new A.HeroEquipmentDialog_render_writeLine(terminal); writeScale = new A.HeroEquipmentDialog_render_writeScale(terminal); writeBonus = new A.HeroEquipmentDialog_render_writeBonus(terminal); terminal.writeAt$4(48, 0, "\u2550\u2550\u2550\u2550\u2550\u2550 Attack \u2550\u2550\u2550\u2550\u2550 \u2550\u2550 Defend \u2550\u2550", B.Color_38_42_66); terminal.writeAt$4(48, 1, "El Damage Hit Dodge Armor", B.Color_63_75_115); this.drawEquipmentTable$2(terminal, new A.HeroEquipmentDialog_render_closure(writeLine, terminal, writeScale, writeBonus)); element = $.$get$Element_none(); for (t1 = this.hero._equipment.slots, baseDamage = 3, totalDamageScale = 1, totalDamageBonus = 0, totalStrikeBonus = 0, totalArmor = 0, totalArmorBonus = 0, _i = 0; _i < 9; ++_i) { item = t1[_i]; if (item == null) continue; t2 = item.type; t3 = t2.attack; if (t3 != null) { element = t3.element; baseDamage = t3.damage; } totalDamageScale *= item.get$damageScale(); totalDamageBonus += item.get$damageBonus(); totalStrikeBonus += item.get$strikeBonus(); totalArmor += t2.armor; totalArmorBonus += item.get$armorModifier(); } terminal.writeAt$4(41, 21, "Totals", B.Color_63_75_115); writeLine.call$2(2, B.Color_38_42_66); writeLine.call$2(20, B.Color_38_42_66); terminal.writeAt$4(48, 21, element.abbreviation, A.elementColor(element)); terminal.writeAt$3(51, 21, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(baseDamage), 2)); writeScale.call$3(54, 21, totalDamageScale); writeBonus.call$3(59, 21, totalDamageBonus); writeBonus.call$3(64, 21, totalStrikeBonus); terminal.writeAt$4(74, 21, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(totalArmor), 2), B.Color_226_223_240); writeBonus.call$3(77, 21, totalArmorBonus); } }; A.HeroEquipmentDialog_render_writeLine.prototype = { call$2(y, color) { this.terminal.writeAt$4(2, y, "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500", color); }, $signature: 17 }; A.HeroEquipmentDialog_render_writeScale.prototype = { call$3(x, y, scale) { var t1, string = B.JSNumber_methods.toStringAsFixed$1(scale, 1); if (scale > 1) { t1 = this.terminal; t1.writeAt$4(x, y, "x", B.Color_0_64_39); t1.writeAt$4(x + 1, y, string, B.Color_22_117_38); } else if (scale < 1) { t1 = this.terminal; t1.writeAt$4(x, y, "x", B.Color_84_0_39); t1.writeAt$4(x + 1, y, string, B.Color_204_35_57); } }, $signature: 112 }; A.HeroEquipmentDialog_render_writeBonus.prototype = { call$3(x, y, bonus) { var t1, t2, string = B.JSInt_methods.toString$0(Math.abs(bonus)); if (bonus > 0) { t1 = this.terminal; t2 = string.length; t1.writeAt$4(x + 2 - t2, y, "+", B.Color_0_64_39); t1.writeAt$4(x + 3 - t2, y, string, B.Color_22_117_38); } else if (bonus < 0) { t1 = this.terminal; t2 = string.length; t1.writeAt$4(x + 2 - t2, y, "-", B.Color_84_0_39); t1.writeAt$4(x + 3 - t2, y, string, B.Color_204_35_57); } }, $signature: 28 }; A.HeroEquipmentDialog_render_closure.prototype = { call$2(item, y) { var t1, attack, t2, _this = this; _this.writeLine.call$2(y - 1, B.Color_20_19_31); if (item == null) return; t1 = item.type; attack = t1.attack; if (attack != null) { t2 = _this.terminal; t2.writeAt$4(48, y, item.get$element().abbreviation, A.elementColor(item.get$element())); t2.writeAt$4(51, y, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(attack.damage), 2), B.Color_226_223_240); } _this.writeScale.call$3(54, y, item.get$damageScale()); t2 = _this.writeBonus; t2.call$3(59, y, item.get$damageBonus()); t2.call$3(64, y, item.get$strikeBonus()); t1 = t1.armor; if (t1 !== 0) _this.terminal.writeAt$4(74, y, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(t1), 2), B.Color_226_223_240); t2.call$3(77, y, item.get$armorModifier()); }, $signature: 27 }; A.HeroInfoDialog.prototype = { get$extraHelp() { var t1 = type$.String; return A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); }, keyDown$3$alt$shift(keyCode, alt, shift) { var index, $screen; if (alt) return false; if (keyCode === 9) { index = B.JSArray_methods.indexOf$1($.HeroInfoDialog__screens, this); index = shift ? index + ($.HeroInfoDialog__screens.length - 1) : index + 1; $screen = $.HeroInfoDialog__screens[B.JSInt_methods.$mod(index, $.HeroInfoDialog__screens.length)]; this._ui.goTo$1($screen); return true; } return false; }, handleInput$1(input) { if (input === B.Input_cancel) { this._ui.pop$0(); return true; } return false; }, render$1(terminal) { var nextScreen = $.HeroInfoDialog__screens[B.JSInt_methods.$mod(B.JSArray_methods.indexOf$1($.HeroInfoDialog__screens, this) + 1, $.HeroInfoDialog__screens.length)], t1 = type$.String; t1 = A.LinkedHashMap_LinkedHashMap$of(this.get$extraHelp(), t1, t1); t1.$indexSet(0, "Tab", "View " + nextScreen.get$name()); t1.$indexSet(0, "`", "Exit"); A.Draw_helpKeys(terminal, t1, null); }, drawEquipmentTable$2(terminal, callback) { var t1, t2, y, i, item; type$.void_Function_2_nullable_Item_and_int._as(callback); terminal.writeAt$4(2, 1, "Equipment", B.Color_222_156_33); for (t1 = terminal._display, t2 = this.hero._equipment.slots, y = 3, i = 0; i < 9; ++i) { item = t2[i]; callback.call$2(item, y); if (item == null) { terminal.writeAt$4(2, y, "(" + B.List_5L9[i] + ")", B.Color_38_42_66); y += 2; continue; } t1.setGlyph$3(0, y, item.type.appearance); terminal.writeAt$4(2, y, item.get$nounText(), B.Color_226_223_240); y += 2; } } }; A.HeroItemLoreDialog.prototype = { get$name() { return "Item Lore"; }, get$extraHelp() { var t1 = type$.String; return A.LinkedHashMap_LinkedHashMap$_literal(["\u2195", "Scroll", "S", this._sort.get$next().helpText], t1, t1); }, keyDown$3$alt$shift(keyCode, alt, shift) { var _this = this; if (!shift && !alt && keyCode === 83) { _this._sort = _this._sort.get$next(); _this._listItems$0(); _this.dirty$0(); return true; } return _this.super$HeroInfoDialog$keyDown(keyCode, alt, shift); }, handleInput$1(input) { var _this = this; switch (input) { case B.Input_n: _this._hero_item_lore_dialog$_select$1(-1); return true; case B.Input_s: _this._hero_item_lore_dialog$_select$1(1); return true; case B.Input_runN: _this._hero_item_lore_dialog$_select$1(-10); return true; case B.Input_runS: _this._hero_item_lore_dialog$_select$1(10); return true; } return _this.super$HeroInfoDialog$handleInput(input); }, render$1(terminal) { var writeLine, t1, t2, t3, t4, t5, t6, i, y, index, t7, item, fore, found, used, inspector, _0_0, leftY, _1_0, rightTerminal, _2_0, rightY, _3_0, _this = this; terminal.fill$4(0, 0, terminal.get$width(), terminal.get$height()); writeLine = new A.HeroItemLoreDialog_render_writeLine(terminal); terminal.writeAt$4(2, 1, "Items", B.Color_222_156_33); terminal.writeAt$4(20, 1, B.JSString_methods.padLeft$1("(" + _this._sort.description + ")", 34), B.Color_38_42_66); terminal.writeAt$4(55, 1, "Depth Price Found Used", B.Color_63_75_115); for (t1 = _this.hero, t2 = t1.lore, t3 = t2._foundItems, t4 = _this._hero_item_lore_dialog$_items, t5 = terminal._display, t6 = t2._usedItems, i = 0; i < 11; ++i) { y = i * 2 + 3; writeLine.call$2(y + 1, B.Color_20_19_31); index = _this._hero_item_lore_dialog$_scroll + i; t7 = t4.length; if (index >= t7) continue; if (!(index >= 0)) return A.ioore(t4, index); item = t4[index]; if (index === _this._selection) { terminal.writeAt$4(1, y, "\u25ba", B.Color_222_156_33); fore = B.Color_222_156_33; } else fore = B.Color_132_126_135; found = t3.$index(0, item); if (found == null) found = 0; if (found > 0) { t5.setGlyph$3(0, y, item.appearance); terminal.writeAt$4(2, y, A.Log__categorize(item.quantifiableName, false, true), fore); terminal.writeAt$4(55, y, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(item.depth), 5), fore); terminal.writeAt$4(61, y, B.JSString_methods.padLeft$1(A.formatMoney(item.price), 7), fore); if (item.isArtifact) terminal.writeAt$4(69, y, B.JSString_methods.padLeft$1("Yes", 5), fore); else terminal.writeAt$4(69, y, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(found), 5), fore); if (item.use != null) { used = t6.$index(0, item); terminal.writeAt$4(75, y, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(used == null ? 0 : used), 5), fore); } else terminal.writeAt$4(75, y, B.JSString_methods.padLeft$1("--", 5), fore); } else terminal.writeAt$4(2, y, "(undiscovered " + (_this._hero_item_lore_dialog$_scroll + i + 1) + ")", B.Color_38_42_66); } writeLine.call$2(2, B.Color_38_42_66); t3 = _this._selection; if (!(t3 >= 0 && t3 < t4.length)) return A.ioore(t4, t3); if (t2.foundItems$1(t4[t3]) > 0) { t2 = _this._selection; if (!(t2 >= 0 && t2 < t4.length)) return A.ioore(t4, t2); inspector = A.ItemInspector$(t1, new A.Item(t4[t2], null, null, null, 1), true); t5 = new A.PortTerminal(new A.Vec(80, 14), 0, t5._glyphs.bounds.size.y - 15, terminal); t2 = inspector._item; A.Draw_glyphFrame(t5, 0, 0, 80, 14, t2.type.appearance, t2.get$nounText()); _0_0 = inspector._attackSection; leftY = _0_0 != null ? _0_0.draw$2(t5, 3) : 3; _1_0 = inspector._defenseSection; if (_1_0 != null) leftY = _1_0.draw$2(t5, leftY); rightTerminal = t5.rect$4(40, 0, 40, 14); _2_0 = inspector._resistancesSection; rightY = _2_0 != null ? _2_0.draw$2(rightTerminal, 3) : 3; y = Math.max(leftY, rightY); _3_0 = inspector._useSection; if (_3_0 != null) y = _3_0.draw$2(t5, y); t1 = inspector.__ItemInspector__descriptionSection_F; t1 === $ && A.throwLateFieldNI("_descriptionSection"); t1.draw$2(t5, y); } _this.super$HeroInfoDialog$render(terminal); }, _hero_item_lore_dialog$_select$1(offset) { var _this = this, t1 = _this._selection = B.JSInt_methods.clamp$2(_this._selection + offset, 0, _this._hero_item_lore_dialog$_items.length - 1); _this._hero_item_lore_dialog$_scroll = B.JSInt_methods.clamp$2(_this._hero_item_lore_dialog$_scroll, t1 - 11 + 1, t1); _this.dirty$0(); }, _listItems$0() { var t3, selectedItem, compareDepth, _this = this, _box_0 = {}, t1 = _this._hero_item_lore_dialog$_items, t2 = t1.length; if (t2 !== 0) { t3 = _this._selection; if (!(t3 >= 0 && t3 < t2)) return A.ioore(t1, t3); selectedItem = t1[t3]; } else selectedItem = null; B.JSArray_methods.clear$0(t1); B.JSArray_methods.addAll$1(t1, $.$get$Items_types().get$all()); compareDepth = new A.HeroItemLoreDialog__listItems_compareDepth(); t2 = type$.JSArray_of_int_Function_ItemType_ItemType; _box_0.comparisons = A._setArrayType([], t2); switch (_this._sort) { case B._Sort_tJq: _box_0.comparisons = A._setArrayType([new A.HeroItemLoreDialog__listItems_compareSort(), compareDepth], t2); break; case B._Sort_AXH: break; case B._Sort_WrN: _box_0.comparisons = A._setArrayType([compareDepth], t2); break; case B._Sort_Csn: _box_0.comparisons = A._setArrayType([new A.HeroItemLoreDialog__listItems_comparePrice()], t2); break; } B.JSArray_methods.sort$1(t1, new A.HeroItemLoreDialog__listItems_closure(_box_0)); _this._selection = 0; if (selectedItem != null) _this._selection = B.JSArray_methods.indexOf$1(t1, selectedItem); _this._hero_item_lore_dialog$_select$1(0); } }; A.HeroItemLoreDialog_render_writeLine.prototype = { call$2(y, color) { this.terminal.writeAt$4(2, y, "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500", color); }, $signature: 17 }; A.HeroItemLoreDialog__listItems_compareSort.prototype = { call$2(a, b) { var t1 = type$.ItemType; return B.JSInt_methods.compareTo$1(t1._as(a).sortIndex, t1._as(b).sortIndex); }, $signature: 16 }; A.HeroItemLoreDialog__listItems_compareDepth.prototype = { call$2(a, b) { var t1 = type$.ItemType; return B.JSInt_methods.compareTo$1(t1._as(a).depth, t1._as(b).depth); }, $signature: 16 }; A.HeroItemLoreDialog__listItems_comparePrice.prototype = { call$2(a, b) { var t1 = type$.ItemType; return B.JSInt_methods.compareTo$1(t1._as(a).price, t1._as(b).price); }, $signature: 16 }; A.HeroItemLoreDialog__listItems_closure.prototype = { call$2(a, b) { var t2, _i, compare, t1 = type$.ItemType; t1._as(a); t1._as(b); for (t1 = this._box_0.comparisons, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { compare = t1[_i].call$2(a, b); if (compare !== 0) return compare; } return B.JSString_methods.compareTo$1(A.Log__categorize(a.quantifiableName, false, true).toLowerCase(), A.Log__categorize(b.quantifiableName, false, true).toLowerCase()); }, $signature: 16 }; A._Sort.prototype = { get$next() { return B.List_owd[B.JSInt_methods.$mod(B.JSArray_methods.indexOf$1(B.List_owd, this) + 1, 4)]; } }; A.HeroMonsterLoreDialog.prototype = { get$name() { return "Monster Lore"; }, get$extraHelp() { var t1 = type$.String; return A.LinkedHashMap_LinkedHashMap$_literal(["\u2195", "Scroll", "S", this._hero_monster_lore_dialog$_sort.get$next().helpText], t1, t1); }, keyDown$3$alt$shift(keyCode, alt, shift) { var _this = this; if (!shift && !alt && keyCode === 83) { _this._hero_monster_lore_dialog$_sort = _this._hero_monster_lore_dialog$_sort.get$next(); _this._listBreeds$0(); _this.dirty$0(); return true; } return _this.super$HeroInfoDialog$keyDown(keyCode, alt, shift); }, handleInput$1(input) { var _this = this; switch (input) { case B.Input_n: _this._hero_monster_lore_dialog$_select$1(-1); return true; case B.Input_s: _this._hero_monster_lore_dialog$_select$1(1); return true; case B.Input_runN: _this._hero_monster_lore_dialog$_select$1(-10); return true; case B.Input_runS: _this._hero_monster_lore_dialog$_select$1(10); return true; } return _this.super$HeroInfoDialog$handleInput(input); }, render$1(terminal) { var writeLine, t1, t2, t3, t4, i, y, index, t5, breed, fore, seen, slain, _this = this; terminal.fill$4(0, 0, terminal.get$width(), terminal.get$height()); writeLine = new A.HeroMonsterLoreDialog_render_writeLine(terminal); terminal.writeAt$4(2, 1, "Monsters", B.Color_222_156_33); terminal.writeAt$4(20, 1, B.JSString_methods.padLeft$1("(" + _this._hero_monster_lore_dialog$_sort.description + ")", 42), B.Color_38_42_66); terminal.writeAt$4(63, 1, "Depth Seen Slain", B.Color_63_75_115); for (t1 = _this.hero.lore, t2 = t1._slainBreeds, t1 = t1._seenBreeds, t3 = _this._breeds, t4 = terminal._display, i = 0; i < 11; ++i) { y = i * 2 + 3; writeLine.call$2(y + 1, B.Color_20_19_31); index = _this._hero_monster_lore_dialog$_scroll + i; t5 = t3.length; if (index >= t5) continue; if (!(index >= 0)) return A.ioore(t3, index); breed = t3[index]; if (index === _this._hero_monster_lore_dialog$_selection) { terminal.writeAt$4(1, y, "\u25ba", B.Color_222_156_33); fore = B.Color_222_156_33; } else fore = B.Color_132_126_135; seen = t1.$index(0, breed); if (seen == null) seen = 0; slain = t2.$index(0, breed); if (slain == null) slain = 0; if (seen > 0) { t4.setGlyph$3(0, y, breed.appearance); terminal.writeAt$4(2, y, A.Log__categorize(breed._breed$_name, false, true), fore); terminal.writeAt$4(63, y, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(breed.depth), 5), fore); if (breed.flags.unique) { terminal.writeAt$4(69, y, B.JSString_methods.padLeft$1("Yes", 5), fore); terminal.writeAt$4(75, y, B.JSString_methods.padLeft$1(slain > 0 ? "Yes" : "No", 5), fore); } else { terminal.writeAt$4(69, y, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(seen), 5), fore); terminal.writeAt$4(75, y, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(slain), 5), fore); } } else terminal.writeAt$4(2, y, "(undiscovered " + (_this._hero_monster_lore_dialog$_scroll + i + 1) + ")", B.Color_38_42_66); } writeLine.call$2(2, B.Color_38_42_66); t1 = _this._hero_monster_lore_dialog$_selection; if (!(t1 >= 0 && t1 < t3.length)) return A.ioore(t3, t1); _this._showMonster$2(terminal, t3[t1]); _this.super$HeroInfoDialog$render(terminal); }, _showMonster$2(terminal, breed) { var t1, t2, y, _i; terminal = new A.PortTerminal(new A.Vec(80, 14), 0, terminal._display._glyphs.bounds.size.y - 15, terminal); t1 = this.hero.lore.seenBreed$1(breed) === 0; t2 = t1 ? A.Glyph$("?", B.Color_38_42_66, null) : breed.appearance; A.Draw_glyphFrame(terminal, 0, 0, 80, 14, t2, t1 ? "" : A.Log__categorize(breed._breed$_name, false, true)); if (t1) { terminal.writeAt$4(1, 3, "You have not seen this breed yet.", B.Color_38_42_66); return; } t1 = breed.description; if (t1 !== "") { for (t1 = A.Log_wordWrap(78, t1), t2 = t1.length, y = 3, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { terminal.writeAt$4(1, y, t1[_i], B.Color_132_126_135); ++y; } ++y; } else y = 3; for (t1 = A.Log_wordWrap(78, this._describeBreed$1(breed)), t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { terminal.writeAt$4(1, y, t1[_i], B.Color_132_126_135); ++y; } }, _hero_monster_lore_dialog$_select$1(offset) { var _this = this, t1 = _this._hero_monster_lore_dialog$_selection = B.JSInt_methods.clamp$2(_this._hero_monster_lore_dialog$_selection + offset, 0, _this._breeds.length - 1); _this._hero_monster_lore_dialog$_scroll = B.JSInt_methods.clamp$2(_this._hero_monster_lore_dialog$_scroll, t1 - 11 + 1, t1); _this.dirty$0(); }, _describeBreed$1(breed) { var t2, noun, sentences = A._setArrayType([], type$.JSArray_String), pronoun = breed.pronoun.subjective, lore = this.hero.lore, t1 = breed.groups; if (t1.length !== 0) { t2 = A._arrayInstanceType(t1); noun = new A.MappedListIterable(t1, t2._eval$1("String(1)")._as(new A.HeroMonsterLoreDialog__describeBreed_closure()), t2._eval$1("MappedListIterable<1,String>")).join$1(0, " "); } else noun = "monster"; if (breed.flags.unique) if (lore.slain$1(breed) > 0) B.JSArray_methods.add$1(sentences, "You have slain this unique " + noun + "."); else B.JSArray_methods.add$1(sentences, "You have seen but not slain this unique " + noun + "."); else B.JSArray_methods.add$1(sentences, "You have seen " + lore.seenBreed$1(breed) + " and slain " + lore.slain$1(breed) + " of this " + noun + "."); B.JSArray_methods.add$1(sentences, pronoun + " is worth " + breed.get$experience() + " experience."); if (lore.slain$1(breed) > 0) B.JSArray_methods.add$1(sentences, pronoun + " has " + breed.maxHealth + " health."); return new A.MappedListIterable(sentences, type$.String_Function_String._as(new A.HeroMonsterLoreDialog__describeBreed_closure0()), type$.MappedListIterable_String_String).join$1(0, " "); }, _listBreeds$0() { var t3, selectedBreed, compareDepth, _this = this, _box_0 = {}, t1 = _this._breeds, t2 = t1.length; if (t2 !== 0) { t3 = _this._hero_monster_lore_dialog$_selection; if (!(t3 >= 0 && t3 < t2)) return A.ioore(t1, t3); selectedBreed = t1[t3]; } else selectedBreed = null; B.JSArray_methods.clear$0(t1); if (_this._hero_monster_lore_dialog$_sort === B._Sort_4kz) { t2 = $.$get$Monsters_breeds().get$all(); t3 = A._instanceType(t2); B.JSArray_methods.addAll$1(t1, new A.WhereIterable(t2, t3._eval$1("bool(Iterable.E)")._as(new A.HeroMonsterLoreDialog__listBreeds_closure()), t3._eval$1("WhereIterable"))); } else B.JSArray_methods.addAll$1(t1, $.$get$Monsters_breeds().get$all()); compareDepth = new A.HeroMonsterLoreDialog__listBreeds_compareDepth(); t2 = type$.JSArray_of_int_Function_Breed_Breed; _box_0.comparisons = A._setArrayType([], t2); switch (_this._hero_monster_lore_dialog$_sort) { case B._Sort_401: _box_0.comparisons = A._setArrayType([new A.HeroMonsterLoreDialog__listBreeds_compareGlyph(), compareDepth], t2); break; case B._Sort_AXH0: break; case B._Sort_WrN0: _box_0.comparisons = A._setArrayType([compareDepth], t2); break; case B._Sort_4kz: _box_0.comparisons = A._setArrayType([compareDepth], t2); break; } B.JSArray_methods.sort$1(t1, new A.HeroMonsterLoreDialog__listBreeds_closure0(_box_0)); _this._hero_monster_lore_dialog$_selection = 0; if (selectedBreed != null) { t1 = B.JSArray_methods.indexOf$1(t1, selectedBreed); _this._hero_monster_lore_dialog$_selection = t1; if (t1 === -1) _this._hero_monster_lore_dialog$_selection = 0; } _this._hero_monster_lore_dialog$_select$1(0); } }; A.HeroMonsterLoreDialog_render_writeLine.prototype = { call$2(y, color) { this.terminal.writeAt$4(2, y, "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500", color); }, $signature: 17 }; A.HeroMonsterLoreDialog__describeBreed_closure.prototype = { call$1(group) { return A._asString(group); }, $signature: 7 }; A.HeroMonsterLoreDialog__describeBreed_closure0.prototype = { call$1(sentence) { A._asString(sentence); return B.JSString_methods.substring$2(sentence, 0, 1).toUpperCase() + B.JSString_methods.substring$1(sentence, 1); }, $signature: 7 }; A.HeroMonsterLoreDialog__listBreeds_closure.prototype = { call$1(breed) { return type$.Breed._as(breed).flags.unique; }, $signature: 115 }; A.HeroMonsterLoreDialog__listBreeds_compareGlyph.prototype = { call$2(a, b) { var t1 = type$.Breed, aChar = t1._as(a).appearance.char, bChar = t1._as(b).appearance.char; t1 = new A.HeroMonsterLoreDialog__listBreeds_compareGlyph_isUpper(); if (t1.call$1(aChar) && !t1.call$1(bChar)) return 1; if (!t1.call$1(aChar) && t1.call$1(bChar)) return -1; return B.JSInt_methods.compareTo$1(aChar, bChar); }, $signature: 22 }; A.HeroMonsterLoreDialog__listBreeds_compareGlyph_isUpper.prototype = { call$1(c) { return c >= 65 && c <= 90; }, $signature: 117 }; A.HeroMonsterLoreDialog__listBreeds_compareDepth.prototype = { call$2(a, b) { var t1 = type$.Breed; return B.JSInt_methods.compareTo$1(t1._as(a).depth, t1._as(b).depth); }, $signature: 22 }; A.HeroMonsterLoreDialog__listBreeds_closure0.prototype = { call$2(a, b) { var t2, _i, compare, t1 = type$.Breed; t1._as(a); t1._as(b); for (t1 = this._box_0.comparisons, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { compare = t1[_i].call$2(a, b); if (compare !== 0) return compare; } return B.JSString_methods.compareTo$1(A.Log__categorize(a._breed$_name, false, true).toLowerCase(), A.Log__categorize(b._breed$_name, false, true).toLowerCase()); }, $signature: 22 }; A._Sort0.prototype = { get$next() { return B.List_fOO[B.JSInt_methods.$mod(B.JSArray_methods.indexOf$1(B.List_fOO, this) + 1, 4)]; } }; A.HeroResistancesDialog.prototype = { get$name() { return "Resistances"; }, render$1(terminal) { var writeLine, t1, t2, i, _i, element, x, resistance, color, _this = this; _this.super$HeroInfoDialog$render(terminal); writeLine = new A.HeroResistancesDialog_render_writeLine(terminal); terminal.writeAt$4(48, 0, "\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 Resistances \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550", B.Color_38_42_66); _this.drawEquipmentTable$2(terminal, new A.HeroResistancesDialog_render_closure(_this, writeLine, terminal)); terminal.writeAt$4(41, 21, "Totals", B.Color_63_75_115); writeLine.call$2(2, B.Color_38_42_66); writeLine.call$2(20, B.Color_38_42_66); for (t1 = $.$get$Elements_all(), t2 = _this.hero, i = 0, _i = 0; _i < 12; ++_i) { element = t1[_i]; if (element === $.$get$Element_none()) continue; x = 48 + i * 3; terminal.writeAt$4(x, 1, element.abbreviation, A.elementColor(element)); resistance = t2.equipmentResistance$1(element); if (resistance > 0) color = B.Color_22_117_38; else color = resistance < 0 ? B.Color_204_35_57 : B.Color_38_42_66; terminal.writeAt$4(x, 21, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(resistance), 2), color); ++i; } } }; A.HeroResistancesDialog_render_writeLine.prototype = { call$2(y, color) { this.terminal.writeAt$4(2, y, "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500 \u2500\u2500 \u2500\u2500 \u2500\u2500 \u2500\u2500 \u2500\u2500 \u2500\u2500 \u2500\u2500 \u2500\u2500 \u2500\u2500 \u2500\u2500", color); }, $signature: 17 }; A.HeroResistancesDialog_render_closure.prototype = { call$2(item, y) { var t1, t2, i, _i, element, x, resistance, string; this.writeLine.call$2(y - 1, B.Color_20_19_31); if (item == null) return; for (t1 = $.$get$Elements_all(), t2 = this.terminal, i = 0, _i = 0; _i < 12; ++_i) { element = t1[_i]; if (element === $.$get$Element_none()) continue; x = 48 + i * 3; resistance = item.resistance$1(element); string = B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(resistance), 2); if (resistance > 0) t2.writeAt$4(x, y, string, B.Color_22_117_38); else if (resistance < 0) t2.writeAt$4(x, y, string, B.Color_204_35_57); ++i; } }, $signature: 27 }; A.Input.prototype = { toString$0(_) { return "Input(" + this.name + ")"; } }; A.DropDialog.prototype = { get$allowedLocations() { return B.List_g3y; }, get$needsCount() { return true; }, get$helpVerb() { return "Drop"; }, query$1($location) { var t1; $label0$0: { if (B.ItemLocation_Inventory === $location) { t1 = "Drop which item?"; break $label0$0; } if (B.ItemLocation_Equipment === $location) { t1 = "Unequip and drop which item?"; break $label0$0; } t1 = A.throwExpression(A.AssertionError$("Unreachable.")); } return t1; }, queryCount$1($location) { return "Drop how many?"; }, canSelect$1(item) { return true; }, selectItem$3(item, count, $location) { this.gameScreen.game.hero._behavior = new A.ActionBehavior(new A.DropAction(count, $location, item)); this._ui.pop$0(); } }; A.EquipDialog.prototype = { get$needsCount() { return false; }, get$helpVerb() { return "Equip"; }, query$1($location) { var t1; $label0$0: { if (B.ItemLocation_Inventory === $location) { t1 = "Equip which item?"; break $label0$0; } if (B.ItemLocation_Equipment === $location) { t1 = "Unequip which item?"; break $label0$0; } if (B.ItemLocation_ybX === $location) { t1 = "Pick up and equip which item?"; break $label0$0; } t1 = A.throwExpression(A.AssertionError$("Unreachable.")); } return t1; }, canSelect$1(item) { return item.type.equipSlot != null; }, selectItem$3(item, count, $location) { this.gameScreen.game.hero._behavior = new A.ActionBehavior(A.EquipAction$($location, item)); this._ui.pop$0(); } }; A.ItemDialog.prototype = { get$isTransparent() { return true; }, get$allowedLocations() { return B.List_N8X; }, get$showPrices() { return false; }, get$items() { var t1 = this.gameScreen.game, hero = t1.hero, _0_0 = this._item_dialog$_location; $label0$0: { if (B.ItemLocation_Inventory === _0_0) { t1 = hero.save._inventory; break $label0$0; } if (B.ItemLocation_Equipment === _0_0) { t1 = hero.save._equipment; break $label0$0; } if (B.ItemLocation_ybX === _0_0) { t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1 = t1.itemsAt$1(hero._pos); break $label0$0; } t1 = A.throwExpression(A.StateError$("Unexpected location.")); } return t1; }, queryCount$1($location) { return A.throwExpression(A.UnimplementedError$(null)); }, getPrice$1(item) { return type$.Item._as(item).get$price(); }, transfer$3(item, count, destination) { var _this = this; if (!destination.canAdd$1(item)) { _this.gameScreen.game.hero.save.log._log$_add$5(B.LogType_1, "Not enough room for " + item.clone$1(count).toString$0(0) + ".", null, null, null); _this.dirty$0(); return; } if (count === item._count) { destination.tryAdd$1(item); _this.get$items().remove$1(0, item); } else { destination.tryAdd$1(item.splitStack$1(count)); _this.get$items().countChanged$0(); } _this.afterTransfer$2(item, count); _this._ui.pop$0(); }, afterTransfer$2(item, count) { }, handleInput$1(input) { var _this = this, _0_0 = _this._selectedItem; if (_0_0 != null) { if (B.Input_ok === input) { _this.selectItem$3(_0_0, _this._item_dialog$_count, _this._item_dialog$_location); return true; } if (B.Input_cancel === input) { _this._selectedItem = null; _this.dirty$0(); return true; } if (B.Input_n === input && _this._item_dialog$_count < _0_0._count) { ++_this._item_dialog$_count; _this.dirty$0(); return true; } if (B.Input_s === input && _this._item_dialog$_count > 1) { --_this._item_dialog$_count; _this.dirty$0(); return true; } } else if (input === B.Input_cancel) { _this._ui.pop$0(); return true; } return false; }, keyDown$3$alt$shift(keyCode, alt, shift) { var t1, index, count, t2, _this = this; if (keyCode === 16) { _this._item_dialog$_shiftDown = true; _this.dirty$0(); return true; } if (alt) return false; t1 = _this._item_dialog$_shiftDown; if (t1 && keyCode === 27) { _this._item_dialog$_inspected = null; _this.dirty$0(); return true; } if (_this._selectedItem != null) return false; if (keyCode >= 65 && keyCode <= 90) { _this._selectItem$1(keyCode - 65); return true; } if (keyCode === 9 && !t1 && _this.get$allowedLocations().length > 1) { t1 = shift ? -1 : 1; index = B.JSArray_methods.indexOf$1(_this.get$allowedLocations(), _this._item_dialog$_location); count = _this.get$allowedLocations().length; t2 = _this.get$allowedLocations(); t1 = B.JSInt_methods.$mod(index + count + t1, count); if (!(t1 < t2.length)) return A.ioore(t2, t1); _this._item_dialog$_location = t2[t1]; _this.dirty$0(); return true; } return false; }, keyUp$3$alt$shift(keyCode, alt, shift) { if (keyCode === 16) { this._item_dialog$_shiftDown = false; this.dirty$0(); return true; } return false; }, render$1(terminal) { var t1, t2, t3, t4, _1_0, itemsTop, _1_6, itemsWidth, itemsLeft, t5, t6, queryText, helpKeys, _this = this, _s20_ = "Unexpected location.", _s12_ = "Inspect item", _0_0 = _this._item_dialog$_location; $label0$0: { if (B.ItemLocation_Inventory === _0_0) { t1 = 24; break $label0$0; } if (B.ItemLocation_Equipment === _0_0) { t1 = 9; break $label0$0; } if (B.ItemLocation_ybX === _0_0) { t1 = _this.get$items(); t1 = Math.min(t1.get$length(t1), 26); break $label0$0; } t1 = A.throwExpression(A.StateError$(_s20_)); } t2 = _this.gameScreen; t3 = t2.itemPanel; t4 = t3._bounds; if (t4 != null) { _1_0 = _this._item_dialog$_location; $label1$1: { itemsTop = 0; if (B.ItemLocation_Inventory === _1_0) { t3 = t3.get$inventoryTop(); break $label1$1; } if (B.ItemLocation_Equipment === _1_0) { t3 = itemsTop; break $label1$1; } _1_6 = B.ItemLocation_ybX === _1_0; if (_1_6 && t4.size.y > 50 && t1 > 5) { t3 = Math.max(0, t3.get$onGroundTop() - t1 + 5); break $label1$1; } if (_1_6 && t4.size.y > 50) { t3 = t3.get$onGroundTop(); break $label1$1; } if (_1_6) { t3 = itemsTop; break $label1$1; } t3 = A.throwExpression(A.StateError$(_s20_)); } itemsWidth = Math.max(46, t4.size.x + 2); itemsLeft = terminal._display._glyphs.bounds.size.x - itemsWidth; itemsTop = t3; } else { t3 = t2.__GameScreen__stagePanel_F; t3 === $ && A.throwLateFieldNI("_stagePanel"); t3 = t3._bounds; itemsLeft = t3.get$right() - 46; itemsTop = t3.pos.y; itemsWidth = 46; } t3 = _this.get$items(); t4 = _this._selectedItem == null && _this._item_dialog$_shiftDown; t5 = _this.get$showPrices(); t6 = _this._item_dialog$_inspected; A.renderItems(terminal, t3, _this.get$_item_dialog$_canSelect(), true, t4, _this.get$getPrice(), t6, false, t1, itemsLeft, t2.game.hero.save, true, t5, itemsTop, itemsWidth); if (_this._selectedItem == null) queryText = _this._item_dialog$_shiftDown ? "Inspect which item?" : _this.query$1(_this._item_dialog$_location); else queryText = _this.queryCount$1(_this._item_dialog$_location) + " " + _this._item_dialog$_count; if (_this._selectedItem == null) { t1 = type$.String; if (_this._item_dialog$_shiftDown) { t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); t1.$indexSet(0, "A-Z", _s12_); if (_this._item_dialog$_inspected != null) t1.$indexSet(0, "`", "Hide inspector"); helpKeys = t1; } else { t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); t1.$indexSet(0, "A-Z", "Select item"); t1.$indexSet(0, "Shift", _s12_); if (_this.get$allowedLocations().length > 1) t1.$indexSet(0, "Tab", "Switch view"); helpKeys = t1; } } else { t1 = type$.String; helpKeys = A.LinkedHashMap_LinkedHashMap$_literal(["OK", _this.get$helpVerb(), "\u2195", "Change quantity", "`", "Cancel"], t1, t1); } A.Draw_helpKeys(terminal, helpKeys, queryText); }, _item_dialog$_canSelect$1(item) { var t1, _this = this; if (_this._item_dialog$_shiftDown && _this._selectedItem == null) return true; t1 = _this._selectedItem; if (t1 != null) return item === t1; return _this.canSelect$1(item); }, _selectItem$1(index) { var item, _this = this, items = J.toList$0$ax(_this.get$items().get$slots()), t1 = items.length; if (index >= t1) return; if (!(index >= 0)) return A.ioore(items, index); item = items[index]; if (item == null) return; if (_this._item_dialog$_shiftDown) { _this._item_dialog$_inspected = item; _this.dirty$0(); } else { if (!_this.canSelect$1(item)) return; if (item._count > 1 && _this.get$needsCount()) { _this._selectedItem = item; _this._item_dialog$_inspected = null; _this._item_dialog$_count = item._count; _this.dirty$0(); } else _this.selectItem$3(item, 1, _this._item_dialog$_location); } } }; A.ItemInspector.prototype = { ItemInspector$3$wide(hero, _item, wide) { var _this = this, t1 = _this._item, t2 = t1.type; if (t2.attack != null) _this._attackSection = new A._AttackSection(hero, t1); if (t2.armor + t1.get$armorModifier() !== 0 || t2.defense != null) _this._defenseSection = new A._DefenseSection(t1); if (t2.equipSlot != null) _this._resistancesSection = new A._ResistancesSection(t1); t1 = t2.use; if (t1 != null) { t2 = wide ? 78 : 34; _this._useSection = new A._TextSection(A.Log_wordWrap(t2, t1.description), "Use"); } }, draw$3(x, itemY, terminal) { var _1_0, _2_0, _3_0, t2, height, t3, y, _i, section, _this = this, t1 = A._setArrayType([], type$.JSArray__Section), _0_0 = _this._attackSection; if (_0_0 != null) t1.push(_0_0); _1_0 = _this._defenseSection; if (_1_0 != null) t1.push(_1_0); _2_0 = _this._resistancesSection; if (_2_0 != null) t1.push(_2_0); _3_0 = _this._useSection; if (_3_0 != null) t1.push(_3_0); t2 = _this.__ItemInspector__descriptionSection_F; t2 === $ && A.throwLateFieldNI("_descriptionSection"); t1.push(t2); height = 4 + _this._sectionsHeight$1(t1); terminal = terminal.rect$4(x, B.JSInt_methods.clamp$2(itemY - 1, 0, terminal.get$height() - 4 - height), 34, height); t2 = terminal.size; t3 = _this._item; A.Draw_glyphFrame(terminal, 0, 0, t2.x, t2.y, t3.type.appearance, t3.get$nounText()); for (t2 = t1.length, y = 3, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { section = t1[_i]; terminal.writeAt$4(1, y, section.get$header() + ":", B.Color_222_156_33); section._drawContent$2(terminal, y + 1); y = y + section.get$height() + 2; } }, _sectionsHeight$1(sections) { var t1, height, _i, t2; type$.List__Section._as(sections); for (t1 = sections.length, height = 0, _i = 0; t2 = sections.length, _i < t2; sections.length === t1 || (0, A.throwConcurrentModificationError)(sections), ++_i) height += sections[_i].get$height() + 1; return height + t2 - 1; } }; A._Section.prototype = { draw$2(terminal, y) { terminal.writeAt$4(1, y, this.get$header() + ":", B.Color_222_156_33); this._drawContent$2(terminal, y + 1); return y + this.get$height() + 2; }, _writeBonus$4(terminal, x, y, bonus) { var t1, t2, string = B.JSInt_methods.toString$0(Math.abs(bonus)); if (bonus > 0) { t1 = string.length; terminal.writeAt$4(x + 2 - t1, y, "+", B.Color_0_64_39); terminal.writeAt$4(x + 3 - t1, y, string, B.Color_22_117_38); } else { t1 = string.length; t2 = x + 2 - t1; t1 = x + 3 - t1; if (bonus < 0) { terminal.writeAt$4(t2, y, "-", B.Color_84_0_39); terminal.writeAt$4(t1, y, string, B.Color_204_35_57); } else { terminal.writeAt$4(t2, y, "+", B.Color_38_42_66); terminal.writeAt$4(t1, y, string, B.Color_38_42_66); } } }, _writeStat$4(terminal, y, label, value) { terminal.writeAt$4(1, y, label + ":", B.Color_132_126_135); terminal.writeAt$4(12, y, B.JSInt_methods.toString$0(value), B.Color_226_223_240); }, _writeScale$4(terminal, x, y, scale) { var xColor, numberColor, string = B.JSNumber_methods.toStringAsFixed$1(scale, 1); if (scale > 1) { xColor = B.Color_0_64_39; numberColor = B.Color_22_117_38; } else if (scale < 1) { xColor = B.Color_84_0_39; numberColor = B.Color_204_35_57; } else { xColor = B.Color_38_42_66; numberColor = B.Color_38_42_66; } terminal.writeAt$4(x, y, "x", xColor); terminal.writeAt$4(x + 1, y, string, numberColor); } }; A._AttackSection.prototype = { get$header() { return "Attack"; }, get$height() { var t1 = this._item, height = t1.get$strikeBonus() !== 0 ? 3 : 2; return t1.type.attack.range > 0 ? height + 1 : height; }, _drawContent$2(terminal, y) { var t1, t2, t3, color, _this = this; terminal.writeAt$4(1, y, "Damage:", B.Color_132_126_135); t1 = _this._item; if (t1.get$element() !== $.$get$Element_none()) terminal.writeAt$4(9, y, t1.get$element().abbreviation, A.elementColor(t1.get$element())); t2 = t1.type.attack; t3 = t2.damage; terminal.writeAt$4(12, y, B.JSInt_methods.toString$0(t3), B.Color_132_126_135); _this._writeScale$4(terminal, 16, y, t1.get$damageScale()); _this._writeBonus$4(terminal, 20, y, t1.get$damageBonus()); terminal.writeAt$4(25, y, "=", B.Color_38_42_66); terminal.writeAt$4(27, y, B.JSString_methods.padLeft$1(B.JSNumber_methods.toStringAsFixed$1(t3 * t1.get$damageScale() + t1.get$damageBonus(), 2), 6), B.Color_179_74_4); ++y; if (t1.get$strikeBonus() !== 0) { terminal.writeAt$4(1, y, "Strike:", B.Color_132_126_135); _this._writeBonus$4(terminal, 12, y, t1.get$strikeBonus()); ++y; } t2 = t2.range; if (t2 > 0) { _this._writeStat$4(terminal, y, "Range", t2); ++y; } terminal.writeAt$4(1, y, "Heft:", B.Color_132_126_135); t2 = _this._item_inspector$_hero.strength; t3 = t2._stat$_value; t3.toString; color = t3 >= t1.get$heft() ? B.Color_226_223_240 : B.Color_204_35_57; terminal.writeAt$4(12, y, B.JSInt_methods.toString$0(t1.get$heft()), color); _this._writeScale$4(terminal, 16, y, t2.heftScale$1(t1.get$heft())); } }; A._DefenseSection.prototype = { get$header() { return "Defense"; }, get$height() { var t1 = this._item, t2 = t1.type, result = t2.defense != null ? 2 : 1; return t2.armor + t1.get$armorModifier() !== 0 ? result + 1 : result; }, _drawContent$2(terminal, y) { var _this = this, t1 = _this._item, t2 = t1.type, t3 = t2.defense; if (t3 != null) { _this._writeStat$4(terminal, y, "Dodge", t3.amount); ++y; } t2 = t2.armor; if (t2 + t1.get$armorModifier() !== 0) { terminal.writeAt$4(1, y, "Armor:", B.Color_132_126_135); terminal.writeAt$4(12, y, B.JSInt_methods.toString$0(t2), B.Color_132_126_135); _this._writeBonus$4(terminal, 16, y, t1.get$armorModifier()); terminal.writeAt$4(25, y, "=", B.Color_38_42_66); terminal.writeAt$4(27, y, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(t2 + t1.get$armorModifier()), 6), B.Color_22_117_38); ++y; } _this._writeStat$4(terminal, y, "Weight", t1.get$weight()); } }; A._ResistancesSection.prototype = { get$header() { return "Resistances"; }, get$height() { return 2; }, _drawContent$2(terminal, y) { var t1, t2, t3, x, _i, element, resistance, t4; for (t1 = $.$get$Elements_all(), t2 = this._item, t3 = y + 1, x = 1, _i = 0; _i < 12; ++_i) { element = t1[_i]; if (element === $.$get$Element_none()) continue; resistance = t2.resistance$1(element); this._writeBonus$4(terminal, x - 1, y, resistance); t4 = resistance === 0 ? B.Color_38_42_66 : A.elementColor(element); terminal.writeAt$4(x, t3, element.abbreviation, t4); x += 3; } } }; A._TextSection.prototype = { get$height() { return this._lines.length; }, _drawContent$2(terminal, y) { var t1, t2, _i; for (t1 = this._lines, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { terminal.writeAt$4(1, y, t1[_i], B.Color_132_126_135); ++y; } }, get$header() { return this.header; } }; A.renderItems_drawStat.prototype = { call$4(symbol, stat, light, dark) { var t4, _this = this, string = J.toString$0$(stat), statLeft = _this._box_1.statRight - string.length - 1, t1 = _this.terminal, t2 = _this.y, t3 = _this._box_0; t1.drawGlyph$3(statLeft, t2, A.Glyph$fromCharCode(symbol, t3.enabled ? dark : B.Color_38_42_66, null)); t4 = t3.enabled ? light : B.Color_38_42_66; t1.writeAt$4(statLeft + 1, t2, string, t4); t3.nameRight = statLeft; }, $signature: 119 }; A.PickUpDialog.prototype = { get$allowedLocations() { return B.List_zFd; }, get$needsCount() { return true; }, get$helpVerb() { return "Pick up"; }, query$1($location) { return "Pick up which item?"; }, queryCount$1($location) { return "Pick up how many?"; }, canSelect$1(item) { return true; }, selectItem$3(item, count, $location) { this.gameScreen.game.hero._behavior = new A.ActionBehavior(A.PickUpAction$(item)); this._ui.pop$0(); } }; A._PutDialog.prototype = { get$allowedLocations() { return B.List_g3y; }, get$needsCount() { return true; }, get$helpVerb() { return "Put"; }, query$1($location) { return "Put which item?"; }, queryCount$1($location) { return "Put how many?"; }, canSelect$1(item) { return true; } }; A.PutCrucibleDialog.prototype = { selectItem$3(item, count, $location) { this.transfer$3(item, count, this.gameScreen.game.hero.save._crucible); }, afterTransfer$2(item, count) { this.gameScreen.game.hero.save.log._log$_add$5(B.LogType_0, "You place " + item.clone$1(count).toString$0(0) + " into the crucible.", null, null, null); this._onTransfer.call$0(); } }; A.PutHomeDialog.prototype = { selectItem$3(item, count, $location) { this.transfer$3(item, count, this.gameScreen.game.hero.save._home); }, afterTransfer$2(item, count) { this.gameScreen.game.hero.save.log._log$_add$5(B.LogType_0, "You put " + item.clone$1(count).toString$0(0) + " safely into your home.", null, null, null); } }; A.SellDialog.prototype = { get$allowedLocations() { return B.List_g3y; }, get$needsCount() { return true; }, get$showPrices() { return true; }, get$helpVerb() { return "Sell"; }, query$1($location) { return "Sell which item?"; }, queryCount$1($location) { return "Sell how many?"; }, canSelect$1(item) { return item.get$price() !== 0; }, getPrice$1(item) { return B.JSNumber_methods.floor$0(type$.Item._as(item).get$price() * 0.75); }, selectItem$3(item, count, $location) { this.transfer$3(item, count, this._sell_dialog$_shop); }, afterTransfer$2(item, count) { var itemText = item.clone$1(count).get$nounText(), price = B.JSNumber_methods.floor$0(item.get$price() * 0.75) * count, t1 = this.gameScreen.game.hero.save; t1.log._log$_add$5(B.LogType_0, "You sell " + itemText + " for " + price + " gold.", null, null, null); t1.gold += price; } }; A.TossDialog.prototype = { get$needsCount() { return false; }, get$helpVerb() { return "Toss"; }, query$1($location) { var t1; $label0$0: { if (B.ItemLocation_Inventory === $location) { t1 = "Throw which item?"; break $label0$0; } if (B.ItemLocation_Equipment === $location) { t1 = "Unequip and throw which item?"; break $label0$0; } if (B.ItemLocation_ybX === $location) { t1 = "Pick up and throw which item?"; break $label0$0; } t1 = A.throwExpression(A.AssertionError$("Unreachable.")); } return t1; }, canSelect$1(item) { return item.type.toss != null; }, selectItem$3(item, count, $location) { var t2, hit = A.Hit$_(item.type.toss.attack), t1 = this.gameScreen; t1.game.hero.modifyHit$2(hit, B.HitType_2); t2 = this._ui; t2.toString; t2.goTo$1(A.TargetDialog$(t1, hit.get$range(), new A.TossDialog_selectItem_closure(this, $location, item, hit))); } }; A.TossDialog_selectItem_closure.prototype = { call$1(target) { var _this = this; _this.$this.gameScreen.game.hero._behavior = new A.ActionBehavior(new A.TossAction(_this.hit, target, _this.location, _this.item)); }, $signature: 12 }; A.TownScreen.prototype = { get$_destination() { return null; }, get$isTransparent() { return true; }, get$_canSelectAny() { return false; }, get$_showPrices() { return false; }, _canSelect$1(item) { if (this._shiftDown) return true; return this.canSelect$1(item); }, canSelect$1(item) { return true; }, handleInput$1(input) { this._town_screen$_error = null; if (input === B.Input_cancel) { this._ui.pop$0(); return true; } return false; }, keyDown$3$alt$shift(keyCode, alt, shift) { var index, item, t1, t2, _this = this; _this._town_screen$_error = null; if (keyCode === 16) { _this._shiftDown = true; _this.dirty$0(); return true; } if (alt) return false; if (_this._shiftDown && keyCode === 27) { _this._inspected = null; _this.dirty$0(); return true; } if (keyCode >= 65 && keyCode <= 90) { index = keyCode - 65; if (index >= _this.get$_town_screen$_items().get$length(0)) return false; item = _this.get$_town_screen$_items().elementAt$1(0, index); if (item == null) return false; if (_this._shiftDown) { _this._inspected = item; _this.dirty$0(); } else { if (!_this.get$_canSelectAny() || !_this.canSelect$1(item)) return false; if (item._count > 1) { _this._town_screen$_isActive = false; t1 = _this._ui; t1.toString; type$._ItemVerbScreen._as(_this); t2 = new A._CountScreen(_this, item, _this._initialCount$1(item), _this._town_screen$_gameScreen); t2._inspected = item; t1.push$1(t2); return true; } if (_this._transfer$2(item, 1)) { _this._ui.pop$0(); return true; } } } return false; }, keyUp$3$alt$shift(keyCode, alt, shift) { if (keyCode === 16) { this._shiftDown = false; this.dirty$0(); return true; } return false; }, activate$2(popped, result) { var _this = this; type$.Screen_Input._as(popped); _this._town_screen$_isActive = true; _this._inspected = null; if (popped instanceof A._CountScreen && result != null) if (_this._transfer$2(popped._town_screen$_item, A._asInt(result))) _this._ui.pop$0(); }, render$1(terminal) { var t1, t2, t3, t4, t5, t6, t7, t8, t9, _this = this; if (_this._town_screen$_isActive) if (_this._shiftDown) { t1 = type$.String; t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); t1.$indexSet(0, "A-Z", "Inspect item"); if (_this._inspected != null) t1.$indexSet(0, "`", "Hide inspector"); A.Draw_helpKeys(terminal, t1, "Inspect which item?"); } else A.Draw_helpKeys(terminal, _this.get$_helpKeys(), _this.get$_headerText()); t1 = _this.get$_town_screen$_items(); t2 = _this._town_screen$_gameScreen; t3 = t2.__GameScreen__stagePanel_F; t3 === $ && A.throwLateFieldNI("_stagePanel"); t3 = t3._bounds; t4 = t3.pos; t3 = Math.min(46, t3.size.x); t5 = _this.get$_town_screen$_items()._items.length; t6 = _this._shiftDown; t7 = _this.get$_showPrices(); t8 = _this._town_screen$_isActive ? _this._inspected : null; t9 = _this._shiftDown || _this.get$_canSelectAny(); A.renderItems(terminal, t1, _this.get$_canSelect(), t9, t6, _this.get$_itemPrice(), t8, true, t5, t4.x, t2.game.hero.save, true, t7, t4.y, t3); t1 = _this._town_screen$_error; if (t1 != null) terminal.writeAt$4(0, 32, t1, B.Color_204_35_57); }, _initialCount$1(item) { return item._count; }, _maxCount$1(item) { return item._count; }, _itemPrice$1(item) { type$.Item._as(item); return null; }, _transfer$2(item, count) { var _this = this, destination = _this.get$_destination(); if (!destination.canAdd$1(item)) { _this._town_screen$_error = "Not enough room for " + item.clone$1(count).toString$0(0) + "."; _this.dirty$0(); return false; } if (count === item._count) { destination.tryAdd$1(item); B.JSArray_methods.remove$1(_this.get$_town_screen$_items()._items, item); } else { destination.tryAdd$1(item.splitStack$1(count)); _this.get$_town_screen$_items().countChanged$0(); } _this._afterTransfer$2(item, count); return true; }, _afterTransfer$2(item, count) { } }; A._ItemVerbScreen.prototype = {}; A._HomeScreen.prototype = { get$_town_screen$_items() { return this._town_screen$_gameScreen.game.hero.save._home; }, get$_headerText() { return "Welcome home!"; }, get$_helpKeys() { var t1 = type$.String; return A.LinkedHashMap_LinkedHashMap$_literal(["G", "Get item", "P", "Put item", "Shift", "Inspect item", "Tab", "Use crucible", "`", "Leave"], t1, t1); }, keyDown$3$alt$shift(keyCode, alt, shift) { var $screen, t1, t2, _this = this; if (_this.super$TownScreen$keyDown(keyCode, alt, shift)) return true; if (shift || alt) return false; switch (keyCode) { case 71: $screen = new A._GetFromHomeScreen(_this._town_screen$_gameScreen); $screen._inspected = _this._inspected; _this._town_screen$_isActive = false; _this._ui.push$1($screen); return true; case 80: _this._town_screen$_isActive = false; _this._ui.push$1(new A.PutHomeDialog(_this._town_screen$_gameScreen, B.ItemLocation_Inventory)); return true; case 9: t1 = _this._ui; t1.toString; t2 = new A._CrucibleScreen(_this._town_screen$_gameScreen); t2._refreshRecipe$0(); t1.goTo$1(t2); return true; } return false; } }; A._GetScreen.prototype = { get$_headerText() { return "Get which item?"; }, get$_verb() { return "Get"; }, get$_helpKeys() { var t1 = type$.String; return A.LinkedHashMap_LinkedHashMap$_literal(["A-Z", "Select item", "Shift", "Inspect item", "`", "Cancel"], t1, t1); }, get$_destination() { return this._town_screen$_gameScreen.game.hero.save._inventory; }, get$_canSelectAny() { return true; }, canSelect$1(item) { return true; }, _afterTransfer$2(item, count) { var t1 = this._town_screen$_gameScreen.game; t1.hero.pickUp$2(t1, item); } }; A._GetFromHomeScreen.prototype = { get$_town_screen$_items() { return this._town_screen$_gameScreen.game.hero.save._home; }, _afterTransfer$2(item, count) { this._town_screen$_gameScreen.game.hero.save.log._log$_add$5(B.LogType_0, "You take " + item.clone$1(count).toString$0(0) + " from your home.", null, null, null); this.super$_GetScreen$_afterTransfer(item, count); } }; A._GetFromCrucibleScreen.prototype = { get$_town_screen$_items() { return this._town_screen$_gameScreen.game.hero.save._crucible; }, _afterTransfer$2(item, count) { this._town_screen$_gameScreen.game.hero.save.log._log$_add$5(B.LogType_0, "You remove " + item.clone$1(count).toString$0(0) + " from the crucible.", null, null, null); this.super$_GetScreen$_afterTransfer(item, count); this._town_screen$_onTransfer.call$0(); } }; A._CrucibleScreen.prototype = { get$_town_screen$_items() { return this._town_screen$_gameScreen.game.hero.save._crucible; }, get$_headerText() { return this._completeRecipe != null ? "Ready to forge item!" : "Place items to complete a recipe."; }, get$_helpKeys() { var t1 = type$.String; t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); t1.$indexSet(0, "G", "Get item"); t1.$indexSet(0, "P", "Put item"); t1.$indexSet(0, "Shift", "Inspect item"); if (this._completeRecipe != null) t1.$indexSet(0, "Space", "Forge item"); t1.$indexSet(0, "Tab", "Back to home"); t1.$indexSet(0, "`", "Leave"); return t1; }, render$1(terminal) { var t1, t2, width, t3, _0_0; this.super$TownScreen$render(terminal); t1 = this._town_screen$_gameScreen; t2 = t1.__GameScreen__stagePanel_F; t2 === $ && A.throwLateFieldNI("_stagePanel"); t2 = t2._bounds; width = Math.min(46, t2.size.x); t2 = t2.pos; t1 = t1.game.hero.save._crucible; t3 = width - 8; terminal = new A.PortTerminal(new A.Vec(t3, 3), t2.x + 4, t2.y + t1._items.length + 1, terminal); A.Draw__box(terminal, 0, 0, t3, 3, null, "\u250c", "\u2500", "\u2510", "\u2502", "\u2514", "\u2500", "\u2518"); terminal.writeAt$4(0, 0, "\u252c", B.Color_38_42_66); terminal.writeAt$4(t3 - 1, 0, "\u252c", B.Color_38_42_66); _0_0 = this._completeRecipe; if (_0_0 != null) terminal.writeAt$4(1, 1, "Forge a " + _0_0.produces, B.Color_226_223_240); else if (!t1.get$iterator(0).moveNext$0()) terminal.writeAt$4(1, 1, "Add ingredients to crucible", B.Color_38_42_66); else terminal.writeAt$4(1, 1, "Not a complete recipe", B.Color_38_42_66); }, keyDown$3$alt$shift(keyCode, alt, shift) { var $screen, t1, t2, _this = this; if (_this.super$TownScreen$keyDown(keyCode, alt, shift)) return true; if (shift || alt) return false; if (71 === keyCode) { $screen = new A._GetFromCrucibleScreen(_this.get$_refreshRecipe(), _this._town_screen$_gameScreen); $screen._inspected = _this._inspected; _this._town_screen$_isActive = false; _this._ui.push$1($screen); return true; } if (80 === keyCode) { _this._town_screen$_isActive = false; _this._ui.push$1(new A.PutCrucibleDialog(_this.get$_refreshRecipe(), _this._town_screen$_gameScreen, B.ItemLocation_Inventory)); return true; } if (32 === keyCode && _this._completeRecipe != null) { t1 = _this._town_screen$_gameScreen.game.hero.save; t2 = t1._crucible; B.JSArray_methods.clear$0(t2._items); t2._lastUnequipped = null; _this._completeRecipe.result.dropItem$3(t1.lore, 1, t2.get$tryAdd()); _this._refreshRecipe$0(); _this.dirty$0(); return true; } if (9 === keyCode) { _this._ui.goTo$1(new A._HomeScreen(_this._town_screen$_gameScreen)); return true; } return false; }, _afterTransfer$2(item, count) { this._refreshRecipe$0(); }, _refreshRecipe$0() { var t1, t2, t3, _i, recipe, missing; this._completeRecipe = null; for (t1 = $.Recipes_all.length, t2 = this._town_screen$_gameScreen.game.hero.save._crucible, t3 = type$.Iterable_Item, _i = 0; _i < $.Recipes_all.length; $.Recipes_all.length === t1 || (0, A.throwConcurrentModificationError)($.Recipes_all), ++_i) { recipe = $.Recipes_all[_i]; missing = recipe._missingIngredients$1(t3._as(t2)); if (missing != null && missing.__js_helper$_length === 0) { this._completeRecipe = recipe; return; } } } }; A._ShopScreen.prototype = { get$_town_screen$_items() { return this._shop; }, get$_headerText() { return "What can I interest you in?"; }, get$_showPrices() { return true; }, get$_helpKeys() { var t1 = type$.String; return A.LinkedHashMap_LinkedHashMap$_literal(["B", "Buy item", "S", "Sell item", "Shift", "Inspect item", "`", "Cancel"], t1, t1); }, keyDown$3$alt$shift(keyCode, alt, shift) { var $screen, _this = this; if (_this.super$TownScreen$keyDown(keyCode, alt, shift)) return true; if (shift || alt) return false; switch (keyCode) { case 66: $screen = new A._ShopBuyScreen(_this._shop, _this._town_screen$_gameScreen); $screen._inspected = _this._inspected; _this._town_screen$_isActive = false; _this._ui.push$1($screen); break; case 83: _this._town_screen$_isActive = false; _this._ui.push$1(new A.SellDialog(_this._shop, _this._town_screen$_gameScreen, B.ItemLocation_Inventory)); return true; } return false; }, _itemPrice$1(item) { return type$.Item._as(item).get$price(); } }; A._ShopBuyScreen.prototype = { get$_headerText() { return "Buy which item?"; }, get$_verb() { return "Buy"; }, get$_helpKeys() { var t1 = type$.String; return A.LinkedHashMap_LinkedHashMap$_literal(["A-Z", "Select item", "Shift", "Inspect item", "`", "Cancel"], t1, t1); }, get$_town_screen$_items() { return this._shop; }, get$_destination() { return this._town_screen$_gameScreen.game.hero.save._inventory; }, get$_canSelectAny() { return true; }, get$_showPrices() { return true; }, canSelect$1(item) { return item.get$price() <= this._town_screen$_gameScreen.game.hero.save.gold; }, _initialCount$1(item) { return 1; }, _maxCount$1(item) { return Math.min(item._count, B.JSInt_methods.$tdiv(this._town_screen$_gameScreen.game.hero.save.gold, item.get$price())); }, _itemPrice$1(item) { return type$.Item._as(item).get$price(); }, _afterTransfer$2(item, count) { var price = item.get$price() * count, t1 = this._town_screen$_gameScreen.game, t2 = t1.hero, t3 = t2.save; t3.log._log$_add$5(B.LogType_0, "You buy " + item.clone$1(count).toString$0(0) + " for " + price + " gold.", null, null, null); t3.gold -= price; t2.pickUp$2(t1, item); } }; A._CountScreen.prototype = { get$_town_screen$_items() { return this._parent.get$_town_screen$_items(); }, get$_headerText() { var priceString, _this = this, t1 = _this._town_screen$_item, itemText = t1.clone$1(_this._town_screen$_count).get$nounText(), t2 = _this._parent, price = t2._itemPrice$1(t1); if (price != null) { priceString = A.formatMoney(price * _this._town_screen$_count); return t2.get$_verb() + " " + itemText + " for " + priceString + " gold?"; } else return t2.get$_verb() + " " + itemText + "?"; }, get$_helpKeys() { var t1 = type$.String; return A.LinkedHashMap_LinkedHashMap$_literal(["OK", this._parent.get$_verb(), "\u2195", "Change quantity", "`", "Cancel"], t1, t1); }, get$_canSelectAny() { return true; }, canSelect$1(item) { return item === this._town_screen$_item; }, keyDown$3$alt$shift(keyCode, alt, shift) { if (keyCode === 16) return false; return this.super$TownScreen$keyDown(keyCode, alt, shift); }, keyUp$3$alt$shift(keyCode, alt, shift) { return false; }, handleInput$1(input) { var _this = this; $label0$0: { if (B.Input_ok === input) { _this._ui.pop$1(_this._town_screen$_count); break $label0$0; } if (B.Input_cancel === input) { _this._ui.pop$0(); break $label0$0; } if (B.Input_n === input && _this._town_screen$_count < _this._parent._maxCount$1(_this._town_screen$_item)) { ++_this._town_screen$_count; break $label0$0; } if (B.Input_s === input && _this._town_screen$_count > 1) { --_this._town_screen$_count; break $label0$0; } if (B.Input_runN === input) { _this._town_screen$_count = _this._parent._maxCount$1(_this._town_screen$_item); break $label0$0; } if (B.Input_runS === input) { _this._town_screen$_count = 1; break $label0$0; } return false; } _this.dirty$0(); return true; }, _itemPrice$1(item) { return this._parent._itemPrice$1(type$.Item._as(item)); } }; A.UseDialog.prototype = { get$needsCount() { return false; }, get$helpVerb() { return "Use"; }, query$1($location) { var t1; $label0$0: { if (B.ItemLocation_Inventory === $location || B.ItemLocation_Equipment === $location) { t1 = "Use which item?"; break $label0$0; } if (B.ItemLocation_ybX === $location) { t1 = "Pick up and use which item?"; break $label0$0; } t1 = A.throwExpression(A.AssertionError$("Unreachable.")); } return t1; }, canSelect$1(item) { return item.type.use != null; }, selectItem$3(item, count, $location) { this.gameScreen.game.hero._behavior = new A.ActionBehavior(new A.UseAction($location, item)); this._ui.pop$0(); } }; A.LoadingDialog.prototype = { get$isTransparent() { return true; }, handleInput$1(input) { if (input === B.Input_cancel) { this._ui.pop$1(false); return true; } return false; }, keyDown$3$alt$shift(keyCode, alt, shift) { if (shift || alt) return false; switch (keyCode) { case 78: this._ui.pop$1(false); break; case 89: this._ui.pop$1(true); break; } return true; }, update$0() { var t1, _this = this, stopwatch = new A.Stopwatch(); $.$get$Stopwatch__frequency(); t1 = $.Primitives_timerTicks.call$0(); stopwatch._core$_start = t1; stopwatch._stop = null; for (t1 = _this._steps; stopwatch.get$elapsedMilliseconds() < 16;) if (t1.moveNext$0()) _this.dirty$0(); else { _this._ui.pop$1(_this._loading_dialog$_game); return; } _this._loading_dialog$_frame = (_this._loading_dialog$_frame + 1) % 10; }, render$1(terminal) { var offset, t1 = terminal._display._glyphs.bounds.size; terminal = new A.PortTerminal(new A.Vec(30, 7), B.JSInt_methods._tdivFast$1(t1.x - 30, 2), B.JSInt_methods._tdivFast$1(t1.y - 7, 2), terminal); A.Draw__box(terminal, 0, 0, 30, 7, B.Color_222_156_33, "\u2554", "\u2550", "\u2557", "\u2551", "\u255a", "\u2550", "\u255d"); terminal.writeAt$4(2, 2, "Entering dungeon...", B.Color_132_126_135); offset = B.JSInt_methods._tdivFast$1(this._loading_dialog$_frame, 2); terminal.writeAt$4(2, 4, B.JSString_methods.substring$2(B.JSString_methods.$mul("/ ", 6), offset, offset + 26), B.Color_226_223_240); } }; A.MainMenuScreen.prototype = { handleInput$1(input) { var t1, t2, t3, t4, save, _this = this; if (B.Input_n === input && _this.selectedHero > 0) { --_this.selectedHero; _this._refreshScroll$0(); _this.dirty$0(); return true; } if (B.Input_s === input && _this.selectedHero < _this.storage.heroes.length - 1) { ++_this.selectedHero; _this._refreshScroll$0(); _this.dirty$0(); return true; } if (B.Input_ok === input) { t1 = _this.selectedHero; t2 = _this.storage; t3 = t2.heroes; t4 = t3.length; if (t1 < t4) { if (!(t1 >= 0)) return A.ioore(t3, t1); save = t3[t1]; _this._isActive = false; t1 = _this._ui; t1.toString; t1.push$1(A.GameScreen_GameScreen$town(t2, _this.content, save, false)); } return true; } return false; }, _refreshScroll$0() { var _this = this, t1 = _this._scroll = B.JSInt_methods.clamp$2(_this._scroll, 0, Math.max(_this.storage.heroes.length - 8, 0)), t2 = _this.selectedHero; if (t2 < t1) _this._scroll = t2; else if (t2 >= t1 + 8) _this._scroll = t2 - 8 + 1; }, keyDown$3$alt$shift(keyCode, alt, shift) { var t1, t2, t3, _this = this; if (shift || alt) return false; switch (keyCode) { case 68: t1 = _this.selectedHero; t2 = _this.storage.heroes; t3 = t2.length; if (t1 < t3) { if (!(t1 >= 0)) return A.ioore(t2, t1); t1 = t2[t1]; _this._isActive = false; _this._ui.push$1(new A.ConfirmPopup("Are you sure you want to delete " + t1.name + "?", "delete")); } return true; case 78: _this._isActive = false; t1 = _this._ui; t1.toString; t1.push$1(A.NewHeroScreen$(_this.content, _this.storage)); return true; } return false; }, activate$2(popped, result) { var t1, t2, _this = this; _this._isActive = true; if (popped instanceof A.ConfirmPopup && J.$eq$(result, "delete")) { t1 = _this.storage.heroes; t2 = _this.selectedHero; if (!(t2 >= 0 && t2 < t1.length)) return A.ioore(t1, t2); B.JSArray_methods.remove$1(t1, t1[t2]); t2 = _this.selectedHero; if (t2 > 0 && t2 >= t1.length) _this.selectedHero = t2 - 1; _this._refreshScroll$0(); _this.dirty$0(); } }, resize$1(size) { this._generator = this._game = null; }, update$0() { var t1, _0_0, _this = this; if (!_this._isActive) return; t1 = _this._regenerateDelay; if (t1 > 0) { --t1; _this._regenerateDelay = t1; if (t1 === 0) { _this._game = null; _this.dirty$0(); } return; } _0_0 = _this._generator; if (_0_0 != null) { if (!_0_0.moveNext$0()) { _this._generator = null; _this._regenerateDelay = 300; return; } t1 = _0_0._async$_current; if (J.$eq$(t1 == null ? _0_0.$ti._precomputed1._as(t1) : t1, "Ready to decorate")) _this._lightDungeon = true; if (_this._lightDungeon) { t1 = _this._game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.tileOpacityChanged$0(); t1 = _this._game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1.get$_lighting().refresh$0(); } _this.dirty$0(); } }, render$1(terminal) { var t1, save, t2, game, centerTerminal, y, x, color, i, heroIndex, hero, primary, secondary, _this = this, _0_0 = _this._game; if (_0_0 != null) _this._renderDungeon$2(terminal, _0_0); else { t1 = _this.content; save = t1.createHero$1("Temporary"); t2 = terminal._display._glyphs.bounds.size; game = _this._game = A.Game$(t1, $.$get$rng().inclusive$2(1, 100), save, t2.y, t2.x); t2 = game.generate$0(); _this._generator = new A._SyncStarIterator(t2._outerHelper(), t2.$ti._eval$1("_SyncStarIterator<1>")); _this._lightDungeon = false; _this._renderDungeon$2(terminal, game); } t1 = terminal._display._glyphs.bounds.size; centerTerminal = new A.PortTerminal(new A.Vec(68, 34), B.JSInt_methods._tdivFast$1(t1.x - 68, 2), B.JSInt_methods._tdivFast$1(t1.y - 34, 2), terminal); centerTerminal.fill$4(0, 0, centerTerminal.get$width(), centerTerminal.get$height()); A.Draw__box(centerTerminal, 0, 0, 68, 34, null, "\u2554", "\u2550", "\u2557", "\u2551", "\u255a", "\u2550", "\u255d"); for (y = 0; y < 14; ++y) for (t1 = y + 2, x = 0; x < B.List_Er6[y].length; ++x) { t2 = B.List_Nyg[y]; if (!(x < t2.length)) return A.ioore(t2, x); color = B.Map_SFjnT.$index(0, t2[x]); t2 = B.List_Er6[y]; if (!(x < t2.length)) return A.ioore(t2, x); centerTerminal.writeAt$4(x + 3, t1, t2[x], color); } centerTerminal.writeAt$4(3, 18, "Which hero shall you play?", B.Color_132_126_135); A.Draw_hLine(centerTerminal, 3, 20, 62); A.Draw_hLine(centerTerminal, 3, 29, 62); t1 = _this.storage.heroes; if (t1.length === 0) centerTerminal.writeAt$4(3, 21, "(No heroes. Please create a new one.)", B.Color_38_42_66); else { if (_this._scroll > 0) centerTerminal.writeAt$4(34, 20, "\u25b2", B.Color_222_156_33); if (_this._scroll < t1.length - 8) centerTerminal.writeAt$4(34, 29, "\u25bc", B.Color_222_156_33); for (i = 0; i < 8; ++i) { heroIndex = i + _this._scroll; t2 = t1.length; if (heroIndex >= t2) break; if (!(heroIndex >= 0)) return A.ioore(t1, heroIndex); hero = t1[heroIndex]; if (heroIndex === _this.selectedHero) { centerTerminal.drawGlyph$3(2, 21 + i, new A.Glyph(9658, B.Color_222_156_33, B.Color_0_0_0)); primary = B.Color_222_156_33; secondary = B.Color_222_156_33; } else { primary = B.Color_226_223_240; secondary = B.Color_38_42_66; } t2 = 21 + i; centerTerminal.writeAt$4(3, t2, hero.name, primary); centerTerminal.writeAt$4(34, t2, hero.race.name, secondary); centerTerminal.writeAt$4(42, t2, hero.heroClass.name, secondary); if (hero.permadeath) centerTerminal.writeAt$4(55, t2, "Permadeath", secondary); } } t1 = type$.String; A.Draw_helpKeys(terminal, A.LinkedHashMap_LinkedHashMap$_literal(["OK", "Play", "\u2195", "Change selection", "N", "Create a new hero", "D", "Delete hero"], t1, t1), null); }, _renderDungeon$2(terminal, game) { var t2, y, x, t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); for (t1 = t1.tiles.bounds.size, t2 = t1.y, t1 = t1.x, y = 0; y < t2; ++y) for (x = 0; x < t1; ++x) this._renderTile$3(terminal, game, new A.Vec(x, y)); }, _renderTile$3(terminal, game, pos) { var t2, t3, t4, _0_0, t5, char, fore, $back, items, lightFore, itemGlyph, _1_0, foreShadow, backShadow, back0, t1 = game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = pos.x; t3 = pos.y; t4 = t1.tiles.$get$2(t2, t3); _0_0 = t4.type.appearance; $label0$0: { if (_0_0 instanceof A.Glyph) { t5 = _0_0; break $label0$0; } if (type$.List_Glyph._is(_0_0)) { t5 = _0_0[B.JSInt_methods.$mod(A.hashPoint(t2, t3), _0_0.length)]; break $label0$0; } t5 = B.Glyph_F97; break $label0$0; } char = t5.char; fore = t5.fore; $back = t5.back; items = t1.itemsAt$1(pos); lightFore = items.get$isEmpty(0); if (!lightFore) { itemGlyph = items.get$first(0).type.appearance; char = itemGlyph.char; fore = itemGlyph.fore; } t1 = t1._actorsByTile.$get$2(t2, t3); _1_0 = t1 == null ? null : t1.get$appearance(); if (_1_0 instanceof A.Glyph) { char = _1_0.char; fore = _1_0.fore; lightFore = false; } t1 = new A.MainMenuScreen__renderTile_multiply(); foreShadow = t1.call$2(fore, B.Color_80_80_95); backShadow = t1.call$2($back, B.Color_20_20_35); t4 = new A.MainMenuScreen__renderTile_applyLighting(t4); if (lightFore) fore = t4.call$2(fore, foreShadow); back0 = t4.call$2($back, backShadow); terminal._display.setGlyph$3(t2, t3, A.Glyph$fromCharCode(char, fore, back0)); } }; A.MainMenuScreen__renderTile_multiply.prototype = { call$2(a, b) { return new A.Color(B.JSInt_methods._tdivFast$1(a.r * b.r, 255), B.JSInt_methods._tdivFast$1(a.g * b.g, 255), B.JSInt_methods._tdivFast$1(a.b * b.b, 255)); }, $signature: 15 }; A.MainMenuScreen__renderTile_applyLighting.prototype = { call$2(color, shadow) { var t1 = this.tile, visibility = t1.floorIllumination; if (visibility < 128) color = color.blend$2(shadow, A.lerpDouble(visibility, 0, 127, 1, 0)); else if (visibility > 128) color = color.add$2(0, B.Color_226_223_240, A.lerpDouble(visibility, 128, 255, 0, 0.2)); t1 = t1.actorIllumination; return t1 > 0 ? color.add$2(0, B.Color_200_130_0, A.lerpDouble(t1, 0, 255, 0.05, 0.1)) : color; }, $signature: 15 }; A.NewHeroScreen.prototype = { render$1(terminal) { var t2, t3, _this = this, t1 = type$.String; t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); t1.$indexSet(0, "Tab", "Next field"); t2 = _this._controls; t3 = _this._new_hero_screen$_focus; if (!(t3 >= 0 && t3 < t2.length)) return A.ioore(t2, t3); t1.addAll$1(0, t2[t3].get$helpKeys()); if (_this._new_hero_screen$_name._isUnique) t1.$indexSet(0, "Enter", "Create hero"); t1.$indexSet(0, "`", "Cancel"); A.Draw_dialog(terminal, 80, 40, new A.NewHeroScreen_render_closure(_this), t1, "Out of the forgotten wilderness, a hero appears..."); }, _renderRace$1(terminal) { var race, y, _i, stat, t1 = $.$get$Races_all(), t2 = this._race.selected; if (!(t2 >= 0 && t2 < 5)) return A.ioore(t1, t2); race = t1[t2]; this._renderText$2(terminal, race.description); for (t1 = race._statScales, y = 3, _i = 0; _i < 4; ++_i) { stat = B.List_f5z[_i]; terminal.writeAt$4(0, y, B.JSString_methods.substring$2(stat.name, 0, 3), B.Color_38_42_66); t2 = t1.$index(0, stat); t2.toString; A.Draw_thinMeter(terminal, 4, y, 14, B.JSNumber_methods.toInt$0(t2 * 100), 200, null, null); ++y; } }, _renderText$2(terminal, description) { var t1, t2, y, _i; for (t1 = A.Log_wordWrap(59, description), t2 = t1.length, y = 3, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { terminal.writeAt$4(19, y, t1[_i], B.Color_132_126_135); ++y; } }, handleInput$1(input) { var _this = this, t1 = _this._controls, t2 = _this._new_hero_screen$_focus; if (!(t2 >= 0 && t2 < t1.length)) return A.ioore(t1, t2); if (t1[t2].handleInput$1(input)) { _this.dirty$0(); return true; } switch (input) { case B.Input_cancel: _this._ui.pop$0(); return true; } return false; }, keyDown$3$alt$shift(keyCode, alt, shift) { var t3, t4, t5, hero, offset, _this = this, t1 = _this._controls, t2 = _this._new_hero_screen$_focus; if (!(t2 >= 0 && t2 < t1.length)) return A.ioore(t1, t2); if (t1[t2].keyDown$3$alt$shift(keyCode, alt, shift)) { _this.dirty$0(); return true; } if (alt) return false; if (13 === keyCode && _this._new_hero_screen$_name._isUnique) { t1 = _this._content; t2 = _this._new_hero_screen$_name; t3 = t2._enteredName; t2 = t3.length !== 0 ? t3 : t2._defaultName; t3 = $.$get$Races_all(); t4 = _this._race.selected; if (!(t4 >= 0 && t4 < 5)) return A.ioore(t3, t4); t4 = t3[t4]; t3 = $.$get$Classes_all(); t5 = _this._class.selected; if (!(t5 >= 0 && t5 < 3)) return A.ioore(t3, t5); hero = t1.createHero$4$heroClass$permadeath$race(t2, t3[t5], _this._death.selected === 1, t4); t4 = _this._storage; B.JSArray_methods.add$1(t4.heroes, hero); t4.save$0(); t5 = _this._ui; t5.toString; t5.goTo$1(A.GameScreen_GameScreen$town(t4, t1, hero, true)); return true; } if (9 === keyCode) { offset = shift ? t1.length - 1 : 1; _this._new_hero_screen$_focus = B.JSInt_methods.$mod(_this._new_hero_screen$_focus + offset, t1.length); _this.dirty$0(); return true; } return false; } }; A.NewHeroScreen_closure.prototype = { call$1(race) { return type$.Race._as(race).name; }, $signature: 122 }; A.NewHeroScreen_closure0.prototype = { call$1(cls) { return type$.HeroClass._as(cls).name; }, $signature: 123 }; A.NewHeroScreen_render_closure.prototype = { call$1(terminal) { var t2, t3, t4, t5, i, t1 = terminal.size.x; A.Draw_hLine(terminal, 0, 3, t1); A.Draw_hLine(terminal, 0, 13, t1); A.Draw_hLine(terminal, 0, 27, t1); t2 = this.$this; t2._renderRace$1(terminal.rect$4(0, 4, t1, 8)); t3 = terminal.rect$4(0, 14, t1, 15); t4 = $.$get$Classes_all(); t5 = t2._class.selected; if (!(t5 >= 0 && t5 < 3)) return A.ioore(t4, t5); t2._renderText$2(t3, t4[t5].description); t1 = terminal.rect$4(0, 28, t1, 7); t5 = t2._death.selected; if (!(t5 >= 0 && t5 < 2)) return A.ioore(B.List_rWY, t5); t2._renderText$2(t1, B.List_rWY[t5]); for (t1 = t2._controls, i = 0; i < t1.length; ++i) t1[i].render$2$focus(terminal, i === t2._new_hero_screen$_focus); }, $signature: 30 }; A.Control.prototype = { handleInput$1(input) { return false; }, keyDown$3$alt$shift(keyCode, alt, shift) { return false; } }; A.NameControl.prototype = { get$helpKeys() { return B.Map_t3QSL; }, keyDown$3$alt$shift(keyCode, alt, shift) { var t1, t2, _this = this; if (alt) return false; switch (keyCode) { case 8: t1 = _this._enteredName; t2 = t1.length; if (t2 !== 0) { t1 = B.JSString_methods.substring$2(t1, 0, t2 - 1); _this._enteredName = t1; if (t1.length === 0) { t1 = $.$get$rng(); type$.List_String._as(B.List_E8g); t2 = B.List_E8g.length; t1 = t1.range$1(t2); if (!(t1 >= 0 && t1 < t2)) return A.ioore(B.List_E8g, t1); _this._defaultName = B.List_E8g[t1]; } } _this._refreshUnique$0(); return true; case 32: _this._append$1(" "); return true; default: if (keyCode >= 65 && keyCode <= 90) { _this._append$1(A.Primitives_stringFromCharCode(!shift ? 32 + keyCode : keyCode)); return true; } else if (keyCode >= 48 && keyCode <= 57) { _this._append$1(A.Primitives_stringFromCharCode(keyCode)); return true; } } return false; }, _append$1(append) { var t1 = this._enteredName; if (t1.length < 20) this._enteredName = t1 + append; this._refreshUnique$0(); }, _refreshUnique$0() { this._isUnique = B.JSArray_methods.every$1(this._storage.heroes, new A.NameControl__refreshUnique_closure(this)); }, render$2$focus(terminal, $focus) { var _this = this, color = _this._isUnique ? B.Color_222_156_33 : B.Color_204_35_57, t1 = _this._new_hero_screen$_x, t2 = _this._new_hero_screen$_y, t3 = t2 + 1; terminal.writeAt$4(t1, t3, "Name:", $focus ? B.Color_222_156_33 : B.Color_132_126_135); if ($focus) A.Draw__box(terminal, t1 + 18, t2, 23, 3, color, "\u250c", "\u2500", "\u2510", "\u2502", "\u2514", "\u2500", "\u2518"); t2 = _this._enteredName; if (t2.length !== 0) { t1 += 19; terminal.writeAt$4(t1, t3, t2, B.Color_226_223_240); if ($focus) terminal.writeAt$5(t1 + _this._enteredName.length, t3, " ", B.Color_0_0_0, color); } else { t1 += 19; t2 = _this._defaultName; if ($focus) terminal.writeAt$5(t1, t3, t2, B.Color_0_0_0, color); else terminal.writeAt$4(t1, t3, t2, B.Color_226_223_240); } if (!_this._isUnique) terminal.writeAt$4(42, 1, "Already a hero with that name", B.Color_204_35_57); } }; A.NameControl__refreshUnique_closure.prototype = { call$1(hero) { var t1, t2; type$.HeroSave._as(hero); t1 = this.$this; t2 = t1._enteredName; t1 = t2.length !== 0 ? t2 : t1._defaultName; return hero.name !== t1; }, $signature: 21 }; A.SelectControl.prototype = { get$helpKeys() { var t1 = type$.String; return A.LinkedHashMap_LinkedHashMap$_literal(["\u25c4\u25ba", "Select " + this._new_hero_screen$_name.toLowerCase()], t1, t1); }, handleInput$1(input) { var t1, t2, _this = this; switch (input) { case B.Input_w: t1 = _this.selected; t2 = _this._options.length; _this.selected = B.JSInt_methods.$mod(t1 + t2 - 1, t2); return true; case B.Input_e: _this.selected = B.JSInt_methods.$mod(_this.selected + 1, _this._options.length); return true; } return false; }, render$2$focus(terminal, $focus) { var x, i, option, t5, _this = this, t1 = _this._new_hero_screen$_x, t2 = _this._new_hero_screen$_y, t3 = t2 + 1, t4 = $focus ? B.Color_222_156_33 : B.Color_132_126_135; terminal.writeAt$4(t1, t3, _this._new_hero_screen$_name + ":", t4); x = t1 + 19; if ($focus) for (t1 = _this._options, i = 0; i < t1.length; ++i) { option = t1[i]; if (i === _this.selected) { t4 = x - 1; t5 = option.length; A.Draw__box(terminal, t4, t2, t5 + 2, 3, B.Color_222_156_33, "\u250c", "\u2500", "\u2510", "\u2502", "\u2514", "\u2500", "\u2518"); terminal.writeAt$4(t4, t3, "\u25c4", B.Color_222_156_33); terminal.writeAt$4(x + t5, t3, "\u25ba", B.Color_222_156_33); } terminal.writeAt$4(x, t3, option, i === _this.selected ? B.Color_222_156_33 : B.Color_226_223_240); x += option.length + 2; } else { t1 = _this._options; t2 = _this.selected; if (!(t2 >= 0 && t2 < t1.length)) return A.ioore(t1, t2); terminal.writeAt$4(x, t3, t1[t2], B.Color_226_223_240); } } }; A.ItemPanel.prototype = { get$inventoryTop() { return 11; }, get$onGroundTop() { return 37; }, renderPanel$1(terminal) { var onGround, restTop, _this = this, t1 = _this._item_panel$_game, hero = t1.hero, t2 = hero.save; _this._drawItems$4(terminal, 0, 9, t2._equipment); _this._drawItems$4(terminal, _this.get$inventoryTop(), 24, t2._inventory); if (_this._bounds.size.y > 50) { t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); onGround = t1.itemsAt$1(hero._pos); _this._drawItems$4(terminal, _this.get$onGroundTop(), 5, onGround); } restTop = _this._bounds.size.y > 50 ? _this.get$onGroundTop() + 7 : _this.get$onGroundTop(); t1 = terminal.size; A.Draw__box(terminal, 0, restTop, t1.x, t1.y - restTop, null, "\u250c", "\u2500", "\u2510", "\u2502", "\u2514", "\u2500", "\u2518"); }, _drawItems$4(terminal, y, itemSlotCount, items) { A.renderItems(terminal, items, A.item_renderer___defaultCanSelect$closure(), false, false, A.item_renderer___defaultGetPrice$closure(), null, false, itemSlotCount, 0, this._item_panel$_game.hero.save, false, false, y, terminal.size.x); } }; A.LogPanel.prototype = { renderPanel$1(terminal) { var t1, t2, y, i, t3, message, text, t4, color, lines, j; terminal.fill$4(0, 0, terminal.get$width(), terminal.get$height()); t1 = terminal.size; t2 = t1.y; t1 = t1.x; terminal.writeAt$4(0, t2 - 1, B.JSString_methods.$mul("\u2500", t1), B.Color_38_42_66); y = t2 - 2; t2 = this._log.messages; i = t2.length - 1; for (;;) { if (!(i >= 0 && y >= 0)) break; t3 = t2.length; if (!(i >= 0 && i < t3)) return A.ioore(t2, i); message = t2[i]; text = message.text; t4 = message.count; if (t4 > 1) text = text + " (x" + t4 + ")"; switch (message.type.index) { case 0: t4 = B.Color_226_223_240; break; case 1: t4 = B.Color_204_35_57; break; case 2: t4 = B.Color_86_30_138; break; case 3: t4 = B.Color_222_156_33; break; case 4: t4 = B.Color_22_117_38; break; case 5: t4 = B.Color_15_130_148; break; default: t4 = null; } color = i !== t3 - 1 ? t4.blend$2(B.Color_0_0_0, 0.5) : t4; lines = A.Log_wordWrap(t1, text); j = lines.length - 1; for (;;) { if (!(j >= 0 && y >= 0)) break; if (!(j >= 0 && j < lines.length)) return A.ioore(lines, j); terminal.writeAt$4(0, y, lines[j], color); --y; --j; } --i; } } }; A.Panel.prototype = { render$1(terminal) { var t1, t2, _0_0 = this._bounds; if (_0_0 != null) { t1 = _0_0.pos; t2 = _0_0.size; this.renderPanel$1(new A.PortTerminal(new A.Vec(t2.x, t2.y), t1.x, t1.y, terminal)); } } }; A.SidebarPanel.prototype = { renderPanel$1(terminal) { var t4, t5, experienceString, heroGold, t6, t7, visibleMonsters, i, y, monster, glyph, $name, _this = this, _null = null, t1 = _this._sidebar_panel$_gameScreen, hero = t1.game.hero, t2 = hero.save, t3 = t2.name; A.Draw_frame(terminal, _null, _null, t3, false, _null, _null, _null); terminal.writeAt$4(1, 2, t2.race.name + " " + t2.heroClass.name, B.Color_226_223_240); _this._drawStats$3(hero, terminal, 4); t4 = hero._health; t5 = t2.vitality._stat$_value; t5.toString; _this._drawStat$7(terminal, 7, "Health", t4, B.Color_204_35_57, B.JSNumber_methods.toInt$0(Math.pow(t5, 1.458) + 9), B.Color_84_0_39); terminal.writeAt$4(1, 8, "Exp", B.Color_132_126_135); experienceString = B.JSInt_methods.toString$0(t2.experience); t5 = terminal.size; t4 = t5.x; terminal.writeAt$4(t4 - experienceString.length - 1, 8, experienceString, B.Color_129_231_235); terminal.writeAt$4(1, 9, "Gold", B.Color_132_126_135); heroGold = A.formatMoney(t2.gold); terminal.writeAt$4(t4 - 1 - heroGold.length, 9, heroGold, B.Color_222_156_33); _this._drawArmor$3(hero, terminal, 10); _this._drawDefense$3(hero, terminal, 11); _this._drawWeapons$3(hero, terminal, 12); terminal.writeAt$4(1, 15, "Food", B.Color_132_126_135); A.Draw_thinMeter(terminal, 10, 15, t4 - 11, hero._stomach, 400, B.Color_142_82_55, B.Color_77_29_21); t6 = hero._focus; t7 = t2.intellect._stat$_value; t7.toString; _this._drawStat$7(terminal, 16, "Focus", t6, B.Color_21_87_194, A.Intellect_maxFocusAt(t7), B.Color_26_46_150); t2 = t2.strength; t6 = t2._stat$_value; t6.toString; terminal.writeAt$4(1, 17, "Fury", A.Strength_maxFuryAt(t6) === 0 ? B.Color_38_42_66 : B.Color_132_126_135); terminal.writeAt$4(t4 - 3, 17, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(hero._fury), 2), B.Color_110_32_13); t6 = hero._fury; if (t6 > 0) { t6 = B.JSString_methods.padLeft$1(B.JSNumber_methods.toStringAsFixed$1(1 + t6 * 0.1, 1) + "x", 4); t7 = hero._fury; t2 = t2._stat$_value; t2.toString; terminal.writeAt$4(10, 17, t6, t7 === A.Strength_maxFuryAt(t2) ? B.Color_179_74_4 : B.Color_110_32_13); } terminal.writeAt$4(1, 19, "@", t1.get$heroColor()); terminal.writeAt$4(3, 19, t3, B.Color_132_126_135); _this._drawHealthBar$3(terminal, 20, hero); t2 = t1.__GameScreen__stagePanel_F; t2 === $ && A.throwLateFieldNI("_stagePanel"); visibleMonsters = t2.visibleMonsters; B.JSArray_methods.sort$1(visibleMonsters, new A.SidebarPanel_renderPanel_closure(hero)); t2 = t4 - 4; t5 = t5.y - 2; i = 0; for (;;) { if (!(i < 10 && i < visibleMonsters.length)) break; y = 21 + i * 2; if (y >= t5) break; if (!(i < visibleMonsters.length)) return A.ioore(visibleMonsters, i); monster = visibleMonsters[i]; glyph = monster._breed.appearance; if (t1.get$currentTargetActor() === monster) glyph = new A.Glyph(glyph.char, glyph.back, glyph.fore); $name = A.Log__categorize(monster._breed._breed$_name, false, true); if ($name.length > t2) $name = B.JSString_methods.substring$2($name, 0, t2); terminal.drawGlyph$3(1, y, glyph); terminal.writeAt$4(3, y, $name, t1.get$currentTargetActor() === monster ? B.Color_222_156_33 : B.Color_132_126_135); _this._drawHealthBar$3(terminal, y + 1, monster); ++i; } }, _drawStats$3(hero, terminal, y) { var t2, t1 = {}; t1.x = 1; t1 = new A.SidebarPanel__drawStats_drawStat(t1, terminal, y); t2 = hero.save; t1.call$1(t2.strength); t1.call$1(t2.agility); t1.call$1(t2.vitality); t1.call$1(t2.intellect); }, _drawWeapons$3(hero, terminal, y) { var i, t2, hitString, t1 = hero.createMeleeHits$1(null), hits = A._setArrayType(t1.slice(0), A._arrayInstanceType(t1)); terminal.writeAt$4(1, y, hits.length === 2 ? "Weapons" : "Weapon", B.Color_132_126_135); for (t1 = terminal.size.x, i = 0; i < hits.length; ++i) { t2 = hits[i]; hitString = B.JSNumber_methods.toString$0(B.JSNumber_methods.toInt$0((t2._attack.damage * t2.get$_combat$_damageScale() + t2.get$_combat$_damageBonus()) * 100) / 100); terminal.writeAt$4(t1 - hitString.length - 1, y + i, hitString, B.Color_179_74_4); } }, _drawDefense$3(hero, terminal, y) { var t1, t2, total, t3; for (t1 = hero.get$defenses(), t2 = t1.$ti, t1 = new A._SyncStarIterator(t1._outerHelper(), t2._eval$1("_SyncStarIterator<1>")), t2 = t2._precomputed1, total = 0; t1.moveNext$0();) { t3 = t1._async$_current; total += (t3 == null ? t2._as(t3) : t3).amount; } this._drawStat$5(terminal, y, "Dodge", "" + total + "%", B.Color_15_130_148); }, _drawArmor$3(hero, terminal, y) { var t1, x, _i, element, result, resistance, t2; for (t1 = $.$get$Elements_all(), x = 10, _i = 0; _i < 12; ++_i) { element = t1[_i]; result = hero.onGetResistance$1(element); resistance = hero.resistanceCondition$1(element); if ((resistance._turnsRemaining > 0 ? result + resistance._intensity : result) > 0) { t2 = $.$get$SidebarPanel__resistLetters().$index(0, element); t2.toString; terminal.writeAt$4(x, y, t2, A.elementColor(element)); ++x; } } this._drawStat$5(terminal, y, "Armor", " " + B.JSNumber_methods.toInt$0(100 - A.getArmorMultiplier(hero.save.get$armor()) * 100) + "%", B.Color_22_117_38); }, _drawStat$7(terminal, y, label, value, valueColor, max, maxColor) { var x, maxString, valueString; terminal.writeAt$4(1, y, label, B.Color_132_126_135); x = terminal.size.x - 1; if (max != null) { maxString = B.JSInt_methods.toString$0(max); x -= maxString.length; terminal.writeAt$4(x, y, maxString, maxColor); x -= 3; terminal.writeAt$4(x, y, " / ", maxColor); } valueString = J.toString$0$(value); terminal.writeAt$4(x - valueString.length, y, valueString, valueColor); }, _drawStat$5(terminal, y, label, value, valueColor) { return this._drawStat$7(terminal, y, label, value, valueColor, null, null); }, _drawHealthBar$3(terminal, y, actor) { var drawCondition, t1, t2, _i, element, t3, _box_0 = {}; _box_0.x = 3; drawCondition = new A.SidebarPanel__drawHealthBar_drawCondition(_box_0, terminal, y); t1 = actor instanceof A.Monster; if (t1 && actor._monster$_state instanceof A.AfraidState) drawCondition.call$2("!", B.Color_189_144_108); if (t1 && actor._monster$_state instanceof A.AsleepState) drawCondition.call$2("z", B.Color_26_46_150); t2 = actor.poison; if (t2._turnsRemaining > 0) switch (t2._intensity) { case 1: drawCondition.call$2("P", B.Color_0_64_39); break; case 2: drawCondition.call$2("P", B.Color_22_117_38); break; default: drawCondition.call$2("P", B.Color_129_217_117); } if (actor.cold._turnsRemaining > 0) drawCondition.call$2("C", B.Color_64_163_229); switch (actor.haste._intensity) { case 1: drawCondition.call$2("S", B.Color_142_82_55); break; case 2: drawCondition.call$2("S", B.Color_222_156_33); break; case 3: drawCondition.call$2("S", B.Color_255_238_168); break; } if (actor.blindness._turnsRemaining > 0) drawCondition.call$2("B", B.Color_38_42_66); if (actor.dazzle._turnsRemaining > 0) drawCondition.call$2("D", B.Color_173_88_219); if (actor.perception._turnsRemaining > 0) drawCondition.call$2("V", B.Color_226_223_240); for (t2 = $.$get$Elements_all(), _i = 0; _i < 12; ++_i) { element = t2[_i]; if (actor.resistanceCondition$1(element)._turnsRemaining > 0) { t3 = $.$get$SidebarPanel__resistLetters().$index(0, element); t3.toString; drawCondition.call$3(t3, B.Color_0_0_0, A.elementColor(element)); } } if ($.Debug_showMonsterAlertness && t1) terminal.writeAt$4(2, y, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(B.JSNumber_methods.toInt$0(actor._alertness * 100)), 3), B.Color_226_223_240); A.Draw_meter(terminal, 10, y, terminal.size.x - 11, actor._health, actor.get$maxHealth(), B.Color_204_35_57, B.Color_84_0_39); } }; A.SidebarPanel_renderPanel_closure.prototype = { call$2(a, b) { var t2, t1 = type$.Monster; t1._as(a); t1._as(b); t1 = a._pos; t2 = this.hero._pos; return B.JSInt_methods.compareTo$1(t1.$sub(0, t2).get$lengthSquared(), b._pos.$sub(0, t2).get$lengthSquared()); }, $signature: 125 }; A.SidebarPanel__drawStats_drawStat.prototype = { call$1(stat) { var t4, t5, t1 = this.terminal, t2 = this._box_0, t3 = this.y; t1.writeAt$4(t2.x, t3, B.JSString_methods.substring$2(stat.get$_stat().name, 0, 3), B.Color_132_126_135); t4 = t2.x; t5 = stat._stat$_value; t5.toString; t1.writeAt$4(t4, t3 + 1, B.JSString_methods.padLeft$1(B.JSNumber_methods.toString$0(t5), 2), B.Color_226_223_240); t2.x = t2.x + B.JSInt_methods._tdivFast$1(t1.size.x - 4, 3); }, $signature: 126 }; A.SidebarPanel__drawHealthBar_drawCondition.prototype = { call$3(char, fore, $back) { var t1 = this._box_0, t2 = t1.x; if (t2 > 8) return; this.terminal.writeAt$5(t2, this.y, char, fore, $back); ++t1.x; }, call$2(char, fore) { return this.call$3(char, fore, null); }, $signature: 127 }; A.StagePanel.prototype = { drawStageGlyph$4(terminal, x, y, glyph) { var t1 = this._bounds.pos; this._drawStageGlyph$4(terminal, x + t1.x, y + t1.y, glyph); }, _drawStageGlyph$4(terminal, x, y, glyph) { var t1 = this._cameraBounds.pos, t2 = this._renderOffset; terminal.drawGlyph$3(x - t1.x + t2.x, y - t1.y + t2.y, glyph); }, update$1(events) { var t1, t2, _i, _this = this; type$.Iterable_Event._as(events); ++_this._stage_panel$_frame; for (t1 = events.length, t2 = _this._effects, _i = 0; _i < events.length; events.length === t1 || (0, A.throwConcurrentModificationError)(events), ++_i) A.addEffects(t2, events[_i]); t1 = t2.length; B.JSArray_methods.removeWhere$1(t2, new A.StagePanel_update_closure(_this)); return _this._hasAnimatedTile || t1 !== 0 || t2.length !== 0 || _this._stage_panel$_gameScreen.game.hero.dazzle._turnsRemaining > 0; }, renderPanel$1(terminal) { var t1, t2, game, hero, t3, t4, t5, t6, t7, t8, t9, t10, pos, t11, t12, t13, lightBack, tileGlyph, char, fore, $back, items, lightFore, it, itemGlyph, t14, max, color, showActor, actorGlyph, chance, foreShadow, backShadow, volume, _i, _this = this; _this._positionCamera$1(terminal.size); t1 = _this.visibleMonsters; B.JSArray_methods.clear$0(t1); _this._hasAnimatedTile = false; t2 = _this._stage_panel$_gameScreen; game = t2.game; hero = game.hero; for (t3 = A.RectIterator$(_this._cameraBounds), t4 = hero.dazzle, t5 = type$.JSArray_Item, t6 = type$.List_List_Color, t7 = type$.List_nullable_int, t8 = type$.List_Color; t3.moveNext$0();) { t9 = t3._x; t10 = t3._y; pos = new A.Vec(t9, t10); t11 = game.__Game__stage_F; t11 === $ && A.throwLateFieldNI("_stage"); t12 = t11.tiles; t12._checkBounds$2(t9, t10); t13 = t12._elements; t12 = t10 * t12.bounds.size.x + t9; if (!(t12 >= 0 && t12 < t13.length)) return A.ioore(t13, t12); t12 = t13[t12]; lightBack = t12._isExplored; if (lightBack) { tileGlyph = _this._tileGlyph$2(pos, t12); char = tileGlyph.char; fore = tileGlyph.fore; $back = tileGlyph.back; items = t11._itemsByTile.$index(0, pos); if (items == null) { t13 = A._setArrayType([], t5); items = new A.Inventory(B.ItemLocation_ybX, t13, null); } lightFore = items.get$isEmpty(0); if (!lightFore) { it = items.get$iterator(0); if (!it.moveNext$0()) A.throwExpression(A.IterableElementError_noElement()); itemGlyph = it.get$current().type.appearance; char = itemGlyph.char; fore = itemGlyph.fore; } } else { char = null; fore = B.Color_0_0_0; $back = B.Color_0_0_0; lightFore = false; } if (!t12._isOccluded && t12.floorIllumination + t12.actorIllumination > t12._fallOff) { t13 = t12.substance; if (t13 !== 0) { t14 = t12.element; if (t14 === $.$get$Elements_fire()) { t13 = $.$get$rng(); t7._as(B.List_9650_94); max = B.List_9650_94.length; t13 = t13._random; t14 = t13.nextInt$1(max); if (!(t14 >= 0 && t14 < max)) return A.ioore(B.List_9650_94, t14); char = B.List_9650_94[t14]; t6._as(B.List_0eK); max = B.List_0eK.length; t13 = t13.nextInt$1(max); if (!(t13 >= 0 && t13 < max)) return A.ioore(B.List_0eK, t13); color = B.List_0eK[t13]; t13 = J.getInterceptor$asx(color); fore = t13.$index(color, 0); $back = t13.$index(color, 1); _this._hasAnimatedTile = true; } else if (t14 === $.$get$Elements_poison()) $back = $back.blend$2(B.Color_131_158_13, 0.1 + t13 / 255 * 0.9); } } t13 = t11._actorsByTile; t13._checkBounds$2(t9, t10); t14 = t13._elements; t13 = t10 * t13.bounds.size.x + t9; if (!(t13 >= 0 && t13 < t14.length)) return A.ioore(t14, t13); t13 = t14[t13]; showActor = true; if (!(!t12._isOccluded && t12.floorIllumination + t12.actorIllumination > t12._fallOff)) if (!pos.$eq(0, hero._pos)) { if (!$.Debug_showAllMonsters) t14 = t13 != null && game.heroCanPerceive$1(t13); else t14 = showActor; showActor = t14; } if (showActor && t13 != null) { actorGlyph = t13.get$appearance(); if (actorGlyph instanceof A.Glyph) { char = actorGlyph.char; fore = actorGlyph.fore; } else { fore = t2.get$heroColor(); char = 64; } if (t2.get$currentTargetActor() === t13) { $back = fore; fore = B.Color_20_19_31; lightBack = false; } if (t13 instanceof A.Monster) B.JSArray_methods.add$1(t1, t13); lightFore = false; } t14 = t4._turnsRemaining; if (t14 > 0) { chance = Math.min(90, t14 * 8); t14 = $.$get$rng(); t14 = t14._random; if (t14.nextInt$1(100) < chance) { char = t14.nextInt$1(100) < chance ? char : 42; t8._as(B.List_Zlh); max = B.List_Zlh.length; t14 = t14.nextInt$1(max); if (!(t14 >= 0 && t14 < max)) return A.ioore(B.List_Zlh, t14); fore = B.List_Zlh[t14]; } lightFore = false; lightBack = false; } t14 = new A.StagePanel_renderPanel_multiply(); foreShadow = t14.call$2(fore, B.Color_80_80_95); backShadow = t14.call$2($back, B.Color_40_40_55); if (!t12._isOccluded && t12.floorIllumination + t12.actorIllumination > t12._fallOff) t14 = lightFore || lightBack; else t14 = false; if (t14) { t12 = new A.StagePanel_renderPanel_applyLighting(t12); if (lightFore) fore = t12.call$2(fore, foreShadow); if (lightBack) $back = t12.call$2($back, backShadow); } else { if (lightFore) fore = foreShadow; if (lightBack) $back = backShadow; } if ($.Debug_showHeroVolume) { volume = (16 - t11.get$_sound()._heroAuditoryDistance$1(pos)) / 16; volume *= volume; if (volume > 0) $back = $back.blend$2(B.Color_22_117_38, volume); } if ($.Debug_showMonsterAlertness && t13 instanceof A.Monster) $back = B.Color_0_64_255.blend$2(B.Color_220_0_0, t13._alertness); if (char != null) { t11 = _this._cameraBounds.pos; t12 = _this._renderOffset; terminal.drawGlyph$3(t9 - t11.x + t12.x, t10 - t11.y + t12.y, new A.Glyph(char, fore, $back)); } } for (t1 = _this._effects, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) t1[_i].render$2(game, new A.StagePanel_renderPanel_closure(_this, terminal)); }, _tileGlyph$2(pos, tile) { var t1, phase, frame, appearance = tile.type.appearance; if (appearance instanceof A.Glyph) return appearance; type$.List_Glyph._as(appearance); t1 = appearance.length; phase = A.hashPoint(pos.x, pos.y); frame = B.JSInt_methods.$mod(B.JSInt_methods._tdivFast$1(this._stage_panel$_frame, 8) + phase, t1 * 2 - 2); t1 = appearance.length; if (frame >= t1) frame = t1 - (frame - t1) - 1; this._hasAnimatedTile = true; if (!(frame >= 0 && frame < t1)) return A.ioore(appearance, frame); return appearance[frame]; }, _positionCamera$1(viewSize) { var t5, offsetX, heroViewX, cameraY, t6, offsetY, heroViewY, _this = this, game = _this._stage_panel$_gameScreen.game, t1 = _this._cameraBounds, cameraX = t1.get$left(), t2 = new A.StagePanel__positionCamera_centerX(game, viewSize), t3 = viewSize.x, t4 = game.__Game__stage_F; t4 === $ && A.throwLateFieldNI("_stage"); t5 = t4.tiles.bounds.size.x; if (t3 >= t5) { offsetX = B.JSNumber_methods._tdivFast$1(Math.max(0, t3 - t5), 2); cameraX = 0; } else { t1 = t1.size.x; if (t1 === 0 || t1 !== t3) cameraX = t2.call$0(); else { heroViewX = game.hero._pos.get$x() - _this._cameraBounds.get$left(); if (heroViewX < 8 || heroViewX > t3 - 8) cameraX = t2.call$0(); } offsetX = 0; } t1 = _this._cameraBounds; cameraY = t1.get$top(); t2 = new A.StagePanel__positionCamera_centerY(game, viewSize); t5 = viewSize.y; t6 = t4.tiles.bounds.size.y; if (t5 >= t6) { offsetY = B.JSNumber_methods._tdivFast$1(Math.max(0, t5 - t6), 2); cameraY = 0; } else { t1 = t1.size.y; if (t1 === 0 || t1 !== t5) cameraY = t2.call$0(); else { heroViewY = game.hero._pos.get$y() - _this._cameraBounds.get$top(); if (heroViewY < 8 || heroViewY > t5 - 8) cameraY = t2.call$0(); } offsetY = 0; } t1 = t4.tiles.bounds.size; _this._cameraBounds = new A.Rect(new A.Vec(cameraX, cameraY), new A.Vec(Math.min(t3, t1.x), Math.min(t5, t1.y))); _this._renderOffset = new A.Vec(offsetX, offsetY); } }; A.StagePanel_update_closure.prototype = { call$1(effect) { return !type$.Effect._as(effect).update$1(this.$this._stage_panel$_gameScreen.game); }, $signature: 128 }; A.StagePanel_renderPanel_multiply.prototype = { call$2(a, b) { return new A.Color(B.JSInt_methods._tdivFast$1(a.r * b.r, 255), B.JSInt_methods._tdivFast$1(a.g * b.g, 255), B.JSInt_methods._tdivFast$1(a.b * b.b, 255)); }, $signature: 15 }; A.StagePanel_renderPanel_applyLighting.prototype = { call$2(color, shadow) { var t1 = this.tile, visibility = t1.floorIllumination - t1._fallOff; if (visibility < 64) color = color.blend$2(shadow, A.lerpDouble(visibility, 0, 64, 0.5, 0)); else if (visibility > 128) color = color.add$2(0, B.Color_226_223_240, A.lerpDouble(visibility, 128, 255, 0, 0.2)); t1 = t1.actorIllumination; return t1 > 0 ? color.add$2(0, B.Color_200_130_0, A.lerpDouble(t1, 0, 255, 0.05, 0.1)) : color; }, $signature: 15 }; A.StagePanel_renderPanel_closure.prototype = { call$3(x, y, glyph) { this.$this._drawStageGlyph$4(this.terminal, x, y, glyph); }, $signature: 35 }; A.StagePanel__positionCamera_centerX.prototype = { call$0() { var t1 = this.game, t2 = t1.hero._pos.get$x(), t3 = this.viewSize.x, t4 = B.JSInt_methods._tdivFast$1(t3, 2); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); return B.JSInt_methods.clamp$2(t2 - t4, 0, t1.tiles.bounds.size.x - t3); }, $signature: 2 }; A.StagePanel__positionCamera_centerY.prototype = { call$0() { var t1 = this.game, t2 = t1.hero._pos.get$y(), t3 = this.viewSize.y, t4 = B.JSInt_methods._tdivFast$1(t3, 2); t1 = t1.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); return B.JSInt_methods.clamp$2(t2 - t4, 0, t1.tiles.bounds.size.y - t3); }, $signature: 2 }; A.Popup.prototype = { get$isTransparent() { return true; }, get$width() { return null; }, get$height() { return null; }, get$message() { return null; }, render$1(terminal) { var messageLines, t1, widestLine, lineCount, popupWidth, popupHeight, t2, $top, left, x, y, _i, _this = this; A.Draw_helpKeys(terminal, _this.get$helpKeys(), null); messageLines = _this.get$message(); t1 = messageLines != null; if (t1) { widestLine = B.JSArray_methods.fold$1$2(messageLines, 0, new A.Popup_render_closure(), type$.int); lineCount = messageLines.length; } else { widestLine = 0; lineCount = 0; } popupWidth = _this.get$width(); if (popupWidth == null) popupWidth = widestLine + 2; popupHeight = _this.get$height(); if (popupHeight == null) popupHeight = lineCount + 2; t2 = terminal._display._glyphs.bounds.size; $top = B.JSInt_methods._tdivFast$1(t2.y - popupHeight, 3); left = B.JSInt_methods._tdivFast$1(t2.x - popupWidth, 2); A.Draw__box(terminal, left - 1, $top - 1, popupWidth + 2, popupHeight + 2, B.Color_222_156_33, "\u2554", "\u2550", "\u2557", "\u2551", "\u255a", "\u2550", "\u255d"); terminal = new A.PortTerminal(new A.Vec(popupWidth, popupHeight), left, $top, terminal); terminal.fill$4(0, 0, terminal.get$width(), terminal.get$height()); if (t1) { x = B.JSInt_methods._tdivFast$1(popupWidth - B.JSArray_methods.fold$1$2(messageLines, 0, new A.Popup_render_closure0(), type$.int), 2); for (t1 = messageLines.length, y = 1, _i = 0; _i < messageLines.length; messageLines.length === t1 || (0, A.throwConcurrentModificationError)(messageLines), ++_i) { terminal.writeAt$4(x, y, messageLines[_i], B.Color_132_126_135); ++y; } } _this.renderPopup$1(terminal); }, renderPopup$1(terminal) { } }; A.Popup_render_closure.prototype = { call$2(width, line) { return Math.max(A._asInt(width), A._asString(line).length); }, $signature: 23 }; A.Popup_render_closure0.prototype = { call$2(width, line) { return Math.max(A._asInt(width), A._asString(line).length); }, $signature: 23 }; A.SelectDepthPopup.prototype = { get$width() { return 42; }, get$height() { return 26; }, get$message() { return B.List_VAg; }, get$helpKeys() { return B.Map_tt6T1; }, handleInput$1(input) { var _this = this; switch (input) { case B.Input_w: _this._changeDepth$1(_this._select_depth_popup$_depth - 1); return true; case B.Input_e: _this._changeDepth$1(_this._select_depth_popup$_depth + 1); return true; case B.Input_n: _this._changeDepth$1(_this._select_depth_popup$_depth - 10); return true; case B.Input_s: _this._changeDepth$1(_this._select_depth_popup$_depth + 10); return true; case B.Input_ok: _this._ui.pop$1(_this._select_depth_popup$_depth); return true; case B.Input_cancel: _this._ui.pop$0(); return true; } return false; }, renderPopup$1(terminal) { var depth, t1, x, y, t2, color; for (depth = 1; depth <= 100; ++depth) { t1 = depth - 1; x = B.JSInt_methods.$mod(t1, 10); y = B.JSInt_methods._tdivFast$1(t1, 10) * 2; if (depth === this._select_depth_popup$_depth) { t1 = x * 4; t2 = y + 5; terminal.drawGlyph$3(t1, t2, new A.Glyph(9658, B.Color_222_156_33, B.Color_0_0_0)); terminal.drawGlyph$3(t1 + 4, t2, new A.Glyph(9668, B.Color_222_156_33, B.Color_0_0_0)); color = B.Color_222_156_33; } else color = B.Color_226_223_240; terminal.writeAt$4(x * 4 + 1, y + 5, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(depth), 3), color); } }, _changeDepth$1(depth) { if (depth < 1) return; if (depth > 100) return; this._select_depth_popup$_depth = depth; this.dirty$0(); } }; A.SelectSkillDialog.prototype = { get$isTransparent() { return true; }, SelectSkillDialog$1(_gameScreen) { var t1, t2, t3, t4, t5; for (t1 = this._select_skill_dialog$_gameScreen.game.hero.save.skills.get$acquired(), t2 = J.get$iterator$ax(t1._iterable), t1 = new A.WhereIterator(t2, t1._f, t1.$ti._eval$1("WhereIterator<1>")), t3 = type$.UsableSkill, t4 = this._select_skill_dialog$_skills; t1.moveNext$0();) { t5 = t2.get$current(); if (t3._is(t5)) B.JSArray_methods.add$1(t4, t5); } }, handleInput$1(input) { if (input === B.Input_cancel) { this._ui.pop$0(); return true; } return false; }, keyDown$3$alt$shift(keyCode, alt, shift) { if (shift || alt) return false; if (keyCode >= 65 && keyCode <= 90) { this._useSkill$1(keyCode - 65); return true; } return false; }, _useSkill$1(index) { var t1 = this._select_skill_dialog$_skills, t2 = t1.length; if (index >= t2) return; if (!(index >= 0)) return A.ioore(t1, index); if (t1[index].unusableReason$1(this._select_skill_dialog$_gameScreen.game) != null) return; t2 = this._ui; t2.toString; if (!(index < t1.length)) return A.ioore(t1, index); t2.pop$1(t1[index]); }, render$1(terminal) { var t2, t3, t4, y, skill, _0_0, _null = null, _s26_ = "abcdefghijklmnopqrstuvwxyz", t1 = type$.String; A.Draw_helpKeys(terminal, A.LinkedHashMap_LinkedHashMap$_literal(["A-Z", "Select skill", "`", "Exit"], t1, t1), _null); t1 = this._select_skill_dialog$_gameScreen; t2 = t1.itemPanel._bounds; if (t2 != null) { t3 = t2.get$left(); t4 = t2.get$top(); t2 = t2.size; terminal = new A.PortTerminal(new A.Vec(t2.x, t2.y), t3, t4, terminal); } else { t2 = t1.__GameScreen__stagePanel_F; t2 === $ && A.throwLateFieldNI("_stagePanel"); t2 = t2._bounds; t3 = t2.get$left(); t4 = t2.get$top(); t2 = t2.size; terminal = new A.PortTerminal(new A.Vec(t2.x, t2.y), t3, t4, terminal); } t2 = this._select_skill_dialog$_skills; A.Draw_frame(terminal, B.Color_222_156_33, Math.max(t2.length + 2, 3), "Use which skill?", true, _null, _null, _null); t3 = terminal.size; terminal = terminal.rect$4(1, 1, t3.x - 2, t3.y - 2); if (t2.length === 0) { terminal.writeAt$4(0, 0, "(You don't have any skills yet)", B.Color_38_42_66); return; } for (t1 = t1.game, t3 = terminal.size.x, y = 0; y < t2.length; ++y) { skill = t2[y]; _0_0 = skill.unusableReason$1(t1); if (_0_0 != null) { terminal.writeAt$4(t3 - _0_0.length - 2, y, "(" + _0_0 + ")", B.Color_38_42_66); terminal.writeAt$4(3, y, skill.get$useName(), B.Color_38_42_66); } else { terminal.writeAt$4(0, y, " ) ", B.Color_38_42_66); if (!(y < 26)) return A.ioore(_s26_, y); terminal.writeAt$4(0, y, _s26_[y], B.Color_222_156_33); terminal.writeAt$4(3, y, skill.get$useName(), B.Color_226_223_240); } } } }; A.SkillDialog.prototype = {}; A.SkillTypeDialog.prototype = { SkillTypeDialog$1(_hero, $T) { var t1, t2, t3, _i, skill; for (t1 = this._skill_dialog$_hero.skills.get$discovered(), t2 = t1.length, t3 = this._skill_dialog$_skills, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { skill = t1[_i]; if ($T._is(skill)) B.JSArray_methods.add$1(t3, skill); } }, keyDown$3$alt$shift(keyCode, alt, shift) { var t1, t2; if (shift || alt) return false; if (keyCode === 9) { t1 = this._ui; t1.toString; t2 = this.__SkillDialog__nextScreen_F; t2 === $ && A.throwLateFieldNI("_nextScreen"); t1.goTo$1(t2); return true; } return false; }, handleInput$1(input) { switch (input) { case B.Input_n: this._skill_dialog$_changeSelection$1(-1); return true; case B.Input_s: this._skill_dialog$_changeSelection$1(1); return true; case B.Input_cancel: this._ui.pop$0(); return true; } return false; }, render$1(terminal) { var t1, t2, terminal0, t3, t4, skill, _this = this, _null = null; terminal.fill$4(0, 0, terminal.get$width(), terminal.get$height()); _this._renderSkillList$1(terminal); t1 = terminal._display._glyphs.bounds.size; t2 = t1.x - 40; terminal0 = new A.PortTerminal(new A.Vec(t2, t1.y - 1), 40, 0, terminal); t1 = _this._skill_dialog$_skills; t3 = t1.length; if (t3 === 0) A.Draw_frame(terminal0, _null, _null, _null, false, _null, _null, _null); else { t4 = _this._selectedSkill; if (!(t4 >= 0 && t4 < t3)) return A.ioore(t1, t4); skill = t1[t4]; A.Draw_frame(terminal0, _null, _null, skill.get$name(), true, _null, _null, _null); A.Draw_text(terminal0, skill.get$description(), t2 - 1, 1, 2); _this._renderSkillDetails$2(terminal0, skill); } t1 = type$.String; t1 = A.LinkedHashMap_LinkedHashMap$of(B.Map_empty, t1, t1); t2 = _this.__SkillDialog__nextScreen_F; t2 === $ && A.throwLateFieldNI("_nextScreen"); t1.$indexSet(0, "Tab", "View " + t2.get$_skill_dialog$_name()); t1.$indexSet(0, "`", "Exit"); A.Draw_helpKeys(terminal, t1, _null); }, _renderSkillList$1(terminal) { var t1, t2, t3, i, _i, skill, y, nameColor, detailColor, t4, _this = this, _null = null; terminal = new A.PortTerminal(new A.Vec(40, terminal._display._glyphs.bounds.size.y - 1), 0, 0, terminal); A.Draw_frame(terminal, _null, _null, _this.get$_skill_dialog$_name(), false, _null, _null, _null); _this._renderSkillListHeader$1(terminal); terminal.writeAt$4(2, 2, _this.get$_rowSeparator(), B.Color_38_42_66); t1 = _this._skill_dialog$_skills; t2 = t1.length; if (t2 === 0) { terminal.writeAt$4(2, 3, "(None known.)", B.Color_38_42_66); return; } for (t3 = _this._skill_dialog$_hero.skills._levels, i = 0, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { skill = t1[_i]; y = i * 2 + 3; terminal.writeAt$4(2, y + 1, _this.get$_rowSeparator(), B.Color_20_19_31); if (i === _this._selectedSkill) { nameColor = B.Color_222_156_33; detailColor = B.Color_222_156_33; } else { if (t3.containsKey$1(skill)) { t4 = t3.$index(0, skill); t4.toString; t4 = t4 > 0; } else t4 = false; if (!t4) { nameColor = B.Color_38_42_66; detailColor = B.Color_38_42_66; } else { nameColor = B.Color_226_223_240; detailColor = B.Color_132_126_135; } } terminal.writeAt$4(2, y, skill.get$name(), nameColor); _this._renderSkillInList$4(terminal, y, detailColor, skill); ++i; } terminal.drawGlyph$3(1, _this._selectedSkill * 2 + 3, A.Glyph$fromCharCode(9658, B.Color_222_156_33, _null)); }, _skill_dialog$_changeSelection$1(offset) { var _this = this, t1 = _this._skill_dialog$_skills.length; if (t1 === 0) return; _this._selectedSkill = B.JSInt_methods.clamp$2(_this._selectedSkill + offset, 0, t1 - 1); _this.dirty$0(); } }; A.DisciplineDialog.prototype = { get$_skill_dialog$_name() { return "Disciplines"; }, get$_rowSeparator() { return "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500 \u2500\u2500\u2500\u2500"; }, _renderSkillListHeader$1(terminal) { terminal.writeAt$4(31, 1, "Lev Next", B.Color_132_126_135); }, _renderSkillInList$4(terminal, y, color, skill) { var t1, percent; type$.Discipline._as(skill); t1 = this._skill_dialog$_hero; terminal.writeAt$4(31, y, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(t1.skills.level$1(skill)), 3), color); percent = skill.percentUntilNext$1(t1); terminal.writeAt$4(35, y, percent == null ? " --" : B.JSString_methods.padLeft$1(A.S(percent) + "%", 4), color); }, _renderSkillDetails$2(terminal, skill) { var t1, t2, level, t3, percent, points; type$.Discipline._as(skill); t1 = this._skill_dialog$_hero; t2 = t1.skills; level = t2.level$1(skill); terminal.writeAt$4(1, 8, "At current level " + level + ":", B.Color_226_223_240); if (level > 0) A.Draw_text(terminal, skill.levelDescription$1(level), terminal.size.x - 1, 3, 10); else terminal.writeAt$4(3, 10, "(You haven't trained this yet.)", B.Color_38_42_66); if (level < skill.get$maxLevel()) { t3 = level + 1; terminal.writeAt$4(1, 16, "At next level " + t3 + ":", B.Color_226_223_240); A.Draw_text(terminal, skill.levelDescription$1(t3), terminal.size.x - 1, 3, 18); } terminal.writeAt$4(1, 30, "Level:", B.Color_38_42_66); terminal.writeAt$4(9, 30, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(level), 4), B.Color_132_126_135); A.Draw_meter(terminal, 14, 30, 25, level, skill.get$maxLevel(), B.Color_204_35_57, B.Color_84_0_39); terminal.writeAt$4(1, 32, "Next:", B.Color_38_42_66); percent = skill.percentUntilNext$1(t1); if (percent != null) { points = t2.points$1(skill); t1 = t1.heroClass; t2 = skill.trainingNeeded$2(t1, level); t2.toString; t1 = skill.trainingNeeded$2(t1, level + 1); t1.toString; terminal.writeAt$4(9, 32, B.JSString_methods.padLeft$1(A.S(percent) + "%", 4), B.Color_132_126_135); A.Draw_meter(terminal, 14, 32, 25, points - t2, t1 - t2, B.Color_204_35_57, B.Color_84_0_39); } else terminal.writeAt$4(14, 32, "(At max level.)", B.Color_38_42_66); } }; A.SpellDialog.prototype = { get$_skill_dialog$_name() { return "Spells"; }, get$_rowSeparator() { return "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500"; }, _renderSkillListHeader$1(terminal) { terminal.writeAt$4(35, 1, "Comp", B.Color_132_126_135); }, _renderSkillInList$4(terminal, y, color, skill) { terminal.writeAt$4(35, y, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(type$.Spell._as(skill).complexity$1(this._skill_dialog$_hero.heroClass)), 4), color); }, _renderSkillDetails$2(terminal, skill) { var t1, t2, t3, t4, level; type$.Spell._as(skill); terminal.writeAt$4(1, 30, "Complexity:", B.Color_38_42_66); t1 = this._skill_dialog$_hero; t2 = t1.skills; t3 = t1.heroClass; if (t2.isAcquired$1(skill)) terminal.writeAt$4(13, 30, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(skill.complexity$1(t3)), 3), B.Color_132_126_135); else { terminal.writeAt$4(13, 30, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(skill.complexity$1(t3)), 3), B.Color_204_35_57); t3 = skill.complexity$1(t3); t4 = t1.intellect._stat$_value; t4.toString; terminal.writeAt$4(17, 30, "Need " + A.S(t3 - t4) + " more intellect", B.Color_38_42_66); } level = t2.level$1(skill); terminal.writeAt$4(1, 32, "Focus cost:", B.Color_38_42_66); terminal.writeAt$4(13, 32, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(skill.focusCost$2(t1, level)), 3), B.Color_132_126_135); if (skill.get$damage() !== 0) { terminal.writeAt$4(1, 34, "Damage:", B.Color_38_42_66); terminal.writeAt$4(13, 34, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(skill.get$damage()), 3), B.Color_132_126_135); } if (skill.get$range() !== 0) { terminal.writeAt$4(1, 36, "Range:", B.Color_38_42_66); terminal.writeAt$4(13, 36, B.JSString_methods.padLeft$1(B.JSInt_methods.toString$0(skill.get$range()), 3), B.Color_132_126_135); } } }; A.Storage.prototype = { remove$1(_, hero) { B.JSArray_methods.removeWhere$1(this.heroes, new A.Storage_remove_closure(hero)); this.save$0(); }, replace$1(hero) { var t1 = this.heroes; B.JSArray_methods.$indexSet(t1, B.JSArray_methods.indexWhere$1(t1, new A.Storage_replace_closure(hero)), hero); this.save$0(); }, _load$0() { var hero, heroData, $name, raceName, race, heroClass, name0, permadeath, inventoryItems, inventory, equipment, item, homeItems, $home, crucibleItems, crucible, shops, shopsData, experience, levels, points, skills, name1, skill, skillData, skillSet, log, lore, gold, maxDepth, stats, heroSave, error, trace, storage, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, _i, skill0, maxDepth0, t14, t15, exception, _this = this, t1 = init.G; if (A._asString(A._asJSObject(A._asJSObject(t1.window).location).search) === "?clear") { _this.save$0(); return; } storage = A._asStringQ(A._asJSObject(A._asJSObject(t1.window).localStorage).getItem("heroes")); if (storage == null) return; t1 = type$.Map_String_dynamic; for (t2 = type$.List_dynamic, t3 = J.get$iterator$ax(t2._as(t1._as(B.C_JsonCodec.decode$1(storage)).$index(0, "heroes"))), t4 = _this.heroes, t5 = type$.Skill, t6 = type$.int, t7 = type$.nullable_Map_String_dynamic, t8 = type$.Shop, t9 = type$.Inventory, t10 = type$.JSArray_Item, t11 = type$.nullable_Item; t3.moveNext$0();) { hero = t3.get$current(); try { heroData = t1._as(hero); $name = A._asString(J.$index$asx(heroData, "name")); raceName = A._asString(hero.$index(0, "race")); race = B.JSArray_methods.firstWhere$1($.$get$Races_all(), new A.Storage__load_closure(raceName)); heroClass = null; if (J.$index$asx(heroData, "class") == null) heroClass = $.$get$Classes_all()[0]; else { name0 = A._asString(J.$index$asx(heroData, "class")); heroClass = B.JSArray_methods.firstWhere$1($.$get$Classes_all(), new A.Storage__load_closure0(name0)); } permadeath = J.$eq$(J.$index$asx(heroData, "death"), "permanent"); inventoryItems = _this._loadItems$1(t2._as(J.$index$asx(heroData, "inventory"))); t12 = inventoryItems; t13 = A._setArrayType([], t10); if (t12 != null) B.JSArray_methods.addAll$1(t13, t12); inventory = new A.Inventory(B.ItemLocation_Inventory, t13, 24); equipment = new A.Equipment(A.List_List$filled(9, null, false, t11)); for (t12 = _this._loadItems$1(t2._as(J.$index$asx(heroData, "equipment"))), t13 = t12.length, _i = 0; _i < t12.length; t12.length === t13 || (0, A.throwConcurrentModificationError)(t12), ++_i) { item = t12[_i]; equipment.equip$1(item); } homeItems = _this._loadItems$1(t2._as(J.$index$asx(heroData, "home"))); t12 = homeItems; t13 = A._setArrayType([], t10); if (t12 != null) B.JSArray_methods.addAll$1(t13, t12); $home = new A.Inventory(B.ItemLocation_Home, t13, 26); crucibleItems = _this._loadItems$1(t2._as(J.$index$asx(heroData, "crucible"))); t12 = crucibleItems; t13 = A._setArrayType([], t10); if (t12 != null) B.JSArray_methods.addAll$1(t13, t12); crucible = new A.Inventory(B.ItemLocation_Crucible, t13, 8); shops = A.LinkedHashMap_LinkedHashMap$_empty(t8, t9); if (heroData.containsKey$1("shops")) { shopsData = t1._as(J.$index$asx(heroData, "shops")); $.Shops_all.forEach$1(0, new A.Storage__load_closure1(_this, shopsData, shops)); } inventory.countChanged$0(); $home.countChanged$0(); crucible.countChanged$0(); experience = A._asInt(J.$index$asx(heroData, "experience")); levels = A.LinkedHashMap_LinkedHashMap$_empty(t5, t6); points = A.LinkedHashMap_LinkedHashMap$_empty(t5, t6); skills = t7._as(J.$index$asx(heroData, "skills")); if (skills != null) for (t12 = skills.get$keys(), t12 = t12.get$iterator(t12); t12.moveNext$0();) { name1 = t12.get$current(); t13 = A._asString(name1); skill0 = $.$get$Skills__byName().$index(0, t13); if (skill0 == null) A.throwExpression(A.ArgumentError$("Unknown skill '" + t13 + "'.", null)); skill = skill0; skillData = skills.$index(0, name1); if (A._isInt(skillData)) { J.$indexSet$ax(levels, skill, skillData); J.$indexSet$ax(points, skill, 0); } else { t1._as(skillData); J.$indexSet$ax(levels, skill, A._asInt(skillData.$index(0, "level"))); J.$indexSet$ax(points, skill, A._asInt(skillData.$index(0, "points"))); } } skillSet = new A.SkillSet(levels, points); log = _this._loadLog$1(J.$index$asx(heroData, "log")); lore = _this._loadLore$1(t1._as(J.$index$asx(heroData, "lore"))); gold = A._asInt(J.$index$asx(heroData, "gold")); maxDepth0 = A._asIntQ(J.$index$asx(heroData, "maxDepth")); maxDepth = maxDepth0 == null ? 0 : maxDepth0; stats = t1._as(J.$index$asx(heroData, "stats")); t12 = heroClass; t13 = A._asInt(J.$index$asx(stats, "strength")); t14 = A._asInt(J.$index$asx(stats, "agility")); t15 = A._asInt(J.$index$asx(stats, "vitality")); heroSave = A.HeroSave$($name, race, t12, permadeath, inventory, equipment, $home, crucible, shops, experience, skillSet, log, lore, gold, maxDepth, t14, A._asInt(J.$index$asx(stats, "intellect")), t13, t15); B.JSArray_methods.add$1(t4, heroSave); } catch (exception) { error = A.unwrapException(exception); trace = A.getTraceFromException(exception); A.printString("Could not load hero. Data:"); A.printString(B.C_JsonCodec.encode$1(hero)); A.printString("Error:\n" + A.S(error) + "\n" + A.S(trace)); } } }, _loadItems$1(data) { var t1, t2, item, items = A._setArrayType([], type$.JSArray_Item); for (t1 = J.get$iterator$ax(data), t2 = type$.Map_String_dynamic; t1.moveNext$0();) { item = this._loadItem$1(t2._as(t1.get$current())); if (item != null) B.JSArray_methods.add$1(items, item); } return items; }, _loadItem$1(data) { var t1, type, count; type$.Map_String_dynamic._as(data); t1 = A._asString(data.$index(0, "type")); type = $.$get$Items_types().tryFind$1(t1); if (type == null) { A.print("Couldn't find item type \"" + A.S(data.$index(0, "type")) + '", discarding item.'); return null; } count = data.containsKey$1("count") ? A._asInt(data.$index(0, "count")) : 1; return new A.Item(type, this._loadAffix$1(data.$index(0, "prefix")), this._loadAffix$1(data.$index(0, "suffix")), this._loadAffix$1(data.$index(0, "intrinsic")), count); }, _loadAffix$1(data) { var _0_7, _0_7_isSet, id, t1, _0_4, t2, parameter, _s9_ = "parameter"; $label0$0: { _0_7 = null; _0_7_isSet = false; id = null; t1 = false; if (type$.Map_dynamic_dynamic._is(data)) { _0_4 = data.$index(0, "id"); if (_0_4 == null) t2 = data.containsKey$1("id"); else t2 = true; if (t2) { _0_7_isSet = typeof _0_4 == "string"; if (_0_7_isSet) { _0_7 = data.$index(0, _s9_); if (_0_7 == null) t2 = data.containsKey$1(_s9_); else t2 = true; if (t2) t1 = A._isInt(_0_7); id = _0_4; } } } if (t1) { parameter = A._asInt(_0_7_isSet ? _0_7 : data.$index(0, _s9_)); t1 = new A.Affix(A.Affixes_find(A._asString(id)), parameter); break $label0$0; } t1 = null; break $label0$0; } return t1; }, _loadLog$1(data) { var t2, t3, messageMap, t1 = A._setArrayType([], type$.JSArray_Message); if (type$.List_dynamic._is(data)) for (t2 = J.get$iterator$ax(data), t3 = type$.Map_String_dynamic; t2.moveNext$0();) { messageMap = t3._as(t2.get$current()); B.JSArray_methods.add$1(t1, new A.Message(B.JSArray_methods.firstWhere$1(B.List_GzI, new A.Storage__loadLog_closure(messageMap)), A._asString(messageMap.$index(0, "text")), A._asInt(messageMap.$index(0, "count")))); } return new A.Log(t1); }, _loadLore$1(data) { var t2, t3, seenBreeds, slain, foundItems, foundAffixes, createdArtifacts, usedItems, seenMap, slainMap, foundItemMap, foundAffixMap, usedItemMap, createdArtifactsList, _this = this, t1 = type$.nullable_Map_String_dynamic; t1._as(data); t2 = type$.Breed; t3 = type$.int; seenBreeds = A.LinkedHashMap_LinkedHashMap$_empty(t2, t3); slain = A.LinkedHashMap_LinkedHashMap$_empty(t2, t3); t2 = type$.ItemType; foundItems = A.LinkedHashMap_LinkedHashMap$_empty(t2, t3); foundAffixes = A.LinkedHashMap_LinkedHashMap$_empty(type$.AffixType, t3); createdArtifacts = A.LinkedHashSet_LinkedHashSet$_empty(t2); usedItems = A.LinkedHashMap_LinkedHashMap$_empty(t2, t3); seenMap = t1._as(data.$index(0, "seen")); if (seenMap != null) seenMap.forEach$1(0, new A.Storage__loadLore_closure(_this, seenBreeds)); slainMap = t1._as(data.$index(0, "slain")); if (slainMap != null) slainMap.forEach$1(0, new A.Storage__loadLore_closure0(_this, slain)); foundItemMap = t1._as(data.$index(0, "foundItems")); if (foundItemMap != null) foundItemMap.forEach$1(0, new A.Storage__loadLore_closure1(_this, foundItems)); foundAffixMap = t1._as(data.$index(0, "foundAffixes")); if (foundAffixMap != null) foundAffixMap.forEach$1(0, new A.Storage__loadLore_closure2(_this, foundAffixes)); usedItemMap = t1._as(data.$index(0, "usedItems")); if (usedItemMap != null) usedItemMap.forEach$1(0, new A.Storage__loadLore_closure3(_this, usedItems)); createdArtifactsList = type$.nullable_List_dynamic._as(data.$index(0, "createdArtifacts")); if (createdArtifactsList != null) for (t1 = J.get$iterator$ax(createdArtifactsList); t1.moveNext$0();) { t2 = A._asString(t1.get$current()); t2 = $.$get$Items_types().tryFind$1(t2); t2.toString; createdArtifacts.add$1(0, t2); } return new A.Lore(seenBreeds, slain, foundItems, foundAffixes, createdArtifacts, usedItems); }, save$0() { var t2, t3, t4, t5, t6, t7, t8, _i, hero, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, _i0, skill, t22, t23, t24, encoded, _this = this, t1 = A._setArrayType([], type$.JSArray_Map_String_Object); for (t2 = _this.heroes, t3 = t2.length, t4 = type$.String, t5 = type$.Object, t6 = type$.int, t7 = type$.Map_String_int, t8 = type$.List_dynamic, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { hero = t2[_i]; t9 = A.LinkedHashMap_LinkedHashMap$_literal(["strength", hero.strength._baseValue, "agility", hero.agility._baseValue, "vitality", hero.vitality._baseValue, "intellect", hero.intellect._baseValue], t4, t6); t10 = hero.permadeath ? "permanent" : "dungeon"; t11 = _this._saveItems$1(hero._inventory); t12 = _this._saveItems$1(hero._equipment); t13 = _this._saveItems$1(hero._home); t14 = _this._saveItems$1(hero._crucible); t15 = A.LinkedHashMap_LinkedHashMap$_empty(t4, t8); for (t16 = hero.shops, t16 = new A.LinkedHashMapEntryIterator(t16, t16._modifications, t16._first, A._instanceType(t16)._eval$1("LinkedHashMapEntryIterator<1,2>")); t16.moveNext$0();) { t17 = t16.__js_helper$_current; t15.$indexSet(0, t17.key.name, _this._saveItems$1(t17.value)); } t16 = hero.experience; t17 = A.LinkedHashMap_LinkedHashMap$_empty(t4, t7); t18 = hero.skills; t19 = t18._levels; t20 = A._instanceType(t19)._eval$1("LinkedHashMapKeysIterable<1>"); t20 = A.List_List$_of(new A.LinkedHashMapKeysIterable(t19, t20), t20._eval$1("Iterable.E")); B.JSArray_methods.sort$0(t20); t21 = t20.length; t18 = t18._points; _i0 = 0; for (; _i0 < t20.length; t20.length === t21 || (0, A.throwConcurrentModificationError)(t20), ++_i0) { skill = t20[_i0]; t22 = skill.get$name(); t23 = t19.$index(0, skill); if (t23 == null) t23 = 0; t24 = t18.$index(0, skill); t17.$indexSet(0, t22, A.LinkedHashMap_LinkedHashMap$_literal(["level", t23, "points", t24 == null ? 0 : t24], t4, t6)); } t1.push(A.LinkedHashMap_LinkedHashMap$_literal(["name", hero.name, "race", hero.race.name, "stats", t9, "class", hero.heroClass.name, "death", t10, "inventory", t11, "equipment", t12, "home", t13, "crucible", t14, "shops", t15, "experience", t16, "skills", t17, "log", _this._saveLog$1(hero.log), "lore", _this._saveLore$1(hero.lore), "gold", hero.gold, "maxDepth", hero.maxDepth], t4, t5)); } encoded = B.C_JsonCodec.encode$1(A.LinkedHashMap_LinkedHashMap$_literal(["heroes", t1], t4, type$.List_Map_String_Object)); A._asJSObject(A._asJSObject(init.G.window).localStorage).setItem("heroes", encoded); A.print("Saved."); }, _saveLog$1(log) { var t2, t3, t4, t5, _i, message, t1 = []; for (t2 = log.messages, t3 = t2.length, t4 = type$.String, t5 = type$.dynamic, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { message = t2[_i]; t1.push(A.LinkedHashMap_LinkedHashMap$_literal(["type", message.type._core$_name, "text", message.text, "count", message.count], t4, t5)); } return t1; }, _saveLore$1(lore) { var t3, t4, t5, t6, t7, count, found, used, _i, affix, t1 = type$.String, t2 = type$.dynamic, seen = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), slain = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), foundItems = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), foundAffixes = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), usedItems = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), createdArtifacts = []; for (t3 = $.$get$Monsters_breeds().get$all(), t4 = A._instanceType(t3), t3 = new A.MappedIterator(J.get$iterator$ax(t3._iterable), t3._f, t4._eval$1("MappedIterator<1,2>")), t5 = lore._slainBreeds, t6 = lore._seenBreeds, t4 = t4._rest[1]; t3.moveNext$0();) { t7 = t3._current; if (t7 == null) t7 = t4._as(t7); count = t6.$index(0, t7); if (count == null) count = 0; if (count !== 0) seen.$indexSet(0, A.Log__categorize(t7._breed$_name, false, true), count); count = t5.$index(0, t7); if (count == null) count = 0; if (count !== 0) slain.$indexSet(0, A.Log__categorize(t7._breed$_name, false, true), count); } for (t3 = $.$get$Items_types().get$all(), t4 = A._instanceType(t3), t3 = new A.MappedIterator(J.get$iterator$ax(t3._iterable), t3._f, t4._eval$1("MappedIterator<1,2>")), t5 = lore._usedItems, t6 = lore._foundItems, t4 = t4._rest[1]; t3.moveNext$0();) { t7 = t3._current; if (t7 == null) t7 = t4._as(t7); found = t6.$index(0, t7); if (found == null) found = 0; if (found !== 0) foundItems.$indexSet(0, A.Log__categorize(t7.quantifiableName, false, true), found); used = t5.$index(0, t7); if (used == null) used = 0; if (used !== 0) usedItems.$indexSet(0, A.Log__categorize(t7.quantifiableName, false, true), used); } t3 = A.List_List$_of($.$get$Affixes_prefixes().get$all(), type$.AffixType); B.JSArray_methods.addAll$1(t3, $.$get$Affixes_suffixes().get$all()); t4 = t3.length; t5 = lore._foundAffixes; _i = 0; for (; _i < t3.length; t3.length === t4 || (0, A.throwConcurrentModificationError)(t3), ++_i) { affix = t3[_i]; found = t5.$index(0, affix); if (found == null) found = 0; if (found !== 0) foundAffixes.$indexSet(0, affix.id, found); } for (t3 = $.$get$Items_types().get$all(), t4 = A._instanceType(t3), t3 = new A.MappedIterator(J.get$iterator$ax(t3._iterable), t3._f, t4._eval$1("MappedIterator<1,2>")), t4 = t4._rest[1], t5 = lore._createdArtifacts; t3.moveNext$0();) { t6 = t3._current; if (t6 == null) t6 = t4._as(t6); if (t6.isArtifact && t5.contains$1(0, t6)) createdArtifacts.push(A.Log__categorize(t6.quantifiableName, false, true)); } return A.LinkedHashMap_LinkedHashMap$_literal(["seen", seen, "slain", slain, "foundItems", foundItems, "foundAffixes", foundAffixes, "usedItems", usedItems, "createdArtifacts", createdArtifacts], t1, t2); }, _saveItems$1(items) { var t1, t2, t3, t4, t5, t6, t7, _0_0, _1_0, _2_0; type$.Iterable_Item._as(items); t1 = []; for (t2 = items.get$iterator(items), t3 = type$.String, t4 = type$.Object, t5 = type$.dynamic; t2.moveNext$0();) { t6 = t2.get$current(); t7 = A.LinkedHashMap_LinkedHashMap$_empty(t3, t4); t7.$indexSet(0, "type", A.Log__categorize(t6.type.quantifiableName, false, true)); t7.$indexSet(0, "count", t6._count); _0_0 = t6.prefix; if (_0_0 != null) t7.$indexSet(0, "prefix", A.LinkedHashMap_LinkedHashMap$_literal(["id", _0_0.type.id, "parameter", _0_0.parameter], t3, t5)); _1_0 = t6.suffix; if (_1_0 != null) t7.$indexSet(0, "suffix", A.LinkedHashMap_LinkedHashMap$_literal(["id", _1_0.type.id, "parameter", _1_0.parameter], t3, t5)); _2_0 = t6.intrinsicAffix; if (_2_0 != null) t7.$indexSet(0, "intrinsic", A.LinkedHashMap_LinkedHashMap$_literal(["id", _2_0.type.id, "parameter", _2_0.parameter], t3, t5)); t1.push(t7); } return t1; } }; A.Storage_remove_closure.prototype = { call$1(existing) { return type$.HeroSave._as(existing).name === this.hero.name; }, $signature: 21 }; A.Storage_replace_closure.prototype = { call$1(existing) { return type$.HeroSave._as(existing).name === this.hero.name; }, $signature: 21 }; A.Storage__load_closure.prototype = { call$1(race) { return type$.Race._as(race).name === this.raceName; }, $signature: 130 }; A.Storage__load_closure0.prototype = { call$1(c) { return type$.HeroClass._as(c).name === this.name; }, $signature: 131 }; A.Storage__load_closure1.prototype = { call$2($name, shop) { var shopData, t1; A._asString($name); type$.Shop._as(shop); shopData = type$.nullable_List_dynamic._as(this.shopsData.$index(0, $name)); t1 = this.shops; if (shopData != null) t1.$indexSet(0, shop, A.Inventory$(new A.ItemLocation(shop.name), 26, type$.Iterable_Item._as(this.$this._loadItems$1(shopData)))); else { A.print("No data for " + $name + ", so regenerating."); t1.$indexSet(0, shop, shop.create$0()); } }, $signature: 132 }; A.Storage__loadLog_closure.prototype = { call$1(type) { return type$.LogType._as(type)._core$_name === A._asString(this.messageMap.$index(0, "type")); }, $signature: 133 }; A.Storage__loadLore_closure.prototype = { call$2(breedName, count) { var breed; A._asString(breedName); breed = $.$get$Monsters_breeds().tryFind$1(breedName); if (breed != null) this.seenBreeds.$indexSet(0, breed, A._asInt(count)); }, $signature: 11 }; A.Storage__loadLore_closure0.prototype = { call$2(breedName, count) { var breed; A._asString(breedName); breed = $.$get$Monsters_breeds().tryFind$1(breedName); if (breed != null) this.slain.$indexSet(0, breed, A._asInt(count)); }, $signature: 11 }; A.Storage__loadLore_closure1.prototype = { call$2(itemName, count) { var itemType; A._asString(itemName); itemType = $.$get$Items_types().tryFind$1(itemName); if (itemType != null) this.foundItems.$indexSet(0, itemType, A._asInt(count)); }, $signature: 11 }; A.Storage__loadLore_closure2.prototype = { call$2(affixName, count) { this.foundAffixes.$indexSet(0, A.Affixes_find(A._asString(affixName)), A._asInt(count)); }, $signature: 11 }; A.Storage__loadLore_closure3.prototype = { call$2(itemName, count) { var itemType; A._asString(itemName); itemType = $.$get$Items_types().tryFind$1(itemName); if (itemType != null) this.usedItems.$indexSet(0, itemType, A._asInt(count)); }, $signature: 11 }; A.TargetDialog.prototype = { get$isTransparent() { return true; }, TargetDialog$3(_gameScreen, _range, _onSelect) { var t4, t5, t6, _i, actor, _this = this, t1 = _this._target_dialog$_gameScreen, t2 = t1.game, hero = t2.hero, t3 = t2.__Game__stage_F; t3 === $ && A.throwLateFieldNI("_stage"); t3 = t3._actors; t4 = t3.length; t5 = _this._monsters; t6 = _this._target_dialog$_range; _i = 0; for (; _i < t3.length; t3.length === t4 || (0, A.throwConcurrentModificationError)(t3), ++_i) { actor = t3[_i]; if (!(actor instanceof A.Monster)) continue; if (!t2.heroCanPerceive$1(actor)) continue; if (actor._pos.$sub(0, hero._pos).$gt(0, t6)) continue; B.JSArray_methods.add$1(t5, actor); } if (t5.length === 0) { _this._targetingFloor = true; t1.targetFloor$1(hero._pos); } else _this._targetNearest$1(hero._pos); }, _targetNearest$1(pos) { var nearest, _i, monster, t1 = this._monsters, t2 = t1.length; if (t2 === 0) return false; for (nearest = null, _i = 0; _i < t2; ++_i) { monster = t1[_i]; if (nearest == null || pos.$sub(0, monster._pos).$lt(0, pos.$sub(0, nearest._pos))) nearest = monster; } this._target_dialog$_gameScreen.targetActor$1(nearest); return true; }, handleInput$1(input) { var t1, _this = this; switch (input) { case B.Input_ok: t1 = _this._target_dialog$_gameScreen; if (t1.get$currentTarget() != null) { _this._ui.pop$0(); t1 = t1.get$currentTarget(); t1.toString; _this._target_dialog$_onSelect.call$1(t1); } break; case B.Input_cancel: _this._ui.pop$0(); break; case B.Input_nw: _this._changeTarget$1(B.Direction_m1_m1_8_nw); break; case B.Input_n: _this._changeTarget$1(B.Direction_0_m1_1_n); break; case B.Input_ne: _this._changeTarget$1(B.Direction_1_m1_2_ne); break; case B.Input_w: _this._changeTarget$1(B.Direction_m1_0_7_w); break; case B.Input_e: _this._changeTarget$1(B.Direction_1_0_3_e); break; case B.Input_sw: _this._changeTarget$1(B.Direction_m1_1_6_sw); break; case B.Input_s: _this._changeTarget$1(B.Direction_0_1_5_s); break; case B.Input_se: _this._changeTarget$1(B.Direction_1_1_4_se); break; } return true; }, keyDown$3$alt$shift(keyCode, alt, shift) { var t1, t2, _this = this; if (keyCode === 9 && _this._monsters.length !== 0) { t1 = _this._targetingFloor; _this._targetingFloor = !t1; t2 = _this._target_dialog$_gameScreen; if (t1) { t1 = t2.get$currentTarget(); _this._targetNearest$1(t1 == null ? t2.game.hero._pos : t1); } else t2.targetFloor$1(t2.get$currentTarget()); return true; } return false; }, update$0() { var t1 = (this._target_dialog$_animateOffset + 1) % 25; this._target_dialog$_animateOffset = t1; if (B.JSInt_methods.$mod(t1, 5) === 0) this.dirty$0(); }, render$1(terminal) { var hero, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, pos, t18, t19, t20, appearance, charCode, target, reachedTarget, frame, reticleColor, helpKeys, _this = this, _null = null, _s11_ = "Choose tile", t1 = _this._target_dialog$_gameScreen, t2 = t1.game, t3 = t2.__Game__stage_F; t3 === $ && A.throwLateFieldNI("_stage"); hero = t2.hero; t4 = t1.__GameScreen__stagePanel_F; t4 === $ && A.throwLateFieldNI("_stagePanel"); t5 = A.RectIterator$(t4._cameraBounds); t6 = _this._target_dialog$_range; t7 = t3.tiles; t8 = t7._elements; t9 = t7.bounds.size.x; t10 = t8.length; t11 = t3._actorsByTile; t12 = t11._elements; t13 = t11.bounds.size.x; t14 = t12.length; t3 = t3._itemsByTile; t15 = type$.List_Glyph; while (t5.moveNext$0()) { t16 = t5._x; t17 = t5._y; pos = new A.Vec(t16, t17); t7._checkBounds$2(t16, t17); t18 = t17 * t9 + t16; if (!(t18 >= 0 && t18 < t10)) return A.ioore(t8, t18); t18 = t8[t18]; t11._checkBounds$2(t16, t17); t19 = t17 * t13 + t16; if (!(t19 >= 0 && t19 < t14)) return A.ioore(t12, t19); t19 = t12[t19]; if (t18._isExplored) { if (t18._isOccluded) continue; t20 = t18.type.motility._bitMask; if ((t20 & $.$get$Motility_walk()._bitMask) === 0 && (t20 & $.$get$Motility_fly()._bitMask) === 0) continue; if (t19 != null) continue; if (t3.containsKey$1(pos)) continue; } else if (_this._isKnownOccluded$1(pos)) continue; else if (t19 != null && t2.heroCanPerceive$1(t19)) continue; if (pos.$sub(0, hero._pos).$gt(0, t6)) continue; if (t18._isExplored) { appearance = t18.type.appearance; if (appearance instanceof A.Glyph) charCode = appearance.char; else { t15._as(appearance); if (0 >= appearance.length) return A.ioore(appearance, 0); charCode = appearance[0].char; } } else charCode = 183; t18 = t4._bounds.pos; t19 = t4._cameraBounds.pos; t20 = t4._renderOffset; terminal.drawGlyph$3(t16 + t18.x - t19.x + t20.x, t17 + t18.y - t19.y + t20.y, new A.Glyph(charCode, B.Color_222_156_33, B.Color_0_0_0)); } target = t1.get$currentTarget(); if (target == null) return; t1 = t7.$get$2(target.get$x(), target.get$y()); if (t1._isExplored) { t2 = $.$get$Motility_fly(); t1 = (t1.type.motility._bitMask & t2._bitMask) !== 0 && !t1._isOccluded; } else t1 = true; reachedTarget = false; if (t1) { frame = B.JSInt_methods._tdivFast$1(_this._target_dialog$_animateOffset, 5); for (t1 = A._LineIterator__LineIterator(hero._pos, target); t1.moveNext$0(), true;) { pos = t1._line$_current; if (pos.$eq(0, target)) { reachedTarget = true; break; } t2 = pos.get$x(); t3 = pos.get$y(); t7._checkBounds$2(t2, t3); t2 = t3 * t9 + t2; if (!(t2 >= 0 && t2 < t10)) return A.ioore(t8, t2); t2 = t8[t2]; if (t2._isExplored) { t3 = pos.get$x(); t5 = pos.get$y(); t11._checkBounds$2(t3, t5); t3 = t5 * t13 + t3; if (!(t3 >= 0 && t3 < t14)) return A.ioore(t12, t3); if (t12[t3] != null) break; t3 = $.$get$Motility_fly(); if ((t2.type.motility._bitMask & t3._bitMask) === 0) break; } t2 = pos.get$x(); t3 = pos.get$y(); t5 = frame === 0 ? B.Color_222_156_33 : B.Color_38_42_66; t6 = t4._bounds.pos; t15 = t4._cameraBounds.pos; t16 = t4._renderOffset; terminal.drawGlyph$3(t2 + t6.x - t15.x + t16.x, t3 + t6.y - t15.y + t16.y, new A.Glyph(8226, t5, B.Color_0_0_0)); frame = B.JSInt_methods.$mod(frame + 5 - 1, 5); } } else frame = 0; reticleColor = reachedTarget ? frame === 0 ? B.Color_222_156_33 : B.Color_38_42_66 : B.Color_38_42_66; t4.drawStageGlyph$4(terminal, target.get$x() - 1, target.get$y(), A.Glyph$("-", reticleColor, _null)); t4.drawStageGlyph$4(terminal, target.get$x() + 1, target.get$y(), A.Glyph$("-", reticleColor, _null)); t4.drawStageGlyph$4(terminal, target.get$x(), target.get$y() - 1, A.Glyph$("|", reticleColor, _null)); t4.drawStageGlyph$4(terminal, target.get$x(), target.get$y() + 1, A.Glyph$("|", reticleColor, _null)); if (!reachedTarget) t4.drawStageGlyph$4(terminal, target.get$x(), target.get$y(), A.Glyph$("X", reticleColor, _null)); t1 = type$.String; helpKeys = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); if (_this._monsters.length === 0) helpKeys.$indexSet(0, "\u2195\u2194", _s11_); else if (_this._targetingFloor) { helpKeys.$indexSet(0, "\u2195\u2194", _s11_); helpKeys.$indexSet(0, "Tab", "Target monsters"); } else { helpKeys.$indexSet(0, "\u2195\u2194", "Choose monster"); helpKeys.$indexSet(0, "Tab", "Target floor"); } helpKeys.$indexSet(0, "`", "Cancel"); A.Draw_helpKeys(terminal, helpKeys, "Choose a target"); }, _changeTarget$1(dir) { if (this._targetingFloor) this._changeFloorTarget$1(dir); else this._changeMonsterTarget$1(dir); }, _changeFloorTarget$1(dir) { var t1 = this._target_dialog$_gameScreen, pos = t1.get$currentTarget().$add(0, dir); if (pos.$sub(0, t1.game.hero._pos).$gt(0, this._target_dialog$_range)) return; t1.targetFloor$1(pos); }, _changeMonsterTarget$1(dir) { var t2, perp, t3, t4, t5, t6, _i, monster, relative, nearest, farthest, t1 = type$.JSArray_Monster, ahead = A._setArrayType([], t1), behind = A._setArrayType([], t1); t1 = this._target_dialog$_gameScreen; t2 = t1.get$currentTarget(); t2.toString; perp = dir.get$rotateLeft90(); for (t3 = this._monsters, t4 = t3.length, t5 = perp.x, t6 = perp.y, _i = 0; _i < t3.length; t3.length === t4 || (0, A.throwConcurrentModificationError)(t3), ++_i) { monster = t3[_i]; relative = monster._pos.$sub(0, t2); if (t5 * relative.y - t6 * relative.x > 0) B.JSArray_methods.add$1(ahead, monster); else B.JSArray_methods.add$1(behind, monster); } t3 = type$.Monster; nearest = A._findLowest(ahead, new A.TargetDialog__changeMonsterTarget_closure(t2), t3); if (nearest != null) { t1.targetActor$1(nearest); return; } farthest = A._findHighest(behind, new A.TargetDialog__changeMonsterTarget_closure0(t2), t3); if (farthest != null) t1.targetActor$1(farthest); }, _isKnownOccluded$1(target) { var t3, t4, t5, t6, pos, t7, t8, t1 = this._target_dialog$_gameScreen.game, t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); for (t1 = A._LineIterator__LineIterator(t1.hero._pos, target), t2 = t2.tiles, t3 = t2._elements, t4 = t2.bounds, t5 = t4.size.x, t6 = t3.length; t1.moveNext$0(), true;) { pos = t1._line$_current; if (pos.$eq(0, target)) return false; if (!t4.contains$1(0, pos)) return true; t7 = pos.get$x(); t8 = pos.get$y(); t2._checkBounds$2(t7, t8); t7 = t8 * t5 + t7; if (!(t7 >= 0 && t7 < t6)) return A.ioore(t3, t7); t7 = t3[t7]; if (t7._isExplored) { t8 = $.$get$Motility_fly(); t8 = (t7.type.motility._bitMask & t8._bitMask) === 0; t7 = t8; } else t7 = false; if (t7) return true; } throw A.wrapException(A.AssertionError$("Unreachable.")); } }; A.TargetDialog__changeMonsterTarget_closure.prototype = { call$1(monster) { return type$.Monster._as(monster)._pos.$sub(0, this.target).get$lengthSquared(); }, $signature: 26 }; A.TargetDialog__changeMonsterTarget_closure0.prototype = { call$1(monster) { return type$.Monster._as(monster)._pos.$sub(0, this.target).get$lengthSquared(); }, $signature: 26 }; A.WizardDialog.prototype = { get$isTransparent() { return true; }, handleInput$1(input) { if (input === B.Input_cancel) { this._ui.pop$0(); return true; } return false; }, keyDown$3$alt$shift(keyCode, alt, shift) { var t1, t2, _i, t3, key, action; if (shift || alt) return false; for (t1 = this._menuItems, t2 = t1.length, _i = 0; _i < t2; ++_i) { t3 = t1[_i]._values; key = t3[1]; action = t3[3]; if (key === keyCode) { action.call$0(); this.dirty$0(); return true; } } return false; }, activate$2(popped, result) { type$.Screen_Input._as(popped); this._wizard_dialog$_isActive = true; }, render$1(terminal) { var t1, t2, width, _i, t3, t4, i, key, $name, _this = this; for (t1 = _this._menuItems, t2 = t1.length, width = 0, _i = 0; _i < t2; ++_i) width = Math.max(width, t1[_i]._values[2].length); t3 = _this._wizard_dialog$_isActive; t4 = t3 ? B.Color_222_156_33 : B.Color_38_42_66; A.Draw_frame(terminal, t4, t2 + 2, "Wizard Menu", t3, 40, null, null); for (t2 = t1.length, i = 0, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { t3 = t1[_i]._values; key = t3[0]; $name = t3[2]; ++i; terminal.writeAt$4(1, i, key, _this._wizard_dialog$_isActive ? B.Color_222_156_33 : B.Color_38_42_66); terminal.writeAt$4(2, i, ")", B.Color_38_42_66); terminal.writeAt$4(4, i, $name, _this._wizard_dialog$_isActive ? B.Color_226_223_240 : B.Color_38_42_66); } if (_this._wizard_dialog$_isActive) { t1 = type$.String; A.Draw_helpKeys(terminal, A.LinkedHashMap_LinkedHashMap$_literal(["`", "Exit"], t1, t1), null); } }, _mapDungeon$0() { var t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, _i, neighbor, t12, t13, t1 = this._wizard_dialog$_game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); for (t1 = t1.tiles, t2 = t1.bounds, t3 = A.RectIterator$(t2), t4 = t1._elements, t5 = t2.size.x, t6 = t4.length; t3.moveNext$0();) { t7 = t3._x; t8 = t3._y; t1._checkBounds$2(t7, t8); t9 = t8 * t5 + t7; if (!(t9 >= 0 && t9 < t6)) return A.ioore(t4, t9); t10 = t4[t9]; t11 = $.$get$Motility_fly(); if ((t10.type.motility._bitMask & t11._bitMask) !== 0) { t1._checkBounds$2(t7, t8); t10.updateExplored$1$force(true); continue; } for (t10 = new A.Vec(t7, t8).get$neighbors(), t11 = t10.length, _i = 0; _i < t11; ++_i) { neighbor = t10[_i]; if (t2.contains$1(0, neighbor)) { t12 = neighbor.x; t13 = neighbor.y; t1._checkBounds$2(t12, t13); t12 = t13 * t5 + t12; if (!(t12 >= 0 && t12 < t6)) return A.ioore(t4, t12); t12 = t4[t12]; t13 = $.$get$Motility_fly(); t13 = (t12.type.motility._bitMask & t13._bitMask) !== 0; t12 = t13; } else t12 = false; if (t12) { t1._checkBounds$2(t7, t8); t4[t9].updateExplored$1$force(true); break; } } } }, _illuminateDungeon$0() { var t2, t3, t4, t5, t6, t7, t8, t9, t10, t1 = this._wizard_dialog$_game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); for (t2 = t1.tiles, t3 = t2.bounds, t4 = A.RectIterator$(t3), t5 = t2._elements, t3 = t3.size.x, t6 = t5.length; t4.moveNext$0();) { t7 = t4._x; t8 = t4._y; t2._checkBounds$2(t7, t8); t9 = t8 * t3 + t7; if (!(t9 >= 0 && t9 < t6)) return A.ioore(t5, t9); t9 = t5[t9]; t10 = $.$get$Motility_fly(); if ((t9.type.motility._bitMask & t10._bitMask) !== 0) { t2._checkBounds$2(t7, t8); t9._appliedEmanation = B.JSInt_methods.clamp$2(t9._appliedEmanation + 255, 0, 192); } } t1 = t1.get$_lighting(); t1._floorLightDirty = true; t1.refresh$0(); }, _dropItem$0() { this._wizard_dialog$_isActive = false; this._ui.push$1(new A._WizardDropDialog(this._wizard_dialog$_game)); }, _wizard_dialog$_spawnMonster$0() { this._wizard_dialog$_isActive = false; this._ui.push$1(new A._WizardSpawnDialog(this._wizard_dialog$_game)); }, _gainExperience$0() { var t1 = this._wizard_dialog$_game.hero; t1.save.experience += 10000; t1.refreshProperties$0(); this.dirty$0(); }, _trainDiscipline$0() { this._wizard_dialog$_isActive = false; this._ui.push$1(new A._WizardTrainDialog(this._wizard_dialog$_game)); }, _killAllMonsters$0() { var t2, t3, _i, monster, t4, t5, t1 = this._wizard_dialog$_game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t2 = t1._actors; t2 = A._setArrayType(t2.slice(0), A._arrayInstanceType(t2)); t3 = t2.length; _i = 0; for (; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { monster = t2[_i]; if (!(monster instanceof A.Monster)) continue; t4 = monster._pos; t5 = monster._breed; t1.placeDrops$3$depth(t4, t5.drop, t5.depth); t1.removeActor$1(monster); } this.dirty$0(); }, _toggleShowAllMonsters$0() { var t1 = !$.Debug_showAllMonsters; $.Debug_showAllMonsters = t1; this._wizard_dialog$_game.hero.save.log.debug$1("Show all monsters = " + t1); this._ui.pop$0(); }, _toggleAlertness$0() { var t1 = !$.Debug_showMonsterAlertness; $.Debug_showMonsterAlertness = t1; this._wizard_dialog$_game.hero.save.log.debug$1("Show monster alertness = " + t1); this._ui.pop$0(); }, _toggleShowHeroVolume$0() { var t1 = !$.Debug_showHeroVolume; $.Debug_showHeroVolume = t1; this._wizard_dialog$_game.hero.save.log.debug$1("Show hero volume = " + t1); this._ui.pop$0(); } }; A._SearchDialog.prototype = { get$isTransparent() { return true; }, handleInput$1(input) { if (input === B.Input_cancel) { this._ui.pop$0(); return true; } return false; }, keyDown$3$alt$shift(keyCode, alt, shift) { var t1, t2, _i, n, _this = this; if (alt) return false; switch (keyCode) { case 13: for (t1 = _this.get$_matchedItems(), t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) _this._wizard_dialog$_selectItem$1(t1[_i]); _this._ui.pop$0(); return true; case 8: t1 = _this._wizard_dialog$_pattern; t2 = t1.length; if (t2 !== 0) { _this._wizard_dialog$_pattern = B.JSString_methods.substring$2(t1, 0, t2 - 1); _this.dirty$0(); } return true; case 32: _this._wizard_dialog$_pattern += " "; _this.dirty$0(); return true; default: if (keyCode >= 65 && keyCode <= 90) { _this._wizard_dialog$_pattern = _this._wizard_dialog$_pattern + A.String_String$fromCharCodes(A._setArrayType([keyCode], type$.JSArray_int)).toLowerCase(); _this.dirty$0(); return true; } else if (keyCode >= 48 && keyCode <= 57) { n = keyCode - 48; if (n < _this.get$_matchedItems().length) { t1 = _this.get$_matchedItems(); if (!(n >= 0 && n < t1.length)) return A.ioore(t1, n); _this._wizard_dialog$_selectItem$1(t1[n]); _this._ui.pop$0(); return true; } } } return false; }, render$1(terminal) { var t1, t2, n, _i, item, t3, appearance, _this = this, _null = null, dialog = new A.PortTerminal(new A.Vec(43, 38), 40, 0, terminal); A.Draw_frame(dialog, B.Color_222_156_33, _null, _this.get$_question(), false, _null, _null, _null); dialog.writeAt$4(_this.get$_question().length + 4, 0, _this._wizard_dialog$_pattern, B.Color_222_156_33); dialog.writeAt$5(_this.get$_question().length + 4 + _this._wizard_dialog$_pattern.length, 0, " ", B.Color_222_156_33, B.Color_222_156_33); for (t1 = _this.get$_matchedItems(), t2 = t1.length, n = 0, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { item = t1[_i]; if (!B.JSString_methods.contains$1(_this._itemName$1(item).toLowerCase(), _this._wizard_dialog$_pattern.toLowerCase())) continue; if (n < 10) { t3 = n + 1; dialog.writeAt$4(1, t3, B.JSInt_methods.toString$0(n), B.Color_222_156_33); dialog.writeAt$4(2, t3, ")", B.Color_38_42_66); } appearance = _this._itemAppearance$1(item); ++n; if (appearance instanceof A.Glyph) dialog.drawGlyph$3(3, n, appearance); else dialog.writeAt$3(3, n, "-"); dialog.writeAt$4(5, n, _this._itemName$1(item), B.Color_226_223_240); if (n >= 36) break; } t1 = type$.String; A.Draw_helpKeys(terminal, A.LinkedHashMap_LinkedHashMap$_literal(["0-9", "Select", "Enter", "Select all", "`", "Exit"], t1, t1), _null); }, get$_matchedItems() { var t1 = this.get$_allItems(), t2 = A._instanceType(t1), t3 = t2._eval$1("WhereIterable"); t1 = A.List_List$_of(new A.WhereIterable(t1, t2._eval$1("bool(Iterable.E)")._as(new A._SearchDialog__matchedItems_closure(this)), t3), t3._eval$1("Iterable.E")); return t1; } }; A._SearchDialog__matchedItems_closure.prototype = { call$1(item) { var t1 = this.$this; return B.JSString_methods.contains$1(t1._itemName$1(A._instanceType(t1)._eval$1("_SearchDialog.T")._as(item)).toLowerCase(), t1._wizard_dialog$_pattern.toLowerCase()); }, $signature() { return A._instanceType(this.$this)._eval$1("bool(_SearchDialog.T)"); } }; A._WizardDropDialog.prototype = { get$_question() { return "Drop what?"; }, get$_allItems() { return $.$get$Items_types().get$all(); }, _itemName$1(item) { return A.Log__categorize(type$.ItemType._as(item).quantifiableName, false, true); }, _itemAppearance$1(item) { return type$.ItemType._as(item).appearance; }, _wizard_dialog$_selectItem$1(itemType) { var item, t1, t2; type$.ItemType._as(itemType); if (itemType.isArtifact) this._wizard_dialog$_game.hero.save.lore._createdArtifacts.add$1(0, itemType); item = new A.Item(itemType, null, null, null, itemType.maxStack); t1 = this._wizard_dialog$_game; t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); t1 = t1.hero; t2.addItem$2(item, t1._pos); t1.save.log.debug$2("Dropped {1}.", item); } }; A._WizardSpawnDialog.prototype = { get$_question() { return "Spawn what?"; }, get$_allItems() { return $.$get$Monsters_breeds().get$all(); }, _itemName$1(breed) { return A.Log__categorize(type$.Breed._as(breed)._breed$_name, false, true); }, _itemAppearance$1(breed) { return type$.Breed._as(breed).appearance; }, _wizard_dialog$_selectItem$1(breed) { var t1, t2, pos; type$.Breed._as(breed); t1 = this._wizard_dialog$_game; t2 = t1.__Game__stage_F; t2 === $ && A.throwLateFieldNI("_stage"); pos = A.MotilityFlow$(t2, t1.hero._pos, $.$get$Motility_walk(), null, null, null).bestWhere$1(new A._WizardSpawnDialog__selectItem_closure(this)); if (pos == null) return; t2.addActor$1(breed.spawn$1(pos)); } }; A._WizardSpawnDialog__selectItem_closure.prototype = { call$1(pos) { return pos.$sub(0, this.$this._wizard_dialog$_game.hero._pos).$gt(0, 6); }, $signature: 1 }; A._WizardTrainDialog.prototype = { get$_question() { return "Train which discipline?"; }, get$_allItems() { return new A.WhereTypeIterable($.$get$Skills_all(), type$.WhereTypeIterable_Discipline); }, _itemName$1(discipline) { return type$.Discipline._as(discipline).get$name(); }, _itemAppearance$1(discipline) { type$.Discipline._as(discipline); return null; }, _wizard_dialog$_selectItem$1(discipline) { var t1, t2, t3, t4; type$.Discipline._as(discipline); t1 = this._wizard_dialog$_game.hero; t2 = t1.save; t3 = t2.skills; t4 = t3.level$1(discipline) + 1; if (t4 < discipline.get$maxLevel()) { t2 = discipline.trainingNeeded$2(t2.heroClass, t4); t2.toString; t3.earnPoints$2(discipline, t2 - t3.points$1(discipline)); t1.refreshSkill$1(discipline); } else t2.log.debug$1("Already at max level."); } }; A.Display.prototype = { setGlyph$3(x, y, glyph) { var t1, t2; if (x < 0) return; t1 = this._glyphs; t2 = t1.bounds.size; if (x >= t2.x) return; if (y < 0) return; if (y >= t2.y) return; t2 = this._changedGlyphs; if (!t1.$get$2(x, y).$eq(0, glyph)) t2.$set$3(x, y, glyph); else t2.$set$3(x, y, null); }, render$1(renderGlyph) { var t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, y, t11, t12, x, t13, glyph; type$.void_Function_int_int_Glyph._as(renderGlyph); for (t1 = this._glyphs, t2 = t1.bounds.size, t3 = t2.y, t2 = t2.x, t4 = t1.$ti._precomputed1, t5 = t1._elements, t6 = this._changedGlyphs, t7 = t6.$ti._precomputed1, t8 = t6._elements, t9 = t6.bounds.size.x, t10 = t8.length, y = 0; y < t3; ++y) for (t11 = y * t2, t12 = y * t9, x = 0; x < t2; ++x) { t6._checkBounds$2(x, y); t13 = t12 + x; if (!(t13 >= 0 && t13 < t10)) return A.ioore(t8, t13); glyph = t8[t13]; if (glyph == null) continue; renderGlyph.call$3(x, y, glyph); t4._as(glyph); t1._checkBounds$2(x, y); B.JSArray_methods.$indexSet(t5, t11 + x, glyph); t7._as(null); t6._checkBounds$2(x, y); B.JSArray_methods.$indexSet(t8, t13, null); } } }; A.Color.prototype = { get$hashCode(_) { return B.JSInt_methods.get$hashCode(this.r) ^ B.JSInt_methods.get$hashCode(this.g) ^ B.JSInt_methods.get$hashCode(this.b); }, $eq(_, other) { if (other == null) return false; return other instanceof A.Color && this.r === other.r && this.g === other.g && this.b === other.b; }, add$2(_, other, fractionOther) { return new A.Color(B.JSNumber_methods.toInt$0(B.JSNumber_methods.clamp$2(this.r + other.r * fractionOther, 0, 255)), B.JSNumber_methods.toInt$0(B.JSNumber_methods.clamp$2(this.g + other.g * fractionOther, 0, 255)), B.JSNumber_methods.toInt$0(B.JSNumber_methods.clamp$2(this.b + other.b * fractionOther, 0, 255))); }, blend$2(other, fractionOther) { var fractionThis = 1 - fractionOther; return new A.Color(B.JSNumber_methods.toInt$0(this.r * fractionThis + other.r * fractionOther), B.JSNumber_methods.toInt$0(this.g * fractionThis + other.g * fractionOther), B.JSNumber_methods.toInt$0(this.b * fractionThis + other.b * fractionOther)); } }; A.Glyph.prototype = { get$hashCode(_) { return B.JSInt_methods.get$hashCode(this.char) ^ this.fore.get$hashCode(0) ^ this.back.get$hashCode(0); }, $eq(_, other) { if (other == null) return false; if (other instanceof A.Glyph) return this.char === other.char && this.fore.$eq(0, other.fore) && this.back.$eq(0, other.back); return false; } }; A.KeyBindings.prototype = {}; A._KeyBinding.prototype = { $eq(_, other) { if (other == null) return false; return other instanceof A._KeyBinding && this.charCode === other.charCode && this.shift === other.shift && this.alt === other.alt; }, get$hashCode(_) { return (B.JSInt_methods.get$hashCode(this.charCode) ^ B.JSBool_methods.get$hashCode(this.shift) ^ B.JSBool_methods.get$hashCode(this.alt)) >>> 0; }, toString$0(_) { var result = "key(" + this.charCode; if (this.shift) result += " shift"; return (this.alt ? result + " alt" : result) + ")"; } }; A.PortTerminal.prototype = { get$width() { return this.size.x; }, get$height() { return this.size.y; }, drawGlyph$3(x, y, glyph) { var t1, _this = this; if (x < 0) return; t1 = _this.size; if (x >= t1.x) return; if (y < 0) return; if (y >= t1.y) return; _this._root.drawGlyph$3(_this._port_terminal$_x + x, _this._port_terminal$_y + y, glyph); }, rect$4(x, y, width, height) { return new A.PortTerminal(new A.Vec(width, height), this._port_terminal$_x + x, this._port_terminal$_y + y, this._root); } }; A.RetroTerminal.prototype = { get$width() { return this._display._glyphs.bounds.size.x; }, get$height() { return this._display._glyphs.bounds.size.y; }, RetroTerminal$_$6(_display, _charWidth, _charHeight, canvas, _font, _scale) { var t1 = type$._ElementEventStreamImpl_JSObject; A._EventStreamSubscription$(this._font, "load", t1._eval$1("~(1)?")._as(new A.RetroTerminal$__closure(this)), false, t1._precomputed1); }, drawGlyph$3(x, y, glyph) { this._display.setGlyph$3(x, y, glyph); }, render$0() { if (!this._imageLoaded) return; this._display.render$1(new A.RetroTerminal_render_closure(this)); }, _getColorFont$1(color) { var _this, t2, context, t1 = this._fontColorCache, cached = t1.$index(0, color); if (cached != null) return cached; _this = A._asJSObject(A._asJSObject(init.G.document).createElement("canvas")); t2 = this._font; _this.width = A._asInt(t2.width); _this.height = A._asInt(t2.height); context = A._asJSObjectQ(_this.getContext("2d")); if (context == null) context = A._asJSObject(context); context.drawImage(t2, 0, 0); context.globalCompositeOperation = "source-atop"; context.fillStyle = "rgb(" + color.r + ", " + color.g + ", " + color.b + ")"; context.fillRect(0, 0, A._asInt(t2.width), A._asInt(t2.height)); t1.$indexSet(0, color, _this); return _this; } }; A.RetroTerminal$__closure.prototype = { call$1(__wc0_formal) { var t1 = this.$this; t1._imageLoaded = true; t1.render$0(); }, $signature: 3 }; A.RetroTerminal_render_closure.prototype = { call$3(x, y, glyph) { var t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, color, char = glyph.char, char0 = B.Map_TaQlz.$index(0, char); char = char0 == null ? char : char0; t1 = B.JSInt_methods.$mod(char, 32); t2 = this.$this; t3 = t2._charWidth; t4 = B.JSInt_methods._tdivFast$1(char, 32); t5 = t2._charHeight; t6 = t2._context; t7 = glyph.back; t6.fillStyle = "rgb(" + t7.r + ", " + t7.g + ", " + t7.b + ")"; t7 = t2._scale; t8 = x * t3 * t7; t9 = y * t5 * t7; t10 = t3 * t7; t7 = t5 * t7; t6.fillRect(t8, t9, t10, t7); if (char === 0 || char === 32) return; color = t2._getColorFont$1(glyph.fore); t6.imageSmoothingEnabled = false; t6.drawImage.apply(t6, [color, t1 * t3, t4 * t5, t3, t5, t8, t9, t10, t7]); }, $signature: 35 }; A.Terminal.prototype = { fill$5(x, y, width, height, color) { var t1, t2, py, px, glyph = A.Glyph$fromCharCode(32, B.Color_255_255_255, color == null ? B.Color_0_0_0 : color); for (t1 = y + height, t2 = x + width, py = y; py < t1; ++py) for (px = x; px < t2; ++px) this.drawGlyph$3(px, py, glyph); }, fill$4(x, y, width, height) { return this.fill$5(x, y, width, height, null); }, writeAt$5(x, y, text, fore, $back) { var t1, i, t2; if (fore == null) fore = B.Color_255_255_255; if ($back == null) $back = B.Color_0_0_0; for (t1 = text.length, i = 0; i < t1; ++i) { t2 = x + i; if (t2 >= this.get$width()) break; this.drawGlyph$3(t2, y, new A.Glyph(text.charCodeAt(i), fore, $back)); } }, writeAt$4(x, y, text, fore) { return this.writeAt$5(x, y, text, fore, null); }, writeAt$3(x, y, text) { return this.writeAt$5(x, y, text, null, null); }, rect$4(x, y, width, height) { return new A.PortTerminal(new A.Vec(width, height), x, y, this); } }; A.RenderableTerminal.prototype = {}; A.UserInterface.prototype = { get$_tickJS() { var result, _this = this, value = _this.__UserInterface__tickJS_FI; if (value === $) { result = A._functionToJS1(_this.get$_tick()); _this.__UserInterface__tickJS_FI !== $ && A.throwLateFieldADI("_tickJS"); _this.__UserInterface__tickJS_FI = result; value = result; } return value; }, set$handlingInput(value) { var t1, t2, t3, t4, _this = this; if (_this._keyDownSubscription != null) return; t1 = init.G; t2 = A._asJSObjectQ(A._asJSObject(t1.document).body); t2.toString; t3 = type$._ElementEventStreamImpl_JSObject; t4 = t3._eval$1("~(1)?"); t3 = t3._precomputed1; _this._keyDownSubscription = A._EventStreamSubscription$(t2, "keydown", t4._as(_this.get$_keyDown()), false, t3); t1 = A._asJSObjectQ(A._asJSObject(t1.document).body); t1.toString; _this._keyUpSubscription = A._EventStreamSubscription$(t1, "keyup", t4._as(_this.get$_keyUp()), false, t3); }, set$running(value) { var _this = this; if (_this._running) return; _this._running = true; _this._lastRefreshTime = null; A._asInt(A._asJSObject(init.G.window).requestAnimationFrame(_this.get$_tickJS())); }, setTerminal$1(terminal) { var t3, _i, _this = this, t1 = _this._terminal._display._glyphs.bounds.size, t2 = terminal._display._glyphs.bounds.size, resized = t1.x !== t2.x || t1.y !== t2.y; _this._terminal = terminal; _this._dirty = true; if (resized) for (t1 = _this._screens, t2 = t1.length, t3 = terminal._display._glyphs.bounds.size, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) t1[_i].resize$1(t3); }, push$1($screen) { var _this = this; _this.$ti._eval$1("Screen<1>")._as($screen); $screen._user_interface$_bind$1(_this); B.JSArray_methods.add$1(_this._screens, $screen); _this._render$0(); }, pop$1(result) { var $screen, t2, t3, t1 = this._screens; if (0 >= t1.length) return A.ioore(t1, -1); $screen = t1.pop(); $screen._ui = null; t2 = t1.length; t3 = t2 - 1; if (!(t3 >= 0)) return A.ioore(t1, t3); t1[t3].activate$2($screen, result); this._render$0(); }, pop$0() { return this.pop$1(null); }, goTo$1($screen) { var t1, _this = this; _this.$ti._eval$1("Screen<1>")._as($screen); t1 = _this._screens; if (0 >= t1.length) return A.ioore(t1, -1); t1.pop()._ui = null; $screen._user_interface$_bind$1(_this); B.JSArray_methods.add$1(t1, $screen); _this._render$0(); }, refresh$0() { var t1, i; for (t1 = this._screens, i = 0; i < t1.length; ++i) t1[i].update$0(); if (this._dirty) this._render$0(); }, _keyDown$1($event) { var t1, input, $screen, keyCode = A._asInt($event.keyCode); if (A._asInt($event.location) === 3) { $label0$0: { if (48 === keyCode) { t1 = 96; break $label0$0; } if (49 === keyCode) { t1 = 97; break $label0$0; } if (50 === keyCode) { t1 = 98; break $label0$0; } if (51 === keyCode) { t1 = 99; break $label0$0; } if (52 === keyCode) { t1 = 100; break $label0$0; } if (53 === keyCode) { t1 = 101; break $label0$0; } if (54 === keyCode) { t1 = 102; break $label0$0; } if (55 === keyCode) { t1 = 103; break $label0$0; } if (56 === keyCode) { t1 = 104; break $label0$0; } if (57 === keyCode) { t1 = 105; break $label0$0; } if (187 === keyCode) { t1 = 1000; break $label0$0; } if (13 === keyCode) { t1 = 1001; break $label0$0; } t1 = keyCode; break $label0$0; } keyCode = t1; } if (keyCode === 59) keyCode = 186; input = this.keyPress._bindings.$index(0, new A._KeyBinding(keyCode, A._asBool($event.shiftKey), A._asBool($event.altKey))); $screen = B.JSArray_methods.get$last(this._screens); if (input != null) { $event.preventDefault(); if ($screen.handleInput$1(input)) return; } t1 = A._asBool($event.shiftKey); if ($screen.keyDown$3$alt$shift(keyCode, A._asBool($event.altKey), t1)) $event.preventDefault(); }, _keyUp$1($event) { var $screen, t1, keyCode = A._asInt($event.keyCode); if (keyCode === 59) keyCode = 186; $screen = B.JSArray_methods.get$last(this._screens); t1 = A._asBool($event.shiftKey); if ($screen.keyUp$3$alt$shift(keyCode, A._asBool($event.altKey), t1)) $event.preventDefault(); }, _tick$1(time) { var _0_0, _this = this; A._asNum(time); _0_0 = _this._lastRefreshTime; if (_0_0 != null) { if (time - _0_0 > 16.666666666666668) { _this.refresh$0(); _this._lastRefreshTime = time; } } else { _this.refresh$0(); _this._lastRefreshTime = time; } if (_this._running) A._asInt(A._asJSObject(init.G.window).requestAnimationFrame(_this.get$_tickJS())); }, _render$0() { var t1, i, terminal = this._terminal; terminal.fill$4(0, 0, terminal.get$width(), terminal.get$height()); for (t1 = this._screens, i = t1.length - 1; i >= 0; --i) { if (!(i < t1.length)) return A.ioore(t1, i); if (!t1[i].get$isTransparent()) break; } if (i < 0) i = 0; for (; i < t1.length; ++i) t1[i].render$1(terminal); this._dirty = false; terminal.render$0(); } }; A.Screen.prototype = { get$isTransparent() { return false; }, _user_interface$_bind$1(ui) { A._instanceType(this)._eval$1("UserInterface")._as(ui); this._ui = ui; this.resize$1(ui._terminal._display._glyphs.bounds.size); }, dirty$0() { var t1 = this._ui; if (t1 == null) return; t1._dirty = true; }, handleInput$1(input) { A._instanceType(this)._eval$1("Screen.T")._as(input); return false; }, keyDown$3$alt$shift(keyCode, alt, shift) { return false; }, keyUp$3$alt$shift(keyCode, alt, shift) { return false; }, activate$2(popped, result) { A._instanceType(this)._eval$1("Screen")._as(popped); }, update$0() { }, render$1(terminal) { }, resize$1(size) { } }; A.Array2D.prototype = { Array2D$generated$3(width, height, generator, $T) { var t1, t2, t3, t4, x, t5, y, _this = this; for (t1 = _this.$ti._precomputed1, t2 = _this._elements, t3 = _this.bounds.size.x, t4 = 0 * t3, x = 1; x < width; ++x) { t5 = t1._as(generator.call$1(new A.Vec(x, 0))); _this._checkBounds$2(x, 0); B.JSArray_methods.$indexSet(t2, t4 + x, t5); } for (y = 1; y < height; ++y) for (t4 = y * t3, x = 0; x < width; ++x) { t5 = t1._as(generator.call$1(new A.Vec(x, y))); _this._checkBounds$2(x, y); B.JSArray_methods.$indexSet(t2, t4 + x, t5); } }, $get$2(x, y) { var t1, t2; this._checkBounds$2(x, y); t1 = this._elements; t2 = y * this.bounds.size.x + x; if (!(t2 >= 0 && t2 < t1.length)) return A.ioore(t1, t2); return t1[t2]; }, $set$3(x, y, value) { var _this = this; _this.$ti._precomputed1._as(value); _this._checkBounds$2(x, y); B.JSArray_methods.$indexSet(_this._elements, y * _this.bounds.size.x + x, value); }, get$iterator(_) { var t1 = this._elements; return new J.ArrayIterator(t1, t1.length, A._arrayInstanceType(t1)._eval$1("ArrayIterator<1>")); }, _checkBounds$2(x, y) { if (x < 0 || x >= this.bounds.size.x) throw A.wrapException(A.RangeError$value(x, "x")); if (y < 0 || y >= this.bounds.size.y) throw A.wrapException(A.RangeError$value(y, "y")); } }; A.Circle.prototype = { isEdge$1(pos) { var t1 = this.center, t2 = this.radius; if (!A._contains(t1, t2, pos)) return false; if (t2 > 0 && A._contains(t1, t2 - 1, pos)) return false; return true; }, get$iterator(_) { return A._CircleIterator__CircleIterator(this, false); } }; A._CircleIterator.prototype = { get$current() { var t1 = this._boundsIterator; return new A.Vec(t1._x, t1._y); }, moveNext$0() { var t1, t2, t3, t4, t5, pos; for (t1 = this._boundsIterator, t2 = this._circle, t3 = t2.center, t4 = t2.radius, t5 = this._edge; t1.moveNext$0();) { pos = new A.Vec(t1._x, t1._y); if (t5) { if (t2.isEdge$1(pos)) return true; } else if (A._contains(t3, t4, pos)) return true; } return false; }, $isIterator: 1 }; A.Direction.prototype = { _enumToString$0() { return "Direction." + this._core$_name; }, get$rotateLeft45() { switch (this.index) { case 0: var t1 = B.Direction_0_0_0_none; break; case 1: t1 = B.Direction_m1_m1_8_nw; break; case 2: t1 = B.Direction_0_m1_1_n; break; case 3: t1 = B.Direction_1_m1_2_ne; break; case 4: t1 = B.Direction_1_0_3_e; break; case 5: t1 = B.Direction_1_1_4_se; break; case 6: t1 = B.Direction_0_1_5_s; break; case 7: t1 = B.Direction_m1_1_6_sw; break; case 8: t1 = B.Direction_m1_0_7_w; break; default: t1 = null; } return t1; }, get$rotateRight45() { switch (this.index) { case 0: var t1 = B.Direction_0_0_0_none; break; case 1: t1 = B.Direction_1_m1_2_ne; break; case 2: t1 = B.Direction_1_0_3_e; break; case 3: t1 = B.Direction_1_1_4_se; break; case 4: t1 = B.Direction_0_1_5_s; break; case 5: t1 = B.Direction_m1_1_6_sw; break; case 6: t1 = B.Direction_m1_0_7_w; break; case 7: t1 = B.Direction_m1_m1_8_nw; break; case 8: t1 = B.Direction_0_m1_1_n; break; default: t1 = null; } return t1; }, get$rotateLeft90() { switch (this.index) { case 0: var t1 = B.Direction_0_0_0_none; break; case 1: t1 = B.Direction_m1_0_7_w; break; case 2: t1 = B.Direction_m1_m1_8_nw; break; case 3: t1 = B.Direction_0_m1_1_n; break; case 4: t1 = B.Direction_1_m1_2_ne; break; case 5: t1 = B.Direction_1_0_3_e; break; case 6: t1 = B.Direction_1_1_4_se; break; case 7: t1 = B.Direction_0_1_5_s; break; case 8: t1 = B.Direction_m1_1_6_sw; break; default: t1 = null; } return t1; }, get$rotateRight90() { switch (this.index) { case 0: var t1 = B.Direction_0_0_0_none; break; case 1: t1 = B.Direction_1_0_3_e; break; case 2: t1 = B.Direction_1_1_4_se; break; case 3: t1 = B.Direction_0_1_5_s; break; case 4: t1 = B.Direction_m1_1_6_sw; break; case 5: t1 = B.Direction_m1_0_7_w; break; case 6: t1 = B.Direction_m1_m1_8_nw; break; case 7: t1 = B.Direction_0_m1_1_n; break; case 8: t1 = B.Direction_1_m1_2_ne; break; default: t1 = null; } return t1; }, get$rotate180() { switch (this.index) { case 0: var t1 = B.Direction_0_0_0_none; break; case 1: t1 = B.Direction_0_1_5_s; break; case 2: t1 = B.Direction_m1_1_6_sw; break; case 3: t1 = B.Direction_m1_0_7_w; break; case 4: t1 = B.Direction_m1_m1_8_nw; break; case 5: t1 = B.Direction_0_m1_1_n; break; case 6: t1 = B.Direction_1_m1_2_ne; break; case 7: t1 = B.Direction_1_0_3_e; break; case 8: t1 = B.Direction_1_1_4_se; break; default: t1 = null; } return t1; }, toString$0(_) { var t1; switch (this.index) { case 0: t1 = "none"; break; case 1: t1 = "n"; break; case 2: t1 = "ne"; break; case 3: t1 = "e"; break; case 4: t1 = "se"; break; case 5: t1 = "s"; break; case 6: t1 = "sw"; break; case 7: t1 = "w"; break; case 8: t1 = "nw"; break; default: t1 = null; } return t1; }, $isVec: 1, get$x() { return this.x; }, get$y() { return this.y; } }; A._Direction__Enum_VecMixin.prototype = {}; A._LineIterator.prototype = { get$current() { return this._line$_current; }, moveNext$0() { var t2, t3, _this = this, t1 = _this._line$_current.$add(0, _this._primaryStep); _this._line$_current = t1; t2 = _this._error = _this._error + _this._secondary; t3 = _this._line$_primary; if (t2 * 2 >= t3) { _this._line$_current = t1.$add(0, _this._secondaryStep); _this._error = t2 - t3; } return true; }, $isIterator: 1 }; A.Rect.prototype = { get$left() { var t1 = this.pos.x; return Math.min(t1, t1 + this.size.x); }, get$top() { var t1 = this.pos.y; return Math.min(t1, t1 + this.size.y); }, get$right() { var t1 = this.pos.x; return Math.max(t1, t1 + this.size.x); }, get$bottom() { var t1 = this.pos.y; return Math.max(t1, t1 + this.size.y); }, get$center() { var _this = this; return new A.Vec(B.JSInt_methods._tdivFast$1(_this.get$left() + _this.get$right(), 2), B.JSInt_methods._tdivFast$1(_this.get$top() + _this.get$bottom(), 2)); }, toString$0(_) { return "(" + this.pos.toString$0(0) + ")-(" + this.size.toString$0(0) + ")"; }, inflate$1(distance) { var t1 = this.pos, t2 = this.size, t3 = distance * 2; return new A.Rect(new A.Vec(t1.x - distance, t1.y - distance), new A.Vec(t2.x + t3, t2.y + t3)); }, contains$1(_, element) { var t3, t1 = this.pos, t2 = t1.x; if (element.get$x() < t2) return false; t3 = this.size; if (element.get$x() >= t2 + t3.x) return false; t1 = t1.y; if (element.get$y() < t1) return false; if (element.get$y() >= t1 + t3.y) return false; return true; }, get$iterator(_) { var t1 = this.pos; return new A.RectIterator(this, t1.x - 1, t1.y); }, trace$0() { var result, x, t4, t5, y, _this = this, t1 = _this.size, t2 = t1.x, t3 = t2 > 1; if (t3 && t1.y > 1) { result = A._setArrayType([], type$.JSArray_Vec); for (x = _this.get$left(), t3 = _this.pos, t4 = t3.x, t2 = t4 + t2, t5 = Math.max(t4, t2), t3 = t3.y, t1 = t3 + t1.y; x < t5; ++x) { B.JSArray_methods.add$1(result, new A.Vec(x, Math.min(t3, t1))); B.JSArray_methods.add$1(result, new A.Vec(x, Math.max(t3, t1) - 1)); } for (y = _this.get$top() + 1, t1 = Math.max(t3, t1); y < t1 - 1; ++y) { B.JSArray_methods.add$1(result, new A.Vec(Math.min(t4, t2), y)); B.JSArray_methods.add$1(result, new A.Vec(t5 - 1, y)); } return result; } else if (t3 && t1.y === 1) return new A.Rect(new A.Vec(_this.get$left(), _this.get$top()), new A.Vec(t2, 1)); else { t1 = t1.y; if (t1 >= 1 && t2 === 1) return new A.Rect(new A.Vec(_this.get$left(), _this.get$top()), new A.Vec(1, t1)); } return B.List_empty1; } }; A.RectIterator.prototype = { get$current() { return new A.Vec(this._x, this._y); }, moveNext$0() { var _this = this, t1 = _this._rect; if (++_this._x >= t1.get$right()) { _this._x = t1.pos.x; ++_this._y; } return _this._y < t1.get$bottom(); }, $isIterator: 1 }; A.Rng.prototype = { range$2(minOrMax, max) { if (max == null) { max = minOrMax; minOrMax = 0; } return this._random.nextInt$1(max - minOrMax) + minOrMax; }, range$1(minOrMax) { return this.range$2(minOrMax, null); }, inclusive$2(minOrMax, max) { if (max == null) { max = minOrMax; minOrMax = 0; } return this._random.nextInt$1(max + 1 - minOrMax) + minOrMax; }, inclusive$1(minOrMax) { return this.inclusive$2(minOrMax, null); }, float$2(minOrMax, max) { var t1 = this._random; if (max == null) return t1.nextDouble$0() * minOrMax; else return t1.nextDouble$0() * (max - minOrMax) + minOrMax; }, float$1(minOrMax) { return this.float$2(minOrMax, null); }, round$1(_, value) { var result = B.JSNumber_methods.floor$0(value); return this.float$1(1) < value - result ? result + 1 : result; }, take$1$1(_, items, $T) { var index, result; $T._eval$1("List<0>")._as(items); index = this.range$1(items.length); if (!(index >= 0 && index < items.length)) return A.ioore(items, index); result = items[index]; B.JSArray_methods.$indexSet(items, index, B.JSArray_methods.get$last(items)); B.JSArray_methods.removeLast$0(items); return result; }, triangleInt$2(center, range) { var x; if (range < 0) throw A.wrapException(A.ArgumentError$('The argument "range" must be zero or greater.', null)); x = this.inclusive$1(range); if (x <= this.inclusive$1(range)) return center + x; else return center - range - 1 + x; }, taper$2(start, chanceOfIncrement) { var t1 = this._random; for (;;) { if (!(t1.nextInt$1(chanceOfIncrement) === 0)) break; ++start; } return start; } }; A.VecMixin.prototype = { get$kingLength() { return Math.max(Math.abs(this.get$x()), Math.abs(this.get$y())); }, get$lengthSquared() { var _this = this; return _this.get$x() * _this.get$x() + _this.get$y() * _this.get$y(); }, get$length(_) { return Math.sqrt(this.get$lengthSquared()); }, get$nearestDirection() { var _0_3, t1, _0_5, _this = this, _null = null, _0_1 = _this.get$x(), _0_4 = _this.get$y(); $label0$0: { _0_3 = _0_1 < 0; t1 = _0_3; if (t1 && _this.get$y() / _this.get$x() >= 2) { t1 = B.Direction_0_m1_1_n; break $label0$0; } if (_0_3 && _this.get$y() / _this.get$x() >= 0.5) { t1 = B.Direction_m1_m1_8_nw; break $label0$0; } if (_0_3 && _this.get$y() / _this.get$x() >= -0.5) { t1 = B.Direction_m1_0_7_w; break $label0$0; } if (_0_3 && _this.get$y() / _this.get$x() >= -2) { t1 = B.Direction_m1_1_6_sw; break $label0$0; } if (_0_3) { t1 = B.Direction_0_1_5_s; break $label0$0; } _0_5 = _0_1 > 0; t1 = _0_5; if (t1 && _this.get$y() / _this.get$x() >= 2) { t1 = B.Direction_0_1_5_s; break $label0$0; } if (_0_5 && _this.get$y() / _this.get$x() >= 0.5) { t1 = B.Direction_1_1_4_se; break $label0$0; } if (_0_5 && _this.get$y() / _this.get$x() >= -0.5) { t1 = B.Direction_1_0_3_e; break $label0$0; } if (_0_5 && _this.get$y() / _this.get$x() >= -2) { t1 = B.Direction_1_m1_2_ne; break $label0$0; } if (_0_5) { t1 = B.Direction_0_m1_1_n; break $label0$0; } if (_0_4 < 0) { t1 = B.Direction_0_m1_1_n; break $label0$0; } if (_0_4 > 0) { t1 = B.Direction_0_1_5_s; break $label0$0; } t1 = B.Direction_0_0_0_none; break $label0$0; } return t1; }, get$neighbors() { var _i, t1 = A._setArrayType([], type$.JSArray_Vec); for (_i = 0; _i < 8; ++_i) t1.push(this.$add(0, B.List_wXx[_i])); return t1; }, get$cardinalNeighbors() { var _i, t1 = A._setArrayType([], type$.JSArray_Vec); for (_i = 0; _i < 4; ++_i) t1.push(this.$add(0, B.List_iHk[_i])); return t1; }, $mul(_, other) { A._asInt(other); return new A.Vec(this.get$x() * other, this.get$y() * other); }, $add(_, other) { var t1, _this = this; $label0$0: { if (type$.Vec._is(other)) { t1 = new A.Vec(_this.get$x() + other.get$x(), _this.get$y() + other.get$y()); break $label0$0; } if (A._isInt(other)) { t1 = new A.Vec(_this.get$x() + other, _this.get$y() + other); break $label0$0; } t1 = A.throwExpression(A.ArgumentError$("Operand must be an int or Vec.", null)); } return t1; }, $sub(_, other) { var t1, t2, t3, t4; $label0$0: { t1 = this.get$x(); t2 = other.get$x(); t3 = this.get$y(); t4 = other.get$y(); break $label0$0; } return new A.Vec(t1 - t2, t3 - t4); }, $gt(_, other) { var t1; $label0$0: { if (type$.Vec._is(other)) { t1 = this.get$lengthSquared() > other.get$lengthSquared(); break $label0$0; } if (typeof other == "number") { t1 = this.get$lengthSquared() > other * other; break $label0$0; } t1 = A.throwExpression(A.ArgumentError$("Operand must be a number or Vec.", null)); } return t1; }, $ge(_, other) { var t1; $label0$0: { t1 = this.get$lengthSquared() >= other * other; break $label0$0; } return t1; }, $lt(_, other) { var t1; $label0$0: { if (type$.Vec._is(other)) { t1 = this.get$lengthSquared() < other.get$lengthSquared(); break $label0$0; } if (typeof other == "number") { t1 = this.get$lengthSquared() < other * other; break $label0$0; } t1 = A.throwExpression(A.ArgumentError$("Operand must be a number or Vec.", null)); } return t1; }, $le(_, other) { var t1; $label0$0: { t1 = this.get$lengthSquared() <= other * other; break $label0$0; } return t1; }, toString$0(_) { return "" + this.get$x() + ", " + this.get$y(); } }; A.Vec.prototype = { $eq(_, other) { if (other == null) return false; if (!type$.Vec._is(other)) return false; return this.x === other.get$x() && this.y === other.get$y(); }, get$hashCode(_) { var b, t1 = this.x, a = t1 >= 0 ? 2 * t1 : -2 * t1 - 1; t1 = this.y; b = t1 >= 0 ? 2 * t1 : -2 * t1 - 1; t1 = a + b; return B.JSInt_methods._tdivFast$1(t1 * (t1 + 1), 2) + b; }, get$x() { return this.x; }, get$y() { return this.y; } }; A._Vec_Object_VecMixin.prototype = {}; A.EventStreamProvider.prototype = {}; A._EventStream.prototype = {}; A._ElementEventStreamImpl.prototype = {}; A._EventStreamSubscription.prototype = {$isStreamSubscription: 1}; A._EventStreamSubscription_closure.prototype = { call$1(e) { return this.onData.call$1(A._asJSObject(e)); }, $signature: 3 }; A.TerminalFont.prototype = {}; A.main_closure.prototype = { call$1(__wc0_formal) { A._refreshDebugBoxes(); }, $signature: 3 }; A._addFont_closure.prototype = { call$1(__wc0_formal) { A._fullscreen(); }, $signature: 3 }; A._addFont_closure0.prototype = { call$1($event) { var t1, t2, t3, absolute, gameScreen = $.Debug__gameScreen; if (gameScreen == null) return; t1 = B.JSNumber_methods.toInt$0(A._asDouble($event.offsetX)); t2 = B.JSNumber_methods.toInt$0(A._asDouble($event.offsetY)); t3 = this.terminal; t1 = B.JSInt_methods.$tdiv(t1, t3._charWidth); t3 = B.JSInt_methods.$tdiv(t2, t3._charHeight); t2 = gameScreen.__GameScreen__stagePanel_F; t2 === $ && A.throwLateFieldNI("_stagePanel"); t2 = t2._cameraBounds; absolute = new A.Vec(t1, t3).$add(0, new A.Vec(t2.get$left(), t2.get$top())); if (!t2.contains$1(0, absolute)) return; t1 = gameScreen.game.__Game__stage_F; t1 === $ && A.throwLateFieldNI("_stage"); t1 = t1._actorsByTile.$get$2(absolute.x, absolute.y); if (t1 instanceof A.Monster) { if ($._debugMonsters.contains$1(0, t1)) $._debugMonsters.remove$1(0, t1); else $._debugMonsters.add$1(0, t1); A._refreshDebugBoxes(); } }, $signature: 3 }; A._addFont_closure1.prototype = { call$1(__wc1_formal) { var t1, t2, t3, i, t4, t5; for (t1 = this.name, t2 = init.G, t3 = $.___font._name, i = 0; i < $._fonts.length; ++i) { t4 = $._fonts[i]; if (t4.name === t1) { $.___font._value = t4; t4 = A._asJSObjectQ(A._asJSObject(t2.document).querySelector("#game")); t4.toString; t5 = $.___font._value; if (t5 === $.___font) A.throwExpression(A.LateError$fieldNI(t3)); t4.append(t5.canvas); } else t4.canvas.remove(); } A._resizeTerminal(); A._refreshDebugBoxes(); A._asJSObject(A._asJSObject(t2.window).localStorage).setItem("font", t1); }, $signature: 3 }; A._refreshDebugBoxes_refresh.prototype = { call$0() { var i, t2, t3, gameScreen, t4, t5, t6, t7, t8, t9, screenPos, info, _this, t1 = init.G, debugBoxes = A._asJSObject(A._asJSObject(t1.document).querySelectorAll(".debug")); for (i = 0; i < A._asInt(debugBoxes.length); ++i) { t2 = A._asJSObjectQ(A._asJSObject(t1.document).body); t2.toString; t3 = A._asJSObjectQ(debugBoxes.item(i)); t3.toString; A._asJSObject(t2.removeChild(t3)); } gameScreen = $.Debug__gameScreen; if (gameScreen == null) return; t2 = A._instanceType($._debugMonsters); $._debugMonsters._filterWhere$2(t2._eval$1("bool(1)")._as(new A._refreshDebugBoxes_refresh_closure()), true); for (t2 = A._LinkedHashSetIterator$($._debugMonsters, $._debugMonsters._collection$_modifications, t2._precomputed1), t3 = t2.$ti._precomputed1, t4 = $.___font._name; t2.moveNext$0();) { t5 = t2._collection$_current; if (t5 == null) t5 = t3._as(t5); t6 = gameScreen.__GameScreen__stagePanel_F; t6 === $ && A.throwLateFieldNI("_stagePanel"); t6 = t6._cameraBounds; t7 = t5._pos; if (t6.contains$1(0, t7)) { t8 = t6.pos; t9 = t8.x; t6 = t6.size; t8 = t8.y; screenPos = t7.$sub(0, new A.Vec(Math.min(t9, t9 + t6.x), Math.min(t8, t8 + t6.y))); info = A.Debug_monsterInfo(t5); if (info == null) continue; _this = A._asJSObject(A._asJSObject(t1.document).createElement("pre")); _this.className = "debug"; A._asJSObject(_this.style).display = "inline-block"; t5 = $.___font._value; if (t5 === $.___font) A.throwExpression(A.LateError$fieldNI(t4)); t6 = t5.charWidth; t7 = t5.canvas; t8 = B.JSInt_methods.toInt$0(A._asInt(t7.offsetLeft)); t5 = t5.charHeight; t7 = B.JSInt_methods.toInt$0(A._asInt(t7.offsetTop)); A._asJSObject(_this.style).left = B.JSInt_methods.toString$0((screenPos.x + 1) * t6 + t8 + 4); A._asJSObject(_this.style).top = B.JSInt_methods.toString$0(screenPos.y * t5 + t7 + 2); _this.textContent = info; A._asJSObject(A._asJSObjectQ(A._asJSObject(t1.document).body).children); } } }, $signature: 0 }; A._refreshDebugBoxes_refresh_closure.prototype = { call$1(monster) { return type$.Monster._as(monster)._health <= 0; }, $signature: 138 }; (function aliases() { var _ = J.LegacyJavaScriptObject.prototype; _.super$LegacyJavaScriptObject$toString = _.toString$0; _ = A.BoltAction.prototype; _.super$BoltAction$onHitActor = _.onHitActor$2; _ = A.ConditionAction.prototype; _.super$ConditionAction$onPerform = _.onPerform$0; _ = A.MasteryDiscipline.prototype; _.super$MasteryDiscipline$levelDescription = _.levelDescription$1; _ = A.HeroInfoDialog.prototype; _.super$HeroInfoDialog$keyDown = _.keyDown$3$alt$shift; _.super$HeroInfoDialog$handleInput = _.handleInput$1; _.super$HeroInfoDialog$render = _.render$1; _ = A.TownScreen.prototype; _.super$TownScreen$keyDown = _.keyDown$3$alt$shift; _.super$TownScreen$render = _.render$1; _ = A._GetScreen.prototype; _.super$_GetScreen$_afterTransfer = _._afterTransfer$2; })(); (function installTearOffs() { var _static_2 = hunkHelpers._static_2, _instance_1_i = hunkHelpers._instance_1i, _static_0 = hunkHelpers._static_0, _static_1 = hunkHelpers._static_1, _instance_1_u = hunkHelpers._instance_1u, _instance_2_u = hunkHelpers._instance_2u, _instance = hunkHelpers.installInstanceTearOff, _instance_0_u = hunkHelpers._instance_0u; _static_2(J, "_interceptors_JSArray__compareAny$closure", "JSArray__compareAny", 139); _instance_1_i(J.JSArray.prototype, "get$add", "add$1", 48); _static_0(A, "_js_helper_Primitives_dateNow$closure", "Primitives_dateNow", 2); _static_1(A, "async__AsyncRun__scheduleImmediateJsOverride$closure", "_AsyncRun__scheduleImmediateJsOverride", 20); _static_1(A, "async__AsyncRun__scheduleImmediateWithSetImmediate$closure", "_AsyncRun__scheduleImmediateWithSetImmediate", 20); _static_1(A, "async__AsyncRun__scheduleImmediateWithTimer$closure", "_AsyncRun__scheduleImmediateWithTimer", 20); _static_0(A, "async___startMicrotaskLoop$closure", "_startMicrotaskLoop", 0); _static_1(A, "convert___defaultToEncodable$closure", "_defaultToEncodable", 33); _static_1(A, "furnishing_builder___mirrorCharBoth$closure", "_mirrorCharBoth", 7); _static_1(A, "furnishing_builder___mirrorCharHorizontal$closure", "_mirrorCharHorizontal", 7); _static_1(A, "furnishing_builder___mirrorCharVertical$closure", "_mirrorCharVertical", 7); _static_1(A, "builder___intIdentity$closure", "_intIdentity", 5); _static_1(A, "tiles___closeDoor$closure", "_closeDoor", 8); _static_1(A, "tiles___openDoor$closure", "_openDoor", 8); _static_1(A, "tiles___closeSquareDoor$closure", "_closeSquareDoor", 8); _static_1(A, "tiles___openSquareDoor$closure", "_openSquareDoor", 8); _static_1(A, "tiles___closeBarredDoor$closure", "_closeBarredDoor", 8); _static_1(A, "tiles___openBarredDoor$closure", "_openBarredDoor", 8); _instance_1_u(A.ResourceSet.prototype, "get$find", "find$1", "1(String)"); _instance_1_u(A.Hero.prototype, "get$refreshSkill", "refreshSkill$1", 84); _static_1(A, "affix___noScale$closure", "_noScale", 19); _static_1(A, "affix___noBonus$closure", "_noBonus", 5); var _; _instance_2_u(_ = A.AffixType.prototype, "get$setResist", "setResist$2", 87); _instance_2_u(_, "get$setStatBonus", "setStatBonus$2", 88); _instance(A.Inventory.prototype, "get$tryAdd", 0, 1, null, ["call$2$wasUnequipped", "call$1"], ["tryAdd$2$wasUnequipped", "tryAdd$1"], 91, 0, 0); _instance_1_u(A.GameScreen.prototype, "get$_fireTowards", "_fireTowards$1", 29); _instance_1_u(_ = A.ItemDialog.prototype, "get$getPrice", "getPrice$1", 39); _instance_1_u(_, "get$_item_dialog$_canSelect", "_item_dialog$_canSelect$1", 4); _static_1(A, "item_renderer___defaultCanSelect$closure", "_defaultCanSelect", 4); _static_1(A, "item_renderer___defaultGetPrice$closure", "_defaultGetPrice", 13); _instance_1_u(A.SellDialog.prototype, "get$getPrice", "getPrice$1", 39); _instance_1_u(_ = A.TownScreen.prototype, "get$_canSelect", "_canSelect$1", 4); _instance_1_u(_, "get$_itemPrice", "_itemPrice$1", 13); _instance_0_u(A._CrucibleScreen.prototype, "get$_refreshRecipe", "_refreshRecipe$0", 0); _instance_1_u(A._ShopScreen.prototype, "get$_itemPrice", "_itemPrice$1", 13); _instance_1_u(A._ShopBuyScreen.prototype, "get$_itemPrice", "_itemPrice$1", 13); _instance_1_u(A._CountScreen.prototype, "get$_itemPrice", "_itemPrice$1", 13); _instance_0_u(_ = A.WizardDialog.prototype, "get$_mapDungeon", "_mapDungeon$0", 0); _instance_0_u(_, "get$_illuminateDungeon", "_illuminateDungeon$0", 0); _instance_0_u(_, "get$_dropItem", "_dropItem$0", 0); _instance_0_u(_, "get$_wizard_dialog$_spawnMonster", "_wizard_dialog$_spawnMonster$0", 0); _instance_0_u(_, "get$_gainExperience", "_gainExperience$0", 0); _instance_0_u(_, "get$_trainDiscipline", "_trainDiscipline$0", 0); _instance_0_u(_, "get$_killAllMonsters", "_killAllMonsters$0", 0); _instance_0_u(_, "get$_toggleShowAllMonsters", "_toggleShowAllMonsters$0", 0); _instance_0_u(_, "get$_toggleAlertness", "_toggleAlertness$0", 0); _instance_0_u(_, "get$_toggleShowHeroVolume", "_toggleShowHeroVolume$0", 0); _instance_1_u(_ = A.UserInterface.prototype, "get$_keyDown", "_keyDown$1", 3); _instance_1_u(_, "get$_keyUp", "_keyUp$1", 3); _instance_1_u(_, "get$_tick", "_tick$1", 137); _static_0(A, "main___resizeTerminal$closure", "_resizeTerminal", 0); _static_1(A, "skills_Skills_find$closure", "Skills_find", 94); })(); (function inheritance() { var _mixin = hunkHelpers.mixin, _inherit = hunkHelpers.inherit, _inheritMany = hunkHelpers.inheritMany; _inherit(A.Object, null); _inheritMany(A.Object, [A.JS_CONST, J.Interceptor, A.SafeToStringHook, J.ArrayIterator, A.Error, A.ListBase, A.SentinelValue, A.Iterable, A.ListIterator, A.MappedIterator, A.WhereIterator, A.TakeIterator, A.TakeWhileIterator, A.WhereTypeIterator, A.FixedLengthListMixin, A.UnmodifiableListMixin, A._Record, A.ConstantMap, A._KeysOrValuesOrElementsIterator, A.Closure, A.TypeErrorDecoder, A.NullThrownFromJavaScriptException, A._StackTrace, A.MapBase, A.LinkedHashMapCell, A.LinkedHashMapKeyIterator, A.LinkedHashMapValueIterator, A.LinkedHashMapEntryIterator, A.JSSyntaxRegExp, A._MatchImplementation, A._AllMatchesIterator, A.StringMatch, A._StringAllMatchesIterator, A._Cell, A.Rti, A._FunctionParameters, A._Type, A._TimerImpl, A._SyncStarIterator, A.AsyncError, A._FutureListener, A._Future, A._AsyncCallbackEntry, A.Stream, A._Zone, A.SetBase, A._LinkedHashSetCell, A._LinkedHashSetIterator, A._ListQueueIterator, A.Codec, A.Converter, A._JsonStringifier, A.DateTime, A._Enum, A.OutOfMemoryError, A.StackOverflowError, A._Exception, A.FormatException, A.MapEntry, A.Null, A._StringStackTrace, A.Stopwatch, A.StringBuffer, A._JSRandom, A._Random, A.GameContent, A.Action, A.ElementActionMixin, A.Flow, A.Decor, A.Cell, A._BaseBuilder, A.AffixBuilder, A._BaseDrop, A._PercentDrop, A._AllOfDrop, A._OneOfDrop, A._RepeatDrop, A.FloorDrop, A._BaseBuilder0, A._BreedSpawn, A._TagSpawn, A._RepeatSpawn, A._AllOfSpawn, A.Move, A.Skill, A.Architect, A._Path, A.Architecture, A.Pathfinder, A.ArchitecturalStyle, A.Decorator, A.DensityMap, A.Junction, A.JunctionSet, A.Painter, A.PaintStyle, A.Reachability, A._FillStep, A._RiverPoint, A.RoomTile, A.Town, A.TileBuilder, A._MonsterLog, A.ActionResult, A.GeneratorActionMixin, A.DestroyActionMixin, A.Actor, A.Attack, A.Bonus, A.Scale, A.Hit, A.Defense, A.Condition, A.Element, A.Energy, A.Game, A.GameResult, A.Event, A.EventType, A.Log, A.Noun, A.Pronoun, A.Message, A.ResourceSet, A._Resource, A._Tag, A._QueryKey, A._ResourceQuery, A.Behavior, A.HeroClass, A.HeroSave, A.Lore, A.Race, A.UsableSkill, A.ActionSkill, A.TargetSkill, A.DirectionSkill, A.SkillSet, A.Property, A.Affix, A.AffixType, A.ItemLocation, A.ItemCollection, A.AddItemResult, A.Item, A.ItemUse, A.Toss, A.ItemType, A.Recipe, A.Shop, A.BreedRef, A.Breed, A.BreedFlags, A.MonsterState, A.BucketQueue, A.Fov, A._Shadow, A.Lighting, A.Path, A.Sound, A.Stage, A.Motility, A.TilePortal, A.TileType, A.Tile, A.Screen, A.ElementEffect, A.FrameEffect, A.ItemEffect, A.DamageEffect, A.ParticleEffect, A.TeleportEffect, A.HealEffect, A.DetectEffect, A.MapEffect, A.TreasureEffect, A.HowlEffect, A.BlinkEffect, A._AnimatedValue, A._Sort, A._Sort0, A.Input, A.ItemInspector, A._Section, A.Control, A.Panel, A.Storage, A.Display, A.Color, A.Glyph, A.KeyBindings, A._KeyBinding, A.Terminal, A.UserInterface, A._CircleIterator, A._LineIterator, A.RectIterator, A.Rng, A.VecMixin, A._Vec_Object_VecMixin, A.EventStreamProvider, A._EventStreamSubscription, A.TerminalFont]); _inheritMany(J.Interceptor, [J.JSBool, J.JSNull, J.JavaScriptObject, J.JavaScriptBigInt, J.JavaScriptSymbol, J.JSNumber, J.JSString]); _inheritMany(J.JavaScriptObject, [J.LegacyJavaScriptObject, J.JSArray, A.NativeByteBuffer, A.NativeTypedData]); _inheritMany(J.LegacyJavaScriptObject, [J.PlainJavaScriptObject, J.UnknownJavaScriptObject, J.JavaScriptFunction]); _inherit(J.JSArraySafeToStringHook, A.SafeToStringHook); _inherit(J.JSUnmodifiableArray, J.JSArray); _inheritMany(J.JSNumber, [J.JSInt, J.JSNumNotInt]); _inheritMany(A.Error, [A.LateError, A.TypeError, A.JsNoSuchMethodError, A.UnknownJsTypeError, A.RuntimeError, A._Error, A.JsonUnsupportedObjectError, A.AssertionError, A.ArgumentError, A.UnsupportedError, A.UnimplementedError, A.StateError, A.ConcurrentModificationError]); _inherit(A.UnmodifiableListBase, A.ListBase); _inherit(A.CodeUnits, A.UnmodifiableListBase); _inheritMany(A.Iterable, [A.EfficientLengthIterable, A.MappedIterable, A.WhereIterable, A.TakeIterable, A.TakeWhileIterable, A.WhereTypeIterable, A._KeysOrValues, A._AllMatchesIterable, A._StringAllMatchesIterable, A._SyncStarIterable, A.VecSet, A._Equipment_IterableBase_ItemCollection, A._Inventory_IterableMixin_ItemCollection, A.Array2D, A.Circle, A.Rect]); _inheritMany(A.EfficientLengthIterable, [A.ListIterable, A.LinkedHashMapKeysIterable, A.LinkedHashMapValuesIterable, A.LinkedHashMapEntriesIterable]); _inheritMany(A.ListIterable, [A.SubListIterable, A.MappedListIterable, A.ReversedListIterable, A.ListQueue, A._JsonMapKeyIterable]); _inherit(A.EfficientLengthMappedIterable, A.MappedIterable); _inherit(A.EfficientLengthTakeIterable, A.TakeIterable); _inheritMany(A._Record, [A._Record2, A._RecordN]); _inherit(A._Record_2, A._Record2); _inherit(A._Record_4, A._RecordN); _inheritMany(A.ConstantMap, [A.ConstantStringMap, A.GeneralConstantMap]); _inheritMany(A.Closure, [A.Closure0Args, A.Closure2Args, A.TearOffClosure, A.initHooks_closure, A.initHooks_closure1, A._AsyncRun__initializeScheduleImmediate_internalCallback, A._AsyncRun__initializeScheduleImmediate_closure, A._Future__propagateToListeners_handleWhenCompleteCallback_closure, A.Stream_length_closure, A._RootZone_bindUnaryCallbackGuarded_closure, A.GameContent_startingItems_closure, A.GameContent__tryToIgniteTile_neighbor, A.DetectAction__findTiles_addTile, A.DetectAction__findTiles_closure1, A.WindAction_onPerform_closure, A.FlowAction_onPerform_closure, A.RayActionBase_onPerform_closure, A.furnishing_closure, A.Elements_air_closure, A.Elements_fire_closure, A.Elements_fire_closure0, A.Elements_cold_closure, A.Elements_cold_closure0, A.Elements_poison_closure, A.Elements_poison_closure0, A.Elements_dark_closure, A.Elements_light_closure, A.Elements_light_closure0, A.ItemBuilder_ball_closure0, A.ItemBuilder_flow_closure0, A.AffixBuilder_price_closure, A.AffixBuilder_price_closure0, A.AffixBuilder_heft_closure, A.AffixBuilder_weight_closure, A.AffixBuilder_brand_closure, A.AffixBuilder_resist_closure, A.fixed_closure, A.scaleParam_closure, A.rings_closure, A.weapons_closure, A.SpawnMove_onGetAction_checkNeighbor, A.Archery__hasBow_closure, A.MasteryDiscipline__hasWeapon_closure, A.Swordfighting_getDefense_closure, A.conjuringSpells_closure, A.conjuringSpells_closure0, A.conjuringSpells_closure1, A.divinationSpells_closure, A.sorcerySpells_closure, A.sorcerySpells_closure0, A.sorcerySpells_closure1, A.sorcerySpells_closure2, A.sorcerySpells_closure3, A.Decorator__spawnMonster_closure, A.Keep_spawnMonsters_closure, A.Keep__tryAttachRoom_closure, A.Room__calculateEdges_isFloor, A.Tiles_closedChest_closure, A.Tiles_closedBarrel_closure, A.DestroyActionMixin_destroyFloorItems_closure, A.DestroyActionMixin_destroyHeldItems_closure, A.DestroyActionMixin_destroyHeldItems_closure0, A.Element_closure, A.Element_closure0, A.Game_generate_closure, A.Log_wordWrap_finishWord, A.hashPoint_hashInt, A.ResourceSet_all_closure, A.ResourceSet_hasTag_closure, A.ResourceSet_getTags_closure, A.ResourceSet_tryChoose_closure, A.ResourceSet_tryChoose_closure0, A.ResourceSet_tryChooseMatching_closure, A.ResourceSet_tryChooseMatching_closure0, A.ResourceSet_tryChooseMatching__closure, A.MapExtensions_get_pairs_closure, A.RunBehavior_canPerform_closure, A.RunBehavior__shouldKeepRunning_actorAt, A.Hero_createRangedHit_closure, A.Hero_refreshProperties_closure, A.SkillSet_acquired_closure, A.StatBase_refresh_closure, A.Equipment_weapons_closure, A.Equipment_canEquip_closure, A.Inventory_clone_closure, A.Monster_onGiveDamage_closure, A.Monster_onTakeDamage_closure, A.Monster_onTakeDamage_closure0, A.MonsterState__meander_closure, A.AwakeState_getAction_closure, A.AwakeState__escapeSubstance_closure, A.AwakeState__findRangedPath_isValidRangedPosition, A.AfraidState_getAction_closure, A.AfraidState_getAction_closure0, A.Flow__directionsTo_walkBack, A.Lighting__lightWalls_checkNeighbor, A.Stage_closure, A.Stage_placeDrops_closure, A.Stage_placeDrops__closure, A.DirectionDialog_render_draw, A.ExitPopup_add, A.ExitPopup_closure, A.ExperienceDialog__drawStrengthPanel_closure, A.ExperienceDialog__drawAgilityPanel_closure, A.ExperienceDialog__drawVitalityPanel_closure, A.ExperienceDialog__drawIntellectPanel_closure, A.GameOverScreen_render_closure, A.GameScreen_activate_closure0, A.GameScreen__openTargetDialog_closure, A.HeroEquipmentDialog_render_writeScale, A.HeroEquipmentDialog_render_writeBonus, A.HeroMonsterLoreDialog__describeBreed_closure, A.HeroMonsterLoreDialog__describeBreed_closure0, A.HeroMonsterLoreDialog__listBreeds_closure, A.HeroMonsterLoreDialog__listBreeds_compareGlyph_isUpper, A.renderItems_drawStat, A.TossDialog_selectItem_closure, A.NewHeroScreen_closure, A.NewHeroScreen_closure0, A.NewHeroScreen_render_closure, A.NameControl__refreshUnique_closure, A.SidebarPanel__drawStats_drawStat, A.SidebarPanel__drawHealthBar_drawCondition, A.StagePanel_update_closure, A.StagePanel_renderPanel_closure, A.Storage_remove_closure, A.Storage_replace_closure, A.Storage__load_closure, A.Storage__load_closure0, A.Storage__loadLog_closure, A.TargetDialog__changeMonsterTarget_closure, A.TargetDialog__changeMonsterTarget_closure0, A._SearchDialog__matchedItems_closure, A._WizardSpawnDialog__selectItem_closure, A.RetroTerminal$__closure, A.RetroTerminal_render_closure, A._EventStreamSubscription_closure, A.main_closure, A._addFont_closure, A._addFont_closure0, A._addFont_closure1, A._refreshDebugBoxes_refresh_closure]); _inheritMany(A.Closure0Args, [A.Primitives_initTicker_closure, A._AsyncRun__scheduleImmediateJsOverride_internalCallback, A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback, A._TimerImpl_internalCallback, A._Future__addListener_closure, A._Future__prependListeners_closure, A._Future__chainCoreFuture_closure, A._Future__asyncCompleteErrorObject_closure, A._Future__propagateToListeners_handleWhenCompleteCallback, A._Future__propagateToListeners_handleValueCallback, A._Future__propagateToListeners_handleError, A.Stream_length_closure0, A._rootHandleError_closure, A._RootZone_bindCallbackGuarded_closure, A.DetectAction__findTiles_addTile_closure, A.ItemBuilder_food_closure, A.ItemBuilder_detection_closure, A.ItemBuilder_perception_closure, A.ItemBuilder_resistSalve_closure, A.ItemBuilder_mapping_closure, A.ItemBuilder_haste_closure, A.ItemBuilder_teleport_closure, A.ItemBuilder_heal_closure, A.ItemBuilder_ball_closure, A.ItemBuilder_flow_closure, A.ItemBuilder_lightSource_closure, A.AffixBuilder_parameter_closure, A.dungeon_closure, A.catacomb_closure, A.cavern_closure, A.lake_closure, A.river_closure, A.keep_closure, A.pit_closure, A.Decorator_decorate_closure, A.Decorator__spawnMonster_closure0, A.River_build_northish, A.River_build_southish, A.River_build_eastish, A.River_build_westish, A.River_build_northSouth, A.River_build_eastWest, A.Debug_monsterLog_closure, A.Debug_monsterStat_closure, A.Debug_monsterStat_closure0, A.Debug_monsterReason_closure, A.Log_wordWrap_finishLine, A.Lore_seeBreed_closure, A.Lore_slay_closure, A.Lore_findItem_closure, A.Lore_findItem_closure0, A.Lore_useItem_closure, A.Stage_addItem_closure, A.StagePanel__positionCamera_centerX, A.StagePanel__positionCamera_centerY, A._refreshDebugBoxes_refresh]); _inherit(A.NullError, A.TypeError); _inheritMany(A.TearOffClosure, [A.StaticClosure, A.BoundClosure]); _inheritMany(A.MapBase, [A.JsLinkedHashMap, A._JsonMap]); _inheritMany(A.Closure2Args, [A.JsLinkedHashMap_addAll_closure, A.initHooks_closure0, A._Future__propagateToListeners_handleWhenCompleteCallback_closure0, A.LinkedHashMap_LinkedHashMap$from_closure, A.MapBase_mapToString_closure, A._JsonStringifier_writeMap_closure, A.GameContent__spreadPoison_neighbor, A.BarrierAction_onPerform_tryDirection, A.BarrierAction_onPerform_tryDirection_tryOffset, A.DetectAction__findTiles_closure, A.DetectAction__findTiles_closure0, A._OneOfDrop_closure, A.shop_closure, A.Decorator__spawnMonster_spawn, A.Keep__regionContains_diagonal, A.Tiles_braziers_closure, A._MonsterLog_toString_closure, A.Hit__strikeScale_closure, A.Hit__strikeBonus_closure, A.Hit__damageScale_closure, A.Hit__damageBonus_closure, A.Lore_allSlain_closure, A.Equipment_length_closure, A.Item_strikeBonus_closure, A.Item_damageScale_closure, A.Item_damageBonus_closure, A.Item_armorModifier_closure, A.Item_quantifiableName_closure, A.Item_weight_closure, A.Item_heft_closure, A.Item_resistance_closure, A.Flow__processNext_processNeighbor, A.Lighting__process_checkNeighbor, A.Stage_forEachItem_closure, A.Draw_helpKeys_closure, A.Draw_helpKeys_closure0, A.GameScreen_activate_closure, A.HeroEquipmentDialog_render_writeLine, A.HeroEquipmentDialog_render_closure, A.HeroItemLoreDialog_render_writeLine, A.HeroItemLoreDialog__listItems_compareSort, A.HeroItemLoreDialog__listItems_compareDepth, A.HeroItemLoreDialog__listItems_comparePrice, A.HeroItemLoreDialog__listItems_closure, A.HeroMonsterLoreDialog_render_writeLine, A.HeroMonsterLoreDialog__listBreeds_compareGlyph, A.HeroMonsterLoreDialog__listBreeds_compareDepth, A.HeroMonsterLoreDialog__listBreeds_closure0, A.HeroResistancesDialog_render_writeLine, A.HeroResistancesDialog_render_closure, A.MainMenuScreen__renderTile_multiply, A.MainMenuScreen__renderTile_applyLighting, A.SidebarPanel_renderPanel_closure, A.StagePanel_renderPanel_multiply, A.StagePanel_renderPanel_applyLighting, A.Popup_render_closure, A.Popup_render_closure0, A.Storage__load_closure1, A.Storage__loadLore_closure, A.Storage__loadLore_closure0, A.Storage__loadLore_closure1, A.Storage__loadLore_closure2, A.Storage__loadLore_closure3]); _inherit(A.JsConstantLinkedHashMap, A.JsLinkedHashMap); _inheritMany(A.NativeTypedData, [A.NativeByteData, A.NativeTypedArray]); _inheritMany(A.NativeTypedArray, [A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin]); _inherit(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin, A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin); _inherit(A.NativeTypedArrayOfDouble, A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin); _inherit(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin); _inherit(A.NativeTypedArrayOfInt, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin); _inheritMany(A.NativeTypedArrayOfDouble, [A.NativeFloat32List, A.NativeFloat64List]); _inheritMany(A.NativeTypedArrayOfInt, [A.NativeInt16List, A.NativeInt32List, A.NativeInt8List, A.NativeUint16List, A.NativeUint32List, A.NativeUint8ClampedList, A.NativeUint8List]); _inherit(A._TypeError, A._Error); _inherit(A._RootZone, A._Zone); _inherit(A._SetBase, A.SetBase); _inherit(A._LinkedHashSet, A._SetBase); _inherit(A.JsonCyclicError, A.JsonUnsupportedObjectError); _inherit(A.JsonCodec, A.Codec); _inheritMany(A.Converter, [A.JsonEncoder, A.JsonDecoder]); _inherit(A._JsonStringStringifier, A._JsonStringifier); _inheritMany(A.ArgumentError, [A.RangeError, A.IndexError]); _inheritMany(A.Action, [A._BarrierAction_Action_ElementActionMixin, A.LosAction, A.ConditionAction, A.DetectAction, A.EatAction, A._BurnActorAction_Action_DestroyActionMixin, A._BurnFloorAction_Action_DestroyActionMixin, A._BurningFloorAction_Action_DestroyActionMixin, A._FreezeFloorAction_Action_DestroyActionMixin, A._PoisonFloorAction_Action_DestroyActionMixin, A._PoisonedFloorAction_Action_DestroyActionMixin, A.WindAction, A.LightFloorAction, A._FlowAction_Action_ElementActionMixin, A.FlowSelfAction, A.FlowFromAction, A.HealAction, A.HowlAction, A.RayActionBase, A.IlluminateSelfAction, A.MappingAction, A.MissiveAction, A.PerceiveAction, A.PolymorphAction, A.AmputateAction, A.RingSelfAction, A.RingFromAction, A.SpawnAction, A.TeleportAction, A._OpenTileAction, A.MasteryAction, A.FocusAction, A.AttackAction, A.ItemAction, A.PickUpAction, A.WalkAction, A.OpenDoorAction, A.CloseDoorAction, A.RestAction, A.ChangeMonsterStateAction]); _inherit(A.BarrierAction, A._BarrierAction_Action_ElementActionMixin); _inheritMany(A.LosAction, [A.BoltAction, A.TossLosAction]); _inheritMany(A.ConditionAction, [A.HasteAction, A._FreezeActorAction_ConditionAction_DestroyActionMixin, A.PoisonAction, A.BlindAction, A.DazzleAction, A.ResistAction]); _inherit(A.FreezeActorAction, A._FreezeActorAction_ConditionAction_DestroyActionMixin); _inheritMany(A._Enum, [A.DetectType, A.Missive, A.Symmetry, A.ItemQuality, A.Region, A.TakeFrom, A.RoomShapes, A.RoomSize, A.HitType, A.LogType, A.Stat, A.SpawnLocation, A._Direction__Enum_VecMixin]); _inherit(A.BurnActorAction, A._BurnActorAction_Action_DestroyActionMixin); _inherit(A.BurnFloorAction, A._BurnFloorAction_Action_DestroyActionMixin); _inherit(A.BurningFloorAction, A._BurningFloorAction_Action_DestroyActionMixin); _inherit(A.FreezeFloorAction, A._FreezeFloorAction_Action_DestroyActionMixin); _inherit(A.PoisonFloorAction, A._PoisonFloorAction_Action_DestroyActionMixin); _inherit(A.PoisonedFloorAction, A._PoisonedFloorAction_Action_DestroyActionMixin); _inherit(A.FlowAction, A._FlowAction_Action_ElementActionMixin); _inheritMany(A.RayActionBase, [A.IlluminateAction, A._RayAction_RayActionBase_ElementActionMixin]); _inheritMany(A.Flow, [A.MappingFlow, A.MotilityFlow, A._SoundFlow]); _inherit(A.RayAction, A._RayAction_RayActionBase_ElementActionMixin); _inheritMany(A._OpenTileAction, [A.OpenBarrelAction, A.OpenChestAction]); _inherit(A.Furnishing, A.Decor); _inheritMany(A._BaseBuilder, [A.CategoryBuilder, A.ItemBuilder]); _inheritMany(A._BaseDrop, [A._ItemDrop, A._TagDrop]); _inheritMany(A._BaseBuilder0, [A.FamilyBuilder, A.BreedBuilder]); _inheritMany(A.Move, [A.AmputateMove, A.RangedMove, A.ConeMove, A.HasteMove, A.HealMove, A.HowlMove, A.MissiveMove, A.SpawnMove, A.TeleportMove]); _inherit(A.BoltMove, A.RangedMove); _inheritMany(A.Skill, [A.Discipline, A._Spell_Skill_UsableSkill]); _inheritMany(A.Discipline, [A._Archery_Discipline_UsableSkill, A.MasteryDiscipline, A.BattleHardening, A.DualWield, A.SlayDiscipline]); _inherit(A._Archery_Discipline_UsableSkill_TargetSkill, A._Archery_Discipline_UsableSkill); _inherit(A.Archery, A._Archery_Discipline_UsableSkill_TargetSkill); _inherit(A.ArrowAction, A.BoltAction); _inheritMany(A.MasteryDiscipline, [A._UsableMasteryDiscipline_MasteryDiscipline_UsableSkill, A.Swordfighting]); _inherit(A.UsableMasteryDiscipline, A._UsableMasteryDiscipline_MasteryDiscipline_UsableSkill); _inheritMany(A.UsableMasteryDiscipline, [A._AxeMastery_UsableMasteryDiscipline_DirectionSkill, A._ClubMastery_UsableMasteryDiscipline_DirectionSkill, A._SpearMastery_UsableMasteryDiscipline_DirectionSkill, A._WhipMastery_UsableMasteryDiscipline_TargetSkill]); _inherit(A.AxeMastery, A._AxeMastery_UsableMasteryDiscipline_DirectionSkill); _inheritMany(A.MasteryAction, [A._SweepAction_MasteryAction_GeneratorActionMixin, A.BashAction, A._SpearAction_MasteryAction_GeneratorActionMixin]); _inherit(A.SweepAction, A._SweepAction_MasteryAction_GeneratorActionMixin); _inherit(A.ClubMastery, A._ClubMastery_UsableMasteryDiscipline_DirectionSkill); _inherit(A.SpearMastery, A._SpearMastery_UsableMasteryDiscipline_DirectionSkill); _inherit(A.SpearAction, A._SpearAction_MasteryAction_GeneratorActionMixin); _inherit(A.WhipMastery, A._WhipMastery_UsableMasteryDiscipline_TargetSkill); _inherit(A.Spell, A._Spell_Skill_UsableSkill); _inheritMany(A.Spell, [A._ActionSpell_Spell_ActionSkill, A._TargetSpell_Spell_TargetSkill]); _inherit(A.ActionSpell, A._ActionSpell_Spell_ActionSkill); _inherit(A.TargetSpell, A._TargetSpell_Spell_TargetSkill); _inheritMany(A.Pathfinder, [A._LengthPathfinder, A.MonsterPathfinder, A._SoundPathfinder]); _inheritMany(A.Architecture, [A.Catacomb, A.Cavern, A.RoomArchitecture, A.Lake, A.Pit, A.River]); _inheritMany(A.RoomArchitecture, [A.Dungeon, A.Keep]); _inheritMany(A.ItemAction, [A.DropAction, A.EquipAction, A.UnequipAction, A.UseAction, A.TossAction]); _inheritMany(A.Condition, [A.HasteCondition, A.ColdCondition, A.PoisonCondition, A.BlindnessCondition, A.ResistCondition, A.PerceiveCondition]); _inheritMany(A.Behavior, [A.ActionBehavior, A.RestBehavior, A.RunBehavior]); _inheritMany(A.Actor, [A.Hero, A.Monster]); _inherit(A.StatBase, A.Property); _inheritMany(A.StatBase, [A.Strength, A.Agility, A.Vitality, A.Intellect]); _inherit(A.Equipment, A._Equipment_IterableBase_ItemCollection); _inherit(A.Inventory, A._Inventory_IterableMixin_ItemCollection); _inheritMany(A.MonsterState, [A.AsleepState, A.AwakeState, A.AfraidState]); _inheritMany(A.Screen, [A.Popup, A.DirectionDialog, A.ExperienceDialog, A.GameOverScreen, A.GameScreen, A.HeroInfoDialog, A.ItemDialog, A.TownScreen, A.LoadingDialog, A.MainMenuScreen, A.NewHeroScreen, A.SelectSkillDialog, A.SkillDialog, A.TargetDialog, A.WizardDialog, A._SearchDialog]); _inheritMany(A.Popup, [A.ConfirmPopup, A.ExitPopup, A.ForfeitPopup, A.SelectDepthPopup]); _inheritMany(A.DirectionDialog, [A.SkillDirectionDialog, A.OperateDialog]); _inheritMany(A.HeroInfoDialog, [A.HeroEquipmentDialog, A.HeroItemLoreDialog, A.HeroMonsterLoreDialog, A.HeroResistancesDialog]); _inheritMany(A.ItemDialog, [A.DropDialog, A.EquipDialog, A.PickUpDialog, A._PutDialog, A.SellDialog, A.TossDialog, A.UseDialog]); _inheritMany(A._Section, [A._AttackSection, A._DefenseSection, A._ResistancesSection, A._TextSection]); _inheritMany(A._PutDialog, [A.PutCrucibleDialog, A.PutHomeDialog]); _inheritMany(A.TownScreen, [A._ItemVerbScreen, A._HomeScreen, A._CrucibleScreen, A._ShopScreen, A._CountScreen]); _inheritMany(A._ItemVerbScreen, [A._GetScreen, A._ShopBuyScreen]); _inheritMany(A._GetScreen, [A._GetFromHomeScreen, A._GetFromCrucibleScreen]); _inheritMany(A.Control, [A.NameControl, A.SelectControl]); _inheritMany(A.Panel, [A.ItemPanel, A.LogPanel, A.SidebarPanel, A.StagePanel]); _inherit(A.SkillTypeDialog, A.SkillDialog); _inheritMany(A.SkillTypeDialog, [A.DisciplineDialog, A.SpellDialog]); _inheritMany(A._SearchDialog, [A._WizardDropDialog, A._WizardSpawnDialog, A._WizardTrainDialog]); _inheritMany(A.Terminal, [A.PortTerminal, A.RenderableTerminal]); _inherit(A.RetroTerminal, A.RenderableTerminal); _inherit(A.Direction, A._Direction__Enum_VecMixin); _inherit(A.Vec, A._Vec_Object_VecMixin); _inherit(A._EventStream, A.Stream); _inherit(A._ElementEventStreamImpl, A._EventStream); _mixin(A.UnmodifiableListBase, A.UnmodifiableListMixin); _mixin(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin, A.ListBase); _mixin(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin, A.FixedLengthListMixin); _mixin(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin, A.ListBase); _mixin(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin, A.FixedLengthListMixin); _mixin(A._BarrierAction_Action_ElementActionMixin, A.ElementActionMixin); _mixin(A._FreezeActorAction_ConditionAction_DestroyActionMixin, A.DestroyActionMixin); _mixin(A._BurnActorAction_Action_DestroyActionMixin, A.DestroyActionMixin); _mixin(A._BurnFloorAction_Action_DestroyActionMixin, A.DestroyActionMixin); _mixin(A._BurningFloorAction_Action_DestroyActionMixin, A.DestroyActionMixin); _mixin(A._FreezeFloorAction_Action_DestroyActionMixin, A.DestroyActionMixin); _mixin(A._PoisonFloorAction_Action_DestroyActionMixin, A.DestroyActionMixin); _mixin(A._PoisonedFloorAction_Action_DestroyActionMixin, A.DestroyActionMixin); _mixin(A._FlowAction_Action_ElementActionMixin, A.ElementActionMixin); _mixin(A._RayAction_RayActionBase_ElementActionMixin, A.ElementActionMixin); _mixin(A._Archery_Discipline_UsableSkill, A.UsableSkill); _mixin(A._Archery_Discipline_UsableSkill_TargetSkill, A.TargetSkill); _mixin(A._AxeMastery_UsableMasteryDiscipline_DirectionSkill, A.DirectionSkill); _mixin(A._SweepAction_MasteryAction_GeneratorActionMixin, A.GeneratorActionMixin); _mixin(A._ClubMastery_UsableMasteryDiscipline_DirectionSkill, A.DirectionSkill); _mixin(A._UsableMasteryDiscipline_MasteryDiscipline_UsableSkill, A.UsableSkill); _mixin(A._SpearAction_MasteryAction_GeneratorActionMixin, A.GeneratorActionMixin); _mixin(A._SpearMastery_UsableMasteryDiscipline_DirectionSkill, A.DirectionSkill); _mixin(A._WhipMastery_UsableMasteryDiscipline_TargetSkill, A.TargetSkill); _mixin(A._ActionSpell_Spell_ActionSkill, A.ActionSkill); _mixin(A._Spell_Skill_UsableSkill, A.UsableSkill); _mixin(A._TargetSpell_Spell_TargetSkill, A.TargetSkill); _mixin(A._Equipment_IterableBase_ItemCollection, A.ItemCollection); _mixin(A._Inventory_IterableMixin_ItemCollection, A.ItemCollection); _mixin(A._Direction__Enum_VecMixin, A.VecMixin); _mixin(A._Vec_Object_VecMixin, A.VecMixin); })(); var init = { G: typeof self != "undefined" ? self : globalThis, typeUniverse: {eC: new Map(), tR: {}, eT: {}, tPV: {}, sEA: []}, mangledGlobalNames: {int: "int", double: "double", num: "num", String: "String", bool: "bool", Null: "Null", List: "List", Object: "Object", Map: "Map", JSObject: "JSObject"}, mangledNames: {}, types: ["~()", "bool(Vec)", "int()", "~(JSObject)", "bool(Item)", "int(int)", "double()", "String(String)", "Action(Vec)", "bool(Direction)", "~(Item)", "~(String,@)", "~(Vec)", "int?(Item)", "int(int,Affix)", "Color(Color,Color)", "int(ItemType,ItemType)", "~(int,Color)", "List(int)", "double(int)", "~(~())", "bool(HeroSave)", "int(Breed,Breed)", "int(int,String)", "_MonsterLog()", "TeleportAction(ActionSpell,Game,int)", "int(Monster)", "~(Item?,int)", "~(int,int,int)", "~(Direction)", "~(Terminal)", "int(int,int)", "~(String,String)", "@(@)", "~(Monster)", "~(int,int,Glyph)", "Null(int)", "double(double,Bonus)", "double(double,Scale)", "int(Item)", "Null()", "double(double,Affix)", "FlowAction(ActionSpell,Game,int)", "~(Object?,Object?)", "Null(@)", "List()", "~(AffixBuilder)", "bool(Move)", "~(Object?)", "IlluminateSelfAction()", "~(Drop,double)", "FlowFromAction(Vec)", "~(String,double)", "FlowSelfAction()", "RingFromAction(Vec)", "RingSelfAction()", "DetectAction(ActionSpell,Game,int)", "BoltAction(TargetSpell,Game,int,Vec)", "RayAction(TargetSpell,Game,int,Vec)", "HealAction()", "BarrierAction(TargetSpell,Game,int,Vec)", "Dungeon()", "Catacomb()", "Cavern()", "Lake()", "River()", "Keep()", "Pit()", "~(Breed,Vec)", "Vec()", "double(int,int)", "TeleportAction()", "OpenChestAction(Vec)", "OpenBarrelAction(Vec)", "TileType(TileBuilder,int)", "HasteAction()", "Queue()", "MappingAction()", "ResistAction()", "PerceiveAction()", "DetectAction()", "Null(Vec,Hit,num,int)", "Null(Vec)", "~(int)", "~(Skill)", "Null(double)", "bool(Skill)", "~(Element,int(int))", "~(Stat,int(int))", "int(int,Item?)", "bool(String)", "AddItemResult(Item{wasUnequipped:bool})", "Item(Item)", "EatAction()", "Skill(String)", "String(String,Affix)", "LightFloorAction(Vec,Hit,num,int)", "DazzleAction(int)", "~(Direction,bool)", "~(Vec,int)", "Tile(Vec)", "Inventory()", "~(Vec,Inventory)", "~(int,Direction,String)", "BlindAction(int)", "~(String,Color,int{total:int?})", "bool(Actor)", "PoisonFloorAction(Vec,Hit,num,int)", "PoisonAction(int)", "FreezeFloorAction(Vec,Hit,num,int)", "~(Shop,Inventory)", "FreezeActorAction(int)", "~(int,int,double)", "BurnFloorAction(Vec,Hit,num,int)", "BurnActorAction(int)", "bool(Breed)", "WindAction(int)", "bool(int)", "@(String)", "~(int,Object,Color,Color)", "@(@,String)", "List(int)", "String(Race)", "String(HeroClass)", "~(Item,Vec)", "int(Monster,Monster)", "~(StatBase)", "~(String,Color[Color?])", "bool(Effect)", "bool(double,double)", "bool(Race)", "bool(HeroClass)", "~(String,Shop)", "bool(LogType)", "bool(bool,int)", "~(int,int)", "Null(~())", "~(num)", "bool(Monster)", "int(@,@)", "~(@,@)", "Null(Object,StackTrace)", "bool(double)"], interceptorsByTag: null, leafTags: null, arrayRti: Symbol("$ti"), rttc: { "2;": (t1, t2) => o => o instanceof A._Record_2 && t1._is(o._0) && t2._is(o._1), "4;": types => o => o instanceof A._Record_4 && A.pairwiseIsTest(types, o._values) } }; A._Universe_addRules(init.typeUniverse, JSON.parse('{"PlainJavaScriptObject":"LegacyJavaScriptObject","UnknownJavaScriptObject":"LegacyJavaScriptObject","JavaScriptFunction":"LegacyJavaScriptObject","NativeArrayBuffer":"NativeByteBuffer","JSBool":{"bool":[],"TrustedGetRuntimeType":[]},"JSNull":{"TrustedGetRuntimeType":[]},"JavaScriptObject":{"JSObject":[]},"LegacyJavaScriptObject":{"JSObject":[]},"JSArray":{"List":["1"],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"]},"JSArraySafeToStringHook":{"SafeToStringHook":[]},"JSUnmodifiableArray":{"JSArray":["1"],"List":["1"],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"]},"ArrayIterator":{"Iterator":["1"]},"JSNumber":{"double":[],"num":[],"Comparable":["num"]},"JSInt":{"double":[],"int":[],"num":[],"Comparable":["num"],"TrustedGetRuntimeType":[]},"JSNumNotInt":{"double":[],"num":[],"Comparable":["num"],"TrustedGetRuntimeType":[]},"JSString":{"String":[],"Comparable":["String"],"Pattern":[],"TrustedGetRuntimeType":[]},"LateError":{"Error":[]},"CodeUnits":{"ListBase":["int"],"UnmodifiableListMixin":["int"],"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"ListBase.E":"int","UnmodifiableListMixin.E":"int"},"EfficientLengthIterable":{"Iterable":["1"]},"ListIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"SubListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"ListIterator":{"Iterator":["1"]},"MappedIterable":{"Iterable":["2"],"Iterable.E":"2"},"EfficientLengthMappedIterable":{"MappedIterable":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"MappedIterator":{"Iterator":["2"]},"MappedListIterable":{"ListIterable":["2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListIterable.E":"2","Iterable.E":"2"},"WhereIterable":{"Iterable":["1"],"Iterable.E":"1"},"WhereIterator":{"Iterator":["1"]},"TakeIterable":{"Iterable":["1"],"Iterable.E":"1"},"EfficientLengthTakeIterable":{"TakeIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"TakeIterator":{"Iterator":["1"]},"TakeWhileIterable":{"Iterable":["1"],"Iterable.E":"1"},"TakeWhileIterator":{"Iterator":["1"]},"WhereTypeIterable":{"Iterable":["1"],"Iterable.E":"1"},"WhereTypeIterator":{"Iterator":["1"]},"UnmodifiableListBase":{"ListBase":["1"],"UnmodifiableListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"ReversedListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"_Record_2":{"_Record2":[],"_Record":[]},"_Record_4":{"_RecordN":[],"_Record":[]},"ConstantMap":{"Map":["1","2"]},"ConstantStringMap":{"ConstantMap":["1","2"],"Map":["1","2"]},"_KeysOrValues":{"Iterable":["1"],"Iterable.E":"1"},"_KeysOrValuesOrElementsIterator":{"Iterator":["1"]},"GeneralConstantMap":{"ConstantMap":["1","2"],"Map":["1","2"]},"NullError":{"TypeError":[],"Error":[]},"JsNoSuchMethodError":{"Error":[]},"UnknownJsTypeError":{"Error":[]},"_StackTrace":{"StackTrace":[]},"Closure":{"Function":[]},"Closure0Args":{"Function":[]},"Closure2Args":{"Function":[]},"TearOffClosure":{"Function":[]},"StaticClosure":{"Function":[]},"BoundClosure":{"Function":[]},"RuntimeError":{"Error":[]},"JsLinkedHashMap":{"MapBase":["1","2"],"LinkedHashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"LinkedHashMapKeysIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"LinkedHashMapKeyIterator":{"Iterator":["1"]},"LinkedHashMapValuesIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"LinkedHashMapValueIterator":{"Iterator":["1"]},"LinkedHashMapEntriesIterable":{"EfficientLengthIterable":["MapEntry<1,2>"],"Iterable":["MapEntry<1,2>"],"Iterable.E":"MapEntry<1,2>"},"LinkedHashMapEntryIterator":{"Iterator":["MapEntry<1,2>"]},"JsConstantLinkedHashMap":{"JsLinkedHashMap":["1","2"],"MapBase":["1","2"],"LinkedHashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_Record2":{"_Record":[]},"_RecordN":{"_Record":[]},"JSSyntaxRegExp":{"RegExp":[],"Pattern":[]},"_MatchImplementation":{"RegExpMatch":[],"Match":[]},"_AllMatchesIterable":{"Iterable":["RegExpMatch"],"Iterable.E":"RegExpMatch"},"_AllMatchesIterator":{"Iterator":["RegExpMatch"]},"StringMatch":{"Match":[]},"_StringAllMatchesIterable":{"Iterable":["Match"],"Iterable.E":"Match"},"_StringAllMatchesIterator":{"Iterator":["Match"]},"NativeByteBuffer":{"JSObject":[],"TrustedGetRuntimeType":[]},"NativeTypedData":{"JSObject":[]},"NativeByteData":{"JSObject":[],"TrustedGetRuntimeType":[]},"NativeTypedArray":{"JavaScriptIndexingBehavior":["1"],"JSObject":[]},"NativeTypedArrayOfDouble":{"ListBase":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"Iterable":["double"],"FixedLengthListMixin":["double"]},"NativeTypedArrayOfInt":{"ListBase":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"]},"NativeFloat32List":{"ListBase":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double","FixedLengthListMixin.E":"double"},"NativeFloat64List":{"ListBase":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double","FixedLengthListMixin.E":"double"},"NativeInt16List":{"ListBase":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","FixedLengthListMixin.E":"int"},"NativeInt32List":{"ListBase":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","FixedLengthListMixin.E":"int"},"NativeInt8List":{"ListBase":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","FixedLengthListMixin.E":"int"},"NativeUint16List":{"ListBase":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","FixedLengthListMixin.E":"int"},"NativeUint32List":{"ListBase":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","FixedLengthListMixin.E":"int"},"NativeUint8ClampedList":{"ListBase":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","FixedLengthListMixin.E":"int"},"NativeUint8List":{"ListBase":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","FixedLengthListMixin.E":"int"},"_Error":{"Error":[]},"_TypeError":{"TypeError":[],"Error":[]},"_SyncStarIterator":{"Iterator":["1"]},"_SyncStarIterable":{"Iterable":["1"],"Iterable.E":"1"},"AsyncError":{"Error":[]},"_Future":{"Future":["1"]},"_Zone":{"Zone":[]},"_RootZone":{"_Zone":[],"Zone":[]},"Queue":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"_LinkedHashSet":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_LinkedHashSetIterator":{"Iterator":["1"]},"ListBase":{"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"MapBase":{"Map":["1","2"]},"ListQueue":{"Queue":["1"],"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"_ListQueueIterator":{"Iterator":["1"]},"SetBase":{"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_SetBase":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_JsonMap":{"MapBase":["String","@"],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"_JsonMapKeyIterable":{"ListIterable":["String"],"EfficientLengthIterable":["String"],"Iterable":["String"],"ListIterable.E":"String","Iterable.E":"String"},"JsonUnsupportedObjectError":{"Error":[]},"JsonCyclicError":{"Error":[]},"JsonCodec":{"Codec":["Object?","String"]},"DateTime":{"Comparable":["DateTime"]},"double":{"num":[],"Comparable":["num"]},"int":{"num":[],"Comparable":["num"]},"List":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"num":{"Comparable":["num"]},"RegExpMatch":{"Match":[]},"String":{"Comparable":["String"],"Pattern":[]},"AssertionError":{"Error":[]},"TypeError":{"Error":[]},"ArgumentError":{"Error":[]},"RangeError":{"Error":[]},"IndexError":{"Error":[]},"UnsupportedError":{"Error":[]},"UnimplementedError":{"Error":[]},"StateError":{"Error":[]},"ConcurrentModificationError":{"Error":[]},"OutOfMemoryError":{"Error":[]},"StackOverflowError":{"Error":[]},"_StringStackTrace":{"StackTrace":[]},"StringBuffer":{"StringSink":[]},"_JSRandom":{"Random":[]},"_Random":{"Random":[]},"GameContent":{"Content":[]},"BarrierAction":{"Action":[]},"BoltAction":{"Action":[]},"HasteAction":{"Action":[]},"FreezeActorAction":{"Action":[]},"PoisonAction":{"Action":[]},"BlindAction":{"Action":[]},"DazzleAction":{"Action":[]},"ResistAction":{"Action":[]},"ConditionAction":{"Action":[]},"DetectAction":{"Action":[]},"EatAction":{"Action":[]},"BurnActorAction":{"Action":[]},"BurnFloorAction":{"Action":[]},"FreezeFloorAction":{"Action":[]},"PoisonFloorAction":{"Action":[]},"WindAction":{"Action":[]},"LightFloorAction":{"Action":[]},"BurningFloorAction":{"Action":[]},"PoisonedFloorAction":{"Action":[]},"FlowAction":{"Action":[]},"FlowSelfAction":{"Action":[]},"FlowFromAction":{"Action":[]},"HealAction":{"Action":[]},"HowlAction":{"Action":[]},"IlluminateSelfAction":{"Action":[]},"IlluminateAction":{"Action":[]},"MappingAction":{"Action":[]},"MappingFlow":{"Flow":[]},"MissiveAction":{"Action":[]},"PerceiveAction":{"Action":[]},"PolymorphAction":{"Action":[]},"AmputateAction":{"Action":[]},"RayAction":{"Action":[]},"RingSelfAction":{"Action":[]},"RingFromAction":{"Action":[]},"RayActionBase":{"Action":[]},"SpawnAction":{"Action":[]},"TeleportAction":{"Action":[]},"OpenBarrelAction":{"Action":[]},"OpenChestAction":{"Action":[]},"_OpenTileAction":{"Action":[]},"Furnishing":{"Decor":[]},"_ItemDrop":{"Drop":[]},"_TagDrop":{"Drop":[]},"_PercentDrop":{"Drop":[]},"_AllOfDrop":{"Drop":[]},"_OneOfDrop":{"Drop":[]},"_RepeatDrop":{"Drop":[]},"_BreedSpawn":{"Spawn":[]},"_TagSpawn":{"Spawn":[]},"_RepeatSpawn":{"Spawn":[]},"_AllOfSpawn":{"Spawn":[]},"AmputateMove":{"Move":[]},"BoltMove":{"Move":[]},"ConeMove":{"Move":[]},"HasteMove":{"Move":[]},"HealMove":{"Move":[]},"HowlMove":{"Move":[]},"MissiveMove":{"Move":[]},"SpawnMove":{"Move":[]},"TeleportMove":{"Move":[]},"Archery":{"TargetSkill":[],"Discipline":[],"UsableSkill":[],"Skill":[],"Comparable":["Skill"]},"ArrowAction":{"Action":[]},"AxeMastery":{"DirectionSkill":[],"Discipline":[],"UsableSkill":[],"Skill":[],"Comparable":["Skill"]},"SweepAction":{"Action":[]},"BattleHardening":{"Discipline":[],"Skill":[],"Comparable":["Skill"]},"ClubMastery":{"DirectionSkill":[],"Discipline":[],"UsableSkill":[],"Skill":[],"Comparable":["Skill"]},"BashAction":{"Action":[]},"Discipline":{"Skill":[],"Comparable":["Skill"]},"DualWield":{"Discipline":[],"Skill":[],"Comparable":["Skill"]},"MasteryDiscipline":{"Discipline":[],"Skill":[],"Comparable":["Skill"]},"UsableMasteryDiscipline":{"Discipline":[],"UsableSkill":[],"Skill":[],"Comparable":["Skill"]},"MasteryAction":{"Action":[]},"SlayDiscipline":{"Discipline":[],"Skill":[],"Comparable":["Skill"]},"SpearMastery":{"DirectionSkill":[],"Discipline":[],"UsableSkill":[],"Skill":[],"Comparable":["Skill"]},"SpearAction":{"Action":[]},"Swordfighting":{"Discipline":[],"Skill":[],"Comparable":["Skill"]},"WhipMastery":{"TargetSkill":[],"Discipline":[],"UsableSkill":[],"Skill":[],"Comparable":["Skill"]},"Spell":{"UsableSkill":[],"Skill":[],"Comparable":["Skill"]},"ActionSpell":{"Spell":[],"UsableSkill":[],"Skill":[],"Comparable":["Skill"]},"TargetSpell":{"Spell":[],"TargetSkill":[],"UsableSkill":[],"Skill":[],"Comparable":["Skill"]},"Catacomb":{"Architecture":[]},"Cavern":{"Architecture":[]},"Dungeon":{"Architecture":[]},"Keep":{"Architecture":[]},"Lake":{"Architecture":[]},"Pit":{"Architecture":[]},"River":{"Architecture":[]},"RoomArchitecture":{"Architecture":[]},"FocusAction":{"Action":[]},"AttackAction":{"Action":[]},"ItemAction":{"Action":[]},"PickUpAction":{"Action":[]},"DropAction":{"Action":[]},"EquipAction":{"Action":[]},"UnequipAction":{"Action":[]},"UseAction":{"Action":[]},"LosAction":{"Action":[]},"TossAction":{"Action":[]},"TossLosAction":{"Action":[]},"WalkAction":{"Action":[]},"OpenDoorAction":{"Action":[]},"CloseDoorAction":{"Action":[]},"RestAction":{"Action":[]},"Actor":{"Noun":[]},"ResistCondition":{"Condition":[]},"HasteCondition":{"Condition":[]},"ColdCondition":{"Condition":[]},"PoisonCondition":{"Condition":[]},"BlindnessCondition":{"Condition":[]},"PerceiveCondition":{"Condition":[]},"VecSet":{"Iterable":["Vec"],"Iterable.E":"Vec"},"ActionBehavior":{"Behavior":[]},"RestBehavior":{"Behavior":[]},"RunBehavior":{"Behavior":[]},"Hero":{"Actor":[],"Noun":[]},"Skill":{"Comparable":["Skill"]},"UsableSkill":{"Skill":[],"Comparable":["Skill"]},"StatBase":{"Property":["int"]},"Property":{"Property.T":"1"},"Strength":{"StatBase":[],"Property":["int"],"Property.T":"int"},"Agility":{"StatBase":[],"Property":["int"],"Property.T":"int"},"Vitality":{"StatBase":[],"Property":["int"],"Property.T":"int"},"Intellect":{"StatBase":[],"Property":["int"],"Property.T":"int"},"Equipment":{"ItemCollection":[],"Iterable":["Item"],"Iterable.E":"Item"},"Inventory":{"ItemCollection":[],"Iterable":["Item"],"Iterable.E":"Item"},"Item":{"Comparable":["Item"],"Noun":[]},"Monster":{"Actor":[],"Noun":[]},"ChangeMonsterStateAction":{"Action":[]},"AsleepState":{"MonsterState":[]},"AwakeState":{"MonsterState":[]},"AfraidState":{"MonsterState":[]},"RangedMove":{"Move":[]},"MotilityFlow":{"Flow":[]},"_SoundFlow":{"Flow":[]},"ConfirmPopup":{"Screen":["Input"],"Screen.T":"Input"},"DirectionDialog":{"Screen":["Input"]},"SkillDirectionDialog":{"Screen":["Input"],"Screen.T":"Input"},"OperateDialog":{"Screen":["Input"],"Screen.T":"Input"},"ElementEffect":{"Effect":[]},"FrameEffect":{"Effect":[]},"ItemEffect":{"Effect":[]},"DamageEffect":{"Effect":[]},"ParticleEffect":{"Effect":[]},"TeleportEffect":{"Effect":[]},"HealEffect":{"Effect":[]},"DetectEffect":{"Effect":[]},"MapEffect":{"Effect":[]},"TreasureEffect":{"Effect":[]},"HowlEffect":{"Effect":[]},"BlinkEffect":{"Effect":[]},"ExitPopup":{"Screen":["Input"],"Screen.T":"Input"},"ExperienceDialog":{"Screen":["Input"],"Screen.T":"Input"},"ForfeitPopup":{"Screen":["Input"],"Screen.T":"Input"},"GameOverScreen":{"Screen":["Input"],"Screen.T":"Input"},"GameScreen":{"Screen":["Input"],"Screen.T":"Input"},"HeroEquipmentDialog":{"HeroInfoDialog":[],"Screen":["Input"],"Screen.T":"Input"},"HeroInfoDialog":{"Screen":["Input"]},"HeroItemLoreDialog":{"HeroInfoDialog":[],"Screen":["Input"],"Screen.T":"Input"},"HeroMonsterLoreDialog":{"HeroInfoDialog":[],"Screen":["Input"],"Screen.T":"Input"},"HeroResistancesDialog":{"HeroInfoDialog":[],"Screen":["Input"],"Screen.T":"Input"},"DropDialog":{"Screen":["Input"],"Screen.T":"Input"},"EquipDialog":{"Screen":["Input"],"Screen.T":"Input"},"ItemDialog":{"Screen":["Input"]},"_AttackSection":{"_Section":[]},"_DefenseSection":{"_Section":[]},"_ResistancesSection":{"_Section":[]},"_TextSection":{"_Section":[]},"PickUpDialog":{"Screen":["Input"],"Screen.T":"Input"},"_PutDialog":{"Screen":["Input"]},"PutCrucibleDialog":{"Screen":["Input"],"Screen.T":"Input"},"PutHomeDialog":{"Screen":["Input"],"Screen.T":"Input"},"SellDialog":{"Screen":["Input"],"Screen.T":"Input"},"TossDialog":{"Screen":["Input"],"Screen.T":"Input"},"TownScreen":{"Screen":["Input"]},"_ItemVerbScreen":{"Screen":["Input"]},"_HomeScreen":{"Screen":["Input"],"Screen.T":"Input"},"_GetScreen":{"_ItemVerbScreen":[],"Screen":["Input"]},"_GetFromHomeScreen":{"_ItemVerbScreen":[],"Screen":["Input"],"Screen.T":"Input"},"_GetFromCrucibleScreen":{"_ItemVerbScreen":[],"Screen":["Input"],"Screen.T":"Input"},"_CrucibleScreen":{"Screen":["Input"],"Screen.T":"Input"},"_ShopScreen":{"Screen":["Input"],"Screen.T":"Input"},"_ShopBuyScreen":{"_ItemVerbScreen":[],"Screen":["Input"],"Screen.T":"Input"},"_CountScreen":{"Screen":["Input"],"Screen.T":"Input"},"UseDialog":{"Screen":["Input"],"Screen.T":"Input"},"LoadingDialog":{"Screen":["Input"],"Screen.T":"Input"},"MainMenuScreen":{"Screen":["Input"],"Screen.T":"Input"},"NewHeroScreen":{"Screen":["Input"],"Screen.T":"Input"},"NameControl":{"Control":[]},"SelectControl":{"Control":[]},"Popup":{"Screen":["Input"]},"SelectDepthPopup":{"Screen":["Input"],"Screen.T":"Input"},"SelectSkillDialog":{"Screen":["Input"],"Screen.T":"Input"},"SkillDialog":{"Screen":["Input"]},"SkillTypeDialog":{"SkillDialog":[],"Screen":["Input"]},"DisciplineDialog":{"SkillTypeDialog":["Discipline"],"SkillDialog":[],"Screen":["Input"],"Screen.T":"Input","SkillTypeDialog.T":"Discipline"},"SpellDialog":{"SkillTypeDialog":["Spell"],"SkillDialog":[],"Screen":["Input"],"Screen.T":"Input","SkillTypeDialog.T":"Spell"},"TargetDialog":{"Screen":["Input"],"Screen.T":"Input"},"WizardDialog":{"Screen":["Input"],"Screen.T":"Input"},"_SearchDialog":{"Screen":["Input"]},"_WizardDropDialog":{"_SearchDialog":["ItemType"],"Screen":["Input"],"Screen.T":"Input","_SearchDialog.T":"ItemType"},"_WizardSpawnDialog":{"_SearchDialog":["Breed"],"Screen":["Input"],"Screen.T":"Input","_SearchDialog.T":"Breed"},"_WizardTrainDialog":{"_SearchDialog":["Discipline"],"Screen":["Input"],"Screen.T":"Input","_SearchDialog.T":"Discipline"},"PortTerminal":{"Terminal":[]},"RetroTerminal":{"RenderableTerminal":[],"Terminal":[]},"RenderableTerminal":{"Terminal":[]},"Array2D":{"Iterable":["1"],"Iterable.E":"1"},"Circle":{"Iterable":["Vec"],"Iterable.E":"Vec"},"_CircleIterator":{"Iterator":["Vec"]},"Direction":{"Vec":[]},"_LineIterator":{"Iterator":["Vec"]},"Rect":{"Iterable":["Vec"],"Iterable.E":"Vec"},"RectIterator":{"Iterator":["Vec"]},"_EventStream":{"Stream":["1"]},"_ElementEventStreamImpl":{"_EventStream":["1"],"Stream":["1"]},"_EventStreamSubscription":{"StreamSubscription":["1"]},"Int8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8ClampedList":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Float32List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]},"Float64List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]}}')); A._Universe_addErasedTypes(init.typeUniverse, JSON.parse('{"EfficientLengthIterable":1,"UnmodifiableListBase":1,"NativeTypedArray":1,"_SetBase":1,"Converter":2,"Pathfinder":1}')); var string$ = { Error_: "Error handler must accept one Object or one Object and a StackTrace as arguments, and return a value of the returned future's type", max_mu: "max must be in range 0 < max \u2264 2^32, was ", _1___d: "{1} [don't|doesn't] have room for {2} and {2 he} drops to the ground." }; var type$ = (function rtii() { var findType = A.findType; return { Action: findType("Action"), ActionResult: findType("ActionResult"), ActionSpell: findType("ActionSpell"), Action_Function: findType("Action()"), Action_Function_Vec: findType("Action(Vec)"), Actor: findType("Actor"), Affix: findType("Affix"), AffixType: findType("AffixType"), Architecture: findType("Architecture"), Array2D_Cell: findType("Array2D"), Array2D_Glyph: findType("Array2D"), Array2D_RoomTile: findType("Array2D"), Array2D_Tile: findType("Array2D"), Array2D_bool: findType("Array2D"), Array2D_int: findType("Array2D"), Array2D_nullable_Actor: findType("Array2D"), Array2D_nullable_Architecture: findType("Array2D"), Array2D_nullable_Glyph: findType("Array2D"), Array2D_nullable_bool: findType("Array2D"), ArrayIterator_Vec: findType("ArrayIterator"), AsyncError: findType("AsyncError"), Bonus: findType("Bonus"), Breed: findType("Breed"), BucketQueue_Path: findType("BucketQueue"), BucketQueue_Vec: findType("BucketQueue"), Cell: findType("Cell"), CodeUnits: findType("CodeUnits"), Color: findType("Color"), Comparable_dynamic: findType("Comparable<@>"), ConstantStringMap_String_String: findType("ConstantStringMap"), DateTime: findType("DateTime"), Direction: findType("Direction"), DirectionSkill: findType("DirectionSkill"), Discipline: findType("Discipline"), Drop: findType("Drop"), Effect: findType("Effect"), EfficientLengthIterable_dynamic: findType("EfficientLengthIterable<@>"), Element: findType("Element"), Error: findType("Error"), Function: findType("Function"), Game: findType("Game"), Glyph: findType("Glyph"), Hero: findType("Hero"), HeroClass: findType("HeroClass"), HeroSave: findType("HeroSave"), Hit: findType("Hit"), Input: findType("Input"), Inventory: findType("Inventory"), Item: findType("Item"), ItemType: findType("ItemType"), Iterable_Event: findType("Iterable"), Iterable_Item: findType("Iterable"), Iterable_String: findType("Iterable"), Iterable_Vec: findType("Iterable"), Iterable_dynamic: findType("Iterable<@>"), JSArray_Action: findType("JSArray"), JSArray_Actor: findType("JSArray"), JSArray_Affix: findType("JSArray"), JSArray_ArchitecturalStyle: findType("JSArray"), JSArray_Architecture: findType("JSArray"), JSArray_Attack: findType("JSArray"), JSArray_Bonus: findType("JSArray"), JSArray_Breed: findType("JSArray"), JSArray_Color: findType("JSArray"), JSArray_Condition: findType("JSArray"), JSArray_Control: findType("JSArray"), JSArray_Defense: findType("JSArray"), JSArray_DetectType: findType("JSArray"), JSArray_Direction: findType("JSArray"), JSArray_Discipline: findType("JSArray"), JSArray_Drop: findType("JSArray"), JSArray_Effect: findType("JSArray"), JSArray_Event: findType("JSArray"), JSArray_Glyph: findType("JSArray"), JSArray_HeroInfoDialog: findType("JSArray"), JSArray_HeroSave: findType("JSArray"), JSArray_Hit: findType("JSArray"), JSArray_Item: findType("JSArray"), JSArray_ItemLocation: findType("JSArray"), JSArray_ItemType: findType("JSArray"), JSArray_Junction: findType("JSArray"), JSArray_List_Vec: findType("JSArray>"), JSArray_Map_String_Object: findType("JSArray>"), JSArray_Message: findType("JSArray"), JSArray_Monster: findType("JSArray"), JSArray_Move: findType("JSArray"), JSArray_Record_2_nullable_Item_and_Attack: findType("JSArray<+(Item?,Attack)>"), JSArray_Record_4_String_and_int_and_String_and_void_Function: findType("JSArray<+(String,int,String,~())>"), JSArray_Region: findType("JSArray"), JSArray_Scale: findType("JSArray"), JSArray_Screen_Input: findType("JSArray>"), JSArray_Skill: findType("JSArray"), JSArray_Spawn: findType("JSArray"), JSArray_Spell: findType("JSArray"), JSArray_String: findType("JSArray"), JSArray_TileType: findType("JSArray"), JSArray_UsableSkill: findType("JSArray"), JSArray_Vec: findType("JSArray"), JSArray__AnimatedValue: findType("JSArray<_AnimatedValue>"), JSArray__FillStep: findType("JSArray<_FillStep>"), JSArray__Path: findType("JSArray<_Path>"), JSArray__Section: findType("JSArray<_Section>"), JSArray__Shadow: findType("JSArray<_Shadow>"), JSArray_double: findType("JSArray"), JSArray_dynamic: findType("JSArray<@>"), JSArray_int: findType("JSArray"), JSArray_nullable_Queue_Path: findType("JSArray?>"), JSArray_nullable_Queue_Vec: findType("JSArray?>"), JSArray_of_int_Function_Breed_Breed: findType("JSArray"), JSArray_of_int_Function_ItemType_ItemType: findType("JSArray"), JSNull: findType("JSNull"), JSObject: findType("JSObject"), JavaScriptFunction: findType("JavaScriptFunction"), JavaScriptIndexingBehavior_dynamic: findType("JavaScriptIndexingBehavior<@>"), Junction: findType("Junction"), KeyBindings_Input: findType("KeyBindings"), List_Architecture: findType("List"), List_Attack: findType("List"), List_Color: findType("List"), List_Defense: findType("List"), List_DetectType: findType("List"), List_Direction: findType("List"), List_Glyph: findType("List"), List_Junction: findType("List"), List_List_Color: findType("List>"), List_List_Vec: findType("List>"), List_Map_String_Object: findType("List>"), List_Move: findType("List"), List_Object: findType("List"), List_String: findType("List"), List_String_Function_int: findType("List(int)"), List_TileType: findType("List"), List_Vec: findType("List"), List__Path: findType("List<_Path>"), List__Section: findType("List<_Section>"), List_dynamic: findType("List<@>"), List_nullable_TileType: findType("List"), List_nullable_Vec: findType("List"), List_nullable_int: findType("List"), LogType: findType("LogType"), Map_String_dynamic: findType("Map"), Map_String_int: findType("Map"), Map_dynamic_dynamic: findType("Map<@,@>"), MappedListIterable_String_Skill: findType("MappedListIterable"), MappedListIterable_String_String: findType("MappedListIterable"), Monster: findType("Monster"), Move: findType("Move"), Null: findType("Null"), Object: findType("Object"), Property_double: findType("Property"), Queue_num: findType("Queue"), Race: findType("Race"), Record: findType("Record"), Record_0: findType("+()"), RegExpMatch: findType("RegExpMatch"), Region: findType("Region"), ResistCondition: findType("ResistCondition"), ResourceSet_AffixType: findType("ResourceSet"), RoomTile: findType("RoomTile"), Scale: findType("Scale"), Screen_Input: findType("Screen"), Shop: findType("Shop"), Skill: findType("Skill"), Skill_Function_String: findType("Skill(String)"), Spell: findType("Spell"), StackTrace: findType("StackTrace"), Stat: findType("Stat"), String: findType("String"), String_Function_String: findType("String(String)"), TargetSkill: findType("TargetSkill"), TargetSpell: findType("TargetSpell"), Tile: findType("Tile"), TileType: findType("TileType"), TrustedGetRuntimeType: findType("TrustedGetRuntimeType"), TypeError: findType("TypeError"), UnknownJavaScriptObject: findType("UnknownJavaScriptObject"), UsableSkill: findType("UsableSkill"), UserInterface_Input: findType("UserInterface"), Vec: findType("Vec"), WhereIterable_Direction: findType("WhereIterable"), WhereTypeIterable_Discipline: findType("WhereTypeIterable"), WhereTypeIterable_Item: findType("WhereTypeIterable"), WhereTypeIterator_Item: findType("WhereTypeIterator"), _ElementEventStreamImpl_JSObject: findType("_ElementEventStreamImpl"), _Future_dynamic: findType("_Future<@>"), _Future_int: findType("_Future"), _ItemVerbScreen: findType("_ItemVerbScreen"), _KeyBinding: findType("_KeyBinding"), _QueryKey: findType("_QueryKey"), _SyncStarIterable_ActionResult: findType("_SyncStarIterable"), _SyncStarIterable_Defense: findType("_SyncStarIterable"), _SyncStarIterable_String: findType("_SyncStarIterable"), _SyncStarIterable_Vec: findType("_SyncStarIterable"), bool: findType("bool"), bool_Function_Direction: findType("bool(Direction)"), bool_Function_Object: findType("bool(Object)"), bool_Function_Vec: findType("bool(Vec)"), double: findType("double"), double_Function_int: findType("double(int)"), dynamic: findType("@"), dynamic_Function: findType("@()"), dynamic_Function_Object: findType("@(Object)"), dynamic_Function_Object_StackTrace: findType("@(Object,StackTrace)"), dynamic_Function_Vec: findType("@(Vec)"), int: findType("int"), int_Function_int: findType("int(int)"), nullable_Actor: findType("Actor?"), nullable_Architecture: findType("Architecture?"), nullable_Future_Null: findType("Future?"), nullable_Glyph: findType("Glyph?"), nullable_Item: findType("Item?"), nullable_JSObject: findType("JSObject?"), nullable_List_dynamic: findType("List<@>?"), nullable_Map_String_dynamic: findType("Map?"), nullable_Monster: findType("Monster?"), nullable_Object: findType("Object?"), nullable_String: findType("String?"), nullable_Vec: findType("Vec?"), nullable__FutureListener_dynamic_dynamic: findType("_FutureListener<@,@>?"), nullable__LinkedHashSetCell: findType("_LinkedHashSetCell?"), nullable_bool: findType("bool?"), nullable_double: findType("double?"), nullable_double_Function_int: findType("double(int)?"), nullable_int: findType("int?"), nullable_int_Function_int: findType("int(int)?"), nullable_num: findType("num?"), nullable_void_Function: findType("~()?"), nullable_void_Function_AffixBuilder: findType("~(AffixBuilder)?"), num: findType("num"), void: findType("~"), void_Function: findType("~()"), void_Function_2_nullable_Item_and_int: findType("~(Item?,int)"), void_Function_AffixBuilder: findType("~(AffixBuilder)"), void_Function_Breed: findType("~(Breed)"), void_Function_Item: findType("~(Item)"), void_Function_Item_Vec: findType("~(Item,Vec)"), void_Function_Monster: findType("~(Monster)"), void_Function_String_dynamic: findType("~(String,@)"), void_Function_int_int_Glyph: findType("~(int,int,Glyph)") }; })(); (function constants() { var makeConstList = hunkHelpers.makeConstList; B.Interceptor_methods = J.Interceptor.prototype; B.JSArray_methods = J.JSArray.prototype; B.JSBool_methods = J.JSBool.prototype; B.JSInt_methods = J.JSInt.prototype; B.JSNumber_methods = J.JSNumber.prototype; B.JSString_methods = J.JSString.prototype; B.JavaScriptFunction_methods = J.JavaScriptFunction.prototype; B.JavaScriptObject_methods = J.JavaScriptObject.prototype; B.PlainJavaScriptObject_methods = J.PlainJavaScriptObject.prototype; B.UnknownJavaScriptObject_methods = J.UnknownJavaScriptObject.prototype; B.ActionResult_null_false_true = new A.ActionResult(null, false, true); B.ActionResult_null_true_false = new A.ActionResult(null, true, false); B.ActionResult_null_true_true = new A.ActionResult(null, true, true); B.C_JS_CONST = function getTagFallback(o) { var s = Object.prototype.toString.call(o); return s.substring(8, s.length - 1); }; B.C_JS_CONST0 = function() { var toStringFunction = Object.prototype.toString; function getTag(o) { var s = toStringFunction.call(o); return s.substring(8, s.length - 1); } function getUnknownTag(object, tag) { if (/^HTML[A-Z].*Element$/.test(tag)) { var name = toStringFunction.call(object); if (name == "[object Object]") return null; return "HTMLElement"; } } function getUnknownTagGenericBrowser(object, tag) { if (object instanceof HTMLElement) return "HTMLElement"; return getUnknownTag(object, tag); } function prototypeForTag(tag) { if (typeof window == "undefined") return null; if (typeof window[tag] == "undefined") return null; var constructor = window[tag]; if (typeof constructor != "function") return null; return constructor.prototype; } function discriminator(tag) { return null; } var isBrowser = typeof HTMLElement == "function"; return { getTag: getTag, getUnknownTag: isBrowser ? getUnknownTagGenericBrowser : getUnknownTag, prototypeForTag: prototypeForTag, discriminator: discriminator }; }; B.C_JS_CONST6 = function(getTagFallback) { return function(hooks) { if (typeof navigator != "object") return hooks; var userAgent = navigator.userAgent; if (typeof userAgent != "string") return hooks; if (userAgent.indexOf("DumpRenderTree") >= 0) return hooks; if (userAgent.indexOf("Chrome") >= 0) { function confirm(p) { return typeof window == "object" && window[p] && window[p].name == p; } if (confirm("Window") && confirm("HTMLElement")) return hooks; } hooks.getTag = getTagFallback; }; }; B.C_JS_CONST1 = function(hooks) { if (typeof dartExperimentalFixupGetTag != "function") return hooks; hooks.getTag = dartExperimentalFixupGetTag(hooks.getTag); }; B.C_JS_CONST5 = function(hooks) { if (typeof navigator != "object") return hooks; var userAgent = navigator.userAgent; if (typeof userAgent != "string") return hooks; if (userAgent.indexOf("Firefox") == -1) return hooks; var getTag = hooks.getTag; var quickMap = { "BeforeUnloadEvent": "Event", "DataTransfer": "Clipboard", "GeoGeolocation": "Geolocation", "Location": "!Location", "WorkerMessageEvent": "MessageEvent", "XMLDocument": "!Document"}; function getTagFirefox(o) { var tag = getTag(o); return quickMap[tag] || tag; } hooks.getTag = getTagFirefox; }; B.C_JS_CONST4 = function(hooks) { if (typeof navigator != "object") return hooks; var userAgent = navigator.userAgent; if (typeof userAgent != "string") return hooks; if (userAgent.indexOf("Trident/") == -1) return hooks; var getTag = hooks.getTag; var quickMap = { "BeforeUnloadEvent": "Event", "DataTransfer": "Clipboard", "HTMLDDElement": "HTMLElement", "HTMLDTElement": "HTMLElement", "HTMLPhraseElement": "HTMLElement", "Position": "Geoposition" }; function getTagIE(o) { var tag = getTag(o); var newTag = quickMap[tag]; if (newTag) return newTag; if (tag == "Object") { if (window.DataView && (o instanceof window.DataView)) return "DataView"; } return tag; } function prototypeForTagIE(tag) { var constructor = window[tag]; if (constructor == null) return null; return constructor.prototype; } hooks.getTag = getTagIE; hooks.prototypeForTag = prototypeForTagIE; }; B.C_JS_CONST2 = function(hooks) { var getTag = hooks.getTag; var prototypeForTag = hooks.prototypeForTag; function getTagFixed(o) { var tag = getTag(o); if (tag == "Document") { if (!!o.xmlVersion) return "!Document"; return "!HTMLDocument"; } return tag; } function prototypeForTagFixed(tag) { if (tag == "Document") return null; return prototypeForTag(tag); } hooks.getTag = getTagFixed; hooks.prototypeForTag = prototypeForTagFixed; }; B.C_JS_CONST3 = function(hooks) { return hooks; } ; B.C_JsonCodec = new A.JsonCodec(); B.C_OutOfMemoryError = new A.OutOfMemoryError(); B.C_SentinelValue = new A.SentinelValue(); B.C__JSRandom = new A._JSRandom(); B.C__RootZone = new A._RootZone(); B.C__StringStackTrace = new A._StringStackTrace(); B.Color_0_0_0 = new A.Color(0, 0, 0); B.Color_0_64_255 = new A.Color(0, 64, 255); B.Color_0_64_39 = new A.Color(0, 64, 39); B.Color_110_32_13 = new A.Color(110, 32, 13); B.Color_116_146_181 = new A.Color(116, 146, 181); B.Color_129_217_117 = new A.Color(129, 217, 117); B.Color_129_231_235 = new A.Color(129, 231, 235); B.Color_131_158_13 = new A.Color(131, 158, 13); B.Color_132_126_135 = new A.Color(132, 126, 135); B.Color_142_82_55 = new A.Color(142, 82, 55); B.Color_15_130_148 = new A.Color(15, 130, 148); B.Color_173_88_219 = new A.Color(173, 88, 219); B.Color_179_74_4 = new A.Color(179, 74, 4); B.Color_189_144_108 = new A.Color(189, 144, 108); B.Color_200_130_0 = new A.Color(200, 130, 0); B.Color_201_166_255 = new A.Color(201, 166, 255); B.Color_204_35_57 = new A.Color(204, 35, 57); B.Color_20_19_31 = new A.Color(20, 19, 31); B.Color_20_20_35 = new A.Color(20, 20, 35); B.Color_21_87_194 = new A.Color(21, 87, 194); B.Color_220_0_0 = new A.Color(220, 0, 0); B.Color_222_156_33 = new A.Color(222, 156, 33); B.Color_226_223_240 = new A.Color(226, 223, 240); B.Color_22_117_38 = new A.Color(22, 117, 38); B.Color_255_122_105 = new A.Color(255, 122, 105); B.Color_255_238_168 = new A.Color(255, 238, 168); B.Color_255_255_255 = new A.Color(255, 255, 255); B.Color_26_46_150 = new A.Color(26, 46, 150); B.Color_36_10_5 = new A.Color(36, 10, 5); B.Color_38_42_66 = new A.Color(38, 42, 66); B.Color_40_40_55 = new A.Color(40, 40, 55); B.Color_42_36_43 = new A.Color(42, 36, 43); B.Color_51_48_28 = new A.Color(51, 48, 28); B.Color_56_16_125 = new A.Color(56, 16, 125); B.Color_63_75_115 = new A.Color(63, 75, 115); B.Color_64_163_229 = new A.Color(64, 163, 229); B.Color_72_64_74 = new A.Color(72, 64, 74); B.Color_77_29_21 = new A.Color(77, 29, 21); B.Color_80_80_95 = new A.Color(80, 80, 95); B.Color_84_0_39 = new A.Color(84, 0, 39); B.Color_86_30_138 = new A.Color(86, 30, 138); B.Color_99_87_7 = new A.Color(99, 87, 7); B.DetectType_0 = new A.DetectType(0, "exit"); B.DetectType_1 = new A.DetectType(1, "item"); B.Direction_0_0_0_none = new A.Direction(0, 0, 0, "none"); B.Direction_0_1_5_s = new A.Direction(0, 1, 5, "s"); B.Direction_0_m1_1_n = new A.Direction(0, -1, 1, "n"); B.Direction_1_0_3_e = new A.Direction(1, 0, 3, "e"); B.Direction_1_1_4_se = new A.Direction(1, 1, 4, "se"); B.Direction_1_m1_2_ne = new A.Direction(1, -1, 2, "ne"); B.Direction_m1_0_7_w = new A.Direction(-1, 0, 7, "w"); B.Direction_m1_1_6_sw = new A.Direction(-1, 1, 6, "sw"); B.Direction_m1_m1_8_nw = new A.Direction(-1, -1, 8, "nw"); B.EventType_awaken = new A.EventType("awaken"); B.EventType_bolt = new A.EventType("bolt"); B.EventType_cone = new A.EventType("cone"); B.EventType_detect = new A.EventType("detect"); B.EventType_die = new A.EventType("die"); B.EventType_frighten = new A.EventType("frighten"); B.EventType_gold = new A.EventType("gold"); B.EventType_heal = new A.EventType("heal"); B.EventType_hit = new A.EventType("hit"); B.EventType_howl = new A.EventType("howl"); B.EventType_knockBack = new A.EventType("knockBack"); B.EventType_map = new A.EventType("map"); B.EventType_openBarrel = new A.EventType("openBarrel"); B.EventType_pause = new A.EventType("pause"); B.EventType_perceive = new A.EventType("perceive"); B.EventType_polymorph = new A.EventType("polymorph"); B.EventType_slash = new A.EventType("slash"); B.EventType_spawn = new A.EventType("spawn"); B.EventType_stab = new A.EventType("stab"); B.EventType_teleport = new A.EventType("teleport"); B.EventType_toss = new A.EventType("toss"); B.EventType_wind = new A.EventType("wind"); B.Glyph_F97 = new A.Glyph(32, B.Color_255_255_255, B.Color_0_0_0); B.HitType_0 = new A.HitType(0, "melee"); B.HitType_1 = new A.HitType(1, "ranged"); B.HitType_2 = new A.HitType(2, "toss"); B.Input_cancel = new A.Input("cancel"); B.Input_drop = new A.Input("drop"); B.Input_e = new A.Input("e"); B.Input_editSkills = new A.Input("editSkills"); B.Input_equip = new A.Input("equip"); B.Input_fire = new A.Input("fire"); B.Input_fireE = new A.Input("fireE"); B.Input_fireN = new A.Input("fireN"); B.Input_fireNE = new A.Input("fireNE"); B.Input_fireNW = new A.Input("fireNW"); B.Input_fireS = new A.Input("fireS"); B.Input_fireSE = new A.Input("fireSE"); B.Input_fireSW = new A.Input("fireSW"); B.Input_fireW = new A.Input("fireW"); B.Input_forfeit = new A.Input("forfeit"); B.Input_heroInfo = new A.Input("heroInfo"); B.Input_n = new A.Input("n"); B.Input_ne = new A.Input("ne"); B.Input_nw = new A.Input("nw"); B.Input_ok = new A.Input("ok"); B.Input_operate = new A.Input("operate"); B.Input_pickUp = new A.Input("pickUp"); B.Input_quit = new A.Input("quit"); B.Input_rest = new A.Input("rest"); B.Input_runE = new A.Input("runE"); B.Input_runN = new A.Input("runN"); B.Input_runNE = new A.Input("runNE"); B.Input_runNW = new A.Input("runNW"); B.Input_runS = new A.Input("runS"); B.Input_runSE = new A.Input("runSE"); B.Input_runSW = new A.Input("runSW"); B.Input_runW = new A.Input("runW"); B.Input_s = new A.Input("s"); B.Input_se = new A.Input("se"); B.Input_selectSkill = new A.Input("selectSkill"); B.Input_spendExperience = new A.Input("spendExperience"); B.Input_sw = new A.Input("sw"); B.Input_swap = new A.Input("swap"); B.Input_toss = new A.Input("toss"); B.Input_use = new A.Input("use"); B.Input_w = new A.Input("w"); B.Input_wizard = new A.Input("wizard"); B.ItemLocation_Crucible = new A.ItemLocation("Crucible"); B.ItemLocation_Equipment = new A.ItemLocation("Equipment"); B.ItemLocation_Home = new A.ItemLocation("Home"); B.ItemLocation_Inventory = new A.ItemLocation("Inventory"); B.ItemLocation_ybX = new A.ItemLocation("On Ground"); B.ItemQuality_0 = new A.ItemQuality(0, "normal"); B.ItemQuality_1 = new A.ItemQuality(1, "good"); B.ItemQuality_2 = new A.ItemQuality(2, "great"); B.JsonDecoder_null = new A.JsonDecoder(null); B.JsonEncoder_null = new A.JsonEncoder(null); B.List_V7A = makeConstList([B.Color_222_156_33, B.Color_110_32_13], type$.JSArray_Color); B.List_PNG = makeConstList([B.Color_255_238_168, B.Color_179_74_4], type$.JSArray_Color); B.List_eXn = makeConstList([B.Color_142_82_55, B.Color_204_35_57], type$.JSArray_Color); B.List_eeu = makeConstList([B.Color_204_35_57, B.Color_77_29_21], type$.JSArray_Color); B.List_0eK = makeConstList([B.List_V7A, B.List_PNG, B.List_eXn, B.List_eeu], A.findType("JSArray>")); B.List_5L9 = makeConstList(["hand", "hand", "ring", "necklace", "body", "cloak", "helm", "gloves", "boots"], type$.JSArray_String); B.List_64O = makeConstList(["Return to main menu?"], type$.JSArray_String); B.List_9650_94 = makeConstList([9650, 94], type$.JSArray_int); B.List_E8g = makeConstList(["Merek", "Carac", "Ulric", "Tybalt", "Borin", "Sadon", "Terrowin", "Rowan", "Forthwind", "Althalos", "Fendrel", "Brom", "Hadrian", "Crewe", "Bolbec", "Fenwick", "Mowbray", "Drake", "Bryce", "Leofrick", "Letholdus", "Lief", "Barda", "Rulf", "Robin", "Gavin", "Terrin", "Jarin", "Cedric", "Gavin", "Josef", "Janshai", "Doran", "Asher", "Quinn", "Xalvador", "Favian", "Destrian", "Dain", "Millicent", "Alys", "Ayleth", "Anastas", "Alianor", "Cedany", "Ellyn", "Helewys", "Malkyn", "Peronell", "Thea", "Gloriana", "Arabella", "Hildegard", "Brunhild", "Adelaide", "Beatrix", "Emeline", "Mirabelle", "Helena", "Guinevere", "Isolde", "Maerwynn", "Catrain", "Gussalen", "Enndolynn", "Krea", "Dimia", "Aleida"], type$.JSArray_String); B.List_EnP = makeConstList([0, 2, 5, 10, 18, 26, 38], type$.JSArray_int); B.List_Er6 = makeConstList(["_____ _____ ____ ____", "\\ . / \\ ./ \\ .| \\ |", " | | |.| | | |.|", " |.|___| | ____ ____ ____ |.| __ ____ ___ __ | | ___", " |::___::| \\:::\\ \\::| \\::| |:|/::\\ /::::\\ \\::|/::\\|:| /::/", " |x| |x| __ \\x| |x| |x| |x| \\x\\ |x|__)x| |x| \\x||x|/x/", " |x| |x| /xx\\|x| |x| |x| |x| |x||x|\\xxx| |x| |xxxx\\", " |X| |X||X(__|X| |X\\__|X| |X|__/XX||X|____ |X| |X| \\X\\", " |X| |X| \\XXX/\\X\\ \\XX/|XX\\/XX/\\XXX/ \\XXXX/ /XXX\\ /XXX\\ \\X\\", " |X| |X|", "_|X| |X|_", "\\XX| |XX/", " \\X| |X/", " \\| |/"], type$.JSArray_String); B.Region_n_1_n = new A.Region("n", 1, "n"); B.Region_ne_2_ne = new A.Region("ne", 2, "ne"); B.Region_e_3_e = new A.Region("e", 3, "e"); B.Region_se_4_se = new A.Region("se", 4, "se"); B.Region_s_5_s = new A.Region("s", 5, "s"); B.Region_sw_6_sw = new A.Region("sw", 6, "sw"); B.Region_w_7_w = new A.Region("w", 7, "w"); B.Region_nw_8_nw = new A.Region("nw", 8, "nw"); B.List_FL1 = makeConstList([B.Region_n_1_n, B.Region_ne_2_ne, B.Region_e_3_e, B.Region_se_4_se, B.Region_s_5_s, B.Region_sw_6_sw, B.Region_w_7_w, B.Region_nw_8_nw], type$.JSArray_Region); B.LogType_0 = new A.LogType(0, "message"); B.LogType_1 = new A.LogType(1, "error"); B.LogType_2 = new A.LogType(2, "quest"); B.LogType_3 = new A.LogType(3, "gain"); B.LogType_4 = new A.LogType(4, "help"); B.LogType_5 = new A.LogType(5, "debug"); B.List_GzI = makeConstList([B.LogType_0, B.LogType_1, B.LogType_2, B.LogType_3, B.LogType_4, B.LogType_5], A.findType("JSArray")); B.List_Jzc = makeConstList(["Are you sure you want to forfeit the level?", "You will lose all items and experience gained in the dungeon."], type$.JSArray_String); B.List_N8X = makeConstList([B.ItemLocation_Inventory, B.ItemLocation_ybX, B.ItemLocation_Equipment], type$.JSArray_ItemLocation); B.List_Nyg = makeConstList(["LLLLL LLLLL LLLL LLLL", "ERRRE ERRRE ERRE ERRE", " ERE ERE ERE ERE", " ERELLLERE LLLL LLLL LLLL ERE LL LLLL LLL LL ERE LLL", " ERREEERRE ERRRE ERRE ERRE EREERRL LRRRRL ERRLLRRLERE LRRE", " EOE EOE LL EOE EOE EOE EOE EOL EOELLEOE EOE EOEEOELOE", " EGE EGE LGGEEGE EGE EGE EGE EGEEGEEGGGE EGE EGGGGL", " EYE EYEEYELLEYE EYLLLEYE EYELLLYYEEYELLLL EYE EYE EYL", " EYE EYE EYYYEEYL EYYEEYYLLYYEEYYYE EYYYYE LYYYL LYYYL EYL", " EYE EYE", "EEYE EYEE", "EYYE EYYE", " EYE EYE", " EE EE"], type$.JSArray_String); B.List_Stairs_Permanent = makeConstList(["Stairs", "Permanent"], type$.JSArray_String); B.List_VAg = makeConstList(["Stairs descend into darkness.", "How far down shall you venture?"], type$.JSArray_String); B.List_Zlh = makeConstList([B.Color_38_42_66, B.Color_63_75_115, B.Color_116_146_181, B.Color_226_223_240, B.Color_189_144_108, B.Color_142_82_55, B.Color_110_32_13, B.Color_77_29_21, B.Color_255_238_168, B.Color_222_156_33, B.Color_179_74_4, B.Color_129_217_117, B.Color_99_87_7, B.Color_131_158_13, B.Color_22_117_38, B.Color_0_64_39, B.Color_255_122_105, B.Color_204_35_57, B.Color_84_0_39, B.Color_173_88_219, B.Color_86_30_138, B.Color_56_16_125, B.Color_129_231_235, B.Color_64_163_229, B.Color_21_87_194, B.Color_26_46_150], type$.JSArray_Color); B.List_d2u = makeConstList([B.Direction_1_m1_2_ne, B.Direction_1_1_4_se, B.Direction_m1_1_6_sw, B.Direction_m1_m1_8_nw], type$.JSArray_Direction); B.List_empty3 = makeConstList([], type$.JSArray_Item); B.List_empty2 = makeConstList([], type$.JSArray_String); B.List_empty1 = makeConstList([], type$.JSArray_Vec); B.List_empty0 = makeConstList([], type$.JSArray__FillStep); B.List_empty = makeConstList([], type$.JSArray__Shadow); B.Stat_Strength_0_strength = new A.Stat("Strength", 0, "strength"); B.Stat_Agility_1_agility = new A.Stat("Agility", 1, "agility"); B.Stat_Fortitude_2_fortitude = new A.Stat("Fortitude", 2, "fortitude"); B.Stat_Intellect_3_intellect = new A.Stat("Intellect", 3, "intellect"); B.List_f5z = makeConstList([B.Stat_Strength_0_strength, B.Stat_Agility_1_agility, B.Stat_Fortitude_2_fortitude, B.Stat_Intellect_3_intellect], A.findType("JSArray")); B._Sort_401 = new A._Sort0("ordered by appearance", "Sort by appearance"); B._Sort_WrN0 = new A._Sort0("ordered by depth", "Sort by depth"); B._Sort_AXH0 = new A._Sort0("ordered by name", "Sort by name"); B._Sort_4kz = new A._Sort0("uniques", "Show only uniques"); B.List_fOO = makeConstList([B._Sort_401, B._Sort_WrN0, B._Sort_AXH0, B._Sort_4kz], A.findType("JSArray<_Sort0>")); B.List_g3y = makeConstList([B.ItemLocation_Inventory, B.ItemLocation_Equipment], type$.JSArray_ItemLocation); B.List_iHk = makeConstList([B.Direction_0_m1_1_n, B.Direction_1_0_3_e, B.Direction_0_1_5_s, B.Direction_m1_0_7_w], type$.JSArray_Direction); B.List_l3H = makeConstList(["hand", "ring", "necklace", "body", "cloak", "helm", "gloves", "boots"], type$.JSArray_String); B.List_mRN = makeConstList([15, 20, 24, 30, 40, 50, 60, 80, 100, 120, 150, 180, 240], type$.JSArray_int); B._Sort_tJq = new A._Sort("ordered by type", "Sort by type"); B._Sort_WrN = new A._Sort("ordered by depth", "Sort by depth"); B._Sort_AXH = new A._Sort("ordered by name", "Sort by name"); B._Sort_Csn = new A._Sort("ordered by price", "Sort by price"); B.List_owd = makeConstList([B._Sort_tJq, B._Sort_WrN, B._Sort_AXH, B._Sort_Csn], A.findType("JSArray<_Sort>")); B.List_rWY = makeConstList(["When you die, you lose everything since the last time you went up or down a set of stairs (or left a shop).", "When you die, that's it. Your hero is gone forever. This is the most challenging way to play, but often the most rewarding as well."], type$.JSArray_String); B.List_wXx = makeConstList([B.Direction_0_m1_1_n, B.Direction_1_m1_2_ne, B.Direction_1_0_3_e, B.Direction_1_1_4_se, B.Direction_0_1_5_s, B.Direction_m1_1_6_sw, B.Direction_m1_0_7_w, B.Direction_m1_m1_8_nw], type$.JSArray_Direction); B.List_zFd = makeConstList([B.ItemLocation_ybX], type$.JSArray_ItemLocation); B.Object_DD7 = {Y: 0, N: 1, "`": 2}; B.Map_Am2t0 = new A.ConstantStringMap(B.Object_DD7, ["Yes", "No", "No"], type$.ConstantStringMap_String_String); B.Missive_0 = new A.Missive(0, "clumsy"); B.Missive_1 = new A.Missive(1, "insult"); B.Missive_2 = new A.Missive(2, "screech"); B.Missive_3 = new A.Missive(3, "hiss"); B.List_eLZ = makeConstList(["{1} forget[s] what {1 he} was doing.", "{1} lurch[es] around.", "{1} stumble[s] awkwardly.", "{1} trip[s] over {1 his} own feet!"], type$.JSArray_String); B.List_cLr = makeConstList(["{1} insult[s] {2 his} mother!", "{1} jeer[s] at {2}!", "{1} mock[s] {2} mercilessly!", "{1} make[s] faces at {2}!", "{1} laugh[s] at {2}!", "{1} sneer[s] at {2}!"], type$.JSArray_String); B.List_9y0 = makeConstList(["{1} screech[es] at {2}!", "{1} taunt[s] {2}!", "{1} cackle[s] at {2}!"], type$.JSArray_String); B.List_X6h = makeConstList(["{1} hiss[es] at {2}!", "{1} spit[s] at {2}!"], type$.JSArray_String); B.Map_DeHhx = new A.GeneralConstantMap([B.Missive_0, B.List_eLZ, B.Missive_1, B.List_cLr, B.Missive_2, B.List_9y0, B.Missive_3, B.List_X6h], A.findType("GeneralConstantMap>")); B.Map_NgGHE = new A.GeneralConstantMap([B.Direction_0_0_0_none, "\u2022", B.Direction_0_m1_1_n, "|", B.Direction_1_m1_2_ne, "/", B.Direction_1_0_3_e, "-", B.Direction_1_1_4_se, "\\", B.Direction_0_1_5_s, "|", B.Direction_m1_1_6_sw, "/", B.Direction_m1_0_7_w, "-", B.Direction_m1_m1_8_nw, "\\"], A.findType("GeneralConstantMap")); B.Object_dh7 = {L: 0, E: 1, R: 2, O: 3, G: 4, Y: 5}; B.Color_232_200_21 = new A.Color(232, 200, 21); B.Map_SFjnT = new A.ConstantStringMap(B.Object_dh7, [B.Color_132_126_135, B.Color_72_64_74, B.Color_204_35_57, B.Color_179_74_4, B.Color_222_156_33, B.Color_232_200_21], A.findType("ConstantStringMap")); B.Map_TaQlz = new A.GeneralConstantMap([9786, 1, 9787, 2, 9829, 3, 9830, 4, 9827, 5, 9824, 6, 8226, 7, 9688, 8, 9675, 9, 9689, 10, 9794, 11, 9792, 12, 9834, 13, 9835, 14, 9788, 15, 9658, 16, 9668, 17, 8597, 18, 8252, 19, 182, 20, 167, 21, 9644, 22, 8616, 23, 8593, 24, 8595, 25, 8594, 26, 8592, 27, 8735, 28, 8596, 29, 9650, 30, 9660, 31, 8962, 127, 199, 128, 252, 129, 233, 130, 226, 131, 228, 132, 224, 133, 229, 134, 231, 135, 234, 136, 235, 137, 232, 138, 239, 139, 238, 140, 236, 141, 196, 142, 197, 143, 201, 144, 230, 145, 198, 146, 244, 147, 246, 148, 242, 149, 251, 150, 249, 151, 255, 152, 214, 153, 220, 154, 162, 155, 163, 156, 165, 157, 8359, 158, 402, 159, 225, 160, 237, 161, 243, 162, 250, 163, 241, 164, 209, 165, 170, 166, 186, 167, 191, 168, 8976, 169, 172, 170, 189, 171, 188, 172, 161, 173, 171, 174, 187, 175, 9617, 176, 9618, 177, 9619, 178, 9474, 179, 9508, 180, 9569, 181, 9570, 182, 9558, 183, 9557, 184, 9571, 185, 9553, 186, 9559, 187, 9565, 188, 9564, 189, 9563, 190, 9488, 191, 9492, 192, 9524, 193, 9516, 194, 9500, 195, 9472, 196, 9532, 197, 9566, 198, 9567, 199, 9562, 200, 9556, 201, 9577, 202, 9574, 203, 9568, 204, 9552, 205, 9580, 206, 9575, 207, 9576, 208, 9572, 209, 9573, 210, 9561, 211, 9560, 212, 9554, 213, 9555, 214, 9579, 215, 9578, 216, 9496, 217, 9484, 218, 9608, 219, 9604, 220, 9612, 221, 9616, 222, 9600, 223, 945, 224, 223, 225, 915, 226, 960, 227, 931, 228, 963, 229, 181, 230, 964, 231, 934, 232, 920, 233, 937, 234, 948, 235, 8734, 236, 966, 237, 949, 238, 8745, 239, 8801, 240, 177, 241, 8805, 242, 8804, 243, 8992, 244, 8993, 245, 247, 246, 8776, 247, 176, 248, 8729, 249, 183, 250, 8730, 251, 8319, 252, 178, 253, 9632, 254], A.findType("GeneralConstantMap")); B.Object_empty = {}; B.Map_empty = new A.ConstantStringMap(B.Object_empty, [], type$.ConstantStringMap_String_String); B.Object_tv1 = {"A-Z Del": 0}; B.Map_t3QSL = new A.ConstantStringMap(B.Object_tv1, ["Edit name"], type$.ConstantStringMap_String_String); B.Object_xRF = {OK: 0, "\u2195\u2194": 1, "`": 2}; B.Map_tt6T1 = new A.ConstantStringMap(B.Object_xRF, ["Enter dungeon", "Change depth", "Cancel"], type$.ConstantStringMap_String_String); B.Pronoun_he_him_his = new A.Pronoun("he", "him", "his"); B.Pronoun_it_it_its = new A.Pronoun("it", "it", "its"); B.Pronoun_she_her_her = new A.Pronoun("she", "her", "her"); B.Pronoun_they_them_their = new A.Pronoun("they", "them", "their"); B.Pronoun_you_you_your = new A.Pronoun("you", "you", "your"); B.Record2_10_16 = new A._Record_2(10, 16); B.Record2_10_17 = new A._Record_2(10, 17); B.Record2_13_18 = new A._Record_2(13, 18); B.Record2_17_24 = new A._Record_2(17, 24); B.Record2_18_27 = new A._Record_2(18, 27); B.Record2_1_1 = new A._Record_2(1, 1); B.Record2_5_8 = new A._Record_2(5, 8); B.Record2_5_9 = new A._Record_2(5, 9); B.Record2_6_9 = new A._Record_2(6, 9); B.Record2_9_12 = new A._Record_2(9, 12); B.Record2_LpS = new A._Record_2(0.002, 0.8); B.Record2_yab = new A._Record_2(0.1, 1); B.Vec_0_0 = new A.Vec(0, 0); B.Rect_yK0 = new A.Rect(B.Vec_0_0, B.Vec_0_0); B.Region_everywhere_0_everywhere = new A.Region("everywhere", 0, "everywhere"); B.RoomShapes_0 = new A.RoomShapes(0, "rectangular"); B.RoomShapes_1 = new A.RoomShapes(1, "octagonal"); B.RoomShapes_2 = new A.RoomShapes(2, "any"); B.RoomSize_0 = new A.RoomSize(0, "small"); B.RoomSize_1 = new A.RoomSize(1, "medium"); B.RoomSize_2 = new A.RoomSize(2, "large"); B.SpawnLocation_0 = new A.SpawnLocation(0, "anywhere"); B.SpawnLocation_1 = new A.SpawnLocation(1, "open"); B.SpawnLocation_2 = new A.SpawnLocation(2, "wall"); B.SpawnLocation_3 = new A.SpawnLocation(3, "corner"); B.Symmetry_0 = new A.Symmetry(0, "none"); B.Symmetry_1 = new A.Symmetry(1, "mirrorHorizontal"); B.Symmetry_2 = new A.Symmetry(2, "mirrorVertical"); B.Symmetry_3 = new A.Symmetry(3, "mirrorBoth"); B.Symmetry_4 = new A.Symmetry(4, "rotate90"); B.Symmetry_5 = new A.Symmetry(5, "rotate180"); B.TakeFrom_1 = new A.TakeFrom(1, "oldest"); B.TilePortal_cvm4 = new A.TilePortal("shop 1"); B.TilePortal_cvm3 = new A.TilePortal("shop 2"); B.TilePortal_cvm2 = new A.TilePortal("shop 3"); B.TilePortal_cvm1 = new A.TilePortal("shop 4"); B.TilePortal_cvm0 = new A.TilePortal("shop 5"); B.TilePortal_cvm = new A.TilePortal("shop 6"); B.TilePortal_cvm5 = new A.TilePortal("shop 7"); B.TilePortal_cvm6 = new A.TilePortal("shop 8"); B.TilePortal_cvm7 = new A.TilePortal("shop 9"); B.TilePortal_dungeon = new A.TilePortal("dungeon"); B.TilePortal_exit = new A.TilePortal("exit"); B.TilePortal_home = new A.TilePortal("home"); B.Type_ByteBuffer_rqD = A.typeLiteral("ByteBuffer"); B.Type_ByteData_9dB = A.typeLiteral("ByteData"); B.Type_Float32List_9Kz = A.typeLiteral("Float32List"); B.Type_Float64List_9Kz = A.typeLiteral("Float64List"); B.Type_Int16List_s5h = A.typeLiteral("Int16List"); B.Type_Int32List_O8Z = A.typeLiteral("Int32List"); B.Type_Int8List_rFV = A.typeLiteral("Int8List"); B.Type_Object_A4p = A.typeLiteral("Object"); B.Type_Uint16List_kmP = A.typeLiteral("Uint16List"); B.Type_Uint32List_kmP = A.typeLiteral("Uint32List"); B.Type_Uint8ClampedList_04U = A.typeLiteral("Uint8ClampedList"); B.Type_Uint8List_8Eb = A.typeLiteral("Uint8List"); B.Vec_0_1 = new A.Vec(0, 1); B.Vec_0_m1 = new A.Vec(0, -1); B.Vec_1_0 = new A.Vec(1, 0); B.Vec_m1_0 = new A.Vec(-1, 0); })(); (function staticFields() { $._JS_INTEROP_INTERCEPTOR_TAG = null; $.toStringVisiting = A._setArrayType([], A.findType("JSArray")); $.Primitives__identityHashCodeProperty = null; $.Primitives_timerFrequency = 0; $.Primitives_timerTicks = A._js_helper_Primitives_dateNow$closure(); $.BoundClosure__receiverFieldNameCache = null; $.BoundClosure__interceptorFieldNameCache = null; $.getTagFunction = null; $.alternateTagFunction = null; $.prototypeForTagFunction = null; $.dispatchRecordsForInstanceTags = null; $.interceptorsForUncacheableTags = null; $.initNativeDispatchFlag = null; $._Record__computedFieldKeys = A._setArrayType([], A.findType("JSArray?>")); $._nextCallback = null; $._lastCallback = null; $._lastPriorityCallback = null; $._isInCallbackLoop = false; $.Zone__current = B.C__RootZone; $._categoryFrequency = null; $._furnishingFrequency = null; $.___themes = A._Cell$named("_themes"); $._categoryCells = null; $._mirrorHorizontal = A._setArrayType(["\u250c\u2510", "\u255b\u2558", "\u255e\u2561"], type$.JSArray_String); $._mirrorVertical = A._setArrayType(["\u250c\u2558", "\u2510\u255b", "\u2500\u2550"], type$.JSArray_String); $._rotate = A._setArrayType(["\u250c\u2510\u255b\u2558", "\u2500\u2502\u2550\u2502"], type$.JSArray_String); $.___category = A._Cell$named("_category"); $._itemBuilder = null; $._affixTag = null; $._affixBuilder = null; $.ItemBuilder__sortIndex = 0; $.AffixBuilder__sortIndex = 0; $.Recipes_all = A._setArrayType([], A.findType("JSArray")); $.Shops_all = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.Shop); $._builder = null; $.___family = A._Cell$named("_family"); $.Debug_showAllMonsters = false; $.Debug_showMonsterAlertness = false; $.Debug_showHeroVolume = false; $.Debug__monsters = A.LinkedHashMap_LinkedHashMap$_empty(type$.Monster, A.findType("_MonsterLog")); $.Debug__gameScreen = null; $.Skill__nextSortOrder = 0; $.BreedRef__unresolved = A._setArrayType([], A.findType("JSArray")); $.Fov__octantCoordinates = function() { var t1 = type$.JSArray_Vec; return A._setArrayType([A._setArrayType([B.Vec_0_m1, B.Vec_1_0], t1), A._setArrayType([B.Vec_1_0, B.Vec_0_m1], t1), A._setArrayType([B.Vec_1_0, B.Vec_0_1], t1), A._setArrayType([B.Vec_0_1, B.Vec_1_0], t1), A._setArrayType([B.Vec_0_1, B.Vec_m1_0], t1), A._setArrayType([B.Vec_m1_0, B.Vec_0_1], t1), A._setArrayType([B.Vec_m1_0, B.Vec_0_m1], t1), A._setArrayType([B.Vec_0_m1, B.Vec_m1_0], t1)], type$.JSArray_List_Vec); }(); $.TeleportEffect__colors = A._setArrayType([B.Color_129_231_235, B.Color_64_163_229, B.Color_173_88_219, B.Color_226_223_240], type$.JSArray_Color); $.DetectEffect__colors = A._setArrayType([B.Color_226_223_240, B.Color_255_238_168, B.Color_222_156_33, B.Color_99_87_7, B.Color_51_48_28], type$.JSArray_Color); $.HeroInfoDialog__screens = A._setArrayType([], type$.JSArray_HeroInfoDialog); $._fonts = A._setArrayType([], A.findType("JSArray")); $.___ui = A._Cell$named("_ui"); $.___font = A._Cell$named("_font"); $._debugMonsters = A.LinkedHashSet_LinkedHashSet$_empty(type$.Monster); })(); (function lazyInitializers() { var _lazyFinal = hunkHelpers.lazyFinal; _lazyFinal($, "DART_CLOSURE_PROPERTY_NAME", "$get$DART_CLOSURE_PROPERTY_NAME", () => A.getIsolateAffinityTag("_$dart_dartClosure")); _lazyFinal($, "_safeToStringHooks", "$get$_safeToStringHooks", () => A._setArrayType([new J.JSArraySafeToStringHook()], A.findType("JSArray"))); _lazyFinal($, "TypeErrorDecoder_noSuchMethodPattern", "$get$TypeErrorDecoder_noSuchMethodPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn({ toString: function() { return "$receiver$"; } }))); _lazyFinal($, "TypeErrorDecoder_notClosurePattern", "$get$TypeErrorDecoder_notClosurePattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn({$method$: null, toString: function() { return "$receiver$"; } }))); _lazyFinal($, "TypeErrorDecoder_nullCallPattern", "$get$TypeErrorDecoder_nullCallPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn(null))); _lazyFinal($, "TypeErrorDecoder_nullLiteralCallPattern", "$get$TypeErrorDecoder_nullLiteralCallPattern", () => A.TypeErrorDecoder_extractPattern(function() { var $argumentsExpr$ = "$arguments$"; try { null.$method$($argumentsExpr$); } catch (e) { return e.message; } }())); _lazyFinal($, "TypeErrorDecoder_undefinedCallPattern", "$get$TypeErrorDecoder_undefinedCallPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn(void 0))); _lazyFinal($, "TypeErrorDecoder_undefinedLiteralCallPattern", "$get$TypeErrorDecoder_undefinedLiteralCallPattern", () => A.TypeErrorDecoder_extractPattern(function() { var $argumentsExpr$ = "$arguments$"; try { (void 0).$method$($argumentsExpr$); } catch (e) { return e.message; } }())); _lazyFinal($, "TypeErrorDecoder_nullPropertyPattern", "$get$TypeErrorDecoder_nullPropertyPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokePropertyErrorOn(null))); _lazyFinal($, "TypeErrorDecoder_nullLiteralPropertyPattern", "$get$TypeErrorDecoder_nullLiteralPropertyPattern", () => A.TypeErrorDecoder_extractPattern(function() { try { null.$method$; } catch (e) { return e.message; } }())); _lazyFinal($, "TypeErrorDecoder_undefinedPropertyPattern", "$get$TypeErrorDecoder_undefinedPropertyPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokePropertyErrorOn(void 0))); _lazyFinal($, "TypeErrorDecoder_undefinedLiteralPropertyPattern", "$get$TypeErrorDecoder_undefinedLiteralPropertyPattern", () => A.TypeErrorDecoder_extractPattern(function() { try { (void 0).$method$; } catch (e) { return e.message; } }())); _lazyFinal($, "_AsyncRun__scheduleImmediateClosure", "$get$_AsyncRun__scheduleImmediateClosure", () => A._AsyncRun__initializeScheduleImmediate()); _lazyFinal($, "_hashSeed", "$get$_hashSeed", () => A.objectHashCode(B.Type_Object_A4p)); _lazyFinal($, "Stopwatch__frequency", "$get$Stopwatch__frequency", () => { A.Primitives_initTicker(); return $.Primitives_timerFrequency; }); _lazyFinal($, "Classes_adventurer", "$get$Classes_adventurer", () => A._class("Adventurer", A.parseDrop("item", null, null), "No special birthright, training, or inclination is needed to become an adventurer, simply the courage (or foolhardiness) to brave the wilds and live on one's wits. Adventurers are flexible and resourceful. They are masters of nothing, but able to learn a little of everything.", 0.5, 0.2)); _lazyFinal($, "Classes_warrior", "$get$Classes_warrior", () => A._class("Warrior", A.parseDrop("weapon", null, null), "It's not that warriors are stupid. Many are, in fact, quite intelligent. It's just that they tend to apply most of that intelligence towards deciding which weapon is best suited for splitting a monster's head open.\n\nWarriors rely on the might of their bodies and the reassuring heft of their equipment. While they aren't above using a little magic here and there, they're most comfortable when those supernatural forces are safely ensconced in a piece of familiar gear.", 1, 0)); _lazyFinal($, "Classes_mage", "$get$Classes_mage", () => A._class("Mage", A.parseDrop('Spellbook "Elemental Primer"', null, null), "Where others rightly fear the awesome power and unpredictability of magic, mages see it as a source of personal power and glory. Magic demands great sacrifices of anyone who dares to wield it directly. Mages who have devoted their lives to it have little time to master other arts and skills. But the rewards in return can be great for anyone willing to dance with the raw forces of nature (as well as some less natural forces).", 0.2, 1)); _lazyFinal($, "Classes_all", "$get$Classes_all", () => A._setArrayType([$.$get$Classes_adventurer(), $.$get$Classes_warrior(), $.$get$Classes_mage()], A.findType("JSArray"))); _lazyFinal($, "Decor_all", "$get$Decor_all", () => A.ResourceSet$(A.findType("Decor"))); _lazyFinal($, "Cell_uninitialized", "$get$Cell_uninitialized", () => { var _null = null; return A.Cell$(_null, _null, _null, _null); }); _lazyFinal($, "_applyCells", "$get$_applyCells", () => { var t4, t5, t6, t7, t8, t9, t10, _null = null, t1 = $.$get$Tiles_wallTorch(), t2 = A.Cell$(t1, _null, _null, A._setArrayType([$.$get$Tiles_flagstoneWall(), $.$get$Tiles_graniteWall()], type$.JSArray_TileType)), t3 = $.$get$Motility_walk(); t1 = A.Cell$(t1, t3, _null, _null); t4 = A.Cell$($.$get$Tiles_statue(), t3, _null, _null); t5 = $.$get$Tiles_water(); t6 = A.Cell$(t5, t3, _null, _null); t7 = A.Cell$($.$get$Tiles_closedBarrel(), t3, _null, _null); t8 = A.Cell$($.$get$Tiles_closedChest(), t3, _null, _null); t9 = A.Cell$($.$get$Tiles_tallGrass(), _null, $.$get$Tiles_grass(), _null); t10 = $.$get$Tiles_bridge(); return A.LinkedHashMap_LinkedHashMap$_literal(["I", t2, "l", t1, "P", t4, "\u2248", t6, "%", t7, "&", t8, "*", t9, "=", A.Cell$(t10, _null, t5, _null), "\u2261", A.Cell$(t10, t3, _null, _null), "\u2022", A.Cell$($.$get$Tiles_steppingStone(), _null, t5, _null)], type$.String, type$.Cell); }); _lazyFinal($, "_requireCells", "$get$_requireCells", () => { var _null = null, t1 = type$.JSArray_TileType; return A.LinkedHashMap_LinkedHashMap$_literal(["?", A.Cell$(_null, _null, _null, _null), ".", A.Cell$(_null, $.$get$Motility_walk(), _null, _null), "#", A.Cell$(_null, _null, _null, A._setArrayType([$.$get$Tiles_flagstoneWall(), $.$get$Tiles_graniteWall(), $.$get$Tiles_granite1(), $.$get$Tiles_granite2(), $.$get$Tiles_granite3()], t1)), "\u250c", A.Cell$(_null, _null, $.$get$Tiles_tableTopLeft(), _null), "\u2500", A.Cell$(_null, _null, $.$get$Tiles_tableTop(), _null), "\u2510", A.Cell$(_null, _null, $.$get$Tiles_tableTopRight(), _null), "-", A.Cell$(_null, _null, $.$get$Tiles_tableCenter(), _null), "\u2502", A.Cell$(_null, _null, $.$get$Tiles_tableSide(), _null), "\u2558", A.Cell$(_null, _null, $.$get$Tiles_tableBottomLeft(), _null), "\u2550", A.Cell$(_null, _null, $.$get$Tiles_tableBottom(), _null), "\u255b", A.Cell$(_null, _null, $.$get$Tiles_tableBottomRight(), _null), "\u255e", A.Cell$(_null, _null, $.$get$Tiles_tableLegLeft(), _null), "\u2564", A.Cell$(_null, _null, $.$get$Tiles_tableLeg(), _null), "\u2561", A.Cell$(_null, _null, $.$get$Tiles_tableLegRight(), _null), "\u03c0", A.Cell$(_null, _null, $.$get$Tiles_chair(), _null), "\u2248", A.Cell$(_null, _null, $.$get$Tiles_water(), _null), "'", A.Cell$(_null, _null, _null, A._setArrayType([$.$get$Tiles_grass(), $.$get$Tiles_tallGrass()], t1))], type$.String, type$.Cell); }); _lazyFinal($, "Elements_air", "$get$Elements_air", () => A.Element$("air", "Ai", 1.2, new A.Elements_air_closure(), "", false, null)); _lazyFinal($, "Elements_earth", "$get$Elements_earth", () => A.Element$("earth", "Ea", 1.1, null, "", false, null)); _lazyFinal($, "Elements_fire", "$get$Elements_fire", () => A.Element$("fire", "Fi", 1.2, new A.Elements_fire_closure(), "burns up", true, new A.Elements_fire_closure0())); _lazyFinal($, "Elements_water", "$get$Elements_water", () => A.Element$("water", "Wa", 1.3, null, "", false, null)); _lazyFinal($, "Elements_acid", "$get$Elements_acid", () => A.Element$("acid", "Ac", 1.4, null, "", false, null)); _lazyFinal($, "Elements_cold", "$get$Elements_cold", () => A.Element$("cold", "Co", 1.2, new A.Elements_cold_closure(), "shatters", false, new A.Elements_cold_closure0())); _lazyFinal($, "Elements_lightning", "$get$Elements_lightning", () => A.Element$("lightning", "Ln", 1.1, null, "", false, null)); _lazyFinal($, "Elements_poison", "$get$Elements_poison", () => A.Element$("poison", "Po", 2, new A.Elements_poison_closure(), "", false, new A.Elements_poison_closure0())); _lazyFinal($, "Elements_dark", "$get$Elements_dark", () => A.Element$("dark", "Dk", 1.5, new A.Elements_dark_closure(), "", false, null)); _lazyFinal($, "Elements_light", "$get$Elements_light", () => A.Element$("light", "Li", 1.5, new A.Elements_light_closure(), "", false, new A.Elements_light_closure0())); _lazyFinal($, "Elements_spirit", "$get$Elements_spirit", () => A.Element$("spirit", "Sp", 3, null, "", false, null)); _lazyFinal($, "Elements_all", "$get$Elements_all", () => A._setArrayType([$.$get$Element_none(), $.$get$Elements_air(), $.$get$Elements_earth(), $.$get$Elements_fire(), $.$get$Elements_water(), $.$get$Elements_acid(), $.$get$Elements_cold(), $.$get$Elements_lightning(), $.$get$Elements_poison(), $.$get$Elements_dark(), $.$get$Elements_light(), $.$get$Elements_spirit()], A.findType("JSArray"))); _lazyFinal($, "Affixes_prefixes", "$get$Affixes_prefixes", () => A.ResourceSet$(type$.AffixType)); _lazyFinal($, "Affixes_suffixes", "$get$Affixes_suffixes", () => A.ResourceSet$(type$.AffixType)); _lazyFinal($, "_floorDrops", "$get$_floorDrops", () => A.ResourceSet$(A.findType("FloorDrop"))); _lazyFinal($, "Items_types", "$get$Items_types", () => A.ResourceSet$(type$.ItemType)); _lazyFinal($, "collapseNewlines", "$get$collapseNewlines", () => A.RegExp_RegExp("\\n\\s*")); _lazyFinal($, "_elementText", "$get$_elementText", () => { var t1 = type$.JSArray_String; return A.LinkedHashMap_LinkedHashMap$_literal([$.$get$Elements_air(), A._setArrayType(["the wind", "buffets"], t1), $.$get$Elements_earth(), A._setArrayType(["the soil", "buries"], t1), $.$get$Elements_fire(), A._setArrayType(["the flame", "burns"], t1), $.$get$Elements_water(), A._setArrayType(["the water", "blasts"], t1), $.$get$Elements_acid(), A._setArrayType(["the acid", "melts"], t1), $.$get$Elements_cold(), A._setArrayType(["the ice", "freezes"], t1), $.$get$Elements_lightning(), A._setArrayType(["the lightning", "shocks"], t1), $.$get$Elements_poison(), A._setArrayType(["the poison", "chokes"], t1), $.$get$Elements_dark(), A._setArrayType(["the darkness", "crushes"], t1), $.$get$Elements_light(), A._setArrayType(["the light", "sears"], t1), $.$get$Elements_spirit(), A._setArrayType(["the spirit", "haunts"], t1)], type$.Element, type$.List_String); }); _lazyFinal($, "Monsters_breeds", "$get$Monsters_breeds", () => A.ResourceSet$(type$.Breed)); _lazyFinal($, "Races_dwarf", "$get$Races_dwarf", () => A.Races__race("Dwarf", 0.6, "It takes a certain kind of person to be willing to spend their life deep under the Earth, toiling away in darkness. Dwarves aren't just willing, but delight in it. Solid, impenetrable and somewhat dim, dwarves have much in common with the mines they love.", 1.4, 0.7, 1.3)); _lazyFinal($, "Races_elf", "$get$Races_elf", () => A.Races__race("Elf", 1.1, "There are few things elves are not good at, as any elf will be quick to inform you. Clever, quick on their feet, and surprisingly strong for how they look. Which is radiantly beautiful, naturally.", 0.7, 1.3, 0.9)); _lazyFinal($, "Races_fae", "$get$Races_fae", () => A.Races__race("Fae", 1.6, "What can be said about the fae folk that is known to be true? Dimunitive and easily harmed, they survive by cloaking themselves in fables, tricks, and subterfuge. Quick to anger and quick to forgive, the fae live each moment as if it may be their last, bright-burning flames all too aware of how easily they may be snuffed out.", 0.7, 1.1, 0.6)); _lazyFinal($, "Races_gnome", "$get$Races_gnome", () => A.Races__race("Gnome", 0.8, "Gnomes are gentle, quiet folk, difficult to arouse to anger (unless you interrupt one while reading). Most live a life of the mind, seeking knowledge more than adventure. But this insatiable desire for the former, on many occasions, leads them into the jaws of the latter.", 1, 1.5, 0.7)); _lazyFinal($, "Races_human", "$get$Races_human", () => A.Races__race("Human", 1, "Humans excel at nothing, but nor are they particularly weak in any area. Most other races consider humans sort of like mice: pesky creatures who seem do little but breed, which they do with great devotion.", 1, 1, 1)); _lazyFinal($, "Races_all", "$get$Races_all", () => A._setArrayType([$.$get$Races_dwarf(), $.$get$Races_elf(), $.$get$Races_fae(), $.$get$Races_gnome(), $.$get$Races_human()], A.findType("JSArray"))); _lazyFinal($, "Skills_all", "$get$Skills_all", () => { var t1 = $.Skill__nextSortOrder, t2 = $.Skill__nextSortOrder = t1 + 1, t3 = $.Skill__nextSortOrder = t2 + 1, t4 = $.Skill__nextSortOrder = t3 + 1, t5 = $.Skill__nextSortOrder = t4 + 1, t6 = $.Skill__nextSortOrder = t5 + 1, t7 = $.Skill__nextSortOrder = t6 + 1, t8 = $.Skill__nextSortOrder = t7 + 1; $.Skill__nextSortOrder = t8 + 1; t8 = A.List_List$of(A._setArrayType([new A.BattleHardening(t1), new A.DualWield(t2), new A.Archery(t3), new A.AxeMastery(t4), new A.ClubMastery(t5), new A.SpearMastery(t6), new A.Swordfighting(t7), new A.WhipMastery(t8), A.SlayDiscipline$("Animals", "animal"), A.SlayDiscipline$("Bugs", "bug"), A.SlayDiscipline$("Dragons", "dragon"), A.SlayDiscipline$("Fae Folk", "fae"), A.SlayDiscipline$("Goblins", "goblin"), A.SlayDiscipline$("Humans", "human"), A.SlayDiscipline$("Jellies", "jelly"), A.SlayDiscipline$("Kobolds", "kobold"), A.SlayDiscipline$("Plants", "plant"), A.SlayDiscipline$("Saurians", "saurian"), A.SlayDiscipline$("Undead", "undead")], type$.JSArray_Skill), true, type$.Skill); B.JSArray_methods.addAll$1(t8, A.divinationSpells()); B.JSArray_methods.addAll$1(t8, A.conjuringSpells()); B.JSArray_methods.addAll$1(t8, A.sorcerySpells()); return t8; }); _lazyFinal($, "Skills__byName", "$get$Skills__byName", () => { var t2, t3, _i, skill, t1 = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.Skill); for (t2 = $.$get$Skills_all(), t3 = t2.length, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { skill = t2[_i]; t1.$indexSet(0, skill.get$name(), skill); } return t1; }); _lazyFinal($, "ArchitecturalStyle_styles", "$get$ArchitecturalStyle_styles", () => A.ResourceSet$(A.findType("ArchitecturalStyle"))); _lazyFinal($, "PaintStyle_rock", "$get$PaintStyle_rock", () => { var _null = null; return A.PaintStyle$(_null, _null, _null, _null); }); _lazyFinal($, "PaintStyle_flagstone", "$get$PaintStyle_flagstone", () => { var t1 = type$.JSArray_TileType, t2 = A._setArrayType([$.$get$Tiles_flagstoneFloor()], t1); t1 = A._setArrayType([$.$get$Tiles_flagstoneWall()], t1); return A.PaintStyle$($.$get$Tiles_closedDoor(), t2, $.$get$Tiles_openDoor(), t1); }); _lazyFinal($, "PaintStyle_granite", "$get$PaintStyle_granite", () => { var t1 = type$.JSArray_TileType, t2 = A._setArrayType([$.$get$Tiles_graniteFloor()], t1); t1 = A._setArrayType([$.$get$Tiles_graniteWall()], t1); return A.PaintStyle$($.$get$Tiles_closedSquareDoor(), t2, null, t1); }); _lazyFinal($, "PaintStyle_stoneJail", "$get$PaintStyle_stoneJail", () => A.PaintStyle$($.$get$Tiles_closedBarredDoor(), null, null, null)); _lazyFinal($, "PaintStyle__defaultTypes", "$get$PaintStyle__defaultTypes", () => { var t1 = type$.JSArray_TileType; return A.LinkedHashMap_LinkedHashMap$_literal([$.$get$Tiles_solidWet(), A._setArrayType([$.$get$Tiles_water()], t1), $.$get$Tiles_passageWet(), A._setArrayType([$.$get$Tiles_bridge()], t1)], type$.TileType, type$.List_TileType); }); _lazyFinal($, "PaintStyle__defaultWalls", "$get$PaintStyle__defaultWalls", () => A._setArrayType([$.$get$Tiles_granite1(), $.$get$Tiles_granite2(), $.$get$Tiles_granite3()], type$.JSArray_TileType)); _lazyFinal($, "RoomTile_unused", "$get$RoomTile_unused", () => A.RoomTile$junction(B.Direction_0_0_0_none)); _lazyFinal($, "RoomTile_floor", "$get$RoomTile_floor", () => A.RoomTile$tile($.$get$Tiles_open())); _lazyFinal($, "RoomTile_wall", "$get$RoomTile_wall", () => A.RoomTile$tile($.$get$Tiles_solid())); _lazyFinal($, "Tiles_unformed", "$get$Tiles_unformed", () => A.TileBuilder_TileBuilder("unformed", " ", B.Color_20_19_31, null).open$0()); _lazyFinal($, "Tiles_unformedWet", "$get$Tiles_unformedWet", () => A.TileBuilder_TileBuilder("unformed wet", "\u2248", B.Color_38_42_66, null).open$0()); _lazyFinal($, "Tiles_open", "$get$Tiles_open", () => A.TileBuilder_TileBuilder("open", "\xb7", B.Color_72_64_74, null).open$0()); _lazyFinal($, "Tiles_solid", "$get$Tiles_solid", () => A.TileBuilder_TileBuilder("solid", "\u2593", B.Color_72_64_74, null).solid$0()); _lazyFinal($, "Tiles_passage", "$get$Tiles_passage", () => A.TileBuilder_TileBuilder("passage", "\xb7", B.Color_42_36_43, null).open$0()); _lazyFinal($, "Tiles_doorway", "$get$Tiles_doorway", () => A.TileBuilder_TileBuilder("doorway", "\u25cb", B.Color_77_29_21, null).open$0()); _lazyFinal($, "Tiles_solidWet", "$get$Tiles_solidWet", () => A.TileBuilder_TileBuilder("solid wet", "\u2248", B.Color_21_87_194, null).solid$0()); _lazyFinal($, "Tiles_passageWet", "$get$Tiles_passageWet", () => A.TileBuilder_TileBuilder("wet passage", "\u2261", B.Color_77_29_21, null).open$0()); _lazyFinal($, "Tiles_flagstoneWall", "$get$Tiles_flagstoneWall", () => A.TileBuilder_TileBuilder("flagstone wall", "\u2592", B.Color_132_126_135, B.Color_72_64_74).solid$0()); _lazyFinal($, "Tiles_graniteWall", "$get$Tiles_graniteWall", () => A.TileBuilder_TileBuilder("granite wall", "\u2592", B.Color_63_75_115, B.Color_38_42_66).solid$0()); _lazyFinal($, "Tiles_granite1", "$get$Tiles_granite1", () => A.TileBuilder_TileBuilder("granite", "\u2593", B.Color_63_75_115, B.Color_38_42_66).blend$3(0, B.Color_38_42_66, B.Color_20_19_31).solid$0()); _lazyFinal($, "Tiles_granite2", "$get$Tiles_granite2", () => A.TileBuilder_TileBuilder("granite", "\u2593", B.Color_63_75_115, B.Color_38_42_66).blend$3(0.2, B.Color_38_42_66, B.Color_20_19_31).solid$0()); _lazyFinal($, "Tiles_granite3", "$get$Tiles_granite3", () => A.TileBuilder_TileBuilder("granite", "\u2593", B.Color_63_75_115, B.Color_38_42_66).blend$3(0.4, B.Color_38_42_66, B.Color_20_19_31).solid$0()); _lazyFinal($, "Tiles_flagstoneFloor", "$get$Tiles_flagstoneFloor", () => A.TileBuilder_TileBuilder("flagstone floor", "\xb7", B.Color_72_64_74, null).open$0()); _lazyFinal($, "Tiles_graniteFloor", "$get$Tiles_graniteFloor", () => A.TileBuilder_TileBuilder("granite floor", "\xb7", B.Color_63_75_115, null).open$0()); _lazyFinal($, "Tiles_openDoor", "$get$Tiles_openDoor", () => A.TileBuilder_TileBuilder("open door", "\u25cb", B.Color_142_82_55, B.Color_36_10_5).onOperate$1(A.tiles___closeDoor$closure()).open$0()); _lazyFinal($, "Tiles_closedDoor", "$get$Tiles_closedDoor", () => A.TileBuilder_TileBuilder("closed door", "\u25d9", B.Color_142_82_55, B.Color_36_10_5).onOperate$1(A.tiles___openDoor$closure()).door$0()); _lazyFinal($, "Tiles_openSquareDoor", "$get$Tiles_openSquareDoor", () => A.TileBuilder_TileBuilder("open square door", "\u2642", B.Color_142_82_55, B.Color_36_10_5).onOperate$1(A.tiles___closeSquareDoor$closure()).open$0()); _lazyFinal($, "Tiles_closedSquareDoor", "$get$Tiles_closedSquareDoor", () => A.TileBuilder_TileBuilder("closed square door", "\u2640", B.Color_142_82_55, B.Color_36_10_5).onOperate$1(A.tiles___openSquareDoor$closure()).door$0()); _lazyFinal($, "Tiles_openBarredDoor", "$get$Tiles_openBarredDoor", () => A.TileBuilder_TileBuilder("open barred door", "\u2642", B.Color_132_126_135, B.Color_63_75_115).onOperate$1(A.tiles___closeBarredDoor$closure()).open$0()); _lazyFinal($, "Tiles_closedBarredDoor", "$get$Tiles_closedBarredDoor", () => A.TileBuilder_TileBuilder("closed barred door", "\u266a", B.Color_132_126_135, B.Color_63_75_115).onOperate$1(A.tiles___openBarredDoor$closure())._tiles$_motility$1($.$get$Motility_fly().$or(0, $.$get$Motility_door()))); _lazyFinal($, "Tiles_burntFloor", "$get$Tiles_burntFloor", () => A.TileBuilder_TileBuilder("burnt floor", "\u03c6", B.Color_38_42_66, null).open$0()); _lazyFinal($, "Tiles_burntFloor2", "$get$Tiles_burntFloor2", () => A.TileBuilder_TileBuilder("burnt floor", "\u03b5", B.Color_38_42_66, null).open$0()); _lazyFinal($, "Tiles_stairs", "$get$Tiles_stairs", () => A.TileBuilder_TileBuilder("stairs", "\u2261", B.Color_132_126_135, B.Color_63_75_115).to$1(B.TilePortal_exit).open$0()); _lazyFinal($, "Tiles_bridge", "$get$Tiles_bridge", () => A.TileBuilder_TileBuilder("bridge", "\u2261", B.Color_142_82_55, B.Color_36_10_5).open$0()); _lazyFinal($, "Tiles_glowingMoss", "$get$Tiles_glowingMoss", () => A.TileBuilder_TileBuilder("moss", "\u2591", B.Color_15_130_148, null).emanate$1(128).open$0()); _lazyFinal($, "Tiles_water", "$get$Tiles_water", () => A.TileBuilder_TileBuilder("water", "\u2248", B.Color_21_87_194, B.Color_26_46_150).animate$4(10, 0.5, B.Color_26_46_150, B.Color_20_19_31).emanate$1(32)._tiles$_motility$1($.$get$Motility_fly().$or(0, $.$get$Motility_swim()))); _lazyFinal($, "Tiles_steppingStone", "$get$Tiles_steppingStone", () => A.TileBuilder_TileBuilder("stepping stone", "\u2022", B.Color_116_146_181, B.Color_26_46_150).open$0()); _lazyFinal($, "Tiles_dirt", "$get$Tiles_dirt", () => A.TileBuilder_TileBuilder("dirt", "\xb7", B.Color_77_29_21, null).open$0()); _lazyFinal($, "Tiles_dirt2", "$get$Tiles_dirt2", () => A.TileBuilder_TileBuilder("dirt2", "\u03c6", B.Color_77_29_21, null).open$0()); _lazyFinal($, "Tiles_grass", "$get$Tiles_grass", () => A.TileBuilder_TileBuilder("grass", "\u2591", B.Color_22_117_38, null).open$0()); _lazyFinal($, "Tiles_tallGrass", "$get$Tiles_tallGrass", () => A.TileBuilder_TileBuilder("tall grass", "\u221a", B.Color_22_117_38, null).open$0()); _lazyFinal($, "Tiles_tree", "$get$Tiles_tree", () => A.TileBuilder_TileBuilder("tree", "\u25b2", B.Color_22_117_38, B.Color_0_64_39).solid$0()); _lazyFinal($, "Tiles_treeAlt1", "$get$Tiles_treeAlt1", () => A.TileBuilder_TileBuilder("tree", "\u2660", B.Color_22_117_38, B.Color_0_64_39).solid$0()); _lazyFinal($, "Tiles_treeAlt2", "$get$Tiles_treeAlt2", () => A.TileBuilder_TileBuilder("tree", "\u2663", B.Color_22_117_38, B.Color_0_64_39).solid$0()); _lazyFinal($, "Tiles_openChest", "$get$Tiles_openChest", () => A.TileBuilder_TileBuilder("open chest", "\u2320", B.Color_142_82_55, null).obstacle$0()); _lazyFinal($, "Tiles_closedChest", "$get$Tiles_closedChest", () => A.TileBuilder_TileBuilder("closed chest", "\u2321", B.Color_142_82_55, null).onOperate$1(new A.Tiles_closedChest_closure()).obstacle$0()); _lazyFinal($, "Tiles_closedBarrel", "$get$Tiles_closedBarrel", () => A.TileBuilder_TileBuilder("closed barrel", "\xb0", B.Color_142_82_55, null).onOperate$1(new A.Tiles_closedBarrel_closure()).obstacle$0()); _lazyFinal($, "Tiles_openBarrel", "$get$Tiles_openBarrel", () => A.TileBuilder_TileBuilder("open barrel", "\u2219", B.Color_142_82_55, null).obstacle$0()); _lazyFinal($, "Tiles_tableTopLeft", "$get$Tiles_tableTopLeft", () => A.TileBuilder_TileBuilder("table", "\u250c", B.Color_142_82_55, null).obstacle$0()); _lazyFinal($, "Tiles_tableTop", "$get$Tiles_tableTop", () => A.TileBuilder_TileBuilder("table", "\u2500", B.Color_142_82_55, null).obstacle$0()); _lazyFinal($, "Tiles_tableTopRight", "$get$Tiles_tableTopRight", () => A.TileBuilder_TileBuilder("table", "\u2510", B.Color_142_82_55, null).obstacle$0()); _lazyFinal($, "Tiles_tableSide", "$get$Tiles_tableSide", () => A.TileBuilder_TileBuilder("table", "\u2502", B.Color_142_82_55, null).obstacle$0()); _lazyFinal($, "Tiles_tableCenter", "$get$Tiles_tableCenter", () => A.TileBuilder_TileBuilder("table", " ", B.Color_142_82_55, null).obstacle$0()); _lazyFinal($, "Tiles_tableBottomLeft", "$get$Tiles_tableBottomLeft", () => A.TileBuilder_TileBuilder("table", "\u2558", B.Color_142_82_55, null).obstacle$0()); _lazyFinal($, "Tiles_tableBottom", "$get$Tiles_tableBottom", () => A.TileBuilder_TileBuilder("table", "\u2550", B.Color_142_82_55, null).obstacle$0()); _lazyFinal($, "Tiles_tableBottomRight", "$get$Tiles_tableBottomRight", () => A.TileBuilder_TileBuilder("table", "\u255b", B.Color_142_82_55, null).obstacle$0()); _lazyFinal($, "Tiles_tableLegLeft", "$get$Tiles_tableLegLeft", () => A.TileBuilder_TileBuilder("table", "\u255e", B.Color_142_82_55, null).obstacle$0()); _lazyFinal($, "Tiles_tableLeg", "$get$Tiles_tableLeg", () => A.TileBuilder_TileBuilder("table", "\u2564", B.Color_142_82_55, null).obstacle$0()); _lazyFinal($, "Tiles_tableLegRight", "$get$Tiles_tableLegRight", () => A.TileBuilder_TileBuilder("table", "\u2561", B.Color_142_82_55, null).obstacle$0()); _lazyFinal($, "Tiles_candle", "$get$Tiles_candle", () => A.TileBuilder_TileBuilder("candle", "\u2265", B.Color_189_144_108, null).emanate$1(128).obstacle$0()); _lazyFinal($, "Tiles_wallTorch", "$get$Tiles_wallTorch", () => A.TileBuilder_TileBuilder("wall torch", "\u2264", B.Color_222_156_33, B.Color_63_75_115).emanate$1(192).solid$0()); _lazyFinal($, "Tiles_braziers", "$get$Tiles_braziers", () => A.Tiles_multi("brazier", "\u2264", B.Color_142_82_55, null, 5, new A.Tiles_braziers_closure())); _lazyFinal($, "Tiles_statue", "$get$Tiles_statue", () => A.TileBuilder_TileBuilder("statue", "P", B.Color_226_223_240, B.Color_63_75_115).obstacle$0()); _lazyFinal($, "Tiles_chair", "$get$Tiles_chair", () => A.TileBuilder_TileBuilder("chair", "\u03c0", B.Color_142_82_55, null).open$0()); _lazyFinal($, "Tiles_brownJellyStain", "$get$Tiles_brownJellyStain", () => A.TileBuilder_TileBuilder("brown jelly stain", "\xb7", B.Color_142_82_55, null).open$0()); _lazyFinal($, "Tiles_grayJellyStain", "$get$Tiles_grayJellyStain", () => A.TileBuilder_TileBuilder("gray jelly stain", "\xb7", B.Color_38_42_66, null).open$0()); _lazyFinal($, "Tiles_greenJellyStain", "$get$Tiles_greenJellyStain", () => A.TileBuilder_TileBuilder("green jelly stain", "\xb7", B.Color_131_158_13, null).open$0()); _lazyFinal($, "Tiles_redJellyStain", "$get$Tiles_redJellyStain", () => A.TileBuilder_TileBuilder("red jelly stain", "\xb7", B.Color_204_35_57, null).open$0()); _lazyFinal($, "Tiles_violetJellyStain", "$get$Tiles_violetJellyStain", () => A.TileBuilder_TileBuilder("violet jelly stain", "\xb7", B.Color_86_30_138, null).open$0()); _lazyFinal($, "Tiles_whiteJellyStain", "$get$Tiles_whiteJellyStain", () => A.TileBuilder_TileBuilder("white jelly stain", "\xb7", B.Color_226_223_240, null).open$0()); _lazyFinal($, "Tiles_spiderweb", "$get$Tiles_spiderweb", () => A.TileBuilder_TileBuilder("spiderweb", "\xf7", B.Color_63_75_115, null).open$0()); _lazyFinal($, "Tiles_dungeonEntrance", "$get$Tiles_dungeonEntrance", () => A.TileBuilder_TileBuilder("dungeon entrance", "\u2261", B.Color_132_126_135, B.Color_63_75_115).to$1(B.TilePortal_dungeon).open$0()); _lazyFinal($, "Tiles_home", "$get$Tiles_home", () => A.TileBuilder_TileBuilder("home entrance", "\u25cb", B.Color_189_144_108, null).to$1(B.TilePortal_home).open$0()); _lazyFinal($, "Tiles_shop1", "$get$Tiles_shop1", () => A.TileBuilder_TileBuilder("shop entrance", "\u25cb", B.Color_179_74_4, null).to$1(B.TilePortal_cvm4).open$0()); _lazyFinal($, "Tiles_shop2", "$get$Tiles_shop2", () => A.TileBuilder_TileBuilder("shop entrance", "\u25cb", B.Color_222_156_33, null).to$1(B.TilePortal_cvm3).open$0()); _lazyFinal($, "Tiles_shop3", "$get$Tiles_shop3", () => A.TileBuilder_TileBuilder("shop entrance", "\u25cb", B.Color_131_158_13, null).to$1(B.TilePortal_cvm2).open$0()); _lazyFinal($, "Tiles_shop4", "$get$Tiles_shop4", () => A.TileBuilder_TileBuilder("shop entrance", "\u25cb", B.Color_22_117_38, null).to$1(B.TilePortal_cvm1).open$0()); _lazyFinal($, "Tiles_shop5", "$get$Tiles_shop5", () => A.TileBuilder_TileBuilder("shop entrance", "\u25cb", B.Color_15_130_148, null).to$1(B.TilePortal_cvm0).open$0()); _lazyFinal($, "Tiles_shop6", "$get$Tiles_shop6", () => A.TileBuilder_TileBuilder("shop entrance", "\u25cb", B.Color_129_231_235, null).to$1(B.TilePortal_cvm).open$0()); _lazyFinal($, "Tiles__ignition", "$get$Tiles__ignition", () => A.LinkedHashMap_LinkedHashMap$_literal([$.$get$Tiles_openDoor(), 30, $.$get$Tiles_closedDoor(), 30, $.$get$Tiles_bridge(), 50, $.$get$Tiles_glowingMoss(), 10, $.$get$Tiles_grass(), 3, $.$get$Tiles_tallGrass(), 3, $.$get$Tiles_tree(), 40, $.$get$Tiles_treeAlt1(), 40, $.$get$Tiles_treeAlt2(), 40, $.$get$Tiles_tableTopLeft(), 20, $.$get$Tiles_tableTop(), 20, $.$get$Tiles_tableTopRight(), 20, $.$get$Tiles_tableSide(), 20, $.$get$Tiles_tableCenter(), 20, $.$get$Tiles_tableBottomLeft(), 20, $.$get$Tiles_tableBottom(), 20, $.$get$Tiles_tableBottomRight(), 20, $.$get$Tiles_tableLegLeft(), 20, $.$get$Tiles_tableLeg(), 20, $.$get$Tiles_tableLegRight(), 20, $.$get$Tiles_openChest(), 40, $.$get$Tiles_closedChest(), 80, $.$get$Tiles_openBarrel(), 15, $.$get$Tiles_closedBarrel(), 40, $.$get$Tiles_candle(), 1, $.$get$Tiles_chair(), 10, $.$get$Tiles_spiderweb(), 1], type$.TileType, type$.int)); _lazyFinal($, "Tiles__fuel", "$get$Tiles__fuel", () => A.LinkedHashMap_LinkedHashMap$_literal([$.$get$Tiles_openDoor(), 70, $.$get$Tiles_closedDoor(), 70, $.$get$Tiles_bridge(), 50, $.$get$Tiles_glowingMoss(), 20, $.$get$Tiles_grass(), 30, $.$get$Tiles_tallGrass(), 50, $.$get$Tiles_tree(), 100, $.$get$Tiles_treeAlt1(), 100, $.$get$Tiles_treeAlt2(), 100, $.$get$Tiles_tableTopLeft(), 60, $.$get$Tiles_tableTop(), 60, $.$get$Tiles_tableTopRight(), 60, $.$get$Tiles_tableSide(), 60, $.$get$Tiles_tableCenter(), 60, $.$get$Tiles_tableBottomLeft(), 60, $.$get$Tiles_tableBottom(), 60, $.$get$Tiles_tableBottomRight(), 60, $.$get$Tiles_tableLegLeft(), 60, $.$get$Tiles_tableLeg(), 60, $.$get$Tiles_tableLegRight(), 60, $.$get$Tiles_openChest(), 70, $.$get$Tiles_closedChest(), 80, $.$get$Tiles_openBarrel(), 30, $.$get$Tiles_closedBarrel(), 40, $.$get$Tiles_candle(), 60, $.$get$Tiles_chair(), 40, $.$get$Tiles_spiderweb(), 20], type$.TileType, type$.int)); _lazyFinal($, "Tiles__burnTypes", "$get$Tiles__burnTypes", () => { var t1 = $.$get$Tiles_bridge(), t2 = type$.JSArray_TileType, t3 = A._setArrayType([$.$get$Tiles_water()], t2), t4 = $.$get$Tiles_grass(), t5 = $.$get$Tiles_dirt(), t6 = $.$get$Tiles_dirt2(); return A.LinkedHashMap_LinkedHashMap$_literal([t1, t3, t4, A._setArrayType([t5, t6], t2), $.$get$Tiles_tallGrass(), A._setArrayType([t5, t6], t2), $.$get$Tiles_tree(), A._setArrayType([t5, t6], t2), $.$get$Tiles_treeAlt1(), A._setArrayType([t5, t6], t2), $.$get$Tiles_treeAlt2(), A._setArrayType([t5, t6], t2), $.$get$Tiles_candle(), A._setArrayType([$.$get$Tiles_tableCenter()], t2), $.$get$Tiles_spiderweb(), A._setArrayType([$.$get$Tiles_flagstoneFloor()], t2)], type$.TileType, type$.List_TileType); }); _lazyFinal($, "Element_none", "$get$Element_none", () => A.Element$("none", "No", 1, null, "", false, null)); _lazyFinal($, "Motility_none", "$get$Motility_none", () => A.Motility$_(0)); _lazyFinal($, "Motility_door", "$get$Motility_door", () => A.Motility$_(1)); _lazyFinal($, "Motility_fly", "$get$Motility_fly", () => A.Motility$_(2)); _lazyFinal($, "Motility_swim", "$get$Motility_swim", () => A.Motility$_(4)); _lazyFinal($, "Motility_walk", "$get$Motility_walk", () => A.Motility$_(8)); _lazyFinal($, "Motility_doorAndFly", "$get$Motility_doorAndFly", () => $.$get$Motility_door().$or(0, $.$get$Motility_fly())); _lazyFinal($, "Motility_doorAndWalk", "$get$Motility_doorAndWalk", () => $.$get$Motility_door().$or(0, $.$get$Motility_walk())); _lazyFinal($, "Motility_flyAndWalk", "$get$Motility_flyAndWalk", () => $.$get$Motility_fly().$or(0, $.$get$Motility_walk())); _lazyFinal($, "Motility_all", "$get$Motility_all", () => $.$get$Motility_door().$or(0, $.$get$Motility_fly()).$or(0, $.$get$Motility_swim()).$or(0, $.$get$Motility_walk())); _lazyFinal($, "TileType_uninitialized", "$get$TileType_uninitialized", () => { var _null = null; return A.TileType$("uninitialized", _null, $.$get$Motility_none(), _null, _null, _null); }); _lazyFinal($, "_directionLines", "$get$_directionLines", () => A.LinkedHashMap_LinkedHashMap$_literal([B.Direction_0_m1_1_n, "|", B.Direction_1_m1_2_ne, "/", B.Direction_1_0_3_e, "-", B.Direction_1_1_4_se, "\\", B.Direction_0_1_5_s, "|", B.Direction_m1_1_6_sw, "/", B.Direction_m1_0_7_w, "-", B.Direction_m1_m1_8_nw, "\\"], type$.Direction, type$.String)); _lazyFinal($, "_elementSequences", "$get$_elementSequences", () => { var _s1_ = "\u2022", _s2_ = "Oo", _s1_0 = ".", t1 = type$.JSArray_Color, t2 = A.findType("JSArray>"); return A.LinkedHashMap_LinkedHashMap$_literal([$.$get$Element_none(), A._setArrayType([A._glyphs(_s1_, A._setArrayType([B.Color_189_144_108], t1)), A._glyphs(_s1_, A._setArrayType([B.Color_189_144_108], t1)), A._glyphs(_s1_, A._setArrayType([B.Color_142_82_55], t1))], t2), $.$get$Elements_air(), A._setArrayType([A._glyphs(_s2_, A._setArrayType([B.Color_226_223_240, B.Color_129_231_235], t1)), A._glyphs(_s1_0, A._setArrayType([B.Color_129_231_235], t1)), A._glyphs(_s1_0, A._setArrayType([B.Color_64_163_229], t1))], t2), $.$get$Elements_earth(), A._setArrayType([A._glyphs("*%", A._setArrayType([B.Color_189_144_108, B.Color_222_156_33], t1)), A._glyphs("*%", A._setArrayType([B.Color_142_82_55, B.Color_77_29_21], t1)), A._glyphs("\u2022*", A._setArrayType([B.Color_142_82_55], t1)), A._glyphs(_s1_, A._setArrayType([B.Color_77_29_21], t1))], t2), $.$get$Elements_fire(), A._setArrayType([A._glyphs("\u25b2^", A._setArrayType([B.Color_222_156_33, B.Color_255_238_168], t1)), A._glyphs("*^", A._setArrayType([B.Color_179_74_4], t1)), A._glyphs("^", A._setArrayType([B.Color_204_35_57], t1)), A._glyphs("^", A._setArrayType([B.Color_77_29_21, B.Color_204_35_57], t1)), A._glyphs(_s1_0, A._setArrayType([B.Color_77_29_21, B.Color_204_35_57], t1))], t2), $.$get$Elements_water(), A._setArrayType([A._glyphs(_s2_, A._setArrayType([B.Color_129_231_235, B.Color_64_163_229], t1)), A._glyphs("o\u2022^", A._setArrayType([B.Color_64_163_229, B.Color_21_87_194], t1)), A._glyphs("\u2022^", A._setArrayType([B.Color_21_87_194, B.Color_26_46_150], t1)), A._glyphs("^~", A._setArrayType([B.Color_21_87_194, B.Color_26_46_150], t1)), A._glyphs("~", A._setArrayType([B.Color_26_46_150], t1)), A._glyphs(_s1_0, A._setArrayType([B.Color_26_46_150, B.Color_56_16_125], t1))], t2), $.$get$Elements_acid(), A._setArrayType([A._glyphs(_s2_, A._setArrayType([B.Color_255_238_168, B.Color_222_156_33], t1)), A._glyphs("o\u2022~", A._setArrayType([B.Color_131_158_13, B.Color_222_156_33], t1)), A._glyphs(":,", A._setArrayType([B.Color_131_158_13, B.Color_99_87_7], t1)), A._glyphs(_s1_0, A._setArrayType([B.Color_131_158_13], t1))], t2), $.$get$Elements_cold(), A._setArrayType([A._glyphs("*", A._setArrayType([B.Color_226_223_240], t1)), A._glyphs("+x", A._setArrayType([B.Color_129_231_235, B.Color_226_223_240], t1)), A._glyphs("+x", A._setArrayType([B.Color_64_163_229, B.Color_116_146_181], t1)), A._glyphs(_s1_0, A._setArrayType([B.Color_63_75_115, B.Color_26_46_150], t1))], t2), $.$get$Elements_lightning(), A._setArrayType([A._glyphs("*", A._setArrayType([B.Color_173_88_219], t1)), A._glyphs("-|\\/", A._setArrayType([B.Color_86_30_138, B.Color_226_223_240], t1)), A._glyphs(_s1_0, A._setArrayType([B.Color_20_19_31, B.Color_20_19_31, B.Color_20_19_31, B.Color_173_88_219], t1))], t2), $.$get$Elements_poison(), A._setArrayType([A._glyphs(_s2_, A._setArrayType([B.Color_129_217_117, B.Color_131_158_13], t1)), A._glyphs("o\u2022", A._setArrayType([B.Color_22_117_38, B.Color_22_117_38, B.Color_99_87_7], t1)), A._glyphs(_s1_, A._setArrayType([B.Color_0_64_39, B.Color_99_87_7], t1)), A._glyphs(_s1_0, A._setArrayType([B.Color_0_64_39], t1))], t2), $.$get$Elements_dark(), A._setArrayType([A._glyphs("*%", A._setArrayType([B.Color_20_19_31, B.Color_20_19_31, B.Color_38_42_66], t1)), A._glyphs(_s1_, A._setArrayType([B.Color_20_19_31, B.Color_20_19_31, B.Color_116_146_181], t1)), A._glyphs(_s1_0, A._setArrayType([B.Color_20_19_31], t1)), A._glyphs(_s1_0, A._setArrayType([B.Color_20_19_31], t1))], t2), $.$get$Elements_light(), A._setArrayType([A._glyphs("*", A._setArrayType([B.Color_226_223_240], t1)), A._glyphs("x+", A._setArrayType([B.Color_226_223_240, B.Color_255_238_168], t1)), A._glyphs(":;\"'`,", A._setArrayType([B.Color_255_238_168, B.Color_222_156_33], t1)), A._glyphs(_s1_0, A._setArrayType([B.Color_116_146_181, B.Color_255_238_168], t1))], t2), $.$get$Elements_spirit(), A._setArrayType([A._glyphs("Oo*+", A._setArrayType([B.Color_173_88_219, B.Color_116_146_181], t1)), A._glyphs("o+", A._setArrayType([B.Color_86_30_138, B.Color_22_117_38], t1)), A._glyphs("\u2022.", A._setArrayType([B.Color_56_16_125, B.Color_0_64_39, B.Color_0_64_39], t1))], t2)], type$.Element, A.findType("List>")); }); _lazyFinal($, "HowlEffect_bang", "$get$HowlEffect_bang", () => A.Glyph$("!", B.Color_15_130_148, null)); _lazyFinal($, "HowlEffect_slash", "$get$HowlEffect_slash", () => A.Glyph$("/", B.Color_129_231_235, null)); _lazyFinal($, "HowlEffect_backslash", "$get$HowlEffect_backslash", () => A.Glyph$("\\", B.Color_129_231_235, null)); _lazyFinal($, "HowlEffect_dash", "$get$HowlEffect_dash", () => A.Glyph$("-", B.Color_15_130_148, null)); _lazyFinal($, "HowlEffect_less", "$get$HowlEffect_less", () => A.Glyph$("<", B.Color_15_130_148, null)); _lazyFinal($, "HowlEffect_greater", "$get$HowlEffect_greater", () => A.Glyph$(">", B.Color_15_130_148, null)); _lazyFinal($, "SidebarPanel__resistLetters", "$get$SidebarPanel__resistLetters", () => A.LinkedHashMap_LinkedHashMap$_literal([$.$get$Elements_air(), "A", $.$get$Elements_earth(), "E", $.$get$Elements_fire(), "F", $.$get$Elements_water(), "W", $.$get$Elements_acid(), "A", $.$get$Elements_cold(), "C", $.$get$Elements_lightning(), "L", $.$get$Elements_poison(), "P", $.$get$Elements_dark(), "D", $.$get$Elements_light(), "L", $.$get$Elements_spirit(), "S"], type$.Element, type$.String)); _lazyFinal($, "rng", "$get$rng", () => new A.Rng(A.Random_Random(A.Primitives_dateNow()))); })(); (function nativeSupport() { !function() { var intern = function(s) { var o = {}; o[s] = 1; return Object.keys(hunkHelpers.convertToFastObject(o))[0]; }; init.getIsolateTag = function(name) { return intern("___dart_" + name + init.isolateTag); }; var tableProperty = "___dart_isolate_tags_"; var usedProperties = Object[tableProperty] || (Object[tableProperty] = Object.create(null)); var rootProperty = "_ZxYxX"; for (var i = 0;; i++) { var property = intern(rootProperty + "_" + i + "_"); if (!(property in usedProperties)) { usedProperties[property] = 1; init.isolateTag = property; break; } } init.dispatchPropertyName = init.getIsolateTag("dispatch_record"); }(); hunkHelpers.setOrUpdateInterceptorsByTag({ArrayBuffer: A.NativeByteBuffer, SharedArrayBuffer: A.NativeByteBuffer, ArrayBufferView: A.NativeTypedData, DataView: A.NativeByteData, Float32Array: A.NativeFloat32List, Float64Array: A.NativeFloat64List, Int16Array: A.NativeInt16List, Int32Array: A.NativeInt32List, Int8Array: A.NativeInt8List, Uint16Array: A.NativeUint16List, Uint32Array: A.NativeUint32List, Uint8ClampedArray: A.NativeUint8ClampedList, CanvasPixelArray: A.NativeUint8ClampedList, Uint8Array: A.NativeUint8List}); hunkHelpers.setOrUpdateLeafTags({ArrayBuffer: true, SharedArrayBuffer: true, ArrayBufferView: false, DataView: true, Float32Array: true, Float64Array: true, Int16Array: true, Int32Array: true, Int8Array: true, Uint16Array: true, Uint32Array: true, Uint8ClampedArray: true, CanvasPixelArray: true, Uint8Array: false}); A.NativeTypedArray.$nativeSuperclassTag = "ArrayBufferView"; A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin.$nativeSuperclassTag = "ArrayBufferView"; A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin.$nativeSuperclassTag = "ArrayBufferView"; A.NativeTypedArrayOfDouble.$nativeSuperclassTag = "ArrayBufferView"; A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin.$nativeSuperclassTag = "ArrayBufferView"; A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin.$nativeSuperclassTag = "ArrayBufferView"; A.NativeTypedArrayOfInt.$nativeSuperclassTag = "ArrayBufferView"; })(); Function.prototype.call$1 = function(a) { return this(a); }; Function.prototype.call$2 = function(a, b) { return this(a, b); }; Function.prototype.call$4 = function(a, b, c, d) { return this(a, b, c, d); }; Function.prototype.call$0 = function() { return this(); }; Function.prototype.call$3 = function(a, b, c) { return this(a, b, c); }; Function.prototype.call$5 = function(a, b, c, d, e) { return this(a, b, c, d, e); }; convertAllToFastObject(holders); convertToFastObject($); (function(callback) { if (typeof document === "undefined") { callback(null); return; } if (typeof document.currentScript != "undefined") { callback(document.currentScript); return; } var scripts = document.scripts; function onLoad(event) { for (var i = 0; i < scripts.length; ++i) { scripts[i].removeEventListener("load", onLoad, false); } callback(event.target); } for (var i = 0; i < scripts.length; ++i) { scripts[i].addEventListener("load", onLoad, false); } })(function(currentScript) { init.currentScript = currentScript; var callMain = A.main; if (typeof dartMainRunner === "function") { dartMainRunner(callMain, []); } else { callMain([]); } }); })(); //# sourceMappingURL=main.dart.js.map