mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-03-09 11:52:32 +01:00
fmtlint
This commit is contained in:
@ -225,7 +225,6 @@ export class Gang implements IGang {
|
||||
if (AllGangs[otherGang].territory <= 0) return;
|
||||
const territoryGain = calculateTerritoryGain(thisGang, otherGang);
|
||||
AllGangs[thisGang].territory += territoryGain;
|
||||
if (AllGangs[thisGang].territory > 0.999) AllGangs[thisGang].territory = 1;
|
||||
AllGangs[otherGang].territory -= territoryGain;
|
||||
if (thisGang === gangName) {
|
||||
this.clash(true); // Player won
|
||||
@ -239,9 +238,7 @@ export class Gang implements IGang {
|
||||
if (AllGangs[thisGang].territory <= 0) return;
|
||||
const territoryGain = calculateTerritoryGain(otherGang, thisGang);
|
||||
AllGangs[thisGang].territory -= territoryGain;
|
||||
if (AllGangs[otherGang].territory < 0.001) AllGangs[otherGang].territory = 0;
|
||||
AllGangs[otherGang].territory += territoryGain;
|
||||
if (AllGangs[otherGang].territory > 0.999) AllGangs[otherGang].territory = 1;
|
||||
if (thisGang === gangName) {
|
||||
this.clash(false); // Player lost
|
||||
} else if (otherGang === gangName) {
|
||||
@ -251,6 +248,11 @@ export class Gang implements IGang {
|
||||
AllGangs[thisGang].power *= 1 / 1.01;
|
||||
}
|
||||
}
|
||||
|
||||
const total = Object.values(AllGangs)
|
||||
.map((g) => g.territory)
|
||||
.reduce((p, c) => p + c, 0);
|
||||
Object.values(AllGangs).forEach((g) => (g.territory /= total));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user