Skip to content
Snippets Groups Projects
Commit 8692cde7 authored by Pregmodder's avatar Pregmodder
Browse files

Merge branch 'specials-proxy' into 'pregmod-master'

Proxy for special slaves.

See merge request !6725
parents 5a475c87 e340b041
No related branches found
No related tags found
1 merge request!6725Proxy for special slaves.
......@@ -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 {
......
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();
......@@ -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
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment