diff --git a/src/pregmod/FCTV/FCTV.js b/src/pregmod/FCTV/FCTV.js index 9b518165edd04992fa50c68c442c9f79a7e5aecf..832a61178ebdfe4d019dad7e92535342c7fa8de2 100644 --- a/src/pregmod/FCTV/FCTV.js +++ b/src/pregmod/FCTV/FCTV.js @@ -46,17 +46,17 @@ globalThis.FCTV = (function() { * @param {string} operation eq/gt/lt: equals/greater than/less than. * @returns {boolean} */ - function channelCount(i, operation = 'eq') { + function channelCount(selectedChannel, i, operation = 'eq') { if (operation === 'eq') { - if (V.FCTV.channel[num(V.FCTV.channel.selected, true)] === i) { + if (V.FCTV.channel[num(selectedChannel, true)] === i) { return true; } } else if (operation === 'gt') { - if (V.FCTV.channel[num(V.FCTV.channel.selected, true)] > i) { + if (V.FCTV.channel[num(selectedChannel, true)] > i) { return true; } } else if (operation === 'lt') { - if (V.FCTV.channel[num(V.FCTV.channel.selected, true)] < i) { + if (V.FCTV.channel[num(selectedChannel, true)] < i) { return true; } } @@ -77,10 +77,10 @@ globalThis.FCTV = (function() { } })(); -globalThis.FctvDisplay = function({usedRemote = 0, seeAll = 0} = {}) { - return watch({usedRemote: usedRemote, seeAll: seeAll}); +globalThis.FctvDisplay = function({usedRemote = 0, seeAll = 0, selectedChannel = 0} = {}) { + return watch({usedRemote: usedRemote, seeAll: seeAll, selectedChannel: selectedChannel}); - function watch({usedRemote = 0, seeAll = 0} = {}) { + function watch({usedRemote = 0, seeAll = 0, selectedChannel = 0} = {}) { const frag = new DocumentFragment(); let p; let div; @@ -119,7 +119,7 @@ globalThis.FctvDisplay = function({usedRemote = 0, seeAll = 0} = {}) { p.append(randomShow()); } else if (usedRemote && (V.cheatMode > 0 || V.debugMode > 0 || V.FCTV.remote)) { p.append(`bring you the remote so you can choose whatever show you find interesting. `); - if (V.FCTV.channel.selected === V.FCTV.channel.last) { + if (selectedChannel === V.FCTV.channel.last) { App.UI.DOM.appendNewElement("div", p, `You tuned into this channel last week, you may want to choose something else.`); } if (seeAll) { @@ -145,14 +145,14 @@ globalThis.FctvDisplay = function({usedRemote = 0, seeAll = 0} = {}) { } else { p.append(`It looks like the random function chose `); } - App.UI.DOM.appendNewElement("span", p, `channel number: ${V.FCTV.channel.selected}`, "bold"); + App.UI.DOM.appendNewElement("span", p, `channel number: ${selectedChannel}`, "bold"); // A little glue to get unique data based stuff to stick. - if (V.FCTV.channel.selected === 16) { + if (selectedChannel === 16) { p.append(`. `); } else { p.append(`, `); - if (V.FCTV.channel.selected === 11 && usedRemote) { + if (selectedChannel === 11 && usedRemote) { p.append(`for some foolish reason`); } } @@ -171,14 +171,13 @@ globalThis.FctvDisplay = function({usedRemote = 0, seeAll = 0} = {}) { const buttons = []; for (const i of _possibleChannels) { - if (showChannel(i, {usedRemote: usedRemote, seeAll: seeAll}).canSelect > 0) { - if (V.FCTV.channel.selected !== i) { // Selected button + if (showChannel(i, {usedRemote: usedRemote, seeAll: seeAll, selectedChannel: selectedChannel}).canSelect > 0) { + if (selectedChannel !== i) { // Selected button buttons.push( App.UI.DOM.link( i, () => { - V.FCTV.channel.selected = i; - watch({usedRemote: 1, seeAll: seeAll}); + watch({usedRemote: 1, seeAll: seeAll, selectedChannel: i}); } ) ); @@ -190,8 +189,7 @@ globalThis.FctvDisplay = function({usedRemote = 0, seeAll = 0} = {}) { App.UI.DOM.link( i, () => { - V.FCTV.channel.selected = i; - watch({usedRemote: 1, seeAll: seeAll}); + watch({usedRemote: 1, seeAll: seeAll, selectedChannel: i}); }, [], "", @@ -221,7 +219,7 @@ globalThis.FctvDisplay = function({usedRemote = 0, seeAll = 0} = {}) { App.UI.DOM.link( `Random`, () => { - watch({usedRemote: 0, seeAll: seeAll}); + watch({usedRemote: 0, seeAll: seeAll, selectedChannel: selectedChannel}); } ), ["FctvRemote-button"] @@ -238,7 +236,7 @@ globalThis.FctvDisplay = function({usedRemote = 0, seeAll = 0} = {}) { } else { seeAll = 1; } - watch({usedRemote: usedRemote, seeAll: seeAll}); + watch({usedRemote: usedRemote, seeAll: seeAll, selectedChannel: selectedChannel}); } ), ["FctvRemote-button"] @@ -250,11 +248,6 @@ globalThis.FctvDisplay = function({usedRemote = 0, seeAll = 0} = {}) { function randomShow() { const frag = new DocumentFragment(); - // Fallback if channel is bad - if (Number.isNaN(V.FCTV.channel.selected)) { - V.FCTV.channel.selected = 1; - } - if (!usedRemote) { const channels = FCTV.channels(); channels.push(3); // Double chance for slave sale. Replaces old channel 4. @@ -266,7 +259,7 @@ globalThis.FctvDisplay = function({usedRemote = 0, seeAll = 0} = {}) { if (x.canSelect === -1) { App.UI.DOM.appendNewElement("p", frag, channelFailed(x.text)); } else { - V.FCTV.channel.selected = channel; + selectedChannel = channel; break; } @@ -327,10 +320,9 @@ globalThis.FctvDisplay = function({usedRemote = 0, seeAll = 0} = {}) { function displayShow() { const frag = new DocumentFragment(); - const sel = V.FCTV.channel.selected; /** @type {FctvChannel} */ - const channel = App.Data.FCTV.channels[sel]; - const epToShow = getEpisode(sel); + const channel = App.Data.FCTV.channels[selectedChannel]; + const epToShow = getEpisode(selectedChannel); // Fail code, so we fail if (epToShow === -1) { @@ -339,7 +331,7 @@ globalThis.FctvDisplay = function({usedRemote = 0, seeAll = 0} = {}) { } // Increment the viewing record for this channel - V.FCTV.channel[num(sel, true)]++; + V.FCTV.channel[num(selectedChannel, true)]++; // Slave, if needed. Hosts and market slaves. let slave; @@ -366,6 +358,7 @@ globalThis.FctvDisplay = function({usedRemote = 0, seeAll = 0} = {}) { frag.append(channel.outro); } } + V.FCTV.channel.last = selectedChannel; return frag; function getEpisode(sel) { diff --git a/src/pregmod/FCTV/FCTVBC.js b/src/pregmod/FCTV/FCTVBC.js index 820799a07febba8717bc81f9a6f65bd95edfe932..fd75fe5ba3d609f260371cada0c92e4606c728f2 100644 --- a/src/pregmod/FCTV/FCTVBC.js +++ b/src/pregmod/FCTV/FCTVBC.js @@ -31,4 +31,8 @@ App.Update.FCTV = function() { if (V.FCTVreceiver && !V.FCTV.weekEnabled) { V.FCTV.weekEnabled = V.receiverAvailable > 1 ? V.receiverAvailable : 0; } + + if (FCTV.channel.hasOwnProperty("selected")) { + delete V.FCTV.channel.selected; + } }; diff --git a/src/pregmod/FCTV/FCTVshows.js b/src/pregmod/FCTV/FCTVshows.js index 7535d9d982e0cc7786a5a91dc24fabb9ee0e1a4c..8d0e642e5e59d6dec5333eb05034be2d58ac6653 100644 --- a/src/pregmod/FCTV/FCTVshows.js +++ b/src/pregmod/FCTV/FCTVshows.js @@ -639,13 +639,13 @@ App.Data.FCTV.channels = { get intro() { const r = []; r.push(`which is currently showing`); - if (FCTV.channelCount(12, 'lt')) { + if (FCTV.channelCount(1, 12, 'lt')) { r.push(`the newest episode of a`); } else { r.push(`a repeat of the`); } r.push(`popular competitive reality show`); - if (FCTV.channelCount(0, 'gt')) { + if (FCTV.channelCount(1, 0, 'gt')) { r.push(`show: Next Top Breeder.`); } else { r.push(`show where several female citizens are competing for something.`); @@ -1356,7 +1356,7 @@ App.Data.FCTV.channels = { get intro() { const r = []; r.push(`which is currently showing a competitive game show 'Cum and Cream Challenge' The program has a short opening sequence showing a variety of male and female contestants competing in a variety of lewd and messy body fluid competitions. The program flashes to a title screen where the letters are being spelled out in white fluids: "CUM and CREAM CHALLENGE". The writing is messy enough to`); - if (FCTV.channelCount(1)) { + if (FCTV.channelCount(10, 1)) { r.push(`make you wonder`); } else { r.push(`keep you wondering`); @@ -1504,7 +1504,7 @@ App.Data.FCTV.channels = { const {his} = S.Concubine ? getPronouns(S.Concubine) : {}; const {title: Master} = canTalk(S.Concubine) ? getEnunciation(S.Concubine) : {}; - if (FCTV.channelCount(1, 'gt')) { + if (FCTV.channelCount(11, 1, 'gt')) { r.push(`, once again,`); } r.push(`which is currently showing an infomercial attempting to sell a product named "sag-B-gone" that claims to be able to prevent breasts from naturally sagging under their own weight.</p><p>`); @@ -1516,7 +1516,7 @@ App.Data.FCTV.channels = { r.push(`${S.Concubine.slaveName} shakes ${his} chest at you.</p>`); } } else { - if (FCTV.channelCount(1, 'gt')) { + if (FCTV.channelCount(11, 1, 'gt')) { r.push(`You could always order a crate to play around with. Who knows, maybe it'll actually work?`); if (V.PC.dick !== 0) { r.push(`At the very least it should make for some decent lubricant for a titfuck.`); @@ -1621,7 +1621,7 @@ App.Data.FCTV.channels = { tags: {loli: true, incest: true}, loop: true, get intro() { - if (FCTV.channelCount(1)) { + if (FCTV.channelCount(12, 1)) { return `currently airing a drama series about a girl adapting to living in the Free Cities.`; } else { return `currently airing another episode of that drama series.`; diff --git a/src/uncategorized/nextWeek.tw b/src/uncategorized/nextWeek.tw index fd24f292b91cadfd386f4245f4de5a50cbe03a70..f3e7c9fe83af343e337c85c33761ced8d2313d47 100644 --- a/src/uncategorized/nextWeek.tw +++ b/src/uncategorized/nextWeek.tw @@ -263,8 +263,6 @@ <<set $FCTV.pcViewership.count = 0>> <</if>> <</if>> - <<set $FCTV.channel.last = $FCTV.channel.selected>> - <<run delete $FCTV.channel.selected>> <</if>> <<set $week++>>