From c83f8399183a1776c73ce6e8acfda19b2e0ee798 Mon Sep 17 00:00:00 2001 From: Skriv <skrivelese@gmail.com> Date: Fri, 7 May 2021 17:57:46 +0000 Subject: [PATCH] Add typing support to hairstyles and fix obvious errors --- devTools/types/FC/human.d.ts | 1 + src/js/SlaveState.js | 4 +++- src/npc/databases/dSlavesDatabase.js | 21 ++++++++++++----- src/npc/databases/ddSlavesDatabase.js | 33 +++++++++++++++++++++++---- src/npc/databases/dfSlavesDatabase.js | 6 +++++ src/player/js/PlayerState.js | 4 +++- 6 files changed, 57 insertions(+), 12 deletions(-) diff --git a/devTools/types/FC/human.d.ts b/devTools/types/FC/human.d.ts index 29ecadb2abc..673183f17dd 100644 --- a/devTools/types/FC/human.d.ts +++ b/devTools/types/FC/human.d.ts @@ -221,6 +221,7 @@ declare global { | "size queen">; type BreastShape = "normal" | "perky" | "saggy" | "torpedo-shaped" | "downward-facing" | "wide-set" | "spherical"; + type HairStyle = "afro"| "braided" | "cornrows" | "curled" | "dreadlocks" | "eary" | "bun" | "messy bun" | "ponytail" | "tails" | "drills" | "luxurious" | "messy" | "neat" | "permed" | "bangs" | "hime" | "strip" | "up" | "shaved" | "trimmed" | "buzzcut" | "bald"; type Diet = "healthy" | "restricted" | "corrective" | "muscle building" | "fattening" | "slimming" | "XX" | "XY" | "XXY" | "cum production" | "cleansing" | "fertility" | "high caloric"; type Drug = "no drugs" | diff --git a/src/js/SlaveState.js b/src/js/SlaveState.js index 5636ddf9c58..c3c9ba6d5a2 100644 --- a/src/js/SlaveState.js +++ b/src/js/SlaveState.js @@ -804,7 +804,9 @@ App.Entity.SlaveState = class SlaveState { * @type {FC.EyebrowThickness} */ this.eyebrowFullness = "natural"; - /** hair style */ + /** hair style + * @type {FC.HairStyle} + */ this.hStyle = "neat"; /** pubic hair style */ this.pubicHStyle = "neat"; diff --git a/src/npc/databases/dSlavesDatabase.js b/src/npc/databases/dSlavesDatabase.js index 9ebad97aa6f..3babb1d13d5 100644 --- a/src/npc/databases/dSlavesDatabase.js +++ b/src/npc/databases/dSlavesDatabase.js @@ -1,4 +1,7 @@ /* eslint-disable camelcase */ +/** + * @type {Partial<partialSlaveState>[]} + */ App.Data.HeroSlaves.D = [ // start 900000 { @@ -648,7 +651,8 @@ App.Data.HeroSlaves.D = [ origHColor: "red", pubicHColor: "red", origSkin: "pale", - hStyle: "long", + hStyle: "ponytail", + hLength: 60, waist: -55, boobs: 400, butt: 2, @@ -1277,7 +1281,8 @@ App.Data.HeroSlaves.D = [ origHColor: "black", pubicHColor: "black", origSkin: "brown", - hStyle: "long", + hStyle: "luxurious", + hLength: 60, boobs: 500, butt: 3, vagina: 1, @@ -1770,7 +1775,8 @@ App.Data.HeroSlaves.D = [ devotion: 25, race: "white", origSkin: "white", - hStyle: "long", + hStyle: "ponytail", + hLength: 60, boobs: 650, boobsTat: "degradation", buttTat: "degradation", @@ -3992,7 +3998,7 @@ App.Data.HeroSlaves.D = [ pubicHColor: "black", origSkin: "pale", hLength: 0, - hStyle: "shaved bald", + hStyle: "shaved", pubicHStyle: "bushy", boobs: 600, nipplesPiercing: 1, @@ -4074,6 +4080,9 @@ App.Data.HeroSlaves.D = [ }, ]; /* Removed eye color customDesc -BoneyM*/ +/** + * @type {Partial<partialSlaveState>[]} + */ App.Data.HeroSlaves.Dextreme = [ { ID: 900099, @@ -4175,7 +4184,7 @@ App.Data.HeroSlaves.Dextreme = [ pubicHColor: "black", origSkin: "very fair", hLength: 60, - hStyle: "in a hime cut", + hStyle: "hime", boobs: 500, butt: 3, vaginaLube: 1, @@ -4346,7 +4355,7 @@ App.Data.HeroSlaves.Dextreme = [ pubicHColor: "black", origSkin: "pale", hLength: 0, - hStyle: "shaved bald", + hStyle: "shaved", waist: -100, boobs: 2000, boobsImplant: 600, diff --git a/src/npc/databases/ddSlavesDatabase.js b/src/npc/databases/ddSlavesDatabase.js index 90fa71d27fa..0bc4e7c5aaf 100644 --- a/src/npc/databases/ddSlavesDatabase.js +++ b/src/npc/databases/ddSlavesDatabase.js @@ -1,6 +1,27 @@ /* eslint-disable camelcase */ // _i = 800000}, +/** + * @typedef {object} missingProperties + * @property {any} health + * @property {any} skill + * @property {any} custom + * @property {any} eye + * @property {any} counter + * @property {any} leg + * @property {any} geneticQuirks + * @property {any} rules + * @property {Array<0|1>} removedLimbs //limbs to be removed + */ + +/** + * @typedef {object} partialSlaveState + * @type {App.Entity.SlaveState & missingProperties} + */ + +/** + * @type {Partial<partialSlaveState>[]} + */ App.Data.HeroSlaves.DD = [ { ID: 800001, @@ -533,7 +554,8 @@ App.Data.HeroSlaves.DD = [ origHColor: "red", pubicHColor: "red", origSkin: "pale", - hStyle: "long", + hStyle: "braided", + hLength: 60, boobs: 1800, nipplesPiercing: 1, shoulders: -1, @@ -723,7 +745,7 @@ App.Data.HeroSlaves.DD = [ pubicHColor: "blonde", race: "white", hLength: 0, - hStyle: "shaved bald", + hStyle: "shaved", boobs: 200, butt: 3, vagina: -1, @@ -987,7 +1009,7 @@ App.Data.HeroSlaves.DD = [ underArmHColor: "red", origSkin: "light", hLength: 30, - hStyle: "in a hime cut", + hStyle: "hime", waist: -55, boobs: 250, butt: 3.5, @@ -1308,7 +1330,7 @@ App.Data.HeroSlaves.DD = [ pubicHColor: "blonde", origSkin: "pale", hLength: 0, - hStyle: "shaved bald", + hStyle: "shaved", pubicHStyle: "bushy", boobs: 1700, boobsTat: "rude words", @@ -1423,6 +1445,9 @@ App.Data.HeroSlaves.DD = [ }, ]; +/** + * @type {Partial<partialSlaveState>[]} + */ App.Data.HeroSlaves.DDextreme = [ { ID: 800032, diff --git a/src/npc/databases/dfSlavesDatabase.js b/src/npc/databases/dfSlavesDatabase.js index 67eff09a4a1..f630aafa1e1 100644 --- a/src/npc/databases/dfSlavesDatabase.js +++ b/src/npc/databases/dfSlavesDatabase.js @@ -1,6 +1,9 @@ /* eslint-disable camelcase */ // _i: 700000}, +/** + * @type {Partial<partialSlaveState>[]} + */ App.Data.HeroSlaves.DF = [ { ID: 700001, @@ -338,6 +341,9 @@ App.Data.HeroSlaves.DF = [ /* vibe nips, stupid, sensitive, no masturbation implant*/ ]; +/** + * @type {Partial<partialSlaveState>[]} + */ App.Data.HeroSlaves.DFextreme = [ { ID: 700009, diff --git a/src/player/js/PlayerState.js b/src/player/js/PlayerState.js index 7a7c6f335ae..befb2e66c94 100644 --- a/src/player/js/PlayerState.js +++ b/src/player/js/PlayerState.js @@ -485,7 +485,9 @@ App.Entity.PlayerState = class PlayerState { * @type {FC.EyebrowThickness} */ this.eyebrowFullness = "natural"; - /** hair style */ + /** hair style + * @type {FC.HairStyle} + */ this.hStyle = "neat"; /** pubic hair style */ this.pubicHStyle = "hairless"; -- GitLab