diff --git a/src/004-base/proxies.js b/src/004-base/proxies.js index 40af52badfbb5fff43cec0fbf2036be990dbfec2..d28b2503a69bc3e04547a4efc47ff3ff24ac24d7 100644 --- a/src/004-base/proxies.js +++ b/src/004-base/proxies.js @@ -103,7 +103,8 @@ Object.defineProperty(window, "V", { return State.variables; } }); -//This should be used if the user might use V under normal, non-cheating circumstances but shouldn't be punished for accidentally setting the value. The attempt to make the change will simply be disregarded. + +// This should be used if the user might use V under normal, non-cheating circumstances but shouldn't be punished for accidentally setting the value. The attempt to make the change will simply be disregarded. globalThis.runWithReadonlyProxy = function(callback) { globalThis.storyProxy = createReadonlyProxy(State.variables); try { diff --git a/src/004-base/specialSlavesProxy.js b/src/004-base/specialSlavesProxy.js new file mode 100644 index 0000000000000000000000000000000000000000..b74bfdb8b6a3395625b8e6a6a77052d44681b048 --- /dev/null +++ b/src/004-base/specialSlavesProxy.js @@ -0,0 +1,61 @@ +App.SpecialSlavesProxy = class SpecialSlavesProxy { + constructor() { + } + + get Attendant() { + return V.Attendant; + } + get Bodyguard() { + return V.Bodyguard; + } + get Collectrix() { + return V.Collectrix; + } + get Concubine() { + return V.Concubine; + } + get DJ() { + return V.DJ; + } + get Farmer() { + return V.Farmer; + } + get HeadGirl() { + return V.HeadGirl; + } + get Lurcher() { + return slaveStateById(V.LurcherID); + } + get Madam() { + return V.Madam; + } + get Matron() { + return V.Matron; + } + get Milkmaid() { + return V.Milkmaid; + } + get Nurse() { + return V.Nurse; + } + get Recruiter() { + return V.Recruiter; + } + get Schoolteacher() { + return V.Schoolteacher; + } + get Stewardess() { + return V.Stewardess; + } + get Stud() { + return slaveStateById(V.StudID); + } + get Wardeness() { + return V.Wardeness; + } + get activeSlave() { + return V.activeSlave; + } +}; + +globalThis.S = new App.SpecialSlavesProxy(); diff --git a/src/zz1-last/setupEventHandlers.js b/src/zz1-last/setupEventHandlers.js index 190756ccced5b1ba246a99d25876336893d5d9dc..44cba09f389236f963c15e85054696220dd01ff1 100644 --- a/src/zz1-last/setupEventHandlers.js +++ b/src/zz1-last/setupEventHandlers.js @@ -9,3 +9,9 @@ $(document).on(':storyready', function(ev) { $(document).one(':passagestart', function() { App.EventHandlers.optionsChanged(); }); + +$(document).on(':passagestart', function() { + Object.defineProperty(State.temporary, "S", { + get: () => S + }); +});