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 Jun 26, 2023
2 parents 9b7b044 + 6118fd5 commit 3854575
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 27 deletions.
1 change: 1 addition & 0 deletions js/kcEQDATA.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ EQTDATA[ARMYUNIT] = {
EQTDATA[SMOKESCREEN] = {
name: 'Smoke Generator',
image: 54,
improve: {Pshell:1,Pnb:1,ACCshell:1,ACCnb:1.3},
canequip: ['DE','DD','CL','CLT','CA','CT'],
canequipS: [411, 412, 645, 650, 699],
};
Expand Down
8 changes: 5 additions & 3 deletions js/kcships.js
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ Ship.prototype.updateProficiencyBonus = function() {
var avgexp = planeexp/planecount;
if (avgexp >= 10) this.ACCplane = Math.sqrt(avgexp*.1);
if (avgexp >= 100) this.ACCplane += 9;
else if (avgexp >= 85) this.ACCplane += 6;
else if (avgexp >= 80) this.ACCplane += 6;
else if (avgexp >= 70) this.ACCplane += 4;
else if (avgexp >= 55) this.ACCplane += 3;
else if (avgexp >= 40) this.ACCplane += 2;
Expand Down Expand Up @@ -1519,7 +1519,7 @@ Ship.prototype.getAACItype = function(atypes) {
if (this.sclass != 54 && atypes[A_HAGUN] && atypes[A_AAFD] && atypes[A_AIRRADAR]) types.push(7);
if (!MECHANICS.aaci8Up && this.sclass != 54 && atypes[A_HAFD] && atypes[A_AIRRADAR]) types.push(8);

if (([546,911,916].includes(this.mid) || (MECHANICS.yamatoSpecial && [136].includes(this.mid))) && hasID[275] && atypes[A_AIRRADAR]) types.push(26); //Musashi/Yamato Kai Ni
if (([546,911,916].includes(this.mid) || (MECHANICS.yamatoSpecial && [136,148].includes(this.mid))) && hasID[275] && atypes[A_AIRRADAR]) types.push(26); //Musashi/Yamato Kai Ni
if ([321].includes(this.mid) && hasID[275] && hasID[274] && atypes[A_AIRRADAR]) types.push(27); //Ooyodo
if ([82,88,553,554,148,546].indexOf(this.mid) != -1 && hasID[274] && atypes[A_AIRRADAR]) types.push(28); //Ise-class Kai + Musashi Kai
if ((this.mid == 557 || this.mid == 558) && atypes[A_HAGUN] && atypes[A_AIRRADAR]) types.push(29); //Isokaze+Hamakaze B Kai
Expand Down Expand Up @@ -1769,7 +1769,9 @@ CV.prototype.NBPower = function(target) {
let equip = this.equips[i];
if (equip.btype != B_NIGHTFIGHTER && equip.btype != B_NIGHTBOMBER && equip.btype != B_NIGHTBOMBER2) continue;
let mod = .3*((equip.FP || 0) + (equip.TP || 0) + (equip.ASW || 0) + (equip.DIVEBOMB || 0));
power += (equip.FP || 0) + (equip.TP || 0) + Math.sqrt(equip.level || 0);
power += (equip.FP || 0) + Math.sqrt(equip.level || 0);
if (!(target && target.isInstall) && equip.type == TORPBOMBER) power += (equip.TP || 0);
if (equip.type != TORPBOMBER) power += (equip.DIVEBOMB || 0);
if (equip.btype != B_NIGHTBOMBER2) {
power += this.planecount[i]*3;
mod *= 1.5;
Expand Down
80 changes: 57 additions & 23 deletions js/kcsim.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ var LINEABREAST = {shellmod:.6,torpmod:.6,ASWmod:1.3,AAmod:1, shellacc:1.2,torpa
var VANGUARD1 = {shellmod:0.5,torpmod:1,ASWmod:1,AAmod:1.1, shellacc:.8,torpacc:.7,NBacc:.8,ASWacc:1, shellev:1,torpev:1,NBev:1,ASWev:1, id:6};
var VANGUARD2 = {shellmod:1,torpmod:1,ASWmod:.6,AAmod:1.1, shellacc:1.2,torpacc:.9,NBacc:1.2,ASWacc:1.1, shellev:1,torpev:1,NBev:1,ASWev:1, id:6};

var COMBINEDCF1 = {shellmod:.8,torpmod:.7,ASWmod:1.3,AAmod:1.1, shellacc:.9,torpacc:.6,NBacc:1,ASWacc:1.25, shellev:1,torpev:1,NBev:1,ASWev:1, id:11};
var COMBINEDCF2 = {shellmod:1,torpmod:.9,ASWmod:1.1,AAmod:1, shellacc:1,torpacc:1,NBacc:1,ASWacc:1, shellev:1.2,torpev:1,NBev:1,ASWev:1, id:12};
var COMBINEDCF3 = {shellmod:.7,torpmod:.6,ASWmod:1,AAmod:1.5, shellacc:.8,torpacc:.35,NBacc:1,ASWacc:1.1, shellev:1.1,torpev:1,NBev:1,ASWev:1, id:13};
var COMBINEDCF1 = {shellmod:.8,torpmod:.7,ASWmod:1.3,AAmod:1.1, shellacc:.9,torpacc:.6,NBacc:.8,ASWacc:1.25, shellev:1,torpev:1,NBev:1,ASWev:1, id:11};
var COMBINEDCF2 = {shellmod:1,torpmod:.9,ASWmod:1.1,AAmod:1, shellacc:1,torpacc:1,NBacc:.9,ASWacc:1, shellev:1.2,torpev:1,NBev:1,ASWev:1, id:12};
var COMBINEDCF3 = {shellmod:.7,torpmod:.6,ASWmod:1,AAmod:1.5, shellacc:.8,torpacc:.35,NBacc:.7,ASWacc:1.1, shellev:1.1,torpev:1,NBev:1,ASWev:1, id:13};
var COMBINEDCF4 = {shellmod:1.1,torpmod:1,ASWmod:.7,AAmod:1, shellacc:1.1,torpacc:1.2,NBacc:1,ASWacc:.7, shellev:1,torpev:1,NBev:1,ASWev:1, id:14};

var COMBINEDCONSTS = {
Expand Down Expand Up @@ -145,11 +145,11 @@ var NBATTACKDATA = {
62: { dmgMod: 1.2, accMod: 1.2, chanceMod: 1.2, id: 6, name: 'CVCI (1.2)' },
63: { dmgMod: 1.2, accMod: 1.2, chanceMod: 1.2, id: 6, name: 'CVCI (1.2)' },
64: { dmgMod: 1.18, accMod: 1.2, chanceMod: 1.3, id: 6, name: 'CVCI (1.18)' },
7: { dmgMod: 1.3, accMod: 1.5, chanceMod: 1.15, name: 'DDCI (GTR) x1', replace: 11, replaceChance: .65 },
7: { dmgMod: 1.3, accMod: 1.1, chanceMod: 1.15, name: 'DDCI (GTR) x1', replace: 11, replaceChance: .65 },
8: { dmgMod: 1.2, accMod: 1.65, chanceMod: 1.4, name: 'DDCI (LTR) x1', replace: 12, replaceChance: .5 },
9: { dmgMod: 1.5, accMod: 1.65, chanceMod: 1.25, name: 'DDCI (TTL) x1', replace: 13, replaceChance: .875 },
10: { dmgMod: 1.3, accMod: 1.5, chanceMod: 1.22, name: 'DDCI (TDL) x1', replace: 14, replaceChance: .55 },
11: { dmgMod: 1.3, accMod: 1.5, chanceMod: 1.3, numHits: 2, name: 'DDCI (GTR) x2' },
11: { dmgMod: 1.3, accMod: 1.1, chanceMod: 1.3, numHits: 2, name: 'DDCI (GTR) x2' },
12: { dmgMod: 1.2, accMod: 1.65, chanceMod: 1.4, numHits: 2, name: 'DDCI (LTR) x2' },
13: { dmgMod: 1.5, accMod: 1.65, chanceMod: 1.25, numHits: 2, name: 'DDCI (TTL) x2' },
14: { dmgMod: 1.3, accMod: 1.5, chanceMod: 1.22, numHits: 2, name: 'DDCI (TDL) x2' },
Expand Down Expand Up @@ -218,10 +218,12 @@ var SIMCONSTS = {
enableASFit: false,
echelonOld: {shellmod:.6,torpmod:.6,ASWmod:1,AAmod:1, shellacc:1.2,torpacc:.6,NBacc:.8, shellev:1.2,torpev:1.3,NBev:1.1,ASWev:1.3, id:4},
echelonNew: {shellmod:.75,torpmod:.6,ASWmod:1.1,AAmod:1, shellacc:1.2,torpacc:.75,NBacc:.9, shellev:1.4,torpev:1.3,NBev:1.3,ASWev:1.3, id:4},
nbattack7Old: { dmgMod: 1.3, accMod: 1.5, chanceMod: 1.3, name: 'DDCI (GTR)' },
nbattack7New: { dmgMod: 1.3, accMod: 1.5, chanceMod: 1.15, name: 'DDCI (GTR) x1', replace: 11, replaceChance: .65 },
nbattack7Old: { dmgMod: 1.3, accMod: 1.1, chanceMod: 1.3, name: 'DDCI (GTR)' },
nbattack7New: { dmgMod: 1.3, accMod: 1.1, chanceMod: 1.15, name: 'DDCI (GTR) x1', replace: 11, replaceChance: .65 },
nbattack8Old: { dmgMod: 1.2, accMod: 1.65, chanceMod: 1.5, name: 'DDCI (LTR)' },
nbattack8New: { dmgMod: 1.2, accMod: 1.65, chanceMod: 1.4, name: 'DDCI (LTR) x1', replace: 12, replaceChance: .5 },
aaciRatesOld: { 2: .58, 5: .55, 34: .6, 35: .55, 36: .55, 37: .4, 38: .62 },
aaciRatesNew: { 2: .55, 5: .5, 34: .55, 35: .54, 36: .53, 37: .44, 38: .58 },
airstrikeDmgMF: -10,
airstrikeDmgMFRaid: -10,
airstrikeDmgME: -10,
Expand All @@ -234,6 +236,7 @@ var SIMCONSTS = {
airstrikeAccEF: -20,
airstrikeAccEFRaid: -25,
airstrikeAccEE: -15,
nbOnlyCFAccBase: 69,
}
SIMCONSTS.vanguardEvShellDDMod = SIMCONSTS.vanguardEvShellDDModNormal.slice();
SIMCONSTS.vanguardEvTorpDDMod = SIMCONSTS.vanguardEvTorpDDModNormal.slice();
Expand All @@ -250,11 +253,19 @@ function toggleDDCIBuff(enable) {
}

function toggleASWPlaneAir(enable) {
MECHANICS.aswPlaneAir = !!enable;
for (let type of [AUTOGYRO,ASWPLANE]) {
EQTDATA[type].isPlane = EQTDATA[type].isfighter = EQTDATA[type].isdivebomber = !!enable;
}
}

function toggleAACIRework(enable) {
MECHANICS.aaciMultiRoll = !!enable;
for (let id in SIMCONSTS.aaciRatesNew) {
AACIDATA[id].rate = enable ? SIMCONSTS.aaciRatesNew[id] : SIMCONSTS.aaciRatesOld[id];
}
}

var BUCKETPERCENT = .5;
var BUCKETTIME = 99*3600;
var CARRYOVERHP = false;
Expand Down Expand Up @@ -442,6 +453,7 @@ function shell(ship,target,APIhou,attackSpecial,combinedAll) {
acc *= accMod2;

if (ship.bonusSpecialAcc && (evFlat < 20 || SIMCONSTS.vanguardUseType != 1)) acc *= getBonusAcc(ship,target);
if (SIMCONSTS.enablePlaneBonus && ship.CVshelltype) acc *= getBonusSpecialPlane(ship,'bonusSpecialAccP');

if (target.isPT) {
if (NERFPTIMPS) {
Expand Down Expand Up @@ -600,7 +612,7 @@ function NBattack(ship,target,NBonly,NBequips,APIyasen,attackSpecial) {
var postMod = 1;
var bonus = 0;

var accBase = (NBonly && ship.side == 0 && ship.fleet.combinedWith)? 90 : 69;
var accBase = (NBonly && ship.side == 0 && ship.fleet.combinedWith)? SIMCONSTS.nbOnlyCFAccBase : 69;
accBase = accBase + starshells[0]*5;
var accMod = ship.getFormation().NBacc * ship.moraleMod();
if (ship.fleet.formation.id == 6 && target.type == 'DD') accMod *= 1.1;
Expand Down Expand Up @@ -674,9 +686,10 @@ function NBattack(ship,target,NBonly,NBequips,APIyasen,attackSpecial) {
if (equip.mid == 267) { count++; }
if (equip.mid == 366) { count++; count2++; }
}
if (count) dmgMod *= 1.25;
if (count >= 2) dmgMod *= 1.125;
if (count2) dmgMod *= 1.05;
if (count == 1) dmgMod *= 1.25;
else if (count >= 2) dmgMod *= 1.4;
if (count2 == 1) dmgMod *= 1.05;
else if (count2 >= 2) dmgMod *= 1.1;
}
preMod *= dmgMod;
accMod *= attackData.accMod;
Expand Down Expand Up @@ -716,6 +729,7 @@ function NBattack(ship,target,NBonly,NBequips,APIyasen,attackSpecial) {
acc *= accMod2;

if (ship.bonusSpecialAcc && (evFlat < 20 || SIMCONSTS.vanguardUseType != 1)) acc *= getBonusAcc(ship,target);
if (SIMCONSTS.enablePlaneBonus && ship.canNBAirAttack()) acc *= getBonusSpecialPlane(ship,'bonusSpecialAccP');

if (target.isPT) {
if (NERFPTIMPS) {
Expand Down Expand Up @@ -889,6 +903,7 @@ function ASW(ship,target,isnight,APIhou,isOASW) {
var acc = hitRate(ship,80,sonarAcc,accMod);
if (ship.bonusSpecialAcc) acc *= getBonusAcc(ship,target);
let usePlaneProf = ship.planeasw && !isOASW && ship.type != 'CV' && ship.type != 'AO';
if (SIMCONSTS.enablePlaneBonus && usePlaneProf) acc *= getBonusSpecialPlane(ship,'bonusSpecialAccP');
var res = rollHit(accuracyAndCrit(ship,target,acc,target.getFormation().ASWev,evFlat,1.3,usePlaneProf),usePlaneProf ? ship.critdmgbonus : null);
var dmg = 0, realdmg = 0;
var premod = (isnight)? 0 : ship.getFormation().ASWmod*ENGAGEMENT*ship.damageMod();
Expand Down Expand Up @@ -1052,6 +1067,9 @@ function canSpecialAttack(ship,isNB,NBequips,skipUnique) {
if (!NBATTACKDATA[nbtype].isSpecial) continue;
let c = NBchance;
if (NBATTACKDATA[nbtype].id == 200) {
let numZuiun = ship.equips.filter((eq,i) => eq.mid == 490 && ship.planecount[i]).length;
if (numZuiun < 2 && [2001,2002].includes(nbtype)) continue;
if (numZuiun < 1 && [2002,2003].includes(nbtype)) continue;
c -= .14*NBequips[0][0];
c -= .17*NBequips[1][0];
}
Expand Down Expand Up @@ -1743,7 +1761,7 @@ function airstrike(ship,target,slot,contactMod,issupport,isjetphase,isRaid) {
postMod *= Math.random() < .4 ? 2.2 : 1.7;
} else if ([1637,1638,1639,1640].includes(target.mid)) {
postMod *= Math.random() < .4 ? .8 : .5;
} else if (target.nameJP.includes('集積地棲姫')) {
} else if (target.installtype == 3 || target.isSupplyDepot) {
postMod *= Math.random() < .4 ? 2.4 : 1.5;
} else if ([1665,1666,1667].includes(target.mid)) {
postMod *= Math.random() < .4 ? 1.7 : 1;
Expand Down Expand Up @@ -1848,14 +1866,14 @@ function getBonusAcc(ship,target,isAir) {
return mod;
}

function getBonusSpecialPlane(ship) {
function getBonusSpecialPlane(ship,key='bonusSpecialP') {
let mod = 1, groups = {};
for (let i=0; i<ship.equips.length; i++) {
if (ship.planecount[i] <= 0) continue;
let eq = ship.equips[i];
if (eq.bonusSpecialP) {
for (let group in eq.bonusSpecialP) {
groups[group] = eq.bonusSpecialP[group];
if (eq[key]) {
for (let group in eq[key]) {
groups[group] = eq[key][group];
}
}
}
Expand Down Expand Up @@ -2035,7 +2053,7 @@ function getAAShotProp(defender,slotsize,resistMod,isRaid) {
if (!MECHANICS.AACI) return 0;
var sAA = defender.weightedAntiAir(isRaid);
if (MECHANICS.aaResist && resistMod) sAA = Math.floor(sAA*resistMod);
if (MECHANICS.eqBonusAA) sAA += defender.statsEqBonus.AA*.8;
if (MECHANICS.eqBonusAA) sAA += (defender.statsEqBonus.AA || 0)*.8;
return Math.floor(slotsize*sAA/200);
}

Expand All @@ -2049,8 +2067,8 @@ function getAAShotFlat(defender,resistModShip,resistModFleet,isRaid) {
if (resistModFleet) fAA = Math.floor(fAA*resistModFleet);
}
if (MECHANICS.eqBonusAA) {
sAA += defender.statsEqBonus.AA*.8;
fAA += defender.statsEqBonus.AA*.75;
sAA += (defender.statsEqBonus.AA || 0)*.8;
fAA += (defender.statsEqBonus.AA || 0)*.75;
}
return (sAA+fAA)*mod;
}
Expand Down Expand Up @@ -2771,8 +2789,12 @@ function airstrikeLBAS(lbas,target,slot,contactMod,contactModLB,isjetphase) {
else if (['CA','CAV'].includes(target.type)) acc += .21;
else acc += .14;
}
if (SIMCONSTS.enablePlaneBonus && equip.bonusSpecialAccP) {
for (let group in equip.bonusSpecialAccP) acc *= equip.bonusSpecialAccP[group];
if (SIMCONSTS.enablePlaneBonus) {
if (equip.bonusSpecialPUseAll) {
acc *= getBonusSpecialPlane(lbas,'bonusSpecialAccP');
} else if (equip.bonusSpecialAccP) {
for (let group in equip.bonusSpecialAccP) acc *= equip.bonusSpecialAccP[group];
}
}
lbas.critratebonus = critratebonus; lbas.ACCplane = ACCplane;
var res = rollHit(accuracyAndCrit(lbas,target,acc,1,0,0,true),critdmgbonus);
Expand Down Expand Up @@ -2865,8 +2887,12 @@ function airstrikeLBAS(lbas,target,slot,contactMod,contactModLB,isjetphase) {
// postMod *= (target.divebombWeak || 1);
}
if (target.fleet.combinedWith) postMod *= 1.1;
if (SIMCONSTS.enablePlaneBonus && equip.bonusSpecialP) {
for (let group in equip.bonusSpecialP) postMod *= equip.bonusSpecialP[group];
if (SIMCONSTS.enablePlaneBonus) {
if (equip.bonusSpecialPUseAll) {
postMod *= getBonusSpecialPlane(lbas);
} else if (equip.bonusSpecialP) {
for (let group in equip.bonusSpecialP) postMod *= equip.bonusSpecialP[group];
}
}
dmg = damage(lbas,target,dmgbase,preMod,res*contactMod*postMod,SIMCONSTS.lbasDmgCap,true);
realdmg = takeDamage(target,dmg);
Expand Down Expand Up @@ -3315,6 +3341,14 @@ function sim(F1,F2,Fsupport,LBASwaves,doNB,NBonly,aironly,bombing,noammo,BAPI,no
}
}

if (!NBonly && !bombing) {
if (['A','B'].includes(doNB)) {
if (['E','D','C','B','A','S'].indexOf(getRank(ships1,ships2)) >= ['E','D','C','B','A','S'].indexOf(doNB)) doNB = false;
} else if (doNB == 'flagsunk') {
if (ships2[0].HP <= 0) doNB = false;
}
}

if (C) {
apiUpdateFlag(BAPI.data,bombing);
if (!NBonly) BAPI.data.api_midnight_flag = +!!(!bombing && alive2.length + subsalive2.length);
Expand Down
24 changes: 24 additions & 0 deletions js/kcsimcombined.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,14 @@ function simCombined(type,F1,F1C,F2,Fsupport,LBASwaves,doNB,NBonly,aironly,bombi
}
}

if (!NBonly && !bombing) {
if (['A','B'].includes(doNB)) {
if (['E','D','C','B','A','S'].indexOf(getRank(ships1,ships2,ships1C)) >= ['E','D','C','B','A','S'].indexOf(doNB)) doNB = false;
} else if (doNB == 'flagsunk') {
if (ships2[0].HP <= 0) doNB = false;
}
}

if (C) {
apiUpdateFlag(BAPI.data,bombing,type);
if (!NBonly) BAPI.data.api_midnight_flag = +!!(!bombing && alive2.length + subsalive2.length);
Expand Down Expand Up @@ -947,6 +955,14 @@ function sim6vs12(F1,F2,Fsupport,LBASwaves,doNB,NBonly,aironly,bombing,noammo,BA
}
}

if (!NBonly && !bombing) {
if (['A','B'].includes(doNB)) {
if (['E','D','C','B','A','S'].indexOf(getRank(ships1,ships2.concat(ships2C))) >= ['E','D','C','B','A','S'].indexOf(doNB)) doNB = false;
} else if (doNB == 'flagsunk') {
if (ships2[0].HP <= 0) doNB = false;
}
}

if (C) {
apiUpdateFlag(BAPI.data,bombing,null,true);
if (!NBonly) BAPI.data.api_midnight_flag = +!!(!bombing && alive2.length + subsalive2.length + alive2C.length + subsalive2C.length);
Expand Down Expand Up @@ -1413,6 +1429,14 @@ function sim12vs12(type,F1,F1C,F2,Fsupport,LBASwaves,doNB,NBonly,aironly,bombing
}
}

if (!NBonly && !bombing) {
if (['A','B'].includes(doNB)) {
if (['E','D','C','B','A','S'].indexOf(getRank(ships1,ships2.concat(ships2C),ships1C)) >= ['E','D','C','B','A','S'].indexOf(doNB)) doNB = false;
} else if (doNB == 'flagsunk') {
if (ships2[0].HP <= 0) doNB = false;
}
}

if (C) {
apiUpdateFlag(BAPI.data,bombing,type,true);
if (!NBonly) BAPI.data.api_midnight_flag = +!!(!bombing && alive2.length + subsalive2.length + alive2C.length + subsalive2C.length);
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 @@ -805,6 +805,7 @@ window.CONVERT = {
addCostAmmo: battleUI.addCostAmmo/100,
lbas: [],
};
if (battleUI.doNBCond) nodeInput.doNBCond = battleUI.doNBCond;
for (let i=0; i<battleUI.lbasWaves.length; i++) {
if (battleUI.lbasWaves[i]) {
nodeInput.lbas.push(Math.floor(i/2)+1);
Expand Down
2 changes: 2 additions & 0 deletions js/simulator-ui/sim-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ var SIM = {
if (dataInput.mechanics.enable_echelon != null) window.toggleEchelon(dataInput.mechanics.enable_echelon);
if (dataInput.mechanics.enable_DDCI != null) window.toggleDDCIBuff(dataInput.mechanics.enable_DDCI);
if (dataInput.mechanics.enable_ASWPlaneAir != null) window.toggleASWPlaneAir(dataInput.mechanics.enable_ASWPlaneAir);
if (dataInput.mechanics.enable_AACIRework != null) window.toggleAACIRework(dataInput.mechanics.enable_AACIRework);
}

if (dataInput.consts) {
Expand Down Expand Up @@ -672,6 +673,7 @@ var SIM = {
dataReplay.battles.push(apiBattle);
}
let doNB = node.doNB && !node.airRaid && !node.NBOnly;
if (doNB && node.doNBCond && ['A','B','flagsunk'].includes(node.doNBCond)) doNB = node.doNBCond;
if (fleetF.combinedWith) {
fleetF.resetBattle();
fleetF.combinedWith.resetBattle();
Expand Down
3 changes: 2 additions & 1 deletion js/simulator-ui/ui-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var MECHANICS_LIST = [
{ key: 'ffReroll', name: 'Friend Fleet Flagship Reroll' },
{ key: 'antiSubRaid', name: 'Anti-Sub Air Raid' },
{ key: 'enable_ASWPlaneAir', name: 'Autogyro/Liaison Air Battle' },
{ key: 'aaciMultiRoll', name: 'AACI Rework (Sequential Roll + New Priority)' },
{ key: 'enable_AACIRework', name: 'AACI Rework (Sequential Roll + New Priority)' },
];


Expand Down Expand Up @@ -239,6 +239,7 @@ var UI_MAIN = Vue.createApp({
formation: this.fleetFMain.combined ? CONST.formationCombinedDefault : CONST.formationSingleDefault,
nodeType: CONST.NODE_NORMAL,
doNB: false,
doNBCond: '',
lbasWaves: [false,false,false,false,false,false],
addCostFuel: null,
addCostAmmo: null,
Expand Down
1 change: 1 addition & 0 deletions simulator-import-help.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
fleet: &lt;same format as fleetF&gt;,
}],
doNB: &lt;bool&gt; (default 0),
doNBCond: &lt;string&gt; (optional) "A"/"B": don't do NB if rank after day is already this or higher, "flagsunk": don't do NB if enemy flagship already sunk. "doNB" must be true,
NBOnly: &lt;bool&gt; (default 0),
airOnly: &lt;bool&gt; (default 0),
airRaid: &lt;bool&gt; (default 0),
Expand Down
6 changes: 6 additions & 0 deletions simulator.html
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,12 @@ <h3>Statistics</h3>
<label><input type="radio" value="4" v-model="battle.nodeType" /><img src="assets/maps/nodeAir.png" title="Air Only" /></label>
</div>
<div v-show="hasNB"><label><input type="checkbox" v-model="battle.doNB" />Night Battle?</label></div>
<div v-show="hasNB && battle.doNB"><label><select v-model="battle.doNBCond">
<option value="">Always if possible</option>
<option value="A">Only if Day Rank less than A</option>
<option value="B">Only if Day Rank less than B</option>
<option value="flagsunk">Only if Enemy Flagship not sunk</option>
</select></label></div>
</div>
<div>
<div><span class="header">Resupply Cost:</span></div>
Expand Down

0 comments on commit 3854575

Please sign in to comment.