Merge pull request #201 from danielyxie/dev

Fixed various bugs in v0.35.0 with prestiging
This commit is contained in:
danielyxie 2018-03-03 17:59:30 -06:00 committed by GitHub
commit d294ba6180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 811 additions and 617 deletions

1135
dist/bundle.js vendored

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -139,19 +139,49 @@ getStats
Returns an object with the Player's stats. The object has the following properties::
Player.hacking
Player.strength
Player.defense
Player.dexterity
Player.agility
Player.charisma
Player.intelligence
{
hacking
strength
defense
dexterity
agility
charisma
intelligence
}
Example::
res = getStats();
print('My charisma level is: ' + res.charisma);
getCharacterInformation
-----------------------
If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to run this function.
Returns an object with various information about your character. The object has the following properties::
{
bitnode: Current BitNode number
company: Name of company
jobTitle: Name of job
city: Name of city you are currently in
factions: Array of factions you are currently a member of
tor: Boolean indicating whether or not you have a tor router
//The following apply to when the character is performing
//some type of working action, such as working for a company/faction
timeWorked: Timed worked in ms
workHackExpGain: Hacking experience earned so far from work
workStrExpGain: Str experience earned so far from work
workDefExpGain: Def experience earned so far from work
workDexExpGain: Dex experience earned so far from work
workAgiExpGain: Agi experience earned so far from work
workChaExpGain: Cha experience earned so far from work
workRepGain: Reputation earned so far from work, if applicable
workMoneyGain: Money earned so far from work, if applicable
}
isBusy
------
@ -270,6 +300,18 @@ getCompanyRep
This function will return the amount of reputation you have at the specified company.
If the company passed in as an argument is invalid, -1 will be returned.
getCompanyFavor
---------------
.. js:function:: getCompanyFavor(companyName)
:param string companyName: Name of the company. CASE-SENSITIVE
If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function.
This function will return the amount of favor you have at the specified company.
If the company passed in as an argument is invalid, -1 will be returned.
checkFactionInvitations
-----------------------
@ -334,6 +376,17 @@ getFactionRep
This function returns the amount of reputation you have for the specified faction.
getFactionFavor
---------------
.. js:function:: getFactionFavor(factionName)
:param string factionName: Name of faction. CASE-SENSITIVE
If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function.
This function returns the amount of favor you have for the specified faction.
createProgram
-------------

@ -156,10 +156,14 @@
<li><a href="netscriptsingularityfunctions.html#getAugmentationsFromFaction">getAugmentationsFromFaction() (built-in function)</a>
</li>
<li><a href="netscriptadvancedfunctions.html#getBitNodeMultipliers">getBitNodeMultipliers() (built-in function)</a>
</li>
<li><a href="netscriptsingularityfunctions.html#getCompanyFavor">getCompanyFavor() (built-in function)</a>
</li>
<li><a href="netscriptsingularityfunctions.html#getCompanyRep">getCompanyRep() (built-in function)</a>
</li>
<li><a href="netscriptsingularityfunctions.html#getCrimeChance">getCrimeChance() (built-in function)</a>
</li>
<li><a href="netscriptsingularityfunctions.html#getFactionFavor">getFactionFavor() (built-in function)</a>
</li>
<li><a href="netscriptsingularityfunctions.html#getFactionRep">getFactionRep() (built-in function)</a>
</li>
@ -182,11 +186,11 @@
<li><a href="netscriptfunctions.html#getScriptExpGain">getScriptExpGain() (built-in function)</a>
</li>
<li><a href="netscriptfunctions.html#getScriptIncome">getScriptIncome() (built-in function)</a>
</li>
<li><a href="netscriptfunctions.html#getScriptRam">getScriptRam() (built-in function)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="netscriptfunctions.html#getScriptRam">getScriptRam() (built-in function)</a>
</li>
<li><a href="netscriptfunctions.html#getServerBaseSecurityLevel">getServerBaseSecurityLevel() (built-in function)</a>
</li>
<li><a href="netscriptfunctions.html#getServerGrowth">getServerGrowth() (built-in function)</a>

@ -174,6 +174,7 @@ secrets that you've been searching for.</p>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#purchasetor">purchaseTor</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#purchaseprogram">purchaseProgram</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#getstats">getStats</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#getcharacterinformation">getCharacterInformation</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#isbusy">isBusy</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#stopaction">stopAction</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#upgradehomeram">upgradeHomeRam</a></li>
@ -181,10 +182,12 @@ secrets that you've been searching for.</p>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#workforcompany">workForCompany</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#applytocompany">applyToCompany</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#getcompanyrep">getCompanyRep</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#getcompanyfavor">getCompanyFavor</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#checkfactioninvitations">checkFactionInvitations</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#joinfaction">joinFaction</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#workforfaction">workForFaction</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#getfactionrep">getFactionRep</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#getfactionfavor">getFactionFavor</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#createprogram">createProgram</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#commitcrime">commitCrime</a></li>
<li class="toctree-l3"><a class="reference internal" href="netscriptsingularityfunctions.html#getcrimechance">getCrimeChance</a></li>

@ -175,6 +175,7 @@ to reach out to the developer!</p>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#purchasetor">purchaseTor</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#purchaseprogram">purchaseProgram</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#getstats">getStats</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#getcharacterinformation">getCharacterInformation</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#isbusy">isBusy</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#stopaction">stopAction</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#upgradehomeram">upgradeHomeRam</a></li>
@ -182,10 +183,12 @@ to reach out to the developer!</p>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#workforcompany">workForCompany</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#applytocompany">applyToCompany</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#getcompanyrep">getCompanyRep</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#getcompanyfavor">getCompanyFavor</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#checkfactioninvitations">checkFactionInvitations</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#joinfaction">joinFaction</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#workforfaction">workForFaction</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#getfactionrep">getFactionRep</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#getfactionfavor">getFactionFavor</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#createprogram">createProgram</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#commitcrime">commitCrime</a></li>
<li class="toctree-l2"><a class="reference internal" href="netscriptsingularityfunctions.html#getcrimechance">getCrimeChance</a></li>

@ -223,13 +223,15 @@ Terminal <em>buy</em> command.</p>
<code class="descname">getStats</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#getStats" title="Permalink to this definition"></a></dt>
<dd><p>If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to run this function.</p>
<p>Returns an object with the Player's stats. The object has the following properties:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">Player</span><span class="o">.</span><span class="n">hacking</span>
<span class="n">Player</span><span class="o">.</span><span class="n">strength</span>
<span class="n">Player</span><span class="o">.</span><span class="n">defense</span>
<span class="n">Player</span><span class="o">.</span><span class="n">dexterity</span>
<span class="n">Player</span><span class="o">.</span><span class="n">agility</span>
<span class="n">Player</span><span class="o">.</span><span class="n">charisma</span>
<span class="n">Player</span><span class="o">.</span><span class="n">intelligence</span>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="n">hacking</span>
<span class="n">strength</span>
<span class="n">defense</span>
<span class="n">dexterity</span>
<span class="n">agility</span>
<span class="n">charisma</span>
<span class="n">intelligence</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Example:</p>
@ -239,6 +241,35 @@ Terminal <em>buy</em> command.</p>
</div>
</dd></dl>
</div>
<div class="section" id="getcharacterinformation">
<h2>getCharacterInformation<a class="headerlink" href="#getcharacterinformation" title="Permalink to this headline"></a></h2>
<blockquote>
<div><p>If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to run this function.</p>
<p>Returns an object with various information about your character. The object has the following properties:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="n">bitnode</span><span class="p">:</span> <span class="n">Current</span> <span class="n">BitNode</span> <span class="n">number</span>
<span class="n">company</span><span class="p">:</span> <span class="n">Name</span> <span class="n">of</span> <span class="n">company</span>
<span class="n">jobTitle</span><span class="p">:</span> <span class="n">Name</span> <span class="n">of</span> <span class="n">job</span>
<span class="n">city</span><span class="p">:</span> <span class="n">Name</span> <span class="n">of</span> <span class="n">city</span> <span class="n">you</span> <span class="n">are</span> <span class="n">currently</span> <span class="ow">in</span>
<span class="n">factions</span><span class="p">:</span> <span class="n">Array</span> <span class="n">of</span> <span class="n">factions</span> <span class="n">you</span> <span class="n">are</span> <span class="n">currently</span> <span class="n">a</span> <span class="n">member</span> <span class="n">of</span>
<span class="n">tor</span><span class="p">:</span> <span class="n">Boolean</span> <span class="n">indicating</span> <span class="n">whether</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">you</span> <span class="n">have</span> <span class="n">a</span> <span class="n">tor</span> <span class="n">router</span>
<span class="o">//</span><span class="n">The</span> <span class="n">following</span> <span class="n">apply</span> <span class="n">to</span> <span class="n">when</span> <span class="n">the</span> <span class="n">character</span> <span class="ow">is</span> <span class="n">performing</span>
<span class="o">//</span><span class="n">some</span> <span class="nb">type</span> <span class="n">of</span> <span class="n">working</span> <span class="n">action</span><span class="p">,</span> <span class="n">such</span> <span class="k">as</span> <span class="n">working</span> <span class="k">for</span> <span class="n">a</span> <span class="n">company</span><span class="o">/</span><span class="n">faction</span>
<span class="n">timeWorked</span><span class="p">:</span> <span class="n">Timed</span> <span class="n">worked</span> <span class="ow">in</span> <span class="n">ms</span>
<span class="n">workHackExpGain</span><span class="p">:</span> <span class="n">Hacking</span> <span class="n">experience</span> <span class="n">earned</span> <span class="n">so</span> <span class="n">far</span> <span class="kn">from</span> <span class="nn">work</span>
<span class="n">workStrExpGain</span><span class="p">:</span> <span class="n">Str</span> <span class="n">experience</span> <span class="n">earned</span> <span class="n">so</span> <span class="n">far</span> <span class="kn">from</span> <span class="nn">work</span>
<span class="n">workDefExpGain</span><span class="p">:</span> <span class="n">Def</span> <span class="n">experience</span> <span class="n">earned</span> <span class="n">so</span> <span class="n">far</span> <span class="kn">from</span> <span class="nn">work</span>
<span class="n">workDexExpGain</span><span class="p">:</span> <span class="n">Dex</span> <span class="n">experience</span> <span class="n">earned</span> <span class="n">so</span> <span class="n">far</span> <span class="kn">from</span> <span class="nn">work</span>
<span class="n">workAgiExpGain</span><span class="p">:</span> <span class="n">Agi</span> <span class="n">experience</span> <span class="n">earned</span> <span class="n">so</span> <span class="n">far</span> <span class="kn">from</span> <span class="nn">work</span>
<span class="n">workChaExpGain</span><span class="p">:</span> <span class="n">Cha</span> <span class="n">experience</span> <span class="n">earned</span> <span class="n">so</span> <span class="n">far</span> <span class="kn">from</span> <span class="nn">work</span>
<span class="n">workRepGain</span><span class="p">:</span> <span class="n">Reputation</span> <span class="n">earned</span> <span class="n">so</span> <span class="n">far</span> <span class="kn">from</span> <span class="nn">work</span><span class="p">,</span> <span class="k">if</span> <span class="n">applicable</span>
<span class="n">workMoneyGain</span><span class="p">:</span> <span class="n">Money</span> <span class="n">earned</span> <span class="n">so</span> <span class="n">far</span> <span class="kn">from</span> <span class="nn">work</span><span class="p">,</span> <span class="k">if</span> <span class="n">applicable</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</div>
<div class="section" id="isbusy">
<h2>isBusy<a class="headerlink" href="#isbusy" title="Permalink to this headline"></a></h2>
@ -379,6 +410,28 @@ if you are trying to use this function to apply for a promotion and you don't ge
If the company passed in as an argument is invalid, -1 will be returned.</p>
</dd></dl>
</div>
<div class="section" id="getcompanyfavor">
<h2>getCompanyFavor<a class="headerlink" href="#getcompanyfavor" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="getCompanyFavor">
<code class="descname">getCompanyFavor</code><span class="sig-paren">(</span><em>companyName</em><span class="sig-paren">)</span><a class="headerlink" href="#getCompanyFavor" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Arguments:</th><td class="field-body"><ul class="first last simple">
<li><strong>companyName</strong> (<em>string</em>) -- Name of the company. CASE-SENSITIVE</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function.</p>
<p>This function will return the amount of favor you have at the specified company.
If the company passed in as an argument is invalid, -1 will be returned.</p>
</dd></dl>
</div>
<div class="section" id="checkfactioninvitations">
<h2>checkFactionInvitations<a class="headerlink" href="#checkfactioninvitations" title="Permalink to this headline"></a></h2>
@ -473,6 +526,27 @@ reputation. One small hack to get around this is to continuously restart the act
<p>This function returns the amount of reputation you have for the specified faction.</p>
</dd></dl>
</div>
<div class="section" id="getfactionfavor">
<h2>getFactionFavor<a class="headerlink" href="#getfactionfavor" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="getFactionFavor">
<code class="descname">getFactionFavor</code><span class="sig-paren">(</span><em>factionName</em><span class="sig-paren">)</span><a class="headerlink" href="#getFactionFavor" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Arguments:</th><td class="field-body"><ul class="first last simple">
<li><strong>factionName</strong> (<em>string</em>) -- Name of faction. CASE-SENSITIVE</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function.</p>
<p>This function returns the amount of favor you have for the specified faction.</p>
</dd></dl>
</div>
<div class="section" id="createprogram">
<h2>createProgram<a class="headerlink" href="#createprogram" title="Permalink to this headline"></a></h2>
@ -678,6 +752,7 @@ This script will be run with no arguments and 1 thread. It must be located on yo
<li class="toctree-l3"><a class="reference internal" href="#purchasetor">purchaseTor</a></li>
<li class="toctree-l3"><a class="reference internal" href="#purchaseprogram">purchaseProgram</a></li>
<li class="toctree-l3"><a class="reference internal" href="#getstats">getStats</a></li>
<li class="toctree-l3"><a class="reference internal" href="#getcharacterinformation">getCharacterInformation</a></li>
<li class="toctree-l3"><a class="reference internal" href="#isbusy">isBusy</a></li>
<li class="toctree-l3"><a class="reference internal" href="#stopaction">stopAction</a></li>
<li class="toctree-l3"><a class="reference internal" href="#upgradehomeram">upgradeHomeRam</a></li>
@ -685,10 +760,12 @@ This script will be run with no arguments and 1 thread. It must be located on yo
<li class="toctree-l3"><a class="reference internal" href="#workforcompany">workForCompany</a></li>
<li class="toctree-l3"><a class="reference internal" href="#applytocompany">applyToCompany</a></li>
<li class="toctree-l3"><a class="reference internal" href="#getcompanyrep">getCompanyRep</a></li>
<li class="toctree-l3"><a class="reference internal" href="#getcompanyfavor">getCompanyFavor</a></li>
<li class="toctree-l3"><a class="reference internal" href="#checkfactioninvitations">checkFactionInvitations</a></li>
<li class="toctree-l3"><a class="reference internal" href="#joinfaction">joinFaction</a></li>
<li class="toctree-l3"><a class="reference internal" href="#workforfaction">workForFaction</a></li>
<li class="toctree-l3"><a class="reference internal" href="#getfactionrep">getFactionRep</a></li>
<li class="toctree-l3"><a class="reference internal" href="#getfactionfavor">getFactionFavor</a></li>
<li class="toctree-l3"><a class="reference internal" href="#createprogram">createProgram</a></li>
<li class="toctree-l3"><a class="reference internal" href="#commitcrime">commitCrime</a></li>
<li class="toctree-l3"><a class="reference internal" href="#getcrimechance">getCrimeChance</a></li>

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -139,19 +139,49 @@ getStats
Returns an object with the Player's stats. The object has the following properties::
Player.hacking
Player.strength
Player.defense
Player.dexterity
Player.agility
Player.charisma
Player.intelligence
{
hacking
strength
defense
dexterity
agility
charisma
intelligence
}
Example::
res = getStats();
print('My charisma level is: ' + res.charisma);
getCharacterInformation
-----------------------
If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to run this function.
Returns an object with various information about your character. The object has the following properties::
{
bitnode: Current BitNode number
company: Name of company
jobTitle: Name of job
city: Name of city you are currently in
factions: Array of factions you are currently a member of
tor: Boolean indicating whether or not you have a tor router
//The following apply to when the character is performing
//some type of working action, such as working for a company/faction
timeWorked: Timed worked in ms
workHackExpGain: Hacking experience earned so far from work
workStrExpGain: Str experience earned so far from work
workDefExpGain: Def experience earned so far from work
workDexExpGain: Dex experience earned so far from work
workAgiExpGain: Agi experience earned so far from work
workChaExpGain: Cha experience earned so far from work
workRepGain: Reputation earned so far from work, if applicable
workMoneyGain: Money earned so far from work, if applicable
}
isBusy
------
@ -270,6 +300,18 @@ getCompanyRep
This function will return the amount of reputation you have at the specified company.
If the company passed in as an argument is invalid, -1 will be returned.
getCompanyFavor
---------------
.. js:function:: getCompanyFavor(companyName)
:param string companyName: Name of the company. CASE-SENSITIVE
If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function.
This function will return the amount of favor you have at the specified company.
If the company passed in as an argument is invalid, -1 will be returned.
checkFactionInvitations
-----------------------
@ -334,6 +376,17 @@ getFactionRep
This function returns the amount of reputation you have for the specified faction.
getFactionFavor
---------------
.. js:function:: getFactionFavor(factionName)
:param string factionName: Name of faction. CASE-SENSITIVE
If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function.
This function returns the amount of favor you have for the specified faction.
createProgram
-------------

@ -1,5 +1,6 @@
import {BitNodeMultipliers} from "./BitNode.js";
import {Engine} from "./engine.js";
import {Factions} from "./Faction.js";
import {showLiterature} from "./Literature.js";
import {Locations} from "./Location.js";
import {Player} from "./Player.js";
@ -3522,21 +3523,20 @@ Corporation.prototype.displayCorporationOverviewContent = function() {
innerText:"You can use Corporation funds or stock shares to bribe Faction Leaders in exchange for faction reputation"
});
var factionSelector = createElement("select", {margin:"3px"});
for (var facName in Player.factions) {
if (Player.factions.hasOwnProperty(facName)) {
factionSelector.add(createElement("option"), {
text:facName, value:facName
});
}
for (var i = 0; i < Player.factions.length; ++i) {
var facName = Player.factions[i];
factionSelector.add(createElement("option", {
text:facName, value:facName
}));
}
var repGainText = createElement("p");
var stockSharesInput;
var moneyInput = createElement("input", {
type:"number", placeholder:"Corporation funds", margin:"5px",
inputListener:()=>{
var money = moneyInput.value == null ? 0 : moneyInput.value;
var money = moneyInput.value == null || moneyInput.value == "" ? 0 : parseFloat(moneyInput.value);
var stockPrice = this.sharePrice;
var stockShares = stockSharesInput.value == null ? 0 : Math.round(stockSharesInput.value);
var stockShares = stockSharesInput.value == null || stockSharesInput.value == "" ? 0 : Math.round(parseFloat(stockSharesInput.value));
if (isNaN(money) || isNaN(stockShares) || money < 0 || stockShares < 0) {
repGainText.innerText = "ERROR: Invalid value(s) entered";
} else if (this.funds.lt(money)) {
@ -3544,7 +3544,8 @@ Corporation.prototype.displayCorporationOverviewContent = function() {
} else if (this.stockShares > this.numShares) {
repGainText.innerText = "ERROR: You do not have this many shares to bribe with";
} else {
var totalAmount = money + (stockShares * stockPrice);
var totalAmount = Number(money) + (stockShares * stockPrice);
var repGain = totalAmount / BribeToRepRatio;
repGainText.innerText = "You will gain " + formatNumber(repGain, 0) +
" reputation with " +
@ -3556,9 +3557,9 @@ Corporation.prototype.displayCorporationOverviewContent = function() {
stockSharesInput = createElement("input", {
type:"number", placeholder:"Stock Shares", margin: "5px",
inputListener:()=>{
var money = moneyInput.value == null ? 0 : moneyInput.value;
var money = moneyInput.value == null || moneyInput.value == "" ? 0 : moneyInput.value;
var stockPrice = this.sharePrice;
var stockShares = stockSharesInput.value == null ? 0 : Math.round(stockSharesInput.value);
var stockShares = stockSharesInput.value == null || stockSharesInput.value == "" ? 0 : Math.round(stockSharesInput.value);
if (isNaN(money) || isNaN(stockShares) || money < 0 || stockShares < 0) {
repGainText.innerText = "ERROR: Invalid value(s) entered";
} else if (this.funds.lt(money)) {
@ -3568,6 +3569,7 @@ Corporation.prototype.displayCorporationOverviewContent = function() {
} else {
var totalAmount = money + (stockShares * stockPrice);
var repGain = totalAmount / BribeToRepRatio;
console.log("repGain: " + repGain);
repGainText.innerText = "You will gain " + formatNumber(repGain, 0) +
" reputation with " +
factionSelector.options[factionSelector.selectedIndex].value +
@ -3578,9 +3580,9 @@ Corporation.prototype.displayCorporationOverviewContent = function() {
var confirmButton = createElement("a", {
class:"a-link-button", innerText:"Bribe", display:"inline-block",
clickListener:()=>{
var money = moneyInput.value == null ? 0 : moneyInput.value;
var money = moneyInput.value == null || moneyInput.value == "" ? 0 : parseFloat(moneyInput.value);
var stockPrice = this.sharePrice;
var stockShares = stockSharesInput.value == null ? 0 : Math.round(stockSharesInput.value);
var stockShares = stockSharesInput.value == null || stockSharesInput.value == ""? 0 : Math.round(parseFloat(stockSharesInput.value));
var fac = Factions[factionSelector.options[factionSelector.selectedIndex].value];
if (fac == null) {
dialogBoxCreate("ERROR: You must select a faction to bribe");
@ -3598,7 +3600,7 @@ Corporation.prototype.displayCorporationOverviewContent = function() {
dialogBoxCreate("You gained " + formatNumber(repGain, 0) +
" reputation with " + fac.name + " by bribing them.");
fac.playerReputation += repGain;
this.funds = this.funds.lt(money);
this.funds = this.funds.minus(money);
this.numShares -= stockShares;
removeElementById(popupId);
return false;
@ -3612,6 +3614,9 @@ Corporation.prototype.displayCorporationOverviewContent = function() {
return false;
}
});
createPopup(popupId, [txt, factionSelector, repGainText,
moneyInput, stockSharesInput, confirmButton, cancelButton]);
}
});
companyManagementPanel.appendChild(bribeFactions);

@ -44,6 +44,7 @@ function prestigeAugmentation() {
prestigeSpecialServerIps(); //Must be done before initForeignServers()
//Reset home computer (only the programs) and add to AllServers
AddToAllServers(homeComp);
prestigeHomeComputer(homeComp);
if (augmentationExists(AugmentationNames.Neurolink) &&
@ -57,8 +58,6 @@ function prestigeAugmentation() {
homeComp.programs.push(Programs.BruteSSHProgram);
}
AddToAllServers(homeComp);
//Re-create foreign servers
initForeignServers();
@ -117,9 +116,6 @@ function prestigeAugmentation() {
}
}
//BitNode 3: Corporatocracy
if (Player.bitNodeN === 3) {Player.money = new Decimal(150e9);}
//BitNode 8: Ghost of Wall Street
if (Player.bitNodeN === 8) {Player.money = new Decimal(100e6);}
if (Player.bitNodeN === 8 || hasWallStreetSF) {
@ -161,8 +157,12 @@ function prestigeSourceFile() {
prestigeSpecialServerIps();
//Reset home computer (only the programs) and add to AllServers
AddToAllServers(homeComp);
prestigeHomeComputer(homeComp);
//Re-create foreign servers
initForeignServers();
var srcFile1Owned = false;
for (var i = 0; i < Player.sourceFiles.length; ++i) {
if (Player.sourceFiles[i].n == 1) {
@ -176,11 +176,6 @@ function prestigeSourceFile() {
}
homeComp.cpuCores = 1;
AddToAllServers(homeComp);
//Re-create foreign servers
initForeignServers();
//Darkweb is purchase-able
document.getElementById("location-purchase-tor").setAttribute("class", "a-link-button");
@ -246,8 +241,8 @@ function prestigeSourceFile() {
Player.gang = null;
Player.corporation = null;
//BitNode 3, get Handbook .lit file
//BitNode 3: Corporatocracy
if (Player.bitNodeN === 3) {Player.money = new Decimal(150e9);}
homeComp.messages.push("corporation-management-handbook.lit");
dialogBoxCreate("You received a copy of the Corporation Management Handbook on your home computer. " +
"Read it if you need help getting started with Corporations!");