mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 20:25:45 +01:00
Adding gang.getOtherGangInformation() function. Rebalancing
This commit is contained in:
parent
910fa6d0a6
commit
e0df6207c1
@ -56,6 +56,33 @@ getGangInformation
|
||||
wantedLevelGainRate: Wanted level gained/lost per second (negative for losses)
|
||||
}
|
||||
|
||||
getOtherGangInformation
|
||||
-----------------------
|
||||
|
||||
.. js:function:: getOtherGangInformation()
|
||||
|
||||
Get territory and power information about all gangs
|
||||
|
||||
:returns: An object with information about all gangs
|
||||
|
||||
The object has the following structure::
|
||||
|
||||
{
|
||||
"Slum Snakes" : {
|
||||
power: Slum Snakes' power
|
||||
territory: Slum Snakes' territory, in decimal form
|
||||
},
|
||||
"Tetrads" : {
|
||||
power: ...
|
||||
territory: ...
|
||||
},
|
||||
"The Syndicate" : {
|
||||
power: ...
|
||||
territory: ...
|
||||
},
|
||||
... (for all six gangs)
|
||||
}
|
||||
|
||||
getMemberInformation
|
||||
--------------------
|
||||
|
||||
|
@ -29,8 +29,8 @@ function initBitNodes() {
|
||||
"people quickly succumbed to the innate human impulse of evil and savagery. The organized crime " +
|
||||
"factions quickly rose to the top of the modern world.<br><br>" +
|
||||
"In this BitNode:<br><br>" +
|
||||
"Your hacking level is reduced by 25%<br>" +
|
||||
"The growth rate and maximum amount of money available on servers is significantly decreased<br>" +
|
||||
"Your hacking level is reduced by 20%<br>" +
|
||||
"The growth rate and maximum amount of money available on servers are significantly decreased<br>" +
|
||||
"The amount of money gained from crimes and Infiltration is tripled<br>" +
|
||||
"Certain Factions (Slum Snakes, Tetrads, The Syndicate, The Dark Army, Speakers for the Dead, " +
|
||||
"NiteSec, The Black Hand) give the player the ability to form and manage their own gangs. These gangs " +
|
||||
@ -216,8 +216,8 @@ function initBitNodeMultipliers() {
|
||||
case 1: //Source Genesis (every multiplier is 1)
|
||||
break;
|
||||
case 2: //Rise of the Underworld
|
||||
BitNodeMultipliers.HackingLevelMultiplier = 0.75;
|
||||
BitNodeMultipliers.ServerGrowthRate = 0.75;
|
||||
BitNodeMultipliers.HackingLevelMultiplier = 0.8;
|
||||
BitNodeMultipliers.ServerGrowthRate = 0.8;
|
||||
BitNodeMultipliers.ServerMaxMoney = 0.2;
|
||||
BitNodeMultipliers.ServerStartingMoney = 0.4;
|
||||
BitNodeMultipliers.CrimeMoney = 3;
|
||||
|
@ -508,7 +508,7 @@ let CONSTANTS = {
|
||||
*** Added a Gang Netscript API
|
||||
*** Added new 'ascension' mechanic for Gang Members
|
||||
*** The first three gang members are now 'free' (can be recruited instantly)
|
||||
*** Maximum number of increased Gang Members increased from 20 to 40
|
||||
*** Maximum number of increased Gang Members increased from 20 to 30
|
||||
*** Changed the formula for calculating respect needed to recruit the next gang member
|
||||
*** Added a new category of upgrades for Gang Members: Augmentations
|
||||
*** Non-Augmentation Gang member upgrades are now significantly weaker
|
||||
|
44
src/Gang.js
44
src/Gang.js
@ -32,7 +32,7 @@ import {yesNoBoxCreate, yesNoTxtInpBoxCreate,
|
||||
|
||||
// Constants
|
||||
const GangRespectToReputationRatio = 2; // Respect is divided by this to get rep gain
|
||||
const MaximumGangMembers = 40;
|
||||
const MaximumGangMembers = 30;
|
||||
const GangRecruitCostMultiplier = 2;
|
||||
const CyclesPerTerritoryAndPowerUpdate = 100;
|
||||
const AscensionMultiplierRatio = 15 / 100; // Portion of upgrade multiplier that is kept after ascending
|
||||
@ -185,9 +185,9 @@ Gang.prototype.process = function(numCycles=1, player) {
|
||||
}
|
||||
this.storedCycles += numCycles;
|
||||
|
||||
// Only process if there are at least 3 seconds, and at most 10 seconds
|
||||
if (this.storedCycles < 3 * CyclesPerSecond);
|
||||
const cycles = Math.min(this.storedCycles, 10 * CyclesPerSecond);
|
||||
// Only process if there are at least 2 seconds, and at most 5 seconds
|
||||
if (this.storedCycles < 2 * CyclesPerSecond) { return; }
|
||||
const cycles = Math.min(this.storedCycles, 5 * CyclesPerSecond);
|
||||
|
||||
try {
|
||||
this.processGains(cycles, player);
|
||||
@ -271,7 +271,9 @@ Gang.prototype.processTerritoryAndPowerGains = function(numCycles=1) {
|
||||
const gainRoll = Math.random();
|
||||
if (gainRoll < 0.5) {
|
||||
// Multiplicative gain (50% chance)
|
||||
AllGangs[name].power *= 1.008;
|
||||
// This is capped per cycle, to prevent it from getting out of control
|
||||
const multiplicativeGain = AllGangs[name].power * 0.008;
|
||||
AllGangs[name].power += Math.min(1, multiplicativeGain);
|
||||
} else {
|
||||
// Additive gain (50% chance)
|
||||
const additiveGain = 0.5 * gainRoll * AllGangs[name].territory;
|
||||
@ -351,7 +353,7 @@ Gang.prototype.getRespectNeededToRecruitMember = function() {
|
||||
if (this.members.length < numFreeMembers) { return 0; }
|
||||
|
||||
const i = this.members.length - (numFreeMembers - 1);
|
||||
return Math.round(0.7 * Math.pow(i, 3) + 0.8 * Math.pow(i, 2));
|
||||
return Math.round(0.9 * Math.pow(i, 3) + Math.pow(i, 2));
|
||||
}
|
||||
|
||||
Gang.prototype.recruitMember = function(name) {
|
||||
@ -403,11 +405,11 @@ Gang.prototype.clash = function(won=false) {
|
||||
|
||||
// If the clash was lost, the player loses a small percentage of power
|
||||
if (!won) {
|
||||
AllGangs[this.facName].power *= (1 / 1.01);
|
||||
AllGangs[this.facName].power *= (1 / 1.008);
|
||||
}
|
||||
|
||||
// Deaths can only occur during X% of clashes
|
||||
if (Math.random() < 0.75) { return; }
|
||||
if (Math.random() < 0.65) { return; }
|
||||
|
||||
for (let i = this.members.length - 1; i >= 0; --i) {
|
||||
const member = this.members[i];
|
||||
@ -638,7 +640,7 @@ GangMember.prototype.calculateRespectGain = function(gang) {
|
||||
const territoryMult = Math.pow(AllGangs[gang.facName].territory * 100, task.territory.respect) / 100;
|
||||
if (isNaN(territoryMult) || territoryMult <= 0) { return 0; }
|
||||
var respectMult = gang.getWantedPenalty();
|
||||
return 12 * task.baseRespect * statWeight * territoryMult * respectMult;
|
||||
return 11 * task.baseRespect * statWeight * territoryMult * respectMult;
|
||||
}
|
||||
|
||||
GangMember.prototype.calculateWantedLevelGain = function(gang) {
|
||||
@ -655,9 +657,9 @@ GangMember.prototype.calculateWantedLevelGain = function(gang) {
|
||||
const territoryMult = Math.pow(AllGangs[gang.facName].territory * 100, task.territory.wanted) / 100;
|
||||
if (isNaN(territoryMult) || territoryMult <= 0) { return 0; }
|
||||
if (task.baseWanted < 0) {
|
||||
return task.baseWanted * statWeight * territoryMult;
|
||||
return 0.5 * task.baseWanted * statWeight * territoryMult;
|
||||
} else {
|
||||
return 6 * task.baseWanted / (3 * statWeight * territoryMult);
|
||||
return 7 * task.baseWanted / (3 * statWeight * territoryMult);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1010,12 +1012,12 @@ GangMember.prototype.createGangMemberUpgradePanel = function(gangObj, player) {
|
||||
var text = createElement("pre", {
|
||||
fontSize:"14px", display: "inline-block", width:"20%",
|
||||
innerText:
|
||||
"Hack: " + this.hack + " (x" + formatNumber(this.hack_mult, 2) + ")\n" +
|
||||
"Str: " + this.str + " (x" + formatNumber(this.str_mult, 2) + ")\n" +
|
||||
"Def: " + this.def + " (x" + formatNumber(this.def_mult, 2) + ")\n" +
|
||||
"Dex: " + this.dex + " (x" + formatNumber(this.dex_mult, 2) + ")\n" +
|
||||
"Agi: " + this.agi + " (x" + formatNumber(this.agi_mult, 2) + ")\n" +
|
||||
"Cha: " + this.cha + " (x" + formatNumber(this.cha_mult, 2) + ")\n",
|
||||
"Hack: " + this.hack + " (x" + formatNumber(this.hack_mult * this.hack_asc_mult, 2) + ")\n" +
|
||||
"Str: " + this.str + " (x" + formatNumber(this.str_mult * this.str_asc_mult, 2) + ")\n" +
|
||||
"Def: " + this.def + " (x" + formatNumber(this.def_mult * this.def_asc_mult, 2) + ")\n" +
|
||||
"Dex: " + this.dex + " (x" + formatNumber(this.dex_mult * this.dex_asc_mult, 2) + ")\n" +
|
||||
"Agi: " + this.agi + " (x" + formatNumber(this.agi_mult * this.agi_asc_mult, 2) + ")\n" +
|
||||
"Cha: " + this.cha + " (x" + formatNumber(this.cha_mult * this.cha_asc_mult, 2) + ")\n",
|
||||
});
|
||||
|
||||
//Already purchased upgrades
|
||||
@ -1253,7 +1255,8 @@ Gang.prototype.displayGangContent = function(player) {
|
||||
"task to lower your wanted level. <br><br>" +
|
||||
"Installing Augmentations does NOT reset your progress with your Gang. " +
|
||||
"Furthermore, after installing Augmentations, you will " +
|
||||
"automatically be a member of whatever Faction you created your gang with.<br><br>"
|
||||
"automatically be a member of whatever Faction you created your gang with.<br><br>" +
|
||||
"You can also manage your gang programmatically through Netscript using the Gang API"
|
||||
});
|
||||
UIElems.gangManagementSubpage.appendChild(UIElems.gangDesc);
|
||||
|
||||
@ -1392,7 +1395,8 @@ Gang.prototype.displayGangContent = function(player) {
|
||||
"to win a clash depends on your gang's power, which is listed in the display below. " +
|
||||
"Your gang's power slowly accumulates over time. The accumulation rate is determined by the stats " +
|
||||
"of all Gang members you have assigned to the 'Territory Warfare' task. Gang members that are not " +
|
||||
"assigned to this task do not contribute to your gang's power.<br><br>" +
|
||||
"assigned to this task do not contribute to your gang's power. Your gang also loses a small amount " +
|
||||
"of power whenever you lose a clash<br><br>" +
|
||||
"NOTE: Gang members assigned to 'Territory Warfare' can be killed during clashes. This can happen regardless of whether you win " +
|
||||
"or lose the clash. A gang member being killed results in both respect and power loss for your gang.<br><br>" +
|
||||
"The amount of territory you have affects all aspects of your Gang members' production, including " +
|
||||
@ -1615,7 +1619,7 @@ Gang.prototype.updateGangContent = function() {
|
||||
innerText: `Bonus time(s): ${this.storedCycles / CyclesPerSecond}`,
|
||||
display: "inline-block",
|
||||
tooltip: "You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by the browser). " +
|
||||
"Bonus time makes the Gang mechanic progress faster, up to 10x the normal speed",
|
||||
"Bonus time makes the Gang mechanic progress faster, up to 5x the normal speed",
|
||||
}));
|
||||
UIElems.gangInfo.appendChild(createElement("br"));
|
||||
} else {
|
||||
|
@ -3579,6 +3579,19 @@ function NetscriptFunctions(workerScript) {
|
||||
throw makeRuntimeRejectMsg(workerScript, nsGang.unknownGangApiExceptionMessage("getGangInformation", e));
|
||||
}
|
||||
},
|
||||
getOtherGangInformation : function() {
|
||||
if (workerScript.checkingRam) {
|
||||
return updateStaticRam("getOtherGangInformation", CONSTANTS.ScriptGangApiBaseRamCost / 2);
|
||||
}
|
||||
updateDynamicRam("getOtherGangInformation", CONSTANTS.ScriptGangApiBaseRamCost / 2);
|
||||
nsGang.checkGangApiAccess(workerScript, "getOtherGangInformation");
|
||||
|
||||
try {
|
||||
return Object.assign(AllGangs);
|
||||
} catch(e) {
|
||||
throw makeRuntimeRejectMsg(workerScript, nsGang.unknownGangApiExceptionMessage("getOtherGangInformation", e));
|
||||
}
|
||||
},
|
||||
getMemberInformation : function(name) {
|
||||
if (workerScript.checkingRam) {
|
||||
return updateStaticRam("getMemberInformation", CONSTANTS.ScriptGangApiBaseRamCost / 2);
|
||||
|
@ -113,7 +113,7 @@ export const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [
|
||||
isHacking: false,
|
||||
name: "Mug People",
|
||||
params: {
|
||||
baseRespect: 0.00005, baseWanted: 0.00001, baseMoney: 1.2,
|
||||
baseRespect: 0.00005, baseWanted: 0.00005, baseMoney: 1.2,
|
||||
strWeight: 25, defWeight: 25, dexWeight: 25, agiWeight: 10, chaWeight: 15,
|
||||
difficulty: 1,
|
||||
},
|
||||
@ -124,11 +124,11 @@ export const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [
|
||||
isHacking: false,
|
||||
name: "Deal Drugs",
|
||||
params: {
|
||||
baseRespect: 0.00006, baseWanted: 0.0015, baseMoney: 5,
|
||||
baseRespect: 0.00006, baseWanted: 0.002, baseMoney: 5,
|
||||
agiWeight: 20, dexWeight: 20, chaWeight: 60,
|
||||
difficulty: 3.5,
|
||||
territory: {
|
||||
money: 1.25,
|
||||
money: 1.2,
|
||||
respect: 1,
|
||||
wanted: 1.15,
|
||||
},
|
||||
@ -140,7 +140,7 @@ export const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [
|
||||
isHacking: false,
|
||||
name: "Strongarm Civilians",
|
||||
params: {
|
||||
baseRespect: 0.00004, baseWanted: 0.002, baseMoney: 2.5,
|
||||
baseRespect: 0.00004, baseWanted: 0.0035, baseMoney: 2.5,
|
||||
hackWeight: 10, strWeight: 25, defWeight: 25, dexWeight: 20, agiWeight: 10, chaWeight: 10,
|
||||
difficulty: 5,
|
||||
territory: {
|
||||
@ -156,7 +156,7 @@ export const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [
|
||||
isHacking: false,
|
||||
name: "Run a Con",
|
||||
params: {
|
||||
baseRespect: 0.00012, baseWanted: 0.015, baseMoney: 12.5,
|
||||
baseRespect: 0.00012, baseWanted: 0.04, baseMoney: 15,
|
||||
strWeight: 5, defWeight: 5, agiWeight: 25, dexWeight: 25, chaWeight: 40,
|
||||
difficulty: 14,
|
||||
},
|
||||
@ -167,7 +167,7 @@ export const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [
|
||||
isHacking: false,
|
||||
name: "Armed Robbery",
|
||||
params: {
|
||||
baseRespect: 0.00014, baseWanted: 0.075, baseMoney: 32,
|
||||
baseRespect: 0.00014, baseWanted: 0.08, baseMoney: 38,
|
||||
hackWeight: 20, strWeight: 15, defWeight: 15, agiWeight: 10, dexWeight: 20, chaWeight: 20,
|
||||
difficulty: 20,
|
||||
},
|
||||
@ -178,7 +178,7 @@ export const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [
|
||||
isHacking: false,
|
||||
name: "Traffick Illegal Arms",
|
||||
params: {
|
||||
baseRespect: 0.0002, baseWanted: 0.15, baseMoney: 50,
|
||||
baseRespect: 0.0002, baseWanted: 0.18, baseMoney: 58,
|
||||
hackWeight: 15, strWeight: 20, defWeight: 20, dexWeight: 20, chaWeight: 25,
|
||||
difficulty: 32,
|
||||
territory: {
|
||||
@ -194,7 +194,7 @@ export const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [
|
||||
isHacking: false,
|
||||
name: "Threaten & Blackmail",
|
||||
params: {
|
||||
baseRespect: 0.0002, baseWanted: 0.075, baseMoney: 20,
|
||||
baseRespect: 0.0002, baseWanted: 0.1, baseMoney: 24,
|
||||
hackWeight: 25, strWeight: 25, dexWeight: 25, chaWeight: 25,
|
||||
difficulty: 28,
|
||||
},
|
||||
@ -205,7 +205,7 @@ export const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [
|
||||
isHacking: false,
|
||||
name: "Human Trafficking",
|
||||
params: {
|
||||
baseRespect: 0.005, baseWanted: 0.3, baseMoney: 100,
|
||||
baseRespect: 0.005, baseWanted: 0.4, baseMoney: 120,
|
||||
hackWeight: 30, strWeight: 5, defWeight: 5, dexWeight: 30, chaWeight: 30,
|
||||
difficulty: 36,
|
||||
territory: {
|
||||
@ -221,7 +221,7 @@ export const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [
|
||||
isHacking: false,
|
||||
name: "Terrorism",
|
||||
params: {
|
||||
baseRespect: 0.001, baseWanted: 1.5,
|
||||
baseRespect: 0.01, baseWanted: 1.5,
|
||||
hackWeight: 20, strWeight: 20, defWeight: 20, dexWeight: 20, chaWeight: 20,
|
||||
difficulty: 36,
|
||||
territory: {
|
||||
|
Loading…
Reference in New Issue
Block a user