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 5, 2024
2 parents f2a6410 + 1aec477 commit 7c89c30
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions js/data/strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@
"air_softcap": "Air Soft-Cap",
"support_softcap": "Support Soft-Cap",
"use_default_w6_air_raid": "Use default World 6 costs for Air Raid",
"enable_anti_sub_raid": "Enable Anti-Sub Air Raid",
"enable_anti_sub_raid_desc": "Used only in event maps, disable if simulating normal world maps",
"bucket_count_use": "Count use if HP \u2264 {inp_hp}% OR repair time > {inp_time} hours",
"bucket_do_not_count_use": "Do not count if repair time < {inp_time} hours (regardless of above)",
"carry_over_ship_hp": "Carry over ship HP between sims unless {img_bucket} conditions (not including \"Do not count if repair time <\")",
Expand Down
2 changes: 2 additions & 0 deletions js/data/strings_ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@
"air_softcap": "航空戦キャップ",
"support_softcap": "支援(砲撃)キャップ",
"use_default_w6_air_raid": "6面の空襲マスでデフォルトのコストを消費する",
"enable_anti_sub_raid": "空襲マスにおける自艦隊潜水艦への攻撃",
"enable_anti_sub_raid_desc": "2022年春イベ以降のイベント海域では空襲マスにおいて対潜哨戒機を装備した敵艦による自艦隊潜水艦への攻撃が発生します",
"bucket_count_use": "HPが {inp_hp}%以下、または入渠が {inp_time} 時間以上でバケツを使用する",
"bucket_do_not_count_use": "入渠が {inp_time} 時間未満なら使用しない(上記とは関係なく)",
"carry_over_ship_hp": "{img_bucket} の使用条件に合致しない限りHPを持ち越す(不使用条件は含まない)",
Expand Down
10 changes: 8 additions & 2 deletions js/simulator-ui/ui-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var MECHANICS_LIST = [
{ key: 'eqBonusASW', name: 'ASW Use Equipment Bonus' },
{ key: 'ffReroll', name: 'Friend Fleet Flagship Reroll' },
{ key: 'eqBonusAA', name: 'Anti-Air Use Equipment Bonus' },
{ key: 'antiSubRaid', name: 'Anti-Sub Air Raid' },
{ key: 'antiSubRaid', name: 'Anti-Sub Air Raid', hide: true },
{ key: 'enable_ASWPlaneAir', name: 'Autogyro/Liaison Air Battle' },
{ key: 'enable_AACIRework', name: 'AACI Rework (Sequential Roll + New Priority)' },
];
Expand Down Expand Up @@ -234,7 +234,7 @@ var UI_MAIN = Vue.createApp({
}
}
for (let obj of MECHANICS_LIST) {
this.settings.mechanics.push({ key: obj.key, name: obj.name, enabled: true });
this.settings.mechanics.push({ key: obj.key, name: obj.name, enabled: true, hide: !!obj.hide });
}
this.addNewBattle();

Expand Down Expand Up @@ -321,6 +321,7 @@ var UI_MAIN = Vue.createApp({
dataReplay = dataHash;
dataSave = CONVERT.replayToSave(dataReplay);
this.settings.airRaidCostW6 = dataReplay.world == 6;
this.enableAntiSubRaid = !(dataReplay.world < 20);
if (localStorage.sim2 && !CONVERT.saveIsEmpty(JSON.parse(localStorage.sim2))) {
let style = document.createElement('style');
style.innerText = '#divMain > *, #divOther { display: none; }';
Expand Down Expand Up @@ -429,6 +430,11 @@ var UI_MAIN = Vue.createApp({
resultsUnderwayTPPer: function() {
return Math.round(1000*this.results.perTPRes*this.results.underwayTP)/1000;
},

enableAntiSubRaid: {
get() { return !!this.settings.mechanics.length && this.settings.mechanics.find(m => m.key == 'antiSubRaid').enabled },
set(v) { this.settings.mechanics.find(m => m.key == 'antiSubRaid').enabled = v },
},
},
methods: {
addNewBattle: function(indAt) {
Expand Down
5 changes: 3 additions & 2 deletions simulator.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ <h2>{{$t('settings')}}</h2>
<div><label><input type="checkbox" v-model="settings.carryOverMorale" />{{$t('carry_over_ship_morale')}}</label></div>
</div>
<div>
<label><input type="checkbox" v-model="settings.airRaidCostW6" /> {{$t('use_default_w6_air_raid')}} (4% <img src="assets/stats/fuel.png" /> 8% <img src="assets/stats/ammo.png" />)</label>
<div><label><input type="checkbox" v-model="settings.airRaidCostW6" /> {{$t('use_default_w6_air_raid')}} (4% <img src="assets/stats/fuel.png" /> 8% <img src="assets/stats/ammo.png" />)</label></div>
<div><label><input type="checkbox" v-model="enableAntiSubRaid" /> <span class="tooltip" :title="$t('enable_anti_sub_raid_desc')">{{$t('enable_anti_sub_raid')}}</span></label></div>
</div>
<div>
<div class="scrollAnchor"><div ref="divSettingsHistoricalScroll"></div></div>
Expand All @@ -193,7 +194,7 @@ <h2>{{$t('settings')}}</h2>
</div>
<div class="subsection" v-show="showMechanics">
<div v-for="mechanic in settings.mechanics">
<label><input type="checkbox" v-model="mechanic.enabled" @change="onchangeMechanic(mechanic)"/> {{$t('mechanic.' + mechanic.key)}}</label>
<label v-if="!mechanic.hide"><input type="checkbox" v-model="mechanic.enabled" @change="onchangeMechanic(mechanic)"/> {{$t('mechanic.' + mechanic.key)}}</label>
</div>
<br>
<table>
Expand Down

0 comments on commit 7c89c30

Please sign in to comment.