diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 701ce457e6e222e24c6a4c0baf22cafe2e921afb..61394fb0521c19d3df7e7fc86a463d7e9b3fc54f 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -324,7 +324,13 @@ App.Data.resetOnNGPlus = { bestialityOpeness: 0 }, - FCTV: {}, + FCTV: { + receiver: -1, + channel: {}, + pcViewership: {}, + remote: 0, + weekEnabled: 0 + }, assistant: {}, targetArcology: {fs: "New"}, readySlaves: 0, diff --git a/src/data/backwardsCompatibility/backwardsCompatibility.js b/src/data/backwardsCompatibility/backwardsCompatibility.js index c2a4d138f6fe3367b14cbe99ef239d994e708c0b..1f363899aad581df334ee92a38945035cb410b59 100644 --- a/src/data/backwardsCompatibility/backwardsCompatibility.js +++ b/src/data/backwardsCompatibility/backwardsCompatibility.js @@ -923,7 +923,7 @@ App.Update.globalVariables = function(node) { } else { assistant.object(); } - FCTV.manage(); + App.Update.FCTV(); if (jQuery.isEmptyObject(V.FSPromenade)) { V.FSPromenade = { Subjugationist: 0, diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw index 326153feebfb9de116e42e385fa908fcc02ddb89..c73026fe4263074d52d6341330cf7fa3143fc67a 100644 --- a/src/init/storyInit.tw +++ b/src/init/storyInit.tw @@ -40,7 +40,6 @@ You should have received a copy of the GNU General Public License along with thi <</for>> <<run assistant.object()>> -<<run FCTV.manage()>> <<run repX(1000, "event")>> <<run setup.prostheticIDs.forEach(function(id) { $prosthetics[id] = {amount: 0, research: 0}; diff --git a/src/pregmod/FCTV/FCTV.js b/src/pregmod/FCTV/FCTV.js index 9522066b5ae09a4dcb500d177fa9f6498f12cad7..dddd2dd60bca9a4b1a6c5752bbd1aaf4f13ca7c2 100644 --- a/src/pregmod/FCTV/FCTV.js +++ b/src/pregmod/FCTV/FCTV.js @@ -17,7 +17,6 @@ weekEnabled - The week FCTV was installed. globalThis.FCTV = (function() { return { channels: channels, - manage: manage, showChannel: showChannel, incrementChannel: incrementChannel, incrementShow: incrementShow, @@ -30,38 +29,6 @@ globalThis.FCTV = (function() { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; } - function manage() { - function convert(a, b) { - return V.FCTVreceiver ? a : b; - } - delete V.FCTVenable; - - V.FCTV.receiver = V.FCTV.receiver > -1 ? V.FCTV.receiver : -1; - if (convert && V.receiverAvailable) { - V.FCTV.receiver = V.FCTVreceiver > 0 ? V.FCTVreceiver : 0; - } - - if (V.FCTV.receiver > -1) { - V.FCTV.channel = V.FCTV.channel || {}; - V.FCTV.pcViewership = V.FCTV.pcViewership || {}; - - for (let i = 0; i < channels().length; i++) { - let channel = num(channels()[i], true); - let currentChannel = 'show' + capFirstChar(channel); - V.FCTV.channel[channel] = convert(V[currentChannel], V.FCTV.channel[channel]) || 0; - } - V.FCTV.channel.last = convert(V.lastShow, V.FCTV.channel.last) || -1; - - V.FCTV.pcViewership.count = convert(V.FCTVcount, V.FCTV.pcViewership.count) || 0; - V.FCTV.pcViewership.frequency = convert(V.FCTVrate, V.FCTV.pcViewership.frequency) || 4; - V.FCTV.remote = convert(V.FCTVremote, V.FCTV.remote) || 0; - - if (V.FCTVreceiver && !V.FCTV.weekEnabled) { - V.FCTV.weekEnabled = V.receiverAvailable > 1 ? V.receiverAvailable : 0; - } - } - } - function showChannel(i) { let x = { canSelect: 1, diff --git a/src/pregmod/FCTV/FCTVBC.js b/src/pregmod/FCTV/FCTVBC.js new file mode 100644 index 0000000000000000000000000000000000000000..6f0de99139ba891aec74e47efaa8a7098a6e5d8d --- /dev/null +++ b/src/pregmod/FCTV/FCTVBC.js @@ -0,0 +1,29 @@ + +App.Update.FCTV = function() { + function convert(a, b) { + return V.FCTVreceiver ? a : b; + } + V.FCTV = V.FCTV || {}; + V.FCTV.receiver = V.FCTV.receiver > -1 ? V.FCTV.receiver : -1; + 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.last = convert(V.lastShow, V.FCTV.channel.last) || -1; + + V.FCTV.pcViewership.count = convert(V.FCTVcount, V.FCTV.pcViewership.count) || 0; + V.FCTV.pcViewership.frequency = convert(V.FCTVrate, V.FCTV.pcViewership.frequency) || 4; + V.FCTV.remote = convert(V.FCTVremote, V.FCTV.remote) || 0; + + if (V.FCTVreceiver && !V.FCTV.weekEnabled) { + V.FCTV.weekEnabled = V.receiverAvailable > 1 ? V.receiverAvailable : 0; + } +}; diff --git a/src/uncategorized/manageArcology.tw b/src/uncategorized/manageArcology.tw index 0b76b7221c2b427d8e8044ed7049d83adc368824..0815c66caadd79ee21370d5ba69f817359e4accd 100644 --- a/src/uncategorized/manageArcology.tw +++ b/src/uncategorized/manageArcology.tw @@ -107,7 +107,6 @@ </div> <div> - <<run FCTV.manage()>> <<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))>>.