Merge pull request #1051 from danielyxie/dev

hotfix 0 territory being softlocked.
This commit is contained in:
hydroflame 2021-08-17 17:47:58 -04:00 committed by GitHub
commit 27ee65f524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

File diff suppressed because one or more lines are too long

@ -323,7 +323,7 @@ export class Gang {
this.members[i].task !== "Territory Warfare") continue; this.members[i].task !== "Territory Warfare") continue;
memberTotal += this.members[i].calculatePower(); memberTotal += this.members[i].calculatePower();
} }
return (0.015 * this.getTerritory() * memberTotal); return (0.015 * Math.max(0.002, this.getTerritory()) * memberTotal);
} }

@ -122,7 +122,7 @@ export class GangMember {
(task.chaWeight/100) * this.cha; (task.chaWeight/100) * this.cha;
statWeight -= (4 * task.difficulty); statWeight -= (4 * task.difficulty);
if (statWeight <= 0) return 0; if (statWeight <= 0) return 0;
const territoryMult = Math.pow(AllGangs[gang.facName].territory * 100, task.territory.respect) / 100; const territoryMult = Math.max(0.005, Math.pow(AllGangs[gang.facName].territory * 100, task.territory.respect) / 100);
if (isNaN(territoryMult) || territoryMult <= 0) return 0; if (isNaN(territoryMult) || territoryMult <= 0) return 0;
const respectMult = gang.getWantedPenalty(); const respectMult = gang.getWantedPenalty();
return 11 * task.baseRespect * statWeight * territoryMult * respectMult; return 11 * task.baseRespect * statWeight * territoryMult * respectMult;
@ -139,7 +139,7 @@ export class GangMember {
(task.chaWeight / 100) * this.cha; (task.chaWeight / 100) * this.cha;
statWeight -= (3.5 * task.difficulty); statWeight -= (3.5 * task.difficulty);
if (statWeight <= 0) return 0; if (statWeight <= 0) return 0;
const territoryMult = Math.pow(AllGangs[gang.facName].territory * 100, task.territory.wanted) / 100; const territoryMult = Math.max(0.005, Math.pow(AllGangs[gang.facName].territory * 100, task.territory.wanted) / 100);
if (isNaN(territoryMult) || territoryMult <= 0) return 0; if (isNaN(territoryMult) || territoryMult <= 0) return 0;
if (task.baseWanted < 0) { if (task.baseWanted < 0) {
return 0.4 * task.baseWanted * statWeight * territoryMult; return 0.4 * task.baseWanted * statWeight * territoryMult;
@ -160,9 +160,10 @@ export class GangMember {
(task.dexWeight/100) * this.dex + (task.dexWeight/100) * this.dex +
(task.agiWeight/100) * this.agi + (task.agiWeight/100) * this.agi +
(task.chaWeight/100) * this.cha; (task.chaWeight/100) * this.cha;
statWeight -= (3.2 * task.difficulty); statWeight -= (3.2 * task.difficulty);
if (statWeight <= 0) return 0; if (statWeight <= 0) return 0;
const territoryMult = Math.pow(AllGangs[gang.facName].territory * 100, task.territory.money) / 100; const territoryMult = Math.max(0.005, Math.pow(AllGangs[gang.facName].territory * 100, task.territory.money) / 100);
if (isNaN(territoryMult) || territoryMult <= 0) return 0; if (isNaN(territoryMult) || territoryMult <= 0) return 0;
const respectMult = gang.getWantedPenalty(); const respectMult = gang.getWantedPenalty();
return 5 * task.baseMoney * statWeight * territoryMult * respectMult; return 5 * task.baseMoney * statWeight * territoryMult * respectMult;