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 Sep 23, 2024
2 parents 63cb4f8 + dffebed commit 1a04df8
Show file tree
Hide file tree
Showing 7 changed files with 29 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 @@ -213,6 +213,8 @@
"retreat_on_taiha_even": "Retreat on {img_taiha} even if ship has {img_repair} if on Node {sel_node} or before OR number of {img_taiha} ships \u2265 {inp_num}",
"na": "N/A",
"none_node": "None",
"other_retreat_settings": "Other Retreat Settings",
"no_retreat_on_taiha": "Don't Retreat on {img_taiha}",
"retreat_on_chuuha": "Retreat on {img_chuuha}",
"if_any_are_chuuha": "If ANY of the selected are {img_chuuha}",
"if_all_are_chuuha": "If ALL of the selected are {img_chuuha}",
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 @@ -213,6 +213,8 @@
"retreat_on_taiha_even": "{img_taiha}したときダメコンを装備していても、{br}\u3000\u30fbNode{sel_node} か、それより前{br}\u3000\u30fb{img_taiha}が{inp_num}隻以上{br}\u3000のいずれかであれば撤退する",
"na": "無効",
"none_node": "None",
"other_retreat_settings": "撤退設定",
"no_retreat_on_taiha": "{img_taiha}しても撤退しない",
"retreat_on_chuuha": "{img_chuuha}したら撤退する",
"if_any_are_chuuha": "選択したいずれかの艦が{img_chuuha}したら",
"if_all_are_chuuha": "選択した全ての艦が{img_chuuha}したら",
Expand Down
2 changes: 2 additions & 0 deletions js/kcsim.js
Original file line number Diff line number Diff line change
Expand Up @@ -4029,11 +4029,13 @@ function canContinue(ships1,ships1C,ignoreFCF,ignoreDamecon) {
if (DORETREAT) {
for (var i=1; i<ships1.length; i++) {
if (ships1[i].retreated) continue;
if (ships1[i]._dataOrig && ships1[i]._dataOrig.noRetreatOnTaiha) continue;
if (ships1[i].HP/ships1[i].maxHP <= .25 && (ignoreDamecon||!ships1[i].repairs||!ships1[i].repairs.length) && ships1[i] != retreater) return false;
}
if (ships1C) {
for (var i=1; i<ships1C.length; i++) {
if (ships1C[i].retreated) continue;
if (ships1C[i]._dataOrig && ships1C[i]._dataOrig.noRetreatOnTaiha) continue;
if (ships1C[i].HP/ships1C[i].maxHP <= .25 && (ignoreDamecon||!ships1C[i].repairs||!ships1C[i].repairs.length) && ships1C[i] != retreater) return false;
}
}
Expand Down
3 changes: 2 additions & 1 deletion js/simulator-ui/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var CONST = window.COMMON.getConst({});

window.CONVERT = {
_fleetPropsSaved: ['type','formation'],
_shipPropsSaved: ['mstId','level','hp','hpInit','morale','fuelInit','ammoInit','statsBase','slots','bonusDmg','bonusAcc','bonusEva','bonusDmgDebuff','isFaraway','neverFCF','retreatOnChuuha'],
_shipPropsSaved: ['mstId','level','hp','hpInit','morale','fuelInit','ammoInit','statsBase','slots','bonusDmg','bonusAcc','bonusEva','bonusDmgDebuff','isFaraway','neverFCF','retreatOnChuuha','noRetreatOnTaiha'],
_equipPropsSaved: ['mstId','level','rank','bonusDmg','bonusAcc','bonusGroups'],

_UI_MAIN: null,
Expand Down Expand Up @@ -738,6 +738,7 @@ window.CONVERT = {
}
if (shipUI.neverFCF) shipInput.neverFCF = 1;
if (shipUI.retreatOnChuuha) shipInput.retreatOnChuuha = 1;
if (shipUI.noRetreatOnTaiha) shipInput.noRetreatOnTaiha = 1;

shipsInput.push(shipInput);
}
Expand Down
1 change: 1 addition & 0 deletions js/simulator-ui/fleet-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ var FLEET_MODEL = {

neverFCF: false,
retreatOnChuuha: false,
noRetreatOnTaiha: false,

isFaraway: false,
};
Expand Down
10 changes: 9 additions & 1 deletion js/simulator-ui/ui-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ var UI_MAIN = Vue.createApp({
hasChuuhaSettings: function() {
return !!((this.fleetFMain.ships && this.fleetFMain.ships.find(s => s.retreatOnChuuha)) || (this.fleetFMain.shipsEscort && this.fleetFMain.shipsEscort.find(s => s.retreatOnChuuha)));
},
hasNoTaihaSettings: function() {
return !!((this.fleetFMain.ships && this.fleetFMain.ships.find(s => s.noRetreatOnTaiha)) || (this.fleetFMain.shipsEscort && this.fleetFMain.shipsEscort.find(s => s.noRetreatOnTaiha)));
},

autoBonusStatus: function() {
return !this.autoBonus ? this.$i18n.t('autobonus_off') : this.$i18n.t('autobonus_active');
Expand Down Expand Up @@ -1905,8 +1908,13 @@ var UI_RETREATSETTINGS = Vue.createApp({
this.retreatIfAll = UI_MAIN.settings.retreatOnChuuhaIfAll ?? 0;
},

onclickShip: function(ship) {
onclickShipNoTaiha: function(ship) {
ship.noRetreatOnTaiha = !ship.noRetreatOnTaiha;
if (ship.noRetreatOnTaiha && ship.retreatOnChuuha) ship.retreatOnChuuha = false;
},
onclickShipChuuha: function(ship) {
ship.retreatOnChuuha = !ship.retreatOnChuuha;
if (ship.retreatOnChuuha && ship.noRetreatOnTaiha) ship.noRetreatOnTaiha = false;
},
onchangeRetreatIfAll: function() {
UI_MAIN.settings.retreatOnChuuhaIfAll = +this.retreatIfAll;
Expand Down
13 changes: 11 additions & 2 deletions simulator.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ <h2>{{$t('settings')}}</h2>
<template v-slot:inp_num><input type="number" min="0" max="12" :placeholder="$t('na')" v-model.number="settings.dameconNumTaiha" :class="getClassSetting('dameconNumTaiha')"/></template>
<template v-slot:br><br></template>
</i18n-t></div>
<div style="margin-left:10px"><i18n-t keypath="retreat_on_chuuha" scope="global"><template v-slot:img_chuuha><img src="assets/stats/chuuha.png"/></template></i18n-t>: <input type="button" :value="$t('settings')" @click="onclickSetRetreat"/> <span v-show="hasChuuhaSettings" class="bonusMarker chuuha">&#11044;</span></div>
<div style="margin-left:20px"><input type="button" :value="$t('other_retreat_settings')" @click="onclickSetRetreat"/> <span v-show="hasChuuhaSettings||hasNoTaihaSettings" class="bonusMarker chuuha">&#11044;</span></div>
<div><img src="assets/items/28.png"/><input type="button" :value="$t('fcf_settings')" @click="onclickSetFCF"/> <span v-show="hasFCFSettings" class="bonusMarker fcf" :title="$t('fcf_settings_set')">&#11044;</span></div>
<div><label><input type="checkbox" v-model="settings.replaceImpossibleFormations"/> <i18n-t keypath="replace_formations" scope="global">
<template v-slot:closest_alternative><span class="tooltip" :title="$t('closest_alternative_tooltip')">{{$t('closest_alternative')}}</span></template>
Expand Down Expand Up @@ -1652,11 +1652,20 @@ <h3>
<div id="divRetreatSettings"><div v-show="active">
<vmodal :active="active" @vclose="canClose&&(active=false)">
<div id="divRetreatSettingsMain">
<div>
<span class="header"><i18n-t keypath="no_retreat_on_taiha" scope="global"><template v-slot:img_taiha><img src="assets/stats/taiha.png" style="vertical-align:middle"/></template></i18n-t>:</span>
<div v-for="ships in shipGroups" class="shipGroup">
<div v-for="ship in ships" style="position:relative">
<img :src="'assets/icons/' + ship.imgName" :style="{'opacity':ship.noRetreatOnTaiha?1:.35}" @click="onclickShipNoTaiha(ship)"/>
<span class="shipType">{{ship.type}}</span>
</div>
</div>
</div>
<div>
<span class="header"><i18n-t keypath="retreat_on_chuuha" scope="global"><template v-slot:img_chuuha><img src="assets/stats/chuuha.png" style="vertical-align:middle"/></template></i18n-t>:</span>
<div v-for="ships in shipGroups" class="shipGroup">
<div v-for="ship in ships" style="position:relative">
<img :src="'assets/icons/' + ship.imgName" :style="{'opacity':ship.retreatOnChuuha?1:.35}" @click="onclickShip(ship)"/>
<img :src="'assets/icons/' + ship.imgName" :style="{'opacity':ship.retreatOnChuuha?1:.35}" @click="onclickShipChuuha(ship)"/>
<span class="shipType">{{ship.type}}</span>
</div>
</div>
Expand Down

0 comments on commit 1a04df8

Please sign in to comment.