bitburner-src/doc/source/v2.0.0_migration.rst

110 lines
3.8 KiB
ReStructuredText
Raw Normal View History

2022-07-26 14:08:51 +02:00
v2.0.0 Migration Guide
======================
In v2.0.0 a few more APIs have been broken.
2022-07-26 14:08:51 +02:00
Working
-------
Working has been rebuilt from the ground up. The motivation for this change is that all
2022-07-26 14:08:51 +02:00
different types of work all required different cached variables on the main Player object.
This caused a lot of bugs and crashes. It's been reworked in such a way as to prevent bugs
and make it nearly trivial to add new kinds of work.
All work types give their reward immediately. No need to stop work to bank rewards like reputation.
2022-07-26 14:08:51 +02:00
Faction and Company work no longer have a time limit.
Company work no longer reduces rep gain by half for quitting early.
Company factions now require 400k rep to join (up from 200k).
Backdooring a company server reduces faction requirement to 300k.
2022-07-26 14:08:51 +02:00
All types of work generally no longer keep track of cumulative gains like exp and reputation since it's applied instantly.
commitCrime
-----------
Crime now loops, meaning after finishing one shoplift you start the next one with no input. While the signature
has not changed, its behavior has. It also has a new 'focus' parameter.
2022-07-26 14:08:51 +02:00
getPlayer
---------
The following work-related fields are no longer included:
2022-07-26 14:08:51 +02:00
* workChaExpGained
* currentWorkFactionName
* workDexExpGained
* workHackExpGained
* createProgramReqLvl
* workStrExpGained
* companyName
* crimeType
* workRepGained
* workChaExpGainRate
* workType
* workStrExpGainRate
* isWorking
* workRepGainRate
* workDefExpGained
* currentWorkFactionDescription
* workHackExpGainRate
* workAgiExpGainRate
* workDexExpGainRate
* workMoneyGained
* workMoneyLossRate
* workMoneyGainRate
* createProgramName
* workDefExpGainRate
* workAgiExpGained
* className
The reason for this, is that these fields are all, in one way or another, included in the new work field 'currentWork'.
2022-07-26 14:08:51 +02:00
Some of these values are also irrelevant.
Take a look at the new singularity.getCurrentWork function:
2022-07-26 14:08:51 +02:00
All fields ending in _mult have been moved to the 'mults' struct.
For example: getPlayer().hacking_skill_mult => getPlayer().mults.hacking_skill
skills has been moved to the skills struct
For example: getPlayer().hacking => getPlayer().skills.hacking
exp has been moved to the exp struct
For example: getPlayer().hacking_exp => getPlayer().exp.hacking
hp has been moved to the hp struct
For example: getPlayer().max_hp => getPlayer().hp.max or hp.current
2022-07-26 14:08:51 +02:00
hasWseAccount, hasTixApiAccess, has4SData, has4SDataTixApi have been removed and replaced with similar stock functions.
2022-07-28 20:35:55 +02:00
2022-07-26 14:08:51 +02:00
workForCompany
--------------
The argument 'companyName' is now required.
2022-07-26 14:08:51 +02:00
getScriptIncome & getScriptExpGain
----------------------------------
These two functions used to have a call where, if no arguments were provided, it would return the total for all scripts. This caused weird signature.
If you want to get the total income/exp for all scripts, use the new getTotalScriptIncome / getTotalScriptExpGain instead.
2022-07-26 14:08:51 +02:00
scp
---
The last two arguments of spc have been reversed. The signature is now scp(files, destination, optional_source)
2022-07-26 14:08:51 +02:00
Singularity
-----------
The top level singularity functions were deprecated a while ago in favor of the singularity namespace.
2022-07-26 14:08:51 +02:00
This means calls like 'ns.connect' need to be changed to 'ns.singularity.connect'
2022-07-28 08:46:34 +02:00
stock.buy, stock.sell, stock.short
----------------------------------
2022-07-28 08:46:34 +02:00
These functions were renamed to stock.buyStock, stock.sellStock, and stock.buyShort because 'buy', 'sell', and 'short'
are very common tokens that would trick the ram calculation.
corporation.bribe
-----------------
The ability to give shares as a bribe has been removed. The signature is now bribe(faction, money)