mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 06:18:42 +02:00
API: Expose gang's discount rate (#2272)
This commit is contained in:
@@ -30,3 +30,5 @@ RAM cost: 2 GB
|
||||
|
||||
Get the amount of money it takes to purchase a piece of Equipment or an Augmentation. If an invalid Equipment/Augmentation is specified, this function will return Infinity.
|
||||
|
||||
This function already takes equipmentCostMult from [GangGenInfo](./bitburner.ganggeninfo.md) into account.
|
||||
|
||||
|
||||
13
markdown/bitburner.ganggeninfo.equipmentcostmult.md
Normal file
13
markdown/bitburner.ganggeninfo.equipmentcostmult.md
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [GangGenInfo](./bitburner.ganggeninfo.md) > [equipmentCostMult](./bitburner.ganggeninfo.equipmentcostmult.md)
|
||||
|
||||
## GangGenInfo.equipmentCostMult property
|
||||
|
||||
Gang gives a discount on all equipment. This multiplier is applied to the equipment cost.
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
equipmentCostMult: number;
|
||||
```
|
||||
@@ -16,6 +16,7 @@ interface GangGenInfo
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| [equipmentCostMult](./bitburner.ganggeninfo.equipmentcostmult.md) | | number | Gang gives a discount on all equipment. This multiplier is applied to the equipment cost. |
|
||||
| [faction](./bitburner.ganggeninfo.faction.md) | | string | Name of faction that the gang belongs to ("Slum Snakes", etc.) |
|
||||
| [isHacking](./bitburner.ganggeninfo.ishacking.md) | | boolean | Indicating whether or not it's a hacking gang |
|
||||
| [moneyGainRate](./bitburner.ganggeninfo.moneygainrate.md) | | number | Money earned per game cycle |
|
||||
|
||||
@@ -519,6 +519,7 @@ import nsDoc_bitburner_gangformulas_moneygain_md from "../../markdown/bitburner.
|
||||
import nsDoc_bitburner_gangformulas_respectgain_md from "../../markdown/bitburner.gangformulas.respectgain.md?raw";
|
||||
import nsDoc_bitburner_gangformulas_wantedlevelgain_md from "../../markdown/bitburner.gangformulas.wantedlevelgain.md?raw";
|
||||
import nsDoc_bitburner_gangformulas_wantedpenalty_md from "../../markdown/bitburner.gangformulas.wantedpenalty.md?raw";
|
||||
import nsDoc_bitburner_ganggeninfo_equipmentcostmult_md from "../../markdown/bitburner.ganggeninfo.equipmentcostmult.md?raw";
|
||||
import nsDoc_bitburner_ganggeninfo_faction_md from "../../markdown/bitburner.ganggeninfo.faction.md?raw";
|
||||
import nsDoc_bitburner_ganggeninfo_ishacking_md from "../../markdown/bitburner.ganggeninfo.ishacking.md?raw";
|
||||
import nsDoc_bitburner_ganggeninfo_md from "../../markdown/bitburner.ganggeninfo.md?raw";
|
||||
@@ -2021,6 +2022,7 @@ AllPages["nsDoc/bitburner.gangformulas.moneygain.md"] = nsDoc_bitburner_gangform
|
||||
AllPages["nsDoc/bitburner.gangformulas.respectgain.md"] = nsDoc_bitburner_gangformulas_respectgain_md;
|
||||
AllPages["nsDoc/bitburner.gangformulas.wantedlevelgain.md"] = nsDoc_bitburner_gangformulas_wantedlevelgain_md;
|
||||
AllPages["nsDoc/bitburner.gangformulas.wantedpenalty.md"] = nsDoc_bitburner_gangformulas_wantedpenalty_md;
|
||||
AllPages["nsDoc/bitburner.ganggeninfo.equipmentcostmult.md"] = nsDoc_bitburner_ganggeninfo_equipmentcostmult_md;
|
||||
AllPages["nsDoc/bitburner.ganggeninfo.faction.md"] = nsDoc_bitburner_ganggeninfo_faction_md;
|
||||
AllPages["nsDoc/bitburner.ganggeninfo.ishacking.md"] = nsDoc_bitburner_ganggeninfo_ishacking_md;
|
||||
AllPages["nsDoc/bitburner.ganggeninfo.md"] = nsDoc_bitburner_ganggeninfo_md;
|
||||
|
||||
@@ -231,7 +231,7 @@ export function EquipmentsSubpage(): React.ReactElement {
|
||||
</Typography>
|
||||
}
|
||||
>
|
||||
<Typography sx={{ m: 1 }}>Discount: -{formatPercent(1 - 1 / gang.getDiscount())}</Typography>
|
||||
<Typography sx={{ m: 1 }}>Discount: {formatPercent(1 - 1 / gang.getDiscount())}</Typography>
|
||||
</Tooltip>
|
||||
|
||||
<TextField
|
||||
|
||||
@@ -113,6 +113,7 @@ export function NetscriptGang(): InternalAPI<IGang> {
|
||||
wantedLevel: gang.wanted,
|
||||
wantedLevelGainRate: gang.wantedGainRate,
|
||||
wantedPenalty: gang.getWantedPenalty(),
|
||||
equipmentCostMult: 1 / gang.getDiscount(),
|
||||
};
|
||||
},
|
||||
getOtherGangInformation: (ctx) => () => {
|
||||
|
||||
4
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
4
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@@ -866,6 +866,8 @@ interface GangGenInfo {
|
||||
territoryWarfareEngaged: boolean;
|
||||
/** Number indicating the current wanted penalty */
|
||||
wantedPenalty: number;
|
||||
/** Gang gives a discount on all equipment. This multiplier is applied to the equipment cost. */
|
||||
equipmentCostMult: number;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
@@ -4329,6 +4331,8 @@ export interface Gang {
|
||||
* Get the amount of money it takes to purchase a piece of Equipment or an Augmentation.
|
||||
* If an invalid Equipment/Augmentation is specified, this function will return Infinity.
|
||||
*
|
||||
* This function already takes equipmentCostMult from {@link GangGenInfo | GangGenInfo} into account.
|
||||
*
|
||||
* @param equipName - Name of equipment.
|
||||
* @returns Cost to purchase the specified Equipment/Augmentation (number). Infinity for invalid arguments
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user