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 Aug 27, 2024
2 parents 2ba32c6 + 34b0d6d commit 4e0e1d9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 21 deletions.
20 changes: 10 additions & 10 deletions js/simulator-ui/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,16 @@ var COMMON = {

friendFleetImproveSpecial: {
'59-4': [
[{ "id": 264, "improvement": [10,10,0,10] }, { "id": 487, "improvement": [10,10] }, { "id": 647, "improvement": [10,10,10] }, { "id": 627, "improvement": [10,10,10] }],
[{ "id": 156, "improvement": [4] }, { "id": 411, "improvement": [10,10,0,10] }, { "id": 412, "improvement": [10,10,10] }, { "id": 501, "improvement": [10,10,10] }, { "id": 968, "improvement": [10,10,10] }],
[{ "id": 411, "improvement": [10,10,10] }, { "id": 319, "improvement": [10,10,0,10] }, { "id": 194, "improvement": [10,10,0,10] }, { "id": 564, "improvement": [8,10,10] }, { "id": 327, "improvement": [10,10,10] }],
[{ "id": 319, "improvement": [10,10,10,10] }, { "id": 194, "improvement": [10,10] }, { "id": 246, "improvement": [9,10,10] }, { "id": 497, "improvement": [10,10,10] }, { "id": 961, "improvement": [10,10,10] }],
[{ "id": 734, "improvement": [8,8] }, { "id": 659, "improvement": [0,0,10] }, { "id": 697, "improvement": [] }, { "id": 928, "improvement": [9,9] }, { "id": 689, "improvement": [] }, { "id": 726, "improvement": [4] }],
[{ "id": 411, "improvement": [10,10,10] }, { "id": 564, "improvement": [8,10,10] }, { "id": 327, "improvement": [10,10,10] }],
[{ "id": 487, "improvement": [10,10] }, { "id": 647, "improvement": [10,10,10] }, { "id": 627, "improvement": [10,10,10] }],
[{ "id": 928, "improvement": [9,9] }, { "id": 726, "improvement": [] }, { "id": 689, "improvement": [4] }],
[{ "id": 564, "improvement": [8,10,10] }, { "id": 327, "improvement": [10,10,10] }],
[{ "id": 647, "improvement": [10,10,10] }, { "id": 627, "improvement": [10,10,10] }]
{ "ships": [{ "id": 411, "improvement": [10,10,10] }, { "id": 319, "improvement": [10,10,0,10] }, { "id": 194, "improvement": [10,10,0,10] }, { "id": 564, "improvement": [8,10,10] }, { "id": 327, "improvement": [10,10,10] }], "rate": 25 },
{ "ships": [{ "id": 156, "improvement": [4] }, { "id": 411, "improvement": [10,10,0,10] }, { "id": 412, "improvement": [10,10,10] }, { "id": 501, "improvement": [10,10,10] }, { "id": 968, "improvement": [10,10,10] }], "rate": 30 },
{ "ships": [{ "id": 734, "improvement": [8,8] }, { "id": 659, "improvement": [0,0,10] }, { "id": 697, "improvement": [] }, { "id": 928, "improvement": [9,9] }, { "id": 689, "improvement": [] }, { "id": 726, "improvement": [4] }], "rate": 50 },
{ "ships": [{ "id": 319, "improvement": [10,10,10,10] }, { "id": 194, "improvement": [10,10] }, { "id": 246, "improvement": [9,10,10] }, { "id": 497, "improvement": [10,10,10] }, { "id": 961, "improvement": [10,10,10] }], "rate": 70 },
{ "ships": [{ "id": 264, "improvement": [10,10,0,10] }, { "id": 487, "improvement": [10,10] }, { "id": 647, "improvement": [10,10,10] }, { "id": 627, "improvement": [10,10,10] }], "rate": 99 },
{ "ships": [{ "id": 411, "improvement": [10,10,10] }, { "id": 564, "improvement": [8,10,10] }, { "id": 327, "improvement": [10,10,10] }], "rate": 20 },
{ "ships": [{ "id": 487, "improvement": [10,10] }, { "id": 647, "improvement": [10,10,10] }, { "id": 627, "improvement": [10,10,10] }], "rate": 25 },
{ "ships": [{ "id": 928, "improvement": [9,9] }, { "id": 726, "improvement": [] }, { "id": 689, "improvement": [4] }], "rate": 33.333 },
{ "ships": [{ "id": 647, "improvement": [10,10,10] }, { "id": 627, "improvement": [10,10,10] }], "rate": 50 },
{ "ships": [{ "id": 564, "improvement": [8,10,10] }, { "id": 327, "improvement": [10,10,10] }], "rate": 100 }
]
},

Expand Down
27 changes: 16 additions & 11 deletions js/simulator-ui/ui-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1387,20 +1387,25 @@ var UI_KCNAVCOMPIMPORTER = Vue.createApp({
if (this.isFriendFleet) {
let improveSpecial = COMMON.friendFleetImproveSpecial[this.world + '-' + this.mapnum];
if (improveSpecial) {
let improveSpecialByKey = {};
for (let ships of improveSpecial) {
let key = ships.map(ship => ship.id).join(',');
improveSpecialByKey[key] = ships;
let compSaveByKey = {};
for (let compSave of compsSave) {
let key = compSave.fleet.ships.map(ship => ship.mstId).join(',');
compSaveByKey[key] = compSave;
compSave.rate = 0;
}
for (let comp of compsSave) {
let key = comp.fleet.ships.map(ship => ship.mstId).join(',');
if (!improveSpecialByKey[key]) continue;
for (let i=0; i<improveSpecialByKey[key].length; i++) {
let ship = comp.fleet.ships[i];
for (let j=0; j<improveSpecialByKey[key][i].improvement.length; j++) {
ship.equips[j].level = improveSpecialByKey[key][i].improvement[j];
let rateLeft = 1;
for (let item of improveSpecial) {
let key = item.ships.map(ship => ship.id).join(',');
let compSave = compSaveByKey[key];
if (!compSave) continue;
for (let i=0; i<item.ships.length; i++) {
let shipSave = compSave.fleet.ships[i];
for (let j=0; j<item.ships[i].improvement.length; j++) {
shipSave.equips[j].level = item.ships[i].improvement[j];
}
}
compSave.rate = Math.round(10*item.rate*rateLeft) || 1;
rateLeft *= (1-item.rate/100);
}
}
}
Expand Down

0 comments on commit 4e0e1d9

Please sign in to comment.