diff --git a/src/004-base/facility.js b/src/004-base/facility.js index 719fdf7781fc3b08d351315f1707fd60bc3312cc..6e4b59140ce9d4d2b18bd9c4b5a3fb9c2a247ba1 100644 --- a/src/004-base/facility.js +++ b/src/004-base/facility.js @@ -118,6 +118,13 @@ App.Entity.Facilities.Job = class { return V.JobIDMap[this.desc.assignment]; } + /** + * assignment string but the generic facility name replaced with its in-game name + */ + get assignment() { + return this.desc.assignment.replace("the " + this.facility.desc.baseName, this.facility.name); + } + /** * Tests if slave is broken enough * @protected diff --git a/src/facilities/arcade/arcadeFramework.js b/src/facilities/arcade/arcadeFramework.js index 58f5d63338c3742e12960635e9fa64656060e756..1aefdf6abbc4cb49c2f70ef11627d932c80300c5 100644 --- a/src/facilities/arcade/arcadeFramework.js +++ b/src/facilities/arcade/arcadeFramework.js @@ -6,12 +6,7 @@ App.Data.Facilities.arcade = { position: "inmate", assignment: Job.ARCADE, publicSexUse: true, - fuckdollAccepted: true, - description: { - rulesAssistant: { - assigned:()=> `be confined in ${V.arcadeName}` - } - } + fuckdollAccepted: true }, }, defaultJob: "assignee", diff --git a/src/facilities/brothel/brothelFramework.js b/src/facilities/brothel/brothelFramework.js index cfca519f4a580b571d8581a337e87f8dc8fb6a89..c295f6c7d0331ae64d7ebd695c4db22425fae443 100644 --- a/src/facilities/brothel/brothelFramework.js +++ b/src/facilities/brothel/brothelFramework.js @@ -6,12 +6,7 @@ App.Data.Facilities.brothel = { position: "whore", assignment: Job.BROTHEL, publicSexUse: true, - fuckdollAccepted: false, - description: { - rulesAssistant: { - assigned:()=> `work in ${V.brothelName}` - } - } + fuckdollAccepted: false }, }, defaultJob: "assignee", diff --git a/src/facilities/cellblock/cellblockFramework.js b/src/facilities/cellblock/cellblockFramework.js index c3f9c8b1a6688a7388a2bacd66dd4ff89bfeb634..6e44aa9628b87b869192b6a213d219ada49479fa 100644 --- a/src/facilities/cellblock/cellblockFramework.js +++ b/src/facilities/cellblock/cellblockFramework.js @@ -6,12 +6,7 @@ App.Data.Facilities.cellblock = { position: "confinee", assignment: Job.CELLBLOCK, publicSexUse: false, - fuckdollAccepted: false, - description: { - rulesAssistant: { - assigned:()=> `be confined in ${V.cellblockName}` - } - } + fuckdollAccepted: false }, }, defaultJob: "assignee", diff --git a/src/facilities/clinic/clinicFramework.js b/src/facilities/clinic/clinicFramework.js index 92bb159aab8c5fec39d4eaebced87d513989e5df..c351774e0b3c6d1f481093381acd2c519694ce1f 100644 --- a/src/facilities/clinic/clinicFramework.js +++ b/src/facilities/clinic/clinicFramework.js @@ -6,12 +6,7 @@ App.Data.Facilities.clinic = { position: "patient", assignment: Job.CLINIC, publicSexUse: false, - fuckdollAccepted: false, - description: { - rulesAssistant: { - assigned:()=> `get treatment in ${V.clinicName}` - } - } + fuckdollAccepted: false } }, defaultJob: "patient", diff --git a/src/facilities/club/clubFramework.js b/src/facilities/club/clubFramework.js index 3d25fd0af3b9d6da98fb3f78a1d5fd02ce10bf83..efe1827dadbbc500b3cd25e791bc14b4dfd514fb 100644 --- a/src/facilities/club/clubFramework.js +++ b/src/facilities/club/clubFramework.js @@ -6,12 +6,7 @@ App.Data.Facilities.club = { position: "slut", assignment: Job.CLUB, publicSexUse: true, - fuckdollAccepted: false, - description: { - rulesAssistant: { - assigned:()=> `serve in ${V.clubName}` - } - } + fuckdollAccepted: false }, }, defaultJob: "slut", diff --git a/src/facilities/dairy/dairyFramework.js b/src/facilities/dairy/dairyFramework.js index b30c40cbca0f608ba12d2935a154e3ca36b0e70a..a6cb48cbaba2daaa7027470cba24f6a08222b0bb 100644 --- a/src/facilities/dairy/dairyFramework.js +++ b/src/facilities/dairy/dairyFramework.js @@ -6,12 +6,7 @@ App.Data.Facilities.dairy = { position: "cow", assignment: Job.DAIRY, publicSexUse: false, - fuckdollAccepted: false, - description: { - rulesAssistant: { - assigned:()=> `be milked in ${V.dairyName}` - } - } + fuckdollAccepted: false } }, defaultJob: "cow", @@ -77,6 +72,10 @@ App.Entity.Facilities.DairyCowJob = class extends App.Entity.Facilities.Facility return r; } + + get assignment() { + return `be milked in ${this.facility.name}`; + } }; App.Entity.Facilities.Dairy = class extends App.Entity.Facilities.SingleJobFacility { diff --git a/src/facilities/farmyard/farmyardFramework.js b/src/facilities/farmyard/farmyardFramework.js index 74048a4eef65ae5a9aa897cede6b6a1e4954bc48..f4f6630cc534a0eadadb00652b98ee6083c4c9f7 100644 --- a/src/facilities/farmyard/farmyardFramework.js +++ b/src/facilities/farmyard/farmyardFramework.js @@ -6,12 +6,7 @@ App.Data.Facilities.farmyard = { position: "farmhand", assignment: Job.FARMYARD, publicSexUse: false, - fuckdollAccepted: false, - description: { - rulesAssistant: { - assigned:()=> `work in ${V.farmyardName}` - } - } + fuckdollAccepted: false } }, defaultJob: "farmhand", @@ -33,6 +28,17 @@ App.Data.Facilities.farmyard = { } }; +App.Entity.Facilities.FarmHandJob = class extends App.Entity.Facilities.FacilitySingleJob { + /** + * @override + */ + get assignment() { + return `work in ${this.facility.name}`; + } +}; + App.Entity.facilities.farmyard = new App.Entity.Facilities.SingleJobFacility( - App.Data.Facilities.farmyard + App.Data.Facilities.farmyard, { + farmhand: new App.Entity.Facilities.FarmHandJob() + } ); diff --git a/src/facilities/headGirlSuite/headGirlSuiteFramework.js b/src/facilities/headGirlSuite/headGirlSuiteFramework.js index 6a059b0541cbb2941cad8cad94d0dbbaa92af8ca..66d1ad168c549eb03d9850dedface192ff62ffe0 100644 --- a/src/facilities/headGirlSuite/headGirlSuiteFramework.js +++ b/src/facilities/headGirlSuite/headGirlSuiteFramework.js @@ -6,12 +6,7 @@ App.Data.Facilities.headGirlSuite = { position: "Head Girl's toy", assignment: Job.HEADGIRLSUITE, publicSexUse: true, - fuckdollAccepted: false, - description: { - rulesAssistant: { - assigned:()=> `live in your Head Girl's private suite` - } - } + fuckdollAccepted: false } }, defaultJob: "HGToy", diff --git a/src/facilities/masterSuite/masterSuiteFramework.js b/src/facilities/masterSuite/masterSuiteFramework.js index be55b6008cd4dcb8e21ed8a18baa991b3acbc065..73aa85d2931ac3829205900aaf51289d6ae05333 100644 --- a/src/facilities/masterSuite/masterSuiteFramework.js +++ b/src/facilities/masterSuite/masterSuiteFramework.js @@ -6,12 +6,7 @@ App.Data.Facilities.masterSuite = { position: "fucktoy", assignment: Job.MASTERSUITE, publicSexUse: false, - fuckdollAccepted: false, - description: { - rulesAssistant: { - assigned:()=> `${V.masterSuiteName}` - } - } + fuckdollAccepted: false } }, defaultJob: "fucktoy", @@ -47,6 +42,11 @@ App.Entity.Facilities.MasterSuiteFuckToyJob = class extends App.Entity.Facilitie return r; } + + /** @override */ + get assignment() { + return this.facility.name; + } }; App.Entity.Facilities.ConcubineJob = class extends App.Entity.Facilities.ManagingJob { diff --git a/src/facilities/nursery/nurseryFramework.js b/src/facilities/nursery/nurseryFramework.js index 394def23fd3d40792329f06c30d00577bb2982e0..54591cd222ae98136e5025b4531124e33925d9a8 100644 --- a/src/facilities/nursery/nurseryFramework.js +++ b/src/facilities/nursery/nurseryFramework.js @@ -6,12 +6,7 @@ App.Data.Facilities.nursery = { position: "nanny", assignment: Job.NURSERY, publicSexUse: false, - fuckdollAccepted: false, - description: { - rulesAssistant: { - assigned:()=> `work in ${V.nurseryName}` - } - } + fuckdollAccepted: false } }, defaultJob: "nanny", @@ -47,6 +42,13 @@ App.Entity.Facilities.NurseryNannyJob = class extends App.Entity.Facilities.Faci return r; } + + /** + * @override + */ + get assignment() { + return `work in ${this.facility.name}`; + } }; App.Entity.Facilities.Nursery = class extends App.Entity.Facilities.SingleJobFacility { diff --git a/src/facilities/penthouse/penthouseFramework.js b/src/facilities/penthouse/penthouseFramework.js index 5531c55fcd93d7caf3b59dbc315cba56f6cabd49..8ba020d952446d9220d53588c6eee17972feaa46 100644 --- a/src/facilities/penthouse/penthouseFramework.js +++ b/src/facilities/penthouse/penthouseFramework.js @@ -13,13 +13,7 @@ App.Data.Facilities.penthouse = { position: "Choose own", assignment: Job.CHOICE, publicSexUse: false, - fuckdollAccepted: false, - description: { - rulesAssistant: { - assigned:({pronouns:{his}})=>`select ${his} own assignments`, - assignedType: "allowed" - } - } + fuckdollAccepted: false }, fucktoy: { position: "Fucktoy", diff --git a/src/facilities/schoolroom/schoolroomFramework.js b/src/facilities/schoolroom/schoolroomFramework.js index e743bbcefd27a3dfb95a2fd31845c7c72cd808f2..31059cd5e286fffa94a5d5fcab901c0a8441a356 100644 --- a/src/facilities/schoolroom/schoolroomFramework.js +++ b/src/facilities/schoolroom/schoolroomFramework.js @@ -6,12 +6,7 @@ App.Data.Facilities.schoolroom = { position: "student", assignment: Job.SCHOOL, publicSexUse: false, - fuckdollAccepted: false, - description: { - rulesAssistant: { - assigned:()=> `study in ${V.schoolroomName}` - } - } + fuckdollAccepted: false } }, defaultJob: "student", @@ -60,6 +55,13 @@ App.Entity.Facilities.SchoolroomStudentJob = class extends App.Entity.Facilities return r; } + + /** + * @override + */ + get assignment() { + return `study in ${this.facility.name}`; + } }; App.Entity.facilities.schoolroom = new App.Entity.Facilities.SingleJobFacility( diff --git a/src/facilities/servantsQuarters/servantsQuartersFramework.js b/src/facilities/servantsQuarters/servantsQuartersFramework.js index b07dd100fc998fed4bffe6219082c833e07ce51a..24e00796f48c9c58057ea520712229de15922eff 100644 --- a/src/facilities/servantsQuarters/servantsQuartersFramework.js +++ b/src/facilities/servantsQuarters/servantsQuartersFramework.js @@ -6,12 +6,7 @@ App.Data.Facilities.servantsQuarters = { position: "servant", assignment: Job.QUARTER, publicSexUse: false, - fuckdollAccepted: false, - description: { - rulesAssistant: { - assigned:()=> `work in ${V.servantsQuartersName}` - } - } + fuckdollAccepted: false } }, defaultJob: "servant", @@ -52,6 +47,13 @@ App.Entity.Facilities.ServantsQuartersServantJob = class extends App.Entity.Faci } return r; } + + /** + * @override + */ + get assignment() { + return `work in ${this.facility.name}`; + } }; App.Entity.Facilities.ServantsQuartersStewardessJob = class extends App.Entity.Facilities.ManagingJob { diff --git a/src/facilities/spa/spaFramework.js b/src/facilities/spa/spaFramework.js index bd5443a3495b22cd090babb630771f2453d79752..95d8bd88f82745086d6e45f6df33e9a4f953dac2 100644 --- a/src/facilities/spa/spaFramework.js +++ b/src/facilities/spa/spaFramework.js @@ -6,12 +6,7 @@ App.Data.Facilities.spa = { position: "bather", assignment: Job.SPA, publicSexUse: false, - fuckdollAccepted: false, - description: { - rulesAssistant: { - assigned:()=> `rest in ${V.spaName}` - } - } + fuckdollAccepted: false } }, defaultJob: "assignee", diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index 8f78e503baacfd19a78f7d5e492c1525113e1faf..fe70f5f55039ea83c3ab49dd2a6d58c17c1a0eba 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -7,22 +7,18 @@ globalThis.DefaultRules = (function() { "allowed": {success: "is allowed", unable: "could not be allowed"}, }; const getAssignmentDescription = function({rule, slave, assignmentResult, append = null}) { - const job = App.Utils.jobForAssignment(rule.setAssignment).desc; - let work = job.assignment; - let descriptionType = "auto"; - const assignmentInfo = (job.description || {}).rulesAssistant; - if (assignmentInfo != null) { - if (assignmentInfo.assigned != null) { - work = assignmentInfo.assigned({slave, pronouns, rule}); - } - if (assignmentInfo.assignedType != null) { - descriptionType = assignmentInfo.assignedType; - } - } - const assignedTypeInfo = assignedTypes[descriptionType]; - if (assignedTypeInfo == null) { throw Error(`Unknown description type ${JSON.stringify(descriptionType)} in ${JSON.stringify(rule.setAssignment)}`); } + const assignment = rule.setAssignment === Job.CHOICE ? + { + descriptionType: "allowed", + work: `select ${pronouns.his} own assignments` + } : { + descriptionType: "auto", + work: App.Utils.jobForAssignment(rule.setAssignment).assignment + }; + + const assignedTypeInfo = assignedTypes[assignment.descriptionType]; const hasBeenAssigned = assignedTypeInfo[assignmentResult]; - return `<br>${slave.slaveName} ${hasBeenAssigned} to ${work}${append || ''}.`; + return `<br>${slave.slaveName} ${hasBeenAssigned} to ${assignment.work}${append || ''}.`; }; /** @type {string} */