Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/KC3Kai/kancolle-replay in…
Browse files Browse the repository at this point in the history
…to gh-pages
  • Loading branch information
fourinone41 committed Oct 7, 2024
2 parents 7c89c30 + ebfbf95 commit c151d27
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions js/data/strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@
"only_day_rank_less_than_B": "Only if Day Rank less than B",
"only_flag_not_sunk": "Only if Enemy Flagship not sunk",
"only_flag_not_sunk_tooltip": "If enemy combined fleet, does not do Night Battle if the enemy escort fleet would be fought AND Friend Fleet is not used.",
"offroute_before_battle": "Off-route before battle",
"resupply_cost": "Resupply Cost",
"submarine_only": "Submarine Only",
"add_cost": "Add Cost (% of current supply before battle)",
Expand Down
1 change: 1 addition & 0 deletions js/data/strings_ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@
"only_day_rank_less_than_B": "B未満なら",
"only_flag_not_sunk": "敵旗艦が健在なら",
"only_flag_not_sunk_tooltip": "敵連合艦隊第一艦隊との夜戦権が無い場合は夜戦を行わない(友軍艦隊を使用する場合を除く)",
"offroute_before_battle": "戦闘前帰還率",
"resupply_cost": "資源消費タイプ",
"submarine_only": "潜水艦のみ",
"add_cost": "追加コスト(戦闘開始前に現在の残り資源から)",
Expand Down
1 change: 1 addition & 0 deletions js/simulator-ui/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ window.CONVERT = {
useAtoll: battleUI.useAtoll,
useSmoke: battleUI.useSmoke,
useAnchorageRepair: battleUI.useAnchorageRepair,
offrouteRate: battleUI.offrouteRate/100,
};
if (battleUI.doNBCond) nodeInput.doNBCond = battleUI.doNBCond;
if (battleUI.formationUseLAIfNoSpAttack && COMMON.checkSpecialAttackUI(this._UI_MAIN,+battleUI.formation)) nodeInput.formationUseLAIfNoSpAttack = true;
Expand Down
4 changes: 4 additions & 0 deletions js/simulator-ui/sim-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,10 @@ var SIM = {

for (let battleInd=0; battleInd<dataInput.nodes.length; battleInd++) {
let node = dataInput.nodes[battleInd];
if (node.offrouteRate && Math.random() < node.offrouteRate) {
break;
}

let isBossNode = battleInd == dataInput.nodes.length-1;
let fleetF = FLEETS1[0];
let fleetE = FLEETS2[battleInd];
Expand Down
5 changes: 3 additions & 2 deletions js/simulator-ui/ui-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ var UI_MAIN = Vue.createApp({
useAtoll: false,
useSmoke: false,
useAnchorageRepair: false,
offrouteRate: 0,

enemyComps: [],
};
Expand Down Expand Up @@ -734,15 +735,15 @@ var UI_MAIN = Vue.createApp({
this.isRunningWatch = false;
return;
}
let found = (this.watchCondition == 'no_boss' && SIM.simResultPrev.battleNum < this.battles.length)
let found = SIM.simResultPrev && ((this.watchCondition == 'no_boss' && SIM.simResultPrev.battleNum < this.battles.length)
|| (this.watchCondition == 'boss' && SIM.simResultPrev.battleNum == this.battles.length)
|| (this.watchCondition == 'flagsunk' && SIM.simResultPrev.battleNum == this.battles.length && SIM.simResultPrev.result.flagsunk)
|| (this.watchCondition == 'S' && SIM.simResultPrev.battleNum == this.battles.length && SIM.simResultPrev.result.rank == 'S')
|| (this.watchCondition == 'A' && SIM.simResultPrev.battleNum == this.battles.length && SIM.simResultPrev.result.rank == 'A')
|| (this.watchCondition == 'B' && SIM.simResultPrev.battleNum == this.battles.length && SIM.simResultPrev.result.rank == 'B')
|| (this.watchCondition == 'C' && SIM.simResultPrev.battleNum == this.battles.length && SIM.simResultPrev.result.rank == 'C')
|| (this.watchCondition == 'D' && SIM.simResultPrev.battleNum == this.battles.length && SIM.simResultPrev.result.rank == 'D')
|| (this.watchCondition == 'E' && SIM.simResultPrev.battleNum == this.battles.length && SIM.simResultPrev.result.rank == 'E');
|| (this.watchCondition == 'E' && SIM.simResultPrev.battleNum == this.battles.length && SIM.simResultPrev.result.rank == 'E'));
if (!found) {
setTimeout(() => this._getWatch(replay,numRun),1);
return;
Expand Down
3 changes: 3 additions & 0 deletions simulator.html
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,9 @@ <h3>
<option value="B">{{$t('only_day_rank_less_than_B')}}</option>
<option value="flagsunk" :title="$t('only_flag_not_sunk_tooltip')">{{$t('only_flag_not_sunk')}}</option>
</select></label></div>
<div class="space">
<label><span class="header">{{$t('offroute_before_battle')}}: </span><input type="number" min="0" max="100" v-model.number="battle.offrouteRate" :class="{changed:!!battle.offrouteRate}"/>%</label>
</div>
</div>
<div>
<div><span class="header">{{$t('resupply_cost')}}:</span></div>
Expand Down

0 comments on commit c151d27

Please sign in to comment.