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 Apr 16, 2024
2 parents abfe560 + b3f4221 commit 991d00a
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 190 deletions.
20 changes: 12 additions & 8 deletions js/kcships.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ function Ship(id,name,side,LVL,HP,FP,TP,AA,AR,EV,ASW,LOS,LUK,RNG,planeslots) {
this.isInstall = true;
}
}
Ship.prototype.loadEquips = function(equips,levels,profs,addstats) {
Ship.prototype.loadEquips = function(equips,levels,profs,addstats,isSupport) {
if (!equips || this.equips.length > 0) return; //don't load if already have equips, do removeEquips() first
var atypes = {};
var installeqs = {DH1:0,DH2:0,DH3:0,TDH:0,TDH11:0,WG:0,AP:0,T3:0,SB:0,DB:0,DH1stars:0,DH3stars:0};
Expand All @@ -372,7 +372,7 @@ Ship.prototype.loadEquips = function(equips,levels,profs,addstats) {
var aswPenetrate = 0;
for (var i=0; i<equips.length; i++){
if (!equips[i]) continue;
var eq = new Equip(equips[i],levels[i],profs[i]);
var eq = new Equip(equips[i],(isSupport ? 0 : levels[i]),(isSupport ? 0 : profs[i]));

if (eq.RNG && eq.RNG > this.RNG) this.RNG = eq.RNG;
if (eq.ACC) this.ACC += eq.ACC;
Expand Down Expand Up @@ -1426,7 +1426,7 @@ function WGpower(num) {
}

Ship.prototype.shellPower = function(target,base) {
var bonus = (this.improves.Pshell)? Math.floor(this.improves.Pshell) : 0;
var bonus = (this.improves.Pshell)? this.improves.Pshell : 0;
//var shellbonus = (this.fleet && this.fleet.formation.shellbonus!==undefined)? this.fleet.formation.shellbonus : 5;
var shellbonus = (base != null)? base+5 : 5;
if (target && target.isInstall) {
Expand Down Expand Up @@ -1454,7 +1454,7 @@ Ship.prototype.shellPower = function(target,base) {
}

Ship.prototype.NBPower = function(target) {
var bonus = (this.improves.Pnb)? Math.floor(this.improves.Pnb) : 0;
var bonus = (this.improves.Pnb)? this.improves.Pnb : 0;
if (target && target.isInstall) {
let fp = ((this.isSub)? this.FP + 30 : this.FP) + bonus;
switch (target.installtype) {
Expand Down Expand Up @@ -1494,7 +1494,7 @@ Ship.prototype.ASWPower = function() {
if (MECHANICS.eqBonusASW) {
equipASW += this.statsEqBonus.ASW || 0;
}
var bonus = (this.improves.Pasw)? Math.floor(this.improves.Pasw) : 0;
var bonus = (this.improves.Pasw)? this.improves.Pasw : 0;
var synergyMod = 1;
if (MECHANICS.aswSynergy) {
if (hasdcP && hasdcO) synergyMod *= (hassonarS ? 1.25 : 1.1);
Expand Down Expand Up @@ -1849,7 +1849,7 @@ CV.prototype.shellPower = function(target,base) {
}
var bonus = (base||0) + 5;
if (target && target.isInstall) tp = 0;
var improvebonus = (this.improves.Pshell)? Math.floor(this.improves.Pshell) : 0;
var improvebonus = (this.improves.Pshell)? this.improves.Pshell : 0;
let fp = this.FP + bonus + improvebonus;
if (installOnly) {
switch (target.installtype) {
Expand Down Expand Up @@ -1975,8 +1975,8 @@ function AO(id,name,side,LVL,HP,FP,TP,AA,AR,EV,ASW,LOS,LUK,RNG,planeslots) {
Ship.call(this,id,name,side,LVL,HP,FP,TP,AA,AR,EV,ASW,LOS,LUK,RNG,planeslots);
};
AO.prototype = Object.create(Ship.prototype);
AO.prototype.loadEquips = function(equips,levels,profs,addstats) {
Ship.prototype.loadEquips.call(this,equips,levels,profs,addstats);
AO.prototype.loadEquips = function(equips,levels,profs,addstats,isSupport) {
Ship.prototype.loadEquips.call(this,equips,levels,profs,addstats,isSupport);

if (this.canAirAttack && this.equips.find(eq => eq.type == TORPBOMBER || eq.type == DIVEBOMBER)) {
this.planeasw = 2;
Expand Down Expand Up @@ -2254,6 +2254,10 @@ Equip.prototype.setImprovement = function(level) {
this.improves.Pshell = .2*level;
this.improves.Pnb = .2*level;
}
if (this.type == TORPEDOSS) {
this.improves.Ptorp = .2*level;
this.improves.Pnb = .2*level;
}

if (this.type == RADARS || this.type == RADARL) {
if (this.ACC >= 3) {
Expand Down
Loading

0 comments on commit 991d00a

Please sign in to comment.