diff --git a/src/pregmod/manageCorporation.tw b/src/pregmod/manageCorporation.tw index 916974936c2dcc3ba70b7cf39016dc9d9aa1dbfe..05342370087e8847d32cd494fe8bdbaba1b7184b 100644 --- a/src/pregmod/manageCorporation.tw +++ b/src/pregmod/manageCorporation.tw @@ -1377,19 +1377,28 @@ __Dividend__ __Shares__ <br>You own <<print num($personalShares)>> shares while another <<print num($publicShares)>> shares are traded publicly. The going rate on the market for 1000 shares is currently @@.yellowgreen;<<print cashFormat(corpSharePrice())>>.@@ -<br>The corporation can buyback 1000 shares for @@.red;<<print cashFormat(corpSharePrice(-1000))>>@@ or issue 1000 shares and net @@.yellowgreen;<<print cashFormat(corpSharePrice(1000))>>.@@ +<br>The corporation can buyback 1000 shares for @@.red;<<print cashFormat(corpSharePrice(-1000))>>@@ or issue 1000 shares and net @@.yellowgreen;<<print cashFormat(corpSharePrice(1000))>>.@@ If there are an odd number of shares available, the corporation will instead issue or buy the extra shares first. <<if $corpCash > corpSharePrice(-1000)>> <<if $publicShares <= $personalShares - 2000 && $publicShares > 0>> /*It won't buy back player shares if the corporation is entirely owned by the player*/ - <br>The corporation can buyback some of your shares. [[Buyback 1000|Manage Corporation][cashX(corpSharePrice(-1000), "stocksTraded"), $corpCash -= corpSharePrice(-1000), $personalShares -= 1000]] + <<set _persExtraShares = $personalShares % 1000 || 1000>> + <br>The corporation can buyback some of your shares. + <<= "[[Buyback "+ _persExtraShares + "|Manage Corporation][cashX(corpSharePrice(-"+_persExtraShares+"), 'stocksTraded'), $corpCash -= corpSharePrice(-"+_persExtraShares+"), $personalShares -= "+_persExtraShares+"]]">> <<elseif $publicShares >= 1000>> - <br>The corporation can buyback some of the public shares. [[Buyback 1000|Manage Corporation][$corpCash -= corpSharePrice(-1000), $publicShares -= 1000]] + <<set _pubExtraShares = $publicShares % 1000 || 1000>> + <br>The corporation can buyback some of the public shares. + <<= "[[Buyback "+ _pubExtraShares + "|Manage Corporation][$corpCash -= corpSharePrice(-"+_pubExtraShares+"), $publicShares -= "+_pubExtraShares+"]]">> <</if>> <</if>> -<<if $cash > corpSharePrice(1000)>> - <br>The corporation can issue 1000 shares to you. [[Issue 1000|Manage Corporation][cashX(forceNeg(corpSharePrice(1000)), "stocksTraded"), $corpCash += corpSharePrice(1000), $personalShares += 1000]] + +<<set _persLeftoverShares = 1000 - ($personalShares % 1000)>> +<<if $cash > corpSharePrice(_persLeftoverShares)>> + <br>The corporation can issue <<=_persLeftoverShares>> shares to you. + <<= "[[Issue " + _persLeftoverShares + "|Manage Corporation][cashX(forceNeg(corpSharePrice("+_persLeftoverShares+")), 'stocksTraded'), $corpCash += corpSharePrice("+_persLeftoverShares+"), $personalShares += "+_persLeftoverShares+"]]">> <</if>> +<<set _pubLeftoverShares = 1000 - ($publicShares % 1000)>> <<if $publicShares <= $personalShares - 2000>> - <br>The corporation can issue 1000 shares onto the stock market. [[Issue 1000|Manage Corporation][$corpCash += corpSharePrice(1000), $publicShares += 1000]] + <br>The corporation can issue <<=_pubLeftoverShares>> shares onto the stock market. + <<= "[[Issue " + _pubLeftoverShares + "|Manage Corporation][$corpCash += corpSharePrice("+_pubLeftoverShares+"), $publicShares += "+_pubLeftoverShares+"]]">> <</if>> <<if $publicShares <= $personalShares - 3000>> <br>You can sell some of your shares on the stock market. [[Sell 1000|Manage Corporation][cashX(corpSharePrice(), "stocksTraded"), $personalShares -= 1000, $publicShares += 1000]]