mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-09 17:23:53 +01:00
gang.getEquipmentStats added, returns equipment multipliers
This commit is contained in:
parent
1d2136da4b
commit
84423e6309
17
doc/source/netscript/gangapi/getEquipmentStats.rst
Normal file
17
doc/source/netscript/gangapi/getEquipmentStats.rst
Normal file
@ -0,0 +1,17 @@
|
||||
getEquipmentStats() Netscript Function
|
||||
=====================================
|
||||
|
||||
.. js:function:: getEquipmentStats(equipName)
|
||||
|
||||
:RAM cost: 2 GB
|
||||
|
||||
:param string equipName: Name of equipment
|
||||
|
||||
:returns: A dictionary containing the stats of the equipment.
|
||||
|
||||
Get the specified equipment stats.
|
||||
|
||||
{
|
||||
"str":1.04,
|
||||
"def":1.04
|
||||
}
|
@ -6,7 +6,7 @@
|
||||
import { IMap } from "./types";
|
||||
|
||||
export let CONSTANTS: IMap<any> = {
|
||||
Version: "0.48.0",
|
||||
Version: "0.49.0",
|
||||
|
||||
/** Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience
|
||||
* and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then
|
||||
@ -231,6 +231,9 @@ export let CONSTANTS: IMap<any> = {
|
||||
v0.49.0
|
||||
-------
|
||||
|
||||
Netscript
|
||||
* 'gang.getEquipmentStats' returns the stats of the equipment.
|
||||
|
||||
Misc.
|
||||
* Minor formatting under Hacking>Active Scripts
|
||||
`
|
||||
|
@ -981,7 +981,7 @@ GangMemberUpgrade.fromJSON = function(value) {
|
||||
Reviver.constructors.GangMemberUpgrade = GangMemberUpgrade;
|
||||
|
||||
// Initialize Gang Member Upgrades
|
||||
const GangMemberUpgrades = {}
|
||||
export const GangMemberUpgrades = {}
|
||||
|
||||
function addGangMemberUpgrade(name, cost, type, mults) {
|
||||
GangMemberUpgrades[name] = new GangMemberUpgrade(name, cost, type, mults);
|
||||
|
@ -220,6 +220,7 @@ export const RamCosts: IMap<any> = {
|
||||
getEquipmentNames: () => RamCostConstants.ScriptGangApiBaseRamCost / 4,
|
||||
getEquipmentCost: () => RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
||||
getEquipmentType: () => RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
||||
getEquipmentStats: () => RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
||||
purchaseEquipment: () => RamCostConstants.ScriptGangApiBaseRamCost,
|
||||
ascendMember: () => RamCostConstants.ScriptGangApiBaseRamCost,
|
||||
setTerritoryWarfare: () => RamCostConstants.ScriptGangApiBaseRamCost / 2,
|
||||
|
@ -29,7 +29,7 @@ import {
|
||||
calculateGrowTime,
|
||||
calculateWeakenTime
|
||||
} from "./Hacking";
|
||||
import { AllGangs } from "./Gang";
|
||||
import { AllGangs, GangMemberUpgrades } from "./Gang";
|
||||
import { Faction } from "./Faction/Faction";
|
||||
import { Factions, factionExists } from "./Faction/Factions";
|
||||
import { joinFaction, purchaseAugmentation } from "./Faction/FactionHelpers";
|
||||
@ -3742,6 +3742,16 @@ function NetscriptFunctions(workerScript) {
|
||||
throw makeRuntimeRejectMsg(workerScript, nsGang.unknownGangApiExceptionMessage("getEquipmentType", e));
|
||||
}
|
||||
},
|
||||
getEquipmentStats: function(equipName) {
|
||||
updateDynamicRam("getEquipmentStats", getRamCost("gang", "getEquipmentStats"));
|
||||
nsGang.checkGangApiAccess(workerScript, "getEquipmentStats");
|
||||
|
||||
const equipment = GangMemberUpgrades[equipName];
|
||||
if (!equipment) {
|
||||
throw makeRuntimeRejectMsg(workerScript, nsGang.unknownGangApiExceptionMessage("getEquipmentStats", `${equipName} does not exists`));
|
||||
}
|
||||
return Object.assign({}, equipment.mults);
|
||||
},
|
||||
purchaseEquipment: function(memberName, equipName) {
|
||||
updateDynamicRam("purchaseEquipment", getRamCost("gang", "purchaseEquipment"));
|
||||
nsGang.checkGangApiAccess(workerScript, "purchaseEquipment");
|
||||
|
@ -110,7 +110,7 @@ let NetscriptFunctions =
|
||||
"getMemberNames|getGangInformation|getMemberInformation|canRecruitMember|" +
|
||||
"recruitMember|getTaskNames|setMemberTask|getEquipmentNames|" +
|
||||
"getEquipmentCost|getEquipmentType|purchaseEquipment|ascendMember|" +
|
||||
"setTerritoryWarfare|" +
|
||||
"setTerritoryWarfare|getEquipmentStats|" +
|
||||
"getChanceToWinClash|getBonusTime|" +
|
||||
|
||||
// Bladeburner API
|
||||
|
Loading…
Reference in New Issue
Block a user