diff --git a/src/pregmod/FCTV/FCTV.js b/src/pregmod/FCTV/FCTV.js index dddd2dd60bca9a4b1a6c5752bbd1aaf4f13ca7c2..03ad5e619ffdb391b806ba2fbbbff862122e5d66 100644 --- a/src/pregmod/FCTV/FCTV.js +++ b/src/pregmod/FCTV/FCTV.js @@ -17,6 +17,7 @@ weekEnabled - The week FCTV was installed. globalThis.FCTV = (function() { return { channels: channels, + initChannels: initChannels, showChannel: showChannel, incrementChannel: incrementChannel, incrementShow: incrementShow, @@ -29,6 +30,15 @@ globalThis.FCTV = (function() { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; } + function initChannels() { + const channelList = FCTV.channels(); + for (let i = 0; i < channelList.length; i++) { + const channel = num(channelList[i], true); + const currentChannel = 'show' + capFirstChar(channel); + V.FCTV.channel[channel] = convert(V[currentChannel], V.FCTV.channel[channel]) || 0; + } + } + function showChannel(i) { let x = { canSelect: 1, diff --git a/src/pregmod/FCTV/FCTVBC.js b/src/pregmod/FCTV/FCTVBC.js index 6f0de99139ba891aec74e47efaa8a7098a6e5d8d..2329ce3b3c92336cd8525015f493c4d3d76ecadf 100644 --- a/src/pregmod/FCTV/FCTVBC.js +++ b/src/pregmod/FCTV/FCTVBC.js @@ -1,4 +1,5 @@ +// @ts-nocheck App.Update.FCTV = function() { function convert(a, b) { return V.FCTVreceiver ? a : b; @@ -8,15 +9,9 @@ App.Update.FCTV = function() { if (convert && V.receiverAvailable) { V.FCTV.receiver = V.FCTVreceiver > 0 ? V.FCTVreceiver : 0; } - - V.FCTV.channel = V.FCTV.channel || {}; V.FCTV.pcViewership = V.FCTV.pcViewership || {}; - const channelList = FCTV.channels(); - for (let i = 0; i < channelList.length; i++) { - const channel = num(channelList[i], true); - const currentChannel = 'show' + capFirstChar(channel); - V.FCTV.channel[channel] = convert(V[currentChannel], V.FCTV.channel[channel]) || 0; - } + V.FCTV.channel = V.FCTV.channel || {}; + FCTV.initChannels(); V.FCTV.channel.last = convert(V.lastShow, V.FCTV.channel.last) || -1; V.FCTV.pcViewership.count = convert(V.FCTVcount, V.FCTV.pcViewership.count) || 0; diff --git a/src/uncategorized/manageArcology.tw b/src/uncategorized/manageArcology.tw index 0815c66caadd79ee21370d5ba69f817359e4accd..0229238230ddfe704103747f803dd22d64db975c 100644 --- a/src/uncategorized/manageArcology.tw +++ b/src/uncategorized/manageArcology.tw @@ -108,12 +108,35 @@ <div> <<if $FCTV.receiver > -1 && !$FCTV.weekEnabled>> - You have not installed an FCTV receiver. - Installing this receiver yourself will cost <<print cashFormat(Math.trunc(25000*$upgradeMultiplierArcology*$HackingSkillMultiplier))>>. - You can have your citizens pay for the fiberoptic upgrades, reducing the cost to <<print cashFormat(Math.trunc(20000*$upgradeMultiplierArcology*$HackingSkillMultiplier))>>. - You can also have them heavily subsidize installation, they will be upset about it, but it will only cost <<print cashFormat(Math.trunc(10000*$upgradeMultiplierArcology*$HackingSkillMultiplier))>>. + <<set _noSub = Math.trunc(25000*$upgradeMultiplierArcology*$HackingSkillMultiplier)>> + <<set _lightSub = Math.trunc(20000*$upgradeMultiplierArcology*$HackingSkillMultiplier)>> + <<set _heavySub = Math.trunc(10000*$upgradeMultiplierArcology*$HackingSkillMultiplier)>> - [[No subsidy|Manage Arcology][cashX(forceNeg(Math.trunc(25000*$upgradeMultiplierArcology*$HackingSkillMultiplier)), "capEx"), $FCTV.receiver = 1, $FCTV.weekEnabled = $week, repX(500, "capEx"), $PC.skill.hacking += 1]] | [[Light subsidy|Manage Arcology][cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology*$HackingSkillMultiplier)), "capEx"), $FCTV.receiver = 1, $FCTV.weekEnabled= $week, $PC.skill.hacking += 1]] | [[Heavy subsidy|Manage Arcology][cashX(forceNeg(Math.trunc(10000*$upgradeMultiplierArcology*$HackingSkillMultiplier)), "capEx"), $FCTV.receiver = 1, $FCTV.weekEnabled = $week, repX(-1500, "capEx"), $PC.skill.hacking += 1]] + You have not installed an FCTV receiver. + Installing this receiver yourself will cost <<print cashFormat(_noSub)>>. + You can have your citizens pay for the fiberoptic upgrades, reducing the cost to <<print cashFormat(_lightSub)>>. + You can also have them heavily subsidize installation, they will be upset about it, but it will only cost <<print cashFormat(_heavySub)>>. + + <<link "No subsidy" "Manage Arcology">> + <<set $FCTV.receiver = 1, $FCTV.weekEnabled = $week, $PC.skill.hacking += 1>> + <<run FCTV.initChannels()>> + <<run cashX(forceNeg(_noSub), "capEx")>> + <<run repX(500, "capEx")>> + <</link>> + | + <<link "Light subsidy" "Manage Arcology">> + <<set $FCTV.receiver = 1, $FCTV.weekEnabled = $week, $PC.skill.hacking += 1>> + <<run FCTV.initChannels()>> + <<run cashX(forceNeg(_lightSub), "capEx")>> + /* No rep change */ + <</link>> + | + <<link "Heavy subsidy" "Manage Arcology">> + <<set $FCTV.receiver = 1, $FCTV.weekEnabled = $week, $PC.skill.hacking += 1>> + <<run FCTV.initChannels()>> + <<run cashX(forceNeg(Math.trunc(_heavySub), "capEx")>> + <<run repX(-1500, "capEx")>> + <</link>> <<elseif ($FCTV.receiver == 3)>> You have installed the FCTV receiver and have access to the full range of FCTV's programs. High viewership rates amongst your citizens makes it easier to pursue your societal goals. <<elseif ($FCTV.receiver == 2)>>