bastion-siege-logic
Advanced tools
Comparing version 2.5.1 to 2.5.2
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.nextBattleTimestamp = exports.calcBuildingCostPerWinchance = exports.BATTLE_ODDS = void 0; | ||
const cost_1 = require("./buildings/cost"); | ||
@@ -4,0 +5,0 @@ exports.BATTLE_ODDS = { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.sameBattleResourceAssumption = exports.uniqueBattlereportIdentifier = void 0; | ||
function uniqueBattlereportIdentifier(report) { | ||
@@ -4,0 +5,0 @@ const time = Math.floor(report.time / 60); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BUILDING_COST_FACTORS = exports.CONSTRUCTIONS = exports.WORKSHOP = exports.BUILDINGS = void 0; | ||
exports.BUILDINGS = ['townhall', 'storage', 'houses', 'farm', 'sawmill', 'mine', 'barracks', 'wall']; | ||
@@ -4,0 +5,0 @@ exports.WORKSHOP = ['trebuchet', 'ballista']; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.calcMinutesNeededForUpgrade = exports.calcWallRepairCost = exports.calcBuildingCostUntil = exports.calcBuildingCost = void 0; | ||
const resources_1 = require("../resources"); | ||
@@ -4,0 +5,0 @@ const building_types_1 = require("./building-types"); |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./building-types")); | ||
__export(require("./cost")); | ||
__export(require("./people")); | ||
__export(require("./required")); | ||
__exportStar(require("./building-types"), exports); | ||
__exportStar(require("./cost"), exports); | ||
__exportStar(require("./people"), exports); | ||
__exportStar(require("./required"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.calcRecoveryMissingPeople = exports.calcWallArcherCapacity = exports.calcBarracksNeeded = exports.calcBarracksCapacity = exports.calcHousesPeopleIncome = exports.calcHousesCapacity = void 0; | ||
const resources_1 = require("../resources"); | ||
@@ -4,0 +5,0 @@ function calcHousesCapacity(housesLevel) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.calcTownhallLevelNeededForGold = exports.calcMaxBuildingLevelWithTownhall = exports.calcMaxBuildingLevelWithStorage = exports.calcMaxBuildingLevel = exports.calcTownhallLevelNeededForUpgrade = exports.calcStorageLevelNeededForUpgrade = void 0; | ||
const resources_1 = require("../resources"); | ||
@@ -4,0 +5,0 @@ const building_types_1 = require("./building-types"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CASTLE_BONUS = exports.CASTLE_HOLD_SECONDS = exports.CASTLE_SIEGE_SECONDS = exports.CASTLES = void 0; | ||
exports.CASTLES = ['diamond', 'ruby', 'sapphire']; | ||
@@ -4,0 +5,0 @@ exports.CASTLE_SIEGE_SECONDS = 5 * 60 * 60; // 5 hours |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.determineCastle = exports.castleGametext = void 0; | ||
const gametext_1 = require("./gametext"); | ||
@@ -4,0 +5,0 @@ function castleGametext(castle, language) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EMOJI = void 0; | ||
exports.EMOJI = { | ||
@@ -4,0 +5,0 @@ gold: '💰', |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.battlereport = void 0; | ||
const emoji_1 = require("./emoji"); | ||
@@ -36,3 +37,3 @@ const mystics_1 = require("./mystics"); | ||
const { name: enemy, alliance: enemyAlliance } = regexHelper.getPlayer(content, /Битва с (?:альянсом )?([\s\S]+) окончена/); | ||
const winnersLosers = getWinnersLosersFromAllianceAttack(content, 'Победители', 'Проигравшие', '\nДля'); | ||
const winnersLosers = getWinnersLosersFromAllianceAttack(content, 'Победители', 'Проигравшие', ['\nДля', '\nПолучен новый эффект']); | ||
const soldiers = getSoldiers(content, { | ||
@@ -56,3 +57,3 @@ normal: `(\\d+)${REGEX_ARMY} из (\\d+)${REGEX_ARMY}`, | ||
const { name: enemy, alliance: enemyAlliance } = regexHelper.getPlayer(content, /battle with (?:alliance )?([\s\S]+) complete/); | ||
const winnersLosers = getWinnersLosersFromAllianceAttack(content, 'Winners', 'Losers', '\nFor'); | ||
const winnersLosers = getWinnersLosersFromAllianceAttack(content, 'Winners', 'Losers', ['\nFor', '\nA new effect is obtained']); | ||
const soldiers = getSoldiers(content, { | ||
@@ -69,3 +70,3 @@ normal: `(\\d+)${REGEX_ARMY} of (\\d+)${REGEX_ARMY}`, | ||
} | ||
function getWinnersLosersFromAllianceAttack(content, winnersString, losersString, losersAbortString) { | ||
function getWinnersLosersFromAllianceAttack(content, winnersString, losersString, losersAbortStrings) { | ||
if (!contentFilter.includesAll(content, winnersString, losersString)) { | ||
@@ -76,3 +77,3 @@ return {}; | ||
const losersStartIndex = content.indexOf(losersString + ': '); | ||
const loserAbortIndex = content.includes(losersAbortString) ? content.indexOf(losersAbortString) : content.length; | ||
const loserAbortIndex = Math.min(content.length, ...losersAbortStrings.map(o => content.indexOf(o)).filter(o => o > 0)); | ||
const winnersSubstring = content.slice(winnersStartIndex + winnersString.length + 2, losersStartIndex - 1); | ||
@@ -79,0 +80,0 @@ const winners = winnersSubstring.split(', ') |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.resources = exports.otherConstructions = exports.storage = exports.workshop = exports.buildings = exports.main = void 0; | ||
const emoji_1 = require("./emoji"); | ||
@@ -4,0 +5,0 @@ const gametext_1 = require("./gametext"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.nextCastleSiege = exports.participants = exports.joined = exports.siegeEnds = exports.siegeStarts = exports.siegeAvailable = void 0; | ||
const castle_1 = require("./castle"); | ||
@@ -4,0 +5,0 @@ const emoji_1 = require("./emoji"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parseGamescreen = exports.parseGamescreenContent = void 0; | ||
const battlereport = require("./gamescreen.battlereport"); | ||
@@ -4,0 +5,0 @@ const buildings = require("./gamescreen.buildings"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.allianceMembers = exports.ranking = void 0; | ||
const emoji_1 = require("./emoji"); | ||
@@ -4,0 +5,0 @@ const regex_1 = require("./helpers/regex"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.siegeStarted = exports.dig = exports.getChat = exports.getPatrolreport = exports.war = exports.effects = void 0; | ||
const emoji_1 = require("./emoji"); | ||
@@ -4,0 +5,0 @@ const player_1 = require("./player"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.netRecoveredFromFight = exports.alreadyInFight = exports.personalAllianceOverview = exports.serverStatistics = exports.attackscout = exports.attackIncoming = exports.allianceJoinRequest = exports.allianceBattleSupport = exports.allianceBattleStart = void 0; | ||
const emoji_1 = require("./emoji"); | ||
@@ -4,0 +5,0 @@ const mystics_1 = require("./mystics"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GAMETEXT = void 0; | ||
exports.GAMETEXT = { | ||
@@ -4,0 +5,0 @@ townhall: { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.startsWithGametext = exports.endsAny = exports.includesAny = exports.startsAny = exports.endsAll = exports.includesAll = exports.startsAll = exports.ends = exports.includes = exports.starts = void 0; | ||
const emoji_1 = require("../emoji"); | ||
@@ -4,0 +5,0 @@ const gametext_1 = require("../gametext"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getPlayer = exports.getNumberStrict = exports.getStrict = exports.getOptionalNumber = exports.getOptional = exports.generateRegex = void 0; | ||
const player_1 = require("../player"); | ||
@@ -4,0 +5,0 @@ function generateRegex(pattern) { |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./castle")); | ||
__export(require("./emoji")); | ||
__export(require("./gamescreen")); | ||
__export(require("./gametext")); | ||
__export(require("./mystics")); | ||
__export(require("./player")); | ||
__export(require("./text-cleanup")); | ||
__exportStar(require("./castle"), exports); | ||
__exportStar(require("./emoji"), exports); | ||
__exportStar(require("./gamescreen-type"), exports); | ||
__exportStar(require("./gamescreen"), exports); | ||
__exportStar(require("./gametext"), exports); | ||
__exportStar(require("./mystics"), exports); | ||
__exportStar(require("./player"), exports); | ||
__exportStar(require("./text-cleanup"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isMystic = exports.MYSTICS_TEXT_RU = exports.MYSTICS_TEXT_EN = exports.MYSTICS = void 0; | ||
const emoji_1 = require("./emoji"); | ||
@@ -4,0 +5,0 @@ const text_cleanup_1 = require("./text-cleanup"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parsePlayer = void 0; | ||
const text_cleanup_1 = require("./text-cleanup"); | ||
@@ -4,0 +5,0 @@ const mystics_1 = require("./mystics"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.inputTextCleanup = exports.ALTERNATIVE_SPACES = exports.NOT_ALLOWED_CHARS = void 0; | ||
exports.NOT_ALLOWED_CHARS = [ | ||
@@ -4,0 +5,0 @@ // https://en.wikipedia.org/wiki/Zero-width_space |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BASTION_SIEGE_BOT_ID = void 0; | ||
exports.BASTION_SIEGE_BOT_ID = 252148344; | ||
__export(require("./battle")); | ||
__export(require("./battlereport")); | ||
__export(require("./buildings")); | ||
__export(require("./castle")); | ||
__export(require("./gamescreen")); | ||
__export(require("./resources")); | ||
__exportStar(require("./battle"), exports); | ||
__exportStar(require("./battlereport"), exports); | ||
__exportStar(require("./buildings"), exports); | ||
__exportStar(require("./castle"), exports); | ||
__exportStar(require("./gamescreen"), exports); | ||
__exportStar(require("./resources"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.calcResourcesAfterConstruction = exports.estimateResourcesAfter = exports.calcMinutesNeededToFillStorage = exports.calcMinutesNeeded = exports.calcNeeded = exports.calcSemitotalGoldIncome = exports.calcSemitotalGold = exports.calcProductionFood = exports.calcProduction = exports.calcGoldIncome = exports.calcGoldIncomePerPerson = exports.calcStorageCapacity = exports.calcGoldCapacity = exports.RESOURCES = exports.CONSTRUCTION_RESOURCES = void 0; | ||
exports.CONSTRUCTION_RESOURCES = ['gold', 'wood', 'stone']; | ||
@@ -4,0 +5,0 @@ exports.RESOURCES = ['gold', 'wood', 'stone', 'food']; |
{ | ||
"name": "bastion-siege-logic", | ||
"version": "2.5.1", | ||
"version": "2.5.2", | ||
"description": "", | ||
@@ -9,3 +9,3 @@ "license": "MIT", | ||
"name": "EdJoPaTo", | ||
"email": "edjopato@gmail.com", | ||
"email": "bastion-siege-logic@edjopato.de", | ||
"url": "https://edjopato.de" | ||
@@ -37,8 +37,8 @@ }, | ||
"@sindresorhus/tsconfig": "^0.7.0", | ||
"@types/node": "^13.1.4", | ||
"@types/node": "^14.0.13", | ||
"ava": "^3.5.0", | ||
"del-cli": "^3.0.0", | ||
"nyc": "^15.0.0", | ||
"typescript": "^3.7.4", | ||
"xo": "^0.29.1" | ||
"typescript": "^3.9.5", | ||
"xo": "^0.32.0" | ||
}, | ||
@@ -65,9 +65,5 @@ "nyc": { | ||
"ava/no-ignored-test-files": "off", | ||
"import/named": "warn", | ||
"@typescript-eslint/no-unnecessary-condition": [ | ||
"error", | ||
{ | ||
"ignoreRhs": true | ||
} | ||
] | ||
"unicorn/no-reduce": "off", | ||
"@typescript-eslint/prefer-readonly-parameter-types": "error", | ||
"@typescript-eslint/no-unnecessary-condition": "error" | ||
}, | ||
@@ -74,0 +70,0 @@ "overrides": [ |
@@ -20,5 +20,1 @@ # Bastion Siege Logic | ||
The TypeScript types and method names should help you enough :) | ||
## License | ||
MIT © [EdJoPaTo](https://github.com/EdJoPaTo) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143431
2012
20