Skip to content

Commit

Permalink
2.307
Browse files Browse the repository at this point in the history
  • Loading branch information
Irmagon authored Dec 4, 2024
1 parent 708fa12 commit 02d407e
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions HeroWarsHelper_phone.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @name:en HeroWarsPhone
// @name:ru HeroWarsPhone
// @namespace HeroWarsPhone
// @version 2.306
// @version 2.307
// @description Automation of actions for the game Hero Wars
// @description:en Automation of actions for the game Hero Wars
// @description:ru Автоматизация действий для игры Хроники Хаоса
Expand Down Expand Up @@ -1969,7 +1969,7 @@ async function checkChangeSend(sourceData, tempData) {
if (!call.args.result.win) {
let resultPopup = false;
if (call.name == 'adventure_endBattle' ||
call.name == 'invasion_bossEnd' ||
//call.name == 'invasion_bossEnd' ||
call.name == 'bossEndBattle' ||
call.name == 'adventureSolo_endBattle') {
resultPopup = await showMsgs(I18N('MSG_HAVE_BEEN_DEFEATED'), I18N('BTN_OK'), I18N('BTN_CANCEL'), I18N('BTN_AUTO'));
Expand Down Expand Up @@ -2162,7 +2162,6 @@ async function checkChangeSend(sourceData, tempData) {
lastBossBattleStart = Date.now();
}
if (call.name == 'invasion_bossEnd') {
/*
const lastBattle = lastBattleInfo;
if (lastBattle && call.args.result.win) {
lastBattle.progress = call.args.progress;
Expand All @@ -2175,7 +2174,6 @@ async function checkChangeSend(sourceData, tempData) {
await countdownTimer(timer);
}
}
*/
}
/**
* Disable spending divination cards
Expand Down Expand Up @@ -2623,9 +2621,12 @@ async function checkChangeResponse(response) {
});
}
let actions = [getBattleInfo(battle, false)]
const countTestBattle = getInput('countTestBattle');
let countTestBattle = getInput('countTestBattle');
if (call.ident == callsIdent['invasion_bossStart'] ) {
countTestBattle = 0;
}
if (call.ident == callsIdent['battleGetReplay']) {
battle.progress = [{ attackers: { input: ["auto", 0, 0, "auto", 0, 0] } }];
battle.progress = [{ attackers: { input: ['auto', 0, 0, 'auto', 0, 0] } }];
}
for (let i = 0; i < countTestBattle; i++) {
actions.push(getBattleInfo(battle, true));
Expand All @@ -2637,8 +2638,13 @@ async function checkChangeResponse(response) {
const timer = Math.floor(battleDuration - firstBattle.time);
const min = ('00' + Math.floor(timer / 60)).slice(-2);
const sec = ('00' + Math.floor(timer - min * 60)).slice(-2);
let msg = `${I18N('THIS_TIME')} ${firstBattle.win ? I18N('VICTORY') : I18N('DEFEAT')}`;
if (e.length) {
const countWin = e.reduce((w, s) => w + s.win, 0);
setProgress(`${I18N('THIS_TIME')} ${(firstBattle.win ? I18N('VICTORY') : I18N('DEFEAT'))} ${I18N('CHANCE_TO_WIN')}: ${Math.floor(countWin / e.length * 100)}% (${e.length}), ${min}:${sec}`, false, hideProgress)
msg += ` ${I18N('CHANCE_TO_WIN')}: ${Math.floor((countWin / e.length) * 100)}% (${e.length})`;
}
msg += `, ${min}:${sec}`
setProgress(msg, false, hideProgress)
});
}
/**
Expand Down

0 comments on commit 02d407e

Please sign in to comment.