From cabf886bd202e27aed9382d521164d01dcadcbe7 Mon Sep 17 00:00:00 2001 From: x <okp57855@psoxs.com> Date: Sun, 10 Jun 2018 10:51:10 +1200 Subject: [PATCH] Tweaks re-apllied --- src/uncategorized/corporationDevelopments.tw | 223 ++++++++++--------- 1 file changed, 116 insertions(+), 107 deletions(-) diff --git a/src/uncategorized/corporationDevelopments.tw b/src/uncategorized/corporationDevelopments.tw index f174793bd11..cb246e00c89 100644 --- a/src/uncategorized/corporationDevelopments.tw +++ b/src/uncategorized/corporationDevelopments.tw @@ -159,111 +159,116 @@ You hold <<print commaNum($personalShares)>> shares valued at @@.yellowgreen;<<p <br>Sell personal shares: <<if $personalShares-1000 > $publicShares>> - <<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">> - <<set $personalShares -= 1000>> - <<set $publicShares += 1000>> - <<set $cash += 1000*$sharePrice>> - <<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>> - <<replace "#CorpAction">> - <br> <<print "You sold <<print commaNum(1000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">> - <</replace>> - <</link>> - <</if>> - <<if $personalShares-5000 > $publicShares>> - | <<link "<<print commaNum(5000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@">> - <<set $personalShares -= 5000>> - <<set $publicShares += 5000>> - <<set $cash += 5000*$sharePrice>> - <<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>> - <<replace "#CorpAction">> - <br> <<print "You sold <<print commaNum(5000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">> - <</replace>> - <</link>> - <</if>> - <<if $personalShares-10000 > $publicShares>> - | <<link "<<print commaNum(10000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@">> <<set $personalShares -= 10000>> - <<set $publicShares += 10000>> - <<set $cash += 10000*$sharePrice>> - <<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>> - <<replace "#CorpAction">> - <br> <<print "You sold <<print commaNum(10000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(10000*$sharePrice))>>@@" driving the share price down slightly.">> - <</replace>> - <</link>> - <</if>> - <<if $personalShares-15000 > $publicShares>> - | <<link "<<print commaNum(15000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@">> - <<set $personalShares -= 15000>> - <<set $publicShares += 15000>> - <<set $cash += 15000*$sharePrice>> - <<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>> - <<replace "#CorpAction">> - <br> <<print "You sold <<print commaNum(15000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@ driving the share price down somewhat.">> - <</replace>> - <</link>> - <</if>> - <<if $personalShares-20000 > $publicShares>> - | <<link "<<print commaNum(20000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@">> - <<set $personalShares -= 20000>> - <<set $publicShares += 20000>> - <<set $cash += 20000*$sharePrice>> - <<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>> - <<replace "#CorpAction">> - <br> <<print "You sold <<print commaNum(20000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@ driving the share price down significantly.">> - <</replace>> - <</link>> + <<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">> + <<set $personalShares -= 1000>> + <<set $publicShares += 1000>> + <<set $cash += 1000*$sharePrice>> + <<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>> + <<replace "#CorpAction">> + <br> <<print "You sold <<print commaNum(1000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">> + <</replace>> + <</link>> + <</if>> + <<if $personalShares-5000 > $publicShares>> + | <<link "<<print commaNum(5000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@">> + <<set $personalShares -= 5000>> + <<set $publicShares += 5000>> + <<set $cash += 5000*$sharePrice>> + <<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>> + <<replace "#CorpAction">> + <br> <<print "You sold <<print commaNum(5000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">> + <</replace>> + <</link>> + <</if>> + <<if $personalShares-10000 > $publicShares>> + | <<link "<<print commaNum(10000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@">> <<set $personalShares -= 10000>> + <<set $publicShares += 10000>> + <<set $cash += 10000*$sharePrice>> + <<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>> + <<replace "#CorpAction">> + <br> <<print "You sold <<print commaNum(10000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(10000*$sharePrice))>>@@" driving the share price down slightly.">> + <</replace>> + <</link>> + <</if>> + <<if $personalShares-15000 > $publicShares>> + | <<link "<<print commaNum(15000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@">> + <<set $personalShares -= 15000>> + <<set $publicShares += 15000>> + <<set $cash += 15000*$sharePrice>> + <<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>> + <<replace "#CorpAction">> + <br> <<print "You sold <<print commaNum(15000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@ driving the share price down somewhat.">> + <</replace>> + <</link>> + <</if>> + <<if $personalShares-20000 > $publicShares>> + | <<link "<<print commaNum(20000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@">> + <<set $personalShares -= 20000>> + <<set $publicShares += 20000>> + <<set $cash += 20000*$sharePrice>> + <<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>> + <<replace "#CorpAction">> + <br> <<print "You sold <<print commaNum(20000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@ driving the share price down significantly.">> + <</replace>> + <</link>> + <</if>> + <<else>> + //You cannot give up majority control.// <</if>> - <br>Issue new public shares: - <<if $personalShares-1000 > $publicShares>> - <<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">> - <<set $publicShares += 1000>> - <<set $corpCash += 1000*Math.ceil($sharePrice)>> - <<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>> - <<replace "#CorpAction">> - <br> <<print "The corporation issued <<print commaNum(1000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">> - <</replace>> - <</link>> - <</if>> - <<if $personalShares-5000 > $publicShares>> - | <<link "<<print commaNum(5000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@">> - <<set $publicShares += 5000>> - <<set $corpCash += 5000*Math.ceil($sharePrice)>> - <<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>> - <<replace "#CorpAction">> - <br> <<print "The corporation issued <<print commaNum(5000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">> - <</replace>> - <</link>> - <</if>> - <<if $personalShares-10000 > $publicShares>> - | <<link "<<print commaNum(10000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@">> - <<set $publicShares += 10000>> - <<set $corpCash += 10000*Math.ceil($sharePrice)>> - <<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>> - <<replace "#CorpAction">> - <br> <<print "The corporation issued <<print commaNum(10000)>> new sharesfor @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@ driving the share price down slightly.">> - <</replace>> - <</link>> - <</if>> - <<if $personalShares-15000 > $publicShares>> - | <<link "<<print commaNum(15000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@">> - <<set $publicShares += 15000>> - <<set $corpCash += 15000*Math.ceil($sharePrice)>> - <<set $sharePrice = (Math.trunc($sharePrice*random(96,98)))/100>> - <<replace "#CorpAction">> - <br> <<print "The corporation issued <<print commaNum(15000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@ driving the share price down somewhat.">> - <</replace>> - <</link>> - <</if>> - <<if $personalShares-20000 > $publicShares>> - | <<link "<<print commaNum(20000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@">> <<set $publicShares += 15000>> - <<set $corpCash += 20000*Math.ceil($sharePrice)>> - <<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>> - <<replace "#CorpAction">> - <br> <<print "The corporation issued <<print commaNum(20000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@ driving the share price down significantly.">> - <</replace>> - <</link>> - <</if>> -<</if>>/* closes actions that reduce private ownership percentage */ + <br>Issue new public shares: + <<if $personalShares-1000 > $publicShares>> + <<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">> + <<set $publicShares += 1000>> + <<set $corpCash += 1000*Math.ceil($sharePrice)>> + <<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>> + <<replace "#CorpAction">> + <br> <<print "The corporation issued <<print commaNum(1000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">> + <</replace>> + <</link>> + <</if>> + <<if $personalShares-5000 > $publicShares>> + | <<link "<<print commaNum(5000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@">> + <<set $publicShares += 5000>> + <<set $corpCash += 5000*Math.ceil($sharePrice)>> + <<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>> + <<replace "#CorpAction">> + <br> <<print "The corporation issued <<print commaNum(5000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">> + <</replace>> + <</link>> + <</if>> + <<if $personalShares-10000 > $publicShares>> + | <<link "<<print commaNum(10000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@">> + <<set $publicShares += 10000>> + <<set $corpCash += 10000*Math.ceil($sharePrice)>> + <<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>> + <<replace "#CorpAction">> + <br> <<print "The corporation issued <<print commaNum(10000)>> new sharesfor @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@ driving the share price down slightly.">> + <</replace>> + <</link>> + <</if>> + <<if $personalShares-15000 > $publicShares>> + | <<link "<<print commaNum(15000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@">> + <<set $publicShares += 15000>> + <<set $corpCash += 15000*Math.ceil($sharePrice)>> + <<set $sharePrice = (Math.trunc($sharePrice*random(96,98)))/100>> + <<replace "#CorpAction">> + <br> <<print "The corporation issued <<print commaNum(15000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@ driving the share price down somewhat.">> + <</replace>> + <</link>> + <</if>> + <<if $personalShares-20000 > $publicShares>> + | <<link "<<print commaNum(20000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@">> <<set $publicShares += 15000>> + <<set $corpCash += 20000*Math.ceil($sharePrice)>> + <<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>> + <<replace "#CorpAction">> + <br> <<print "The corporation issued <<print commaNum(20000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@ driving the share price down significantly.">> + <</replace>> + <</link>> + <</if>> + <<else>> + //You cannot give up majority control.// + <</if>>/* closes actions that reduce private ownership percentage */ <<if _PublicOwnershipPercentage <= 5>><br>//You cannot make the corporation privately held.// <<else>> /* actions that reduce public ownership percentage */ @@ -329,7 +334,7 @@ You hold <<print commaNum($personalShares)>> shares valued at @@.yellowgreen;<<p <</if>> <br>Buy publicly held shares: - <<if $cash > 1000*$sharePrice>> + <<if $cash > 1000*$sharePrice && $publicShares > 1000>> <<if $publicShares > 1000 && $cash >= 1000*$sharePrice>> <<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">> <<set $personalShares += 1000>> @@ -381,12 +386,14 @@ You hold <<print commaNum($personalShares)>> shares valued at @@.yellowgreen;<<p <</replace>> <</link>> <</if>> - <<else>> + <<elseif $publicShares > 1000>> //You are unable to purchase <<print commaNum(1000)>> shares at the current share price, valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@.// + <<else>> + //You cannot make the corporation privately held.// <</if>> <br>Direct the corporation to buy back publicly held shares: - <<if $corpCash > 1000*$sharePrice>> + <<if $corpCash > 1000*$sharePrice && $publicShares > 1000>> <<if $publicShares > 1000 && $corpCash >= 1000*$sharePrice>> <<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">> <<set $publicShares -= 1000>> @@ -437,8 +444,10 @@ You hold <<print commaNum($personalShares)>> shares valued at @@.yellowgreen;<<p <</replace>> <</link>> <</if>> - <<else>> + <<elseif $publicShares > 1000>> //The corporation is unable to purchase <<print commaNum(1000)>> shares at the current share price, valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@.// + <<else>> + //You cannot make the corporation privately held.// <</if>> <</if>> /* closes actions that reduce public ownership percentage */ -- GitLab