From b3fc3eec801631526d9558f1a2eeab48aad910fb Mon Sep 17 00:00:00 2001 From: ezsh <ezsh.junk@gmail.com> Date: Sun, 12 Apr 2020 21:49:38 +0200 Subject: [PATCH] Refactor long switches in slave summary Replace long simple switches with dictionary lookups and dictionaries under App.Data.SlaveSummary. --- js/003-data/slaveSummaryData.js | 855 ++++++++++++++++++++++++++------ src/js/slaveSummaryHelpers.js | 509 ++++--------------- src/js/slaveSummaryWidgets.js | 786 +---------------------------- 3 files changed, 826 insertions(+), 1324 deletions(-) diff --git a/js/003-data/slaveSummaryData.js b/js/003-data/slaveSummaryData.js index d19b3cc91b7..9152432f7a5 100644 --- a/js/003-data/slaveSummaryData.js +++ b/js/003-data/slaveSummaryData.js @@ -1,150 +1,212 @@ App.Data.SlaveSummary = { long: { + body: { + age: { + 0: "Underage.", + 18: "Eighteen.", + 19: "Nineteen.", + 20: "Early twenties.", + 25: "Late twenties.", + 30: "Early thirties.", + 35: "Late thirties.", + 40: "Forties." + }, + face: { // face value + 100 + 0: {desc: "Very ugly", style: "red"}, + 5: {desc: "Ugly", style: "red"}, + 60: {desc: "Unattractive", style: "red"}, + 90: {desc: "Average"}, + 111: {desc: "Attractive", style: "pink"}, + 141: {desc: "Beautiful", style: "pink"}, + 196: {desc: "Very beautiful", style: "pink"}, + }, + lips: { + 0: {desc: "Thin lips", style: "red"}, + 11: {desc: "Normal lips"}, + 21: {desc: "Pretty lips"}, + 41: {desc: "Big lips"}, + 71: {desc: "Huge lips"}, + 96: {desc: "Facepussy"} + }, + teeth: { + "crooked": {desc: "Crooked teeth.", style: "yellow"}, + "gapped": {desc: "Tooth gap.", style: "yellow"}, + "cosmetic braces": {desc: "Cosmetic braces."}, + "straightening braces": {desc: "Braces."}, + "removable": {desc: "Removable teeth."}, + "pointy": {desc: "Sharp fangs."}, + "baby": {desc: "Baby teeth."}, + "mixed": {desc: "Mixed teeth."} + }, + waist: { // waist value + 100 + 0: {desc: "Absurdly narrow waist", style: "pink"}, + 5: {desc: "Hourglass waist", style: "pink"}, + 60: {desc: "Feminine waist", style: "pink"}, + 90: {desc: "Average waist"}, + 111: {desc: "Unattractive waist", style: "red"}, + 141: {desc: "Ugly waist", style: "red"}, + 195: {desc: "Masculine waist", style: "red"} + } + }, + mental: { + behavioralFlaw: { + "arrogant": "Arrogant.", + "bitchy": "Bitchy.", + "odd": "Odd.", + "hates men": "Hates men.", + "hates women": "Hates women.", + "gluttonous": "Stress eater.", + "anorexic": "Anorexic", + "devout": "Devoutly religious.", + "liberated": "Mentally liberated.", + } + }, + clothes: { - "Western clothing": 'Chaps.', - "a Santa dress": 'Santa dress.', - "a ball gown": 'Ball gown.', - "a bimbo outfit": 'Bimbo outfit.', - "a biyelgee costume": 'Biyelgee costume.', - "a bra": 'Nice bra.', - "a bunny outfit": 'Bunny outfit.', - "a burkini": 'Burkini.', - "a burqa": 'Burqa.', - "a button-up shirt and panties": 'Button-up shirt, panties.', - "a button-up shirt": 'Nice button-up shirt.', - "a chattel habit": 'Chattel habit.', - "a cheerleader outfit": 'Cheerleader.', - "a comfortable bodysuit": 'Bodysuit.', - "a courtesan dress": 'Courtesan dress.', - "a cybersuit": 'Cybersuit.', - "a dirndl": 'Dirndl.', - "a fallen nuns habit": 'Slutty habit.', - "a gothic lolita dress": 'Gothic lolita dress.', - "a halter top dress": 'Halter top dress.', - "a hanbok": 'Hanbok.', - "a hijab and abaya": 'Hijab and abaya.', - "a hijab and blouse": 'Hijab and blouse.', - "a huipil": 'Huipil.', - "a kimono": 'Kimono.', - "a klan robe": 'Klan robe.', - "a latex catsuit": 'Nice latex.', - "a leotard": 'Leotard.', - "a long qipao": 'Long Qipao.', - "a maternity dress": 'Maternity dress.', - "a military uniform": 'Military uniform.', - "a mini dress": 'Mini dress.', - "a monokini": 'Monokini.', - "a mounty outfit": 'Mounty outfit.', - "a nice maid outfit": 'Nice maid.', - "a nice nurse outfit": 'Nice nurse.', - "a nice pony outfit": 'Nice pony outfit.', - "a niqab and abaya": 'Niqab and abaya.', - "a one-piece swimsuit": 'Swimsuit.', - "a penitent nuns habit": 'Cilice.', - "a police uniform": 'Police uniform.', - "a red army uniform": 'Red Army uniform.', - "a scalemail bikini": 'Scalemail bikini.', - "a schoolgirl outfit": 'Schoolgirl outfit.', - "a schutzstaffel uniform": 'Schutzstaffel uniform.', - "a skimpy loincloth": 'Skimpy loincloth.', - "a slave gown": 'Slave gown.', - "a slutty klan robe": 'Slutty klan robe.', - "a slutty maid outfit": 'Slutty maid.', - "a slutty nurse outfit": 'Slutty nurse.', - "a slutty outfit": 'Slutty outfit.', - "a slutty pony outfit": 'Slutty pony outfit.', - "a slutty qipao": 'Slutty qipao.', - "a slutty schutzstaffel uniform": 'Slutty Schutzstaffel uniform.', - "a sports bra": 'Sports bra.', - "a string bikini": 'String bikini.', - "a striped bra": 'Striped bra.', - "a succubus outfit": 'Succubus outfit.', - "a sweater and cutoffs": 'Jean s, sweater.', - "a sweater and panties": 'Sweater, panties.', - "a sweater": 'Nice sweater.', - "a t-shirt and jeans": 'Blue jeans, t-shirt.', - "a t-shirt and panties": 'Panties, t-shirt.', - "a t-shirt and thong": 'Thong, t-shirt.', - "a t-shirt": 'T-shirt.', - "a tank-top and panties": 'Tank-top, panties.', - "a tank-top": 'Nice tank-top.', - "a thong": 'Nice thong.', - "a toga": 'Toga.', - "a tube top and thong": 'Tube top, thong.', - "a tube top": 'Nice tube top.', - "an apron": 'Apron.', - "an oversized t-shirt and boys": 'Over-sized t-shirt, boy s.', - "an oversized t-shirt": 'Nice over-sized t-shirt.', - "attractive lingerie for a pregnant woman": 'Preggo lingerie.', - "attractive lingerie": 'Nice lingerie.', - "battlearmor": 'Battlearmor.', - "battledress": 'Battledress.', - "body oil": 'Body oil.', - "boys": 'Boy s.', - "chains": 'Chains.', - "clubslut netting": 'Netting.', - "conservative clothing": 'Conservative clothing.', - "cutoffs and a t-shirt": 'Cutoffs, t-shirt.', - "cutoffs": 'Jean s.', - "harem gauze": 'Harem outfit.', - "jeans": 'Tight blue jeans.', - "kitty lingerie": 'Kitty lingerie.', - "leather pants and a tube top": 'Leather pants, tube top.', - "leather pants and pasties": 'Leather pants, pasties.', - "leather pants": 'Nice leather pants.', - "lederhosen": 'Lederhosen.', - "nice business attire": 'Nice suit.', - "overalls": 'Overalls.', - "panties and pasties": 'Pasties, panties.', - "panties": 'Nice panties.', - "pasties": 'Pasties.', - "restrictive latex": 'Bondage latex.', - "shibari ropes": 'Shibari.', - "slutty business attire": 'Slutty suit.', - "slutty jewelry": 'Bangles.', - "spats and a tank top": 'Spats, tank top.', - "sport s and a sports bra": 'Shorts, bra.', - "sport s and a t-shirt": 'Nice sport s, shirt.', - "sport s": 'Shorts.', - "stretch pants and a crop-top": 'Stretch pants, crop-top.', - "striped panties": 'Striped panties.', - "striped underwear": 'Striped underwear', - "uncomfortable straps": 'Leather straps.', + "Western clothing": "Chaps.", + "a Santa dress": "Santa dress.", + "a ball gown": "Ball gown.", + "a bimbo outfit": "Bimbo outfit.", + "a biyelgee costume": "Biyelgee costume.", + "a bra": "Nice bra.", + "a bunny outfit": "Bunny outfit.", + "a burkini": "Burkini.", + "a burqa": "Burqa.", + "a button-up shirt and panties": "Button-up shirt, panties.", + "a button-up shirt": "Nice button-up shirt.", + "a chattel habit": "Chattel habit.", + "a cheerleader outfit": "Cheerleader.", + "a comfortable bodysuit": "Bodysuit.", + "a courtesan dress": "Courtesan dress.", + "a cybersuit": "Cybersuit.", + "a dirndl": "Dirndl.", + "a fallen nuns habit": "Slutty habit.", + "a gothic lolita dress": "Gothic lolita dress.", + "a halter top dress": "Halter top dress.", + "a hanbok": "Hanbok.", + "a hijab and abaya": "Hijab and abaya.", + "a hijab and blouse": "Hijab and blouse.", + "a huipil": "Huipil.", + "a kimono": "Kimono.", + "a klan robe": "Klan robe.", + "a latex catsuit": "Nice latex.", + "a leotard": "Leotard.", + "a long qipao": "Long Qipao.", + "a maternity dress": "Maternity dress.", + "a military uniform": "Military uniform.", + "a mini dress": "Mini dress.", + "a monokini": "Monokini.", + "a mounty outfit": "Mounty outfit.", + "a nice maid outfit": "Nice maid.", + "a nice nurse outfit": "Nice nurse.", + "a nice pony outfit": "Nice pony outfit.", + "a niqab and abaya": "Niqab and abaya.", + "a one-piece swimsuit": "Swimsuit.", + "a penitent nuns habit": "Cilice.", + "a police uniform": "Police uniform.", + "a red army uniform": "Red Army uniform.", + "a scalemail bikini": "Scalemail bikini.", + "a schoolgirl outfit": "Schoolgirl outfit.", + "a schutzstaffel uniform": "Schutzstaffel uniform.", + "a skimpy loincloth": "Skimpy loincloth.", + "a slave gown": "Slave gown.", + "a slutty klan robe": "Slutty klan robe.", + "a slutty maid outfit": "Slutty maid.", + "a slutty nurse outfit": "Slutty nurse.", + "a slutty outfit": "Slutty outfit.", + "a slutty pony outfit": "Slutty pony outfit.", + "a slutty qipao": "Slutty qipao.", + "a slutty schutzstaffel uniform": "Slutty Schutzstaffel uniform.", + "a sports bra": "Sports bra.", + "a string bikini": "String bikini.", + "a striped bra": "Striped bra.", + "a succubus outfit": "Succubus outfit.", + "a sweater and cutoffs": "Jean shorts, sweater.", + "a sweater and panties": "Sweater, panties.", + "a sweater": "Nice sweater.", + "a t-shirt and jeans": "Blue jeans, t-shirt.", + "a t-shirt and panties": "Panties, t-shirt.", + "a t-shirt and thong": "Thong, t-shirt.", + "a t-shirt": "T-shirt.", + "a tank-top and panties": "Tank-top, panties.", + "a tank-top": "Nice tank-top.", + "a thong": "Nice thong.", + "a toga": "Toga.", + "a tube top and thong": "Tube top, thong.", + "a tube top": "Nice tube top.", + "an apron": "Apron.", + "an oversized t-shirt and boy shorts": "Over-sized t-shirt, boy shorts.", + "an oversized t-shirt": "Nice over-sized t-shirt.", + "attractive lingerie for a pregnant woman": "Preggo lingerie.", + "attractive lingerie": "Nice lingerie.", + "battlearmor": "Battlearmor.", + "battledress": "Battledress.", + "body oil": "Body oil.", + "boyshorts": "Boy shorts.", + "chains": "Chains.", + "clubslut netting": "Netting.", + "conservative clothing": "Conservative clothing.", + "cutoffs and a t-shirt": "Cutoffs, t-shirt.", + "cutoffs": "Jean shorts.", + "harem gauze": "Harem outfit.", + "jeans": "Tight blue jeans.", + "kitty lingerie": "Kitty lingerie.", + "leather pants and a tube top": "Leather pants, tube top.", + "leather pants and pasties": "Leather pants, pasties.", + "leather pants": "Nice leather pants.", + "lederhosen": "Lederhosen.", + "nice business attire": "Nice suit.", + "overalls": "Overalls.", + "panties and pasties": "Pasties, panties.", + "panties": "Nice panties.", + "pasties": "Pasties.", + "restrictive latex": "Bondage latex.", + "shibari ropes": "Shibari.", + "slutty business attire": "Slutty suit.", + "slutty jewelry": "Bangles.", + "spats and a tank top": "Spats, tank top.", + "sport shorts and a sports bra": "Shorts, bra.", + "sport shorts and a t-shirt": "Nice sport shorts, shirt.", + "sport shorts": "Shorts.", + "stretch pants and a crop-top": "Stretch pants, crop-top.", + "striped panties": "Striped panties.", + "striped underwear": "Striped underwear", + "uncomfortable straps": "Leather straps.", }, accessory: { collar: { - "ancient Egyptian": 'Wesekh.', - "ball gag": 'Ball gag.', - "bell collar": 'Bell collar.', - "bit gag": 'Bit gag.', - "bowtie": 'Bowtie collar.', - "cruel retirement counter": 'Cruel counter collar.', - "dildo gag": 'Dildo gag.', - "heavy gold": 'Gold collar.', - "leather with cowbell": 'Cowbell collar.', - "massive dildo gag": 'Throat-bulging dildo gag.', - "neck corset": 'Neck corset.', - "nice retirement counter": 'Nice counter collar.', - "porcelain mask": 'Porcelain mask.', - "preg biometrics": 'Pregnancy biometrics collar.', - "pretty jewelry": 'Pretty collar.', - "satin choker": 'Satin choker.', - "shock punishment": 'Shock collar.', - "silk ribbon": 'Silken ribbon.', - "stylish leather": 'Stylish leather collar.', - "tight steel": 'Steel collar.', - "uncomfortable leather": 'Leather collar.', + "ancient Egyptian": "Wesekh.", + "ball gag": "Ball gag.", + "bell collar": "Bell collar.", + "bit gag": "Bit gag.", + "bowtie": "Bowtie collar.", + "cruel retirement counter": "Cruel counter collar.", + "dildo gag": "Dildo gag.", + "heavy gold": "Gold collar.", + "leather with cowbell": "Cowbell collar.", + "massive dildo gag": "Throat-bulging dildo gag.", + "neck corset": "Neck corset.", + "nice retirement counter": "Nice counter collar.", + "porcelain mask": "Porcelain mask.", + "preg biometrics": "Pregnancy biometrics collar.", + "pretty jewelry": "Pretty collar.", + "satin choker": "Satin choker.", + "shock punishment": "Shock collar.", + "silk ribbon": "Silken ribbon.", + "stylish leather": "Stylish leather collar.", + "tight steel": "Steel collar.", + "uncomfortable leather": "Leather collar.", }, belly: { - "a corset": 'Corset.', - "a huge empathy belly": 'Huge fake belly.', - "a large empathy belly": 'Large fake belly.', - "a medium empathy belly": 'Medium fake belly.', - "a small empathy belly": 'Small fake belly.', - "a support band": 'Support band.', - "an extreme corset": 'Extreme corsetage.', - "shapewear": 'Shapewear.', + "a corset": "Corset.", + "a huge empathy belly": "Huge fake belly.", + "a large empathy belly": "Large fake belly.", + "a medium empathy belly": "Medium fake belly.", + "a small empathy belly": "Small fake belly.", + "a support band": "Support band.", + "an extreme corset": "Extreme corsetage.", + "shapewear": "Shapewear.", }, vaginal: { "bullet vibrator": "Attached bullet vibrator.", @@ -155,10 +217,523 @@ App.Data.SlaveSummary = { "long dildo": "Long vaginal dildo.", "long, large dildo": "Long and large vaginal dildo.", "long, huge dildo": "Long and wide vaginal dildo.", + }, + buttplug: { + "plug": "Buttplug.", + "large plug": "Large buttplug.", + "huge plug": "Huge buttplug.", + "long plug": "Long buttplug.", + "long, large plug": "Large, long buttplug.", + "long, huge plug": "Enormous buttplug.", + }, + buttplugAttachment: { + "tail": "Attached tail.", + "cat tail": "Attached cat tail.", + "fox tail": "Attached fox tail.", + "cow tail": "Attached cow tail.", + } + }, + diet: { + "restricted": "Dieting.", + "fattening": "Gaining weight.", + "corrective": "Corrective.", + "XX": "Estrogen rich.", + "XY": "Testosterone rich.", + "XXY": "Futanari mix.", + "muscle building": "Pumping iron.", + "slimming": "Slimming down.", + "cum production": "Cum production.", + "cleansing": "Cleansing.", + "fertility": "Fertility.", + }, + race: { + "white": "Caucasian", + "asian": "Asian", + "indo-aryan": "Indo-aryan", + "latina": "Latina", + "middle eastern": "Middle Eastern", + "black": "Black", + "pacific islander": "Pacific Islander", + "malay": "Malay", + "amerindian": "Amerindian", + "semitic": "Semitic", + "southern european": "Southern European", + "mixed race": "Mixed race", + }, + hormoneBalance: { // rating is hormoneBalance value + 400 + 0: "Overwhelmingly masculine", + 100: "Extremely masculine", + 200: "Heavily masculine", + 300: "Very masculine", + 379: "Masculine", + 420: "Neutral", + 499: "Feminine", + 599: "Very feminine", + 699: "Heavily feminine", + 799: "Extremely feminine", + 900: "Overwhelmingly feminine" + }, + health: { + illness: { + 0: {desc: "Sick", style: "yellow"}, + 2: {desc: "Ill", style: ["red", "strong"]}, + 3: {desc: "Very ill", style: ["red", "strong"]}, + 4: {desc: "Terribly ill", style: ["red", "strong"]} + }, + tiredness: { + 0: {desc: "Energetic", style: "green"}, + 31: {desc: "Tired", style: "yellow"}, + 61: {desc: "Fatigued", style: "orange"}, + 91: {desc: "Exhausted", style: ["red", "strong"]} + }, + health: { // health + 100 + 0: {desc: "On the edge of death", style: ["red", "strong"]}, + 10: {desc: "Extremely unhealthy", style: ["red", "strong"]}, + 50: {desc: "Unhealthy", style: ["red", "strong"]}, + 80: {desc: "healthy", style: "yellow"}, + 121: {desc: "Very healthy", style: "green"}, + 151: {desc: "Extremely healthy", style: "green"}, + 191: {desc: "Unnaturally healthy", style: "green"} + }, + }, + prestige: { + 0: null, + 1: {desc: "Prestigious.", style: "green"}, + 2: {desc: "Very prestigious.", style: "green"}, + 3: {desc: "Extremely prestigious.", style: "green"}, + }, + accent: { + 1: {desc: "Cute accent.", style: "pink"}, + 2: {desc: "Accent."}, + 3: {desc: "Bad accent.", style: "red"}, + 4: {desc: "No language skills.", style: "red"}, + } + }, + short: { + body: { + age: { + 18: "18", + 19: "19", + 20: "Ea20s", + 25: "Lt20s", + 30: "Ea30s", + 35: "Lt30s", + 40: "40s" + }, + face: { // face value + 100 + 0: {desc: "Face---", style: "red"}, + 5: {desc: "Face--", style: "red"}, + 60: {desc: "Face-", style: "red"}, + 90: {desc: "Face"}, + 111: {desc: "Face+", style: "pink"}, + 141: {desc: "Face++", style: "pink"}, + 196: {desc: "Face+++", style: "pink"}, + }, + lips: { + 0: {desc: "Lips-", style: "red"}, + 11: {desc: "Lips"}, + 21: {desc: "Lips+"}, + 41: {desc: "Lips++"}, + 71: {desc: "Lips+++"}, + 96: {desc: "Facepussy"} + }, + teeth: { + "crooked": {desc: "Cr Teeth", style: "yellow"}, + "gapped": {desc: "Gap", style: "yellow"}, + "cosmetic braces": {desc: "Cos Braces"}, + "straightening braces": {desc: "Braces"}, + "removable": {desc: "Rem Teeth"}, + "pointy": {desc: "Fangs"}, + "baby": {desc: "Baby"}, + "mixed": {desc: "Mixed"} + }, + waist: { // waist value + 100 + 0: {desc: "Wst+++", style: "pink"}, + 5: {desc: "Wst++", style: "pink"}, + 60: {desc: "Wst+", style: "pink"}, + 90: {desc: "Wst"}, + 111: {desc: "Wst-", style: "red"}, + 141: {desc: "Wst--", style: "red"}, + 195: {desc: "Wst---", style: "red"} + } + }, + mental: { + behavioralFlaw: { + "arrogant": "Arrog", + "bitchy": "Bitchy", + "odd": "Odd", + "hates men": "Men-", + "hates women": "Women-", + "gluttonous": "Glut", + "anorexic": "Ano", + "devout": "Dev", + "liberated": "Lib", + }, + sexualFlaw: { + "hates oral": {desc: "Oral-", style: "red"}, + "hates anal": {desc: "Anal-", style: "red"}, + "hates penetration": {desc: "Fuck-", style: "red"}, + "shamefast": {desc: "Shame", style: "red"}, + "idealistic": {desc: "Ideal", style: "red"}, + "repressed": {desc: "Repre", style: "red"}, + "apathetic": {desc: "Apath", style: "red"}, + "crude": {desc: "Crude", style: "red"}, + "judgemental": {desc: "Judge", style: "red"}, + "cum addict": {desc: "CumAdd", style: "yellow"}, + "anal addict": {desc: "AnalAdd", style: "yellow"}, + "attention whore": {desc: "Attention", style: "yellow"}, + "breast growth": {desc: "BoobObsess", style: "yellow"}, + "abusive": {desc: "Abusive", style: "yellow"}, + "malicious": {desc: "Malice", style: "yellow"}, + "self hating": {desc: "SelfHatr", style: "yellow"}, + "neglectful": {desc: "SelfNeglect", style: "yellow"}, + "breeder": {desc: "BreedObsess", style: "yellow"}, + }, + behavioralQuirk: { + "confident": "Confid", + "cutting": "Cutting", + "funny": "Funny", + "fitness": "Fit", + "adores women": "Women+", + "adores men": "Men+", + "insecure": "Insec", + "sinful": "Sinf", + "advocate": "Advoc", + }, + sexualQuirk: { + "gagfuck queen": "Gagfuck", + "painal queen": "Painal", + "strugglefuck queen": "Struggle", + "tease": "Tease", + "romantic": "Romantic", + "perverted": "Perverted", + "caring": "Caring", + "unflinching": "Unflinch", + "size queen": "SizeQ", + } + }, + health: { + tiredness: { + 0: {desc: "Ene", style: "green"}, + 31: {desc: "Tir", style: "yellow"}, + 61: {desc: "Tir+", style: "orange"}, + 91: {desc: "Exh", style: ["red", "strong"]} } }, - short: { + accent: { + 1: {desc: "Acc", style: "pink"}, + 2: {desc: "Acc-"}, + 3: {desc: "Acc--"}, + 4: {desc: "Acc--", style: "red"}, + }, + diet: { + "restricted": "Di:W-", + "fattening": "Di:W+", + "corrective": "Di:W=", + "XX": "Di:XX+", + "XY": "Di:XY+", + "XXY": "Di:XXY+", + "muscle building": "Di:M+", + "slimming": "Di:M-", + "cum production": "Di:C+", + "cleansing": "Di:H+", + "fertility": "Di:F+", }, + drugs: { + "breast injections": "Boobs+", + "intensive breast injections": "Boobs++", + "hyper breast injections": "Boobs+++", + "nipple enhancers": "Nipple+", + "butt injections": "Butt+", + "intensive butt injections": "Butt++", + "hyper butt injections": "Butt+++", + "lip injections": "Lip+", + "fertility drugs": "Fert+", + "super fertility drugs": "Fert++", + "penis enhancement": "Dick+", + "intensive penis enhancement": "Dick++", + "hyper penis enhancement": "Dick+++", + "testicle enhancement": "Balls+", + "intensive testicle enhancement": "Balls++", + "hyper testicle enhancement": "Balls+++", + "psychosuppressants": "Psych-", + "psychostimulants": "Psych+", + "steroids": "Ster", + "female hormone injections": "HormXX++", + "male hormone injections": "HormXY++", + "hormone enhancers": "Horm+", + "hormone blockers": "Horm-", + "anti-aging cream": "Age-", + "appetite suppressors": "ApSup", + "penis atrophiers": "Dick-", + "testicle atrophiers": "Balls-", + "clitoris atrophiers": "Clit-", + "labia atrophiers": "Labia-", + "nipple atrophiers": "Nipple-", + "lip atrophiers": "Lip-", + "breast redistributors": "Breast-", + "butt redistributors": "Butt-", + "sag-B-gone": "AntiSag", + "growth stimulants": "GroStim", + "priapism agents": "Erection" + }, + nationality: { // NOTE this dictionary lacks "Zimbabwean" key, which is a spacial case + "Afghan": "Afg", + "Albanian": "Alb", + "Algerian": "Alg", + "American": "USA", + "Andorran": "And", + "Angolan": "Ang", + "Antiguan": "AB", + "Argentinian": "Arg", + "Armenian": "Arm", + "Aruban": "Aru", + "Australian": "Aus", + "Austrian": "Aut", + "Azerbaijani": "Aze", + "Bahamian": "Bah", + "Bahraini": "Bah", + "Bangladeshi": "Bgd", + "Barbadian": "Bar", + "Belarusian": "Ber", + "Belgian": "Bel", + "Belizean": "Blz", + "Beninese": "Ben", + "Bermudian": "Bmd", + "Bhutanese": "Bhu", + "Bissau-Guinean": "GB", + "Bolivian": "Bol", + "Bosnian": "Bos", + "Brazilian": "Bra", + "British": "UK", + "Bruneian": "Bru", + "Bulgarian": "Bul", + "Burkinabé": "BF", + "Burmese": "Bur", + "Burundian": "Bnd", + "Cambodian": "Kam", + "Cameroonian": "Cam", + "Canadian": "Can", + "Cape Verdean": "CV", + "Catalan": "Cat", + "Central African": "CAR", + "Chadian": "Cha", + "Chilean": "Chl", + "Chinese": "Chi", + "Colombian": "Col", + "Comorian": "Com", + "Congolese": "RC", + "a Cook Islander": "CI", + "Costa Rican": "CR", + "Croatian": "Cro", + "Cuban": "Cub", + "Curaçaoan": "Cur", + "Cypriot": "Cyp", + "Czech": "Cze", + "Danish": "Den", + "Djiboutian": "Dji", + "Dominican": "DR", + "Dominiquais": "Dom", + "Dutch": "Nld", + "East Timorese": "ET", + "Ecuadorian": "Ecu", + "Egyptian": "Egy", + "Emirati": "UAE", + "Equatoguinean": "EG", + "Eritrean": "Eri", + "Estonian": "Est", + "Ethiopian": "Eth", + "Fijian": "Fij", + "Filipina": "Phl", + "Finnish": "Fin", + "French": "Fra", + "French Guianan": "FG", + "French Polynesian": "FP", + "Gabonese": "Gab", + "Gambian": "Gam", + "Georgian": "Geo", + "German": "Ger", + "Ghanan": "Gha", + "Greek": "Gre", + "Greenlandic": "Grn", + "Grenadian": "Gda", + "Guamanian": "Gua", + "Guatemalan": "Gtm", + "Guinean": "Gui", + "Guyanese": "Guy", + "Haitian": "Hai", + "Honduran": "Hon", + "Hungarian": "Hun", + "I-Kiribati": "Kir", + "Icelandic": "Ice", + "Indian": "Ind", + "Indonesian": "Idn", + "Iranian": "Irn", + "Iraqi": "Irq", + "Irish": "Irl", + "Israeli": "Isr", + "Italian": "Ita", + "Ivorian": "IC", + "Jamaican": "Jam", + "Japanese": "Jpn", + "Jordanian": "Jor", + "Kazakh": "Kaz", + "Kenyan": "Ken", + "Kittitian": "SKN", + "Korean": "Kor", + "Kosovan": "Kos", + "Kurdish": "Kur", + "Kuwaiti": "Kuw", + "Kyrgyz": "Kyr", + "Laotian": "Lao", + "Latvian": "Lat", + "Lebanese": "Lbn", + "Liberian": "Lib", + "Libyan": "Lby", + "a Liechtensteiner": "Lie", + "Lithuanian": "Lit", + "Luxembourgian": "Lux", + "Macedonian": "Mac", + "Malagasy": "Mad", + "Malawian": "Mwi", + "Malaysian": "Mys", + "Maldivian": "Mdv", + "Malian": "Mal", + "Maltese": "Mlt", + "Marshallese": "MI", + "Mauritanian": "Mta", + "Mauritian": "Mts", + "Mexican": "Mex", + "Micronesian": "FSM", + "Moldovan": "Mol", + "Monégasque": "Mnc", + "Mongolian": "Mon", + "Montenegrin": "Mng", + "Moroccan": "Mor", + "Mosotho": "Les", + "Motswana": "Bot", + "Mozambican": "Moz", + "Namibian": "Nam", + "Nauruan": "Nau", + "Nepalese": "Npl", + "New Caledonian": "NC", + "a New Zealander": "NZ", + "Ni-Vanuatu": "Van", + "Nicaraguan": "Nic", + "Nigerian": "Nga", + "Nigerien": "Ngr", + "Niuean": "Niu", + "Norwegian": "Nor", + "Omani": "Omn", + "Pakistani": "Pak", + "Palauan": "Plu", + "Palestinian": "Pal", + "Panamanian": "Pan", + "Papua New Guinean": "PNG", + "Paraguayan": "Par", + "Peruvian": "Per", + "Polish": "Pol", + "Portuguese": "Por", + "Puerto Rican": "PR", + "Qatari": "Qat", + "Romanian": "Rom", + "Russian": "Rus", + "Rwandan": "Rwa", + "Sahrawi": "Sah", + "Saint Lucian": "SL", + "Salvadoran": "ES", + "Sammarinese": "SM", + "Samoan": "Sam", + "São Toméan": "STP", + "Saudi": "Sau", + "Scottish": "Sco", + "Senegalese": "Sen", + "Serbian": "Srb", + "Seychellois": "Sey", + "Sierra Leonean": "Sie", + "Singaporean": "Sng", + "Slovak": "Svk", + "Slovene": "Svn", + "a Solomon Islander": "SI", + "Somali": "Som", + "South African": "RSA", + "South Sudanese": "SS", + "Spanish": "Spa", + "Sri Lankan": "Sri", + "Sudanese": "Sud", + "Surinamese": "Sur", + "Swazi": "Swa", + "Swedish": "Swe", + "Swiss": "Swi", + "Syrian": "Syr", + "Taiwanese": "Tai", + "Tajik": "Taj", + "Tanzanian": "Tza", + "Thai": "Tha", + "Tibetan": "Tib", + "Togolese": "Tog", + "Tongan": "Ton", + "Trinidadian": "TT", + "Tunisian": "Tun", + "Turkish": "Tur", + "Turkmen": "Tkm", + "Tuvaluan": "Tuv", + "Ugandan": "Uga", + "Ukrainian": "Ukr", + "Uruguayan": "Uru", + "Uzbek": "Uzb", + "Vatican": "VC", + "Venezuelan": "Ven", + "Vietnamese": "Vnm", + "Vincentian": "SVG", + "Yemeni": "Yem", + "Zairian": "DRC", + "Zambian": "Zam", + "Ancient Chinese Revivalist": "Chi Rev", + "Ancient Egyptian Revivalist": "Egy Rev", + "Arabian Revivalist": "Ara Rev", + "Aztec Revivalist": "Azt Rev", + "Edo Revivalist": "Edo Rev", + "Roman Revivalist": "Rom Rev", + "": "None", + "none": "None", + "slave": "None", + "Stateless": "None" + }, + race: { + "white": "C", + "asian": "A", + "indo-aryan": "I", + "latina": "L", + "middle eastern": "ME", + "black": "B", + "pacific islander": "PI", + "malay": "M", + "amerindian": "AI", + "semitic": "S", + "southern european": "SE", + "mixed race": "MR", + }, + skin: { + "pure white": "P. Whi", + "extremely fair": "E. Fai", + "very fair": "V. Fai", + "extremely pale": "E. Pal", + "very pale": "V. Pal", + "light brown": "L. Br", + "dark brown": "D. Br", + "light olive": "L. Oli", + "dark olive": "D. Oli", + "light beige": "L. Bei", + "dark beige": "D. Bei", + "tan": "Tan", + "bronze": "Bron", + "ebony": "Ebon", + "pure black": "P. Bla", + "dark": "Dark", + "fair": "Fair", + "pale": "Pale" + } } -} +}; diff --git a/src/js/slaveSummaryHelpers.js b/src/js/slaveSummaryHelpers.js index d08727fb011..f5bfc39e741 100644 --- a/src/js/slaveSummaryHelpers.js +++ b/src/js/slaveSummaryHelpers.js @@ -5,6 +5,8 @@ /* eslint-disable camelcase */ App.UI.SlaveSummaryImpl = function() { + const data = App.Data.SlaveSummary; + const helpers = function() { /** * @param {HTMLElement} element @@ -110,13 +112,71 @@ App.UI.SlaveSummaryImpl = function() { return ratings[p]; } + /** + * @typedef {object} StyledDesc + * @property {string} desc + * @property {string|string[]} [style] + */ + + /** @typedef {Object.<string, StyledDesc>} StyledRatings */ + /** + * @param {Node} container + * @param {StyledRatings} ratings + * @param {number} [value] + * @param {number} [offset] value offset in the ratings dictionary (to eliminate negative values) + * @param {boolean} [stdDecor=false] + */ + function makeRatedStyledSpan(container, ratings, value, offset = 0, stdDecor = false) { + /** @type {StyledDesc} */ + const d = getNumericRating(ratings, value + offset); + makeSpan(container, d.desc, d.style, stdDecor, value); + } + + /** + * @param {Node} container + * @param {StyledRatings} ratings + * @param {string|number} value + */ + function makeStyledSpan(container, ratings, value) { + const d = ratings[value]; + if (d) { + makeSpan(container, d.desc, d.style); + } + } + + /** + * @param {Node} container + * @param {Object.<string, string>} ratings + * @param {string|number} value + * @param {string|string[]} [classNames] + */ + function makeMappedSpan(container, ratings, value, classNames) { + const d = ratings[value]; + if (d) { + makeSpan(container, d, classNames); + } + } + + /** + * Returns first three string characters with the first one uppercased (string -> Str) + * @param {string} s + * @returns {string} + */ + function firstThreeUc(s) { + return s.charAt(0).toUpperCase() + s.charAt(1) + s.charAt(2); + } + return { addText: addText, makeSpan: makeSpan, makeBlock: makeBlock, makeParagraph: makeParagraph, getExactRating: getExactRating, - getNumericRating: getNumericRating + getNumericRating: getNumericRating, + makeRatedStyledSpan: makeRatedStyledSpan, + makeStyledSpan: makeStyledSpan, + makeMappedSpan: makeMappedSpan, + firstThreeUc: firstThreeUc }; }(); @@ -124,6 +184,7 @@ App.UI.SlaveSummaryImpl = function() { const addText = helpers.addText; const makeSpan = helpers.makeSpan; const makeBlock = helpers.makeBlock; + const makeRatedStyledSpan = helpers.makeRatedStyledSpan; /** * @param {App.Entity.SlaveState} slave * @param {Node} c @@ -152,11 +213,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function short_illness(slave, c) { - if (slave.health.illness > 4) { - makeSpan(c, `Ill${slave.health.illness}`, ["red", "strong"], true, slave.health.illness); - } else if (slave.health.illness > 3) { - makeSpan(c, `Ill${slave.health.illness}`, ["red", "strong"], true, slave.health.illness); - } else if (slave.health.illness > 2) { + if (slave.health.illness > 2) { makeSpan(c, `Ill${slave.health.illness}`, ["red", "strong"], true, slave.health.illness); } else if (slave.health.illness > 0) { makeSpan(c, `Ill${slave.health.illness}`, ["yellow", "strong"], true, slave.health.illness); @@ -169,15 +226,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function short_tired(slave, c) { - if (slave.health.tired > 90) { - makeSpan(c, "Exh", ["red", "strong"], true, slave.health.tired); - } else if (slave.health.tired > 60) { - makeSpan(c, "Tir+", "orange", true, slave.health.tired); - } else if (slave.health.tired > 30) { - makeSpan(c, "Tir", "yellow", true, slave.health.tired); - } else if (slave.health.tired < 0) { - makeSpan(c, "Ene", "green", true, slave.health.tired); - } + helpers.makeRatedStyledSpan(c, data.short.health.tiredness, slave.health.tired, 0, true); } /** @@ -186,21 +235,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function long_health(slave, c) { - if (slave.health.health < -90) { - makeSpan(c, "On the edge of death", ["red", "strong"], true, slave.health.health); - } else if (slave.health.health < -50) { - makeSpan(c, "Extremely unhealthy", ["red", "strong"], true, slave.health.health); - } else if (slave.health.health < -20) { - makeSpan(c, "Unhealthy", ["red", "strong"], true, slave.health.health); - } else if (slave.health.health <= 20) { - makeSpan(c, "healthy", "yellow", true, slave.health.health); - } else if (slave.health.health <= 50) { - makeSpan(c, "Very healthy", "green", true, slave.health.health); - } else if (slave.health.health <= 90) { - makeSpan(c, "Extremely healthy", "green", true, slave.health.health); - } else { - makeSpan(c, "Unnaturally healthy", "green", true, slave.health.health); - } + helpers.makeRatedStyledSpan(c, data.long.health.health, slave.health.health, 100, true); if (passage() === "Clinic" && V.clinicUpgradeScanner) { if (slave.chem > 15) { makeSpan(c, `Carcinogen buildup: ${Math.ceil(slave.chem / 10)}.`, "cyan"); @@ -216,15 +251,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function long_illness(slave, c) { - if (slave.health.illness > 4) { - makeSpan(c, "Terribly ill", ["red", "strong"], true, slave.health.illness); - } else if (slave.health.illness > 3) { - makeSpan(c, "Very ill", ["red", "strong"], true, slave.health.illness); - } else if (slave.health.illness > 2) { - makeSpan(c, "Ill", ["red", "strong"], true, slave.health.illness); - } else if (slave.health.illness > 0) { - makeSpan(c, "Sick", "yellow", true, slave.health.illness); - } + makeRatedStyledSpan(c, data.long.health.illness, slave.health.illness, 0, true); } /** @@ -233,15 +260,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function long_tired(slave, c) { - if (slave.health.tired > 90) { - makeSpan(c, "Exhausted", ["red", "strong"], true, slave.health.tired); - } else if (slave.health.tired > 60) { - makeSpan(c, "Fatigued", "orange", true, slave.health.tired); - } else if (slave.health.tired > 30) { - makeSpan(c, "Tired", "yellow", true, slave.health.tired); - } else if (slave.health.tired < 0) { - makeSpan(c, "Energetic", "green", true, slave.health.tired); - } + makeRatedStyledSpan(c, data.long.health.tiredness, slave.health.tired, 0, true); } /** @@ -253,22 +272,8 @@ App.UI.SlaveSummaryImpl = function() { let r = makeSpan(c, "", "pink"); if (V.showAgeDetail === 1) { r.textContent += `Age ` + `${slave.actualAge}` + `.`; - } else if (slave.actualAge >= 40) { - r.textContent += `Forties.`; - } else if (slave.actualAge >= 35) { - r.textContent += `Late thirties.`; - } else if (slave.actualAge >= 30) { - r.textContent += `Early thirties.`; - } else if (slave.actualAge >= 25) { - r.textContent += `Late twenties.`; - } else if (slave.actualAge >= 20) { - r.textContent += `Early twenties.`; - } else if (slave.actualAge >= 19) { - r.textContent += `Nineteen.`; - } else if (slave.actualAge >= 18) { - r.textContent += `Eighteen.`; } else { - r.textContent += `Underage.`; + r.textContent += helpers.getNumericRating(data.long.body.age, slave.actualAge); } /* ** No NCS, then do the standard, However because of the wrinkles of Incubators, as long as visual age is greater @@ -304,21 +309,8 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function long_face(slave, c) { - if (slave.face < -95) { - makeSpan(c, `Very ugly ${slave.faceShape} face`, "red", true, slave.face); - } else if (slave.face < -40) { - makeSpan(c, `Ugly ${slave.faceShape} face`, "red", true, slave.face); - } else if (slave.face < -10) { - makeSpan(c, `Unattractive ${slave.faceShape} face`, "red", true, slave.face); - } else if (slave.face <= 10) { - makeSpan(c, `Average ${slave.faceShape} face`, null, true, slave.face); - } else if (slave.face <= 40) { - makeSpan(c, `Attractive ${slave.faceShape} face`, "pink", true, slave.face); - } else if (slave.face <= 95) { - makeSpan(c, `Beautiful ${slave.faceShape} face`, "pink", true, slave.face); - } else { - makeSpan(c, `Very beautiful ${slave.faceShape} face`, "pink", true, slave.face); - } + const r = helpers.getNumericRating(data.long.body.face, slave.face + 100); + makeSpan(c, `${r.desc} ${slave.faceShape} face`, r.style, true, slave.face); } /** @@ -353,19 +345,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function long_lips(slave, c) { - if (slave.lips > 95) { - makeSpan(c, "Facepussy", undefined, true, slave.lips); - } else if (slave.lips > 70) { - makeSpan(c, "Huge lips", undefined, true, slave.lips); - } else if (slave.lips > 40) { - makeSpan(c, "Big lips", undefined, true, slave.lips); - } else if (slave.lips > 20) { - makeSpan(c, "Pretty lips", undefined, true, slave.lips); - } else if (slave.lips > 10) { - makeSpan(c, "Normal lips", undefined, true, slave.lips); - } else { - makeSpan(c, "Thin lips", "red", true, slave.lips); - } + makeRatedStyledSpan(c, data.long.body.lips, slave.lips, 0, true); } /** @@ -374,23 +354,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function long_teeth(slave, c) { - if (slave.teeth === "crooked") { - makeSpan(c, "Crooked teeth.", "yellow"); - } else if (slave.teeth === "gapped") { - makeSpan(c, "Tooth gap.", "yellow"); - } else if (slave.teeth === "cosmetic braces") { - makeSpan(c, "Cosmetic braces."); - } else if (slave.teeth === "straightening braces") { - makeSpan(c, "Braces."); - } else if (slave.teeth === "removable") { - makeSpan(c, "Removable teeth."); - } else if (slave.teeth === "pointy") { - makeSpan(c, "Sharp fangs."); - } else if (slave.teeth === "baby") { - makeSpan(c, "Baby teeth."); - } else if (slave.teeth === "mixed") { - makeSpan(c, "Mixed teeth."); - } + helpers.makeStyledSpan(c, data.long.body.teeth, slave.teeth); } /** @@ -435,15 +399,7 @@ App.UI.SlaveSummaryImpl = function() { if (slave.voice === 0) { makeSpan(c, "Mute.", "red"); } else { - if (slave.accent === 3) { - makeSpan(c, "Bad accent.", "red"); - } else if (slave.accent === 4) { - makeSpan(c, "No language skills.", "red"); - } else if (slave.accent === 2) { - makeSpan(c, "Accent."); - } else if (slave.accent === 1) { - makeSpan(c, "Cute accent.", "pink"); - } + helpers.makeStyledSpan(c, data.long.accent, slave.accent); } } @@ -531,21 +487,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function long_waist(slave, c) { - if (slave.waist > 95) { - makeSpan(c, "Masculine waist", "red", true, slave.waist); - } else if (slave.waist > 40) { - makeSpan(c, "Ugly waist", "red", true, slave.waist); - } else if (slave.waist > 10) { - makeSpan(c, "Unattractive waist", "red", true, slave.waist); - } else if (slave.waist >= -10) { - makeSpan(c, "Average waist", null, true, slave.waist); - } else if (slave.waist >= -40) { - makeSpan(c, "Feminine waist", "pink", true, slave.waist); - } else if (slave.waist >= -95) { - makeSpan(c, "Hourglass waist", "pink", true, slave.waist); - } else { - makeSpan(c, "Absurdly narrow waist", "pink", true, slave.waist); - } + makeRatedStyledSpan(c, data.long.body.waist, slave.waist, 100, true); } /** @@ -604,19 +546,10 @@ App.UI.SlaveSummaryImpl = function() { let r = makeSpan(c, "", "pink"); if (V.showAgeDetail === 1) { r.textContent += slave.actualAge.toString(); - } else if (slave.actualAge >= 40) { - r.textContent += "40s"; - } else if (slave.actualAge >= 35) { - r.textContent += "Lt30s"; - } else if (slave.actualAge >= 30) { - r.textContent += "Ea30s"; - } else if (slave.actualAge >= 25) { - r.textContent += "Lt20s"; - } else if (slave.actualAge >= 20) { - r.textContent += "Ea20s"; } else if (slave.actualAge >= 18) { - r.textContent += slave.actualAge.toString(); + r.textContent += helpers.getNumericRating(data.short.body.age, slave.actualAge); } + if (slave.actualAge !== slave.physicalAge) { r.textContent += ` w ${slave.physicalAge}y-bdy`; } @@ -631,21 +564,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function short_face(slave, c) { - if (slave.face < -95) { - makeSpan(c, "Face---", "red", true, slave.face); - } else if (slave.face < -40) { - makeSpan(c, "Face--", "red", true, slave.face); - } else if (slave.face < -10) { - makeSpan(c, "Face-", "red", true, slave.face); - } else if (slave.face <= 10) { - makeSpan(c, "Face", null, true, slave.face); - } else if (slave.face <= 40) { - makeSpan(c, "Face+", "pink", true, slave.face); - } else if (slave.face <= 95) { - makeSpan(c, "Face++", "pink", true, slave.face); - } else { - makeSpan(c, "Face+++", "pink", true, slave.face); - } + makeRatedStyledSpan(c, data.short.body.face, slave.face, 100, true); } /** @@ -680,19 +599,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function short_lips(slave, c) { - if (slave.lips > 95) { - makeSpan(c, "Facepussy"); - } else if (slave.lips > 70) { - makeSpan(c, "Lips+++", null, true, slave.lips); - } else if (slave.lips > 40) { - makeSpan(c, "Lips++", null, true, slave.lips); - } else if (slave.lips > 20) { - makeSpan(c, "Lips+", null, true, slave.lips); - } else if (slave.lips > 10) { - makeSpan(c, "Lips", null, true, slave.lips); - } else { - makeSpan(c, "Lips-", "red", true, slave.lips); - } + makeRatedStyledSpan(c, data.short.body.lips, slave.lips, 0, true); } /** @@ -701,23 +608,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function short_teeth(slave, c) { - if (slave.teeth === "crooked") { - makeSpan(c, "Cr Teeth", "yellow"); - } else if (slave.teeth === "gapped") { - makeSpan(c, "Gap", "yellow"); - } else if (slave.teeth === "cosmetic braces") { - makeSpan(c, `Cos Braces`); - } else if (slave.teeth === "straightening braces") { - makeSpan(c, `Braces`); - } else if (slave.teeth === "removable") { - makeSpan(c, `Rem Teeth`); - } else if (slave.teeth === "pointy") { - makeSpan(c, `Fangs`); - } else if (slave.teeth === "baby") { - makeSpan(c, `Baby`); - } else if (slave.teeth === "mixed") { - makeSpan(c, `Mixed`); - } + helpers.makeStyledSpan(c, data.short.body.teeth, slave.teeth); } /** @@ -762,15 +653,7 @@ App.UI.SlaveSummaryImpl = function() { if (slave.voice === 0) { makeSpan(c, "Mute", "red"); } else { - if (slave.accent === 3) { - makeSpan(c, "Acc--", "red"); - } else if (slave.accent === 2) { - makeSpan(c, "Acc-"); - } else if (slave.accent === 4) { - makeSpan(c, "Acc--"); - } else if (slave.accent === 1) { - makeSpan(c, "Acc", "pink"); - } + helpers.makeStyledSpan(c, data.short.accent, slave.accent); } } @@ -861,21 +744,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function short_waist(slave, c) { - if (slave.waist > 95) { - makeSpan(c, "Wst---", "red", false, slave.waist); - } else if (slave.waist > 40) { - makeSpan(c, "Wst--", "red", false, slave.waist); - } else if (slave.waist > 10) { - makeSpan(c, "Wst-", "red", false, slave.waist); - } else if (slave.waist >= -10) { - makeSpan(c, "Wst", undefined, false, slave.waist); - } else if (slave.waist >= -40) { - makeSpan(c, "Wst+", "pink", false, slave.waist); - } else if (slave.waist >= -95) { - makeSpan(c, "Wst++", "pink", false, slave.waist); - } else { - makeSpan(c, "Wst+++", "pink", false, slave.waist); - } + makeRatedStyledSpan(c, data.short.body.waist, slave.waist, 100, false); } /** @@ -1351,40 +1220,8 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function long_buttplug(slave, c) { - switch (slave.buttplug) { - case "plug": - makeSpan(c, "Buttplug."); - break; - case "large plug": - makeSpan(c, "Large buttplug."); - break; - case "huge plug": - makeSpan(c, "Huge buttplug."); - break; - case "long plug": - makeSpan(c, "Long buttplug."); - break; - case "long, large plug": - makeSpan(c, "Large, long buttplug."); - break; - case "long, huge plug": - makeSpan(c, "Enormous buttplug."); - break; - } - switch (slave.buttplugAttachment) { - case "tail": - makeSpan(c, "Attached tail."); - break; - case "cat tail": - makeSpan(c, "Attached cat tail."); - break; - case "fox tail": - makeSpan(c, "Attached fox tail."); - break; - case "cow tail": - makeSpan(c, "Attached cow tail."); - break; - } + helpers.makeMappedSpan(c, data.long.accessory.buttplug, slave.buttplug); + helpers.makeMappedSpan(c, data.long.accessory.buttplugAttachment, slave.buttplugAttachment); } /** @@ -1680,35 +1517,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function short_behavior_flaw(slave, c) { - function descStr() { - switch (slave.behavioralFlaw) { - case "arrogant": - return `Arrog`; - case "bitchy": - return `Bitchy`; - case "odd": - return `Odd`; - case "hates men": - return `Men-`; - case "hates women": - return `Women-`; - case "gluttonous": - return `Glut`; - case "anorexic": - return `Ano`; - case "devout": - return `Dev`; - case "liberated": - return `Lib`; - default: - slave.behavioralFlaw = "none"; - return null; - } - } - const s = descStr(); - if (s) { - makeSpan(c, descStr(), "red"); - } + helpers.makeMappedSpan(c, data.short.mental.behavioralFlaw, slave.behavioralFlaw, "red"); } /** @@ -1717,65 +1526,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function short_sex_flaw(slave, c) { - switch (slave.sexualFlaw) { - case "hates oral": - makeSpan(c, "Oral-", "red"); - break; - case "hates anal": - makeSpan(c, "Anal-", "red"); - break; - case "hates penetration": - makeSpan(c, "Fuck-", "red"); - break; - case "shamefast": - makeSpan(c, "Shame", "red"); - break; - case "idealistic": - makeSpan(c, "Ideal", "red"); - break; - case "repressed": - makeSpan(c, "Repre", "red"); - break; - case "apathetic": - makeSpan(c, "Apath", "red"); - break; - case "crude": - makeSpan(c, "Crude", "red"); - break; - case "judgemental": - makeSpan(c, "Judge", "red"); - break; - case "cum addict": - makeSpan(c, "CumAdd", "yellow"); - break; - case "anal addict": - makeSpan(c, "AnalAdd", "yellow"); - break; - case "attention whore": - makeSpan(c, "Attention", "yellow"); - break; - case "breast growth": - makeSpan(c, "BoobObsess", "yellow"); - break; - case "abusive": - makeSpan(c, "Abusive", "yellow"); - break; - case "malicious": - makeSpan(c, "Malice", "yellow"); - break; - case "self hating": - makeSpan(c, "SelfHatr", "yellow"); - break; - case "neglectful": - makeSpan(c, "SelfNeglect", "yellow"); - break; - case "breeder": - makeSpan(c, "BreedObsess", "yellow"); - break; - default: - slave.sexualFlaw = "none"; - break; - } + helpers.makeStyledSpan(c, data.short.mental.sexualFlaw, slave.sexualFlaw); } /** @@ -1784,35 +1535,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function short_behavior_quirk(slave, c) { - function descStr() { - switch (slave.behavioralQuirk) { - case "confident": - return `Confid`; - case "cutting": - return `Cutting`; - case "funny": - return `Funny`; - case "fitness": - return `Fit`; - case "adores women": - return `Women+`; - case "adores men": - return `Men+`; - case "insecure": - return `Insec`; - case "sinful": - return `Sinf`; - case "advocate": - return `Advoc`; - default: - slave.behavioralQuirk = "none"; - return null; - } - } - const s = descStr(); - if (s) { - makeSpan(c, s, "green"); - } + helpers.makeMappedSpan(c, data.short.mental.behavioralQuirk, slave.behavioralQuirk, "green"); } /** @@ -1821,35 +1544,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function short_sex_quirk(slave, c) { - function descStr() { - switch (slave.sexualQuirk) { - case "gagfuck queen": - return `Gagfuck`; - case "painal queen": - return `Painal`; - case "strugglefuck queen": - return `Struggle`; - case "tease": - return `Tease`; - case "romantic": - return `Romantic`; - case "perverted": - return `Perverted`; - case "caring": - return `Caring`; - case "unflinching": - return `Unflinch`; - case "size queen": - return `SizeQ`; - default: - slave.sexualQuirk = "none"; - return null; - } - } - const s = descStr(); - if (s) { - makeSpan(c, s, "green"); - } + helpers.makeMappedSpan(c, data.short.mental.sexualQuirk, slave.sexualQuirk, "green"); } /** @@ -2100,35 +1795,7 @@ App.UI.SlaveSummaryImpl = function() { * @returns {void} */ function long_behavior_flaw(slave, c) { - function descStr() { - switch (slave.behavioralFlaw) { - case "arrogant": - return `Arrogant.`; - case "bitchy": - return `Bitchy.`; - case "odd": - return `Odd.`; - case "hates men": - return `Hates men.`; - case "hates women": - return `Hates women.`; - case "gluttonous": - return `Stress eater.`; - case "anorexic": - return `Anorexic.`; - case "devout": - return `Devoutly religious.`; - case "liberated": - return `Mentally liberated.`; - default: - slave.behavioralFlaw = "none"; - return null; - } - } - const s = descStr(); - if (s) { - makeSpan(c, s, "red"); - } + helpers.makeMappedSpan(c, data.long.mental.behavioralFlaw, slave.behavioralFlaw, "red"); } /** diff --git a/src/js/slaveSummaryWidgets.js b/src/js/slaveSummaryWidgets.js index 8f5bc4fe424..77f9659a3b9 100644 --- a/src/js/slaveSummaryWidgets.js +++ b/src/js/slaveSummaryWidgets.js @@ -2,6 +2,7 @@ App.UI.SlaveSummaryRenderers = function() { const bits = App.UI.SlaveSummaryImpl.bits; const helpers = App.UI.SlaveSummaryImpl.helpers; + const data = App.Data.SlaveSummary; const shortRenderers = { /** @@ -277,45 +278,11 @@ App.UI.SlaveSummaryRenderers = function() { */ diet: function(slave, c) { const makeSpan = helpers.makeSpan; - let diet = makeSpan(null, "", ["teal", "strong"]); - switch (slave.diet) { - case "restricted": - diet.textContent = "Di:W-"; - break; - case "fattening": - diet.textContent = "Di:W+"; - break; - case "corrective": - diet.textContent = "Di:W="; - break; - case "XX": - diet.textContent = "Di:XX+"; - break; - case "XY": - diet.textContent = "Di:XY+"; - break; - case "XXY": - diet.textContent = "Di:XXY+"; - break; - case "muscle building": - diet.textContent = "Di:M+"; - break; - case "slimming": - diet.textContent = "Di:M-"; - break; - case "cum production": - diet.textContent = "Di:C+"; - break; - case "cleansing": - diet.textContent = "Di:H+"; - break; - case "fertility": - diet.textContent = "Di:F+"; - break; - } - if (diet.textContent.length > 0) { - c.appendChild(diet); + const dietStr = data.short.diet[slave.diet]; + if (dietStr) { + makeSpan(c, dietStr, ["teal", "strong"]); } + let specialDiet = makeSpan(null, "", ["cyan", "strong"]); if (slave.dietCum === 2) { specialDiet.textContent = "Cum++"; @@ -339,117 +306,7 @@ App.UI.SlaveSummaryRenderers = function() { * @returns {void} */ drugs: function(slave, c) { - let drugDesc = ""; - switch (slave.drugs) { - case "breast injections": - drugDesc = "Boobs+"; - break; - case "intensive breast injections": - drugDesc = "Boobs++"; - break; - case "hyper breast injections": - drugDesc = "Boobs+++"; - break; - case "nipple enhancers": - drugDesc = "Nipple+"; - break; - case "butt injections": - drugDesc = "Butt+"; - break; - case "intensive butt injections": - drugDesc = "Butt++"; - break; - case "hyper butt injections": - drugDesc = "Butt+++"; - break; - case "lip injections": - drugDesc = "Lip+"; - break; - case "fertility drugs": - drugDesc = "Fert+"; - break; - case "super fertility drugs": - drugDesc = "Fert++"; - break; - case "penis enhancement": - drugDesc = "Dick+"; - break; - case "intensive penis enhancement": - drugDesc = "Dick++"; - break; - case "hyper penis enhancement": - drugDesc = "Dick+++"; - break; - case "testicle enhancement": - drugDesc = "Balls+"; - break; - case "intensive testicle enhancement": - drugDesc = "Balls++"; - break; - case "hyper testicle enhancement": - drugDesc = "Balls+++"; - break; - case "psychosuppressants": - drugDesc = "Psych-"; - break; - case "psychostimulants": - drugDesc = "Psych+"; - break; - case "steroids": - drugDesc = "Ster"; - break; - case "female hormone injections": - drugDesc = "HormXX++"; - break; - case "male hormone injections": - drugDesc = "HormXY++"; - break; - case "hormone enhancers": - drugDesc = "Horm+"; - break; - case "hormone blockers": - drugDesc = "Horm-"; - break; - case "anti-aging cream": - drugDesc = "Age-"; - break; - case "appetite suppressors": - drugDesc = "ApSup"; - break; - case "penis atrophiers": - drugDesc = "Dick-"; - break; - case "testicle atrophiers": - drugDesc = "Balls-"; - break; - case "clitoris atrophiers": - drugDesc = "Clit-"; - break; - case "labia atrophiers": - drugDesc = "Labia-"; - break; - case "nipple atrophiers": - drugDesc = "Nipple-"; - break; - case "lip atrophiers": - drugDesc = "Lip-"; - break; - case "breast redistributors": - drugDesc = "Breast-"; - break; - case "butt redistributors": - drugDesc = "Butt-"; - break; - case "sag-B-gone": - drugDesc = "AntiSag"; - break; - case "growth stimulants": - drugDesc = "GroStim"; - break; - case "priapism agents": - drugDesc = "Erection"; - break; - } + let drugDesc = data.short.drugs[slave.drugs]; const makeSpan = helpers.makeSpan; if (drugDesc) { makeSpan(c, "Dr:" + drugDesc, ["tan", "strong"]); @@ -610,37 +467,8 @@ App.UI.SlaveSummaryRenderers = function() { * @returns {void} */ race: function(slave, c) { - function descStr(slave) { - switch (slave.race) { - case "white": - return `C`; - case "asian": - return `A`; - case "indo-aryan": - return `I`; - case "latina": - return `L`; - case "middle eastern": - return `ME`; - case "black": - return `B`; - case "pacific islander": - return `PI`; - case "malay": - return `M`; - case "amerindian": - return `AI`; - case "semitic": - return `S`; - case "southern european": - return `SE`; - case "mixed race": - return `MR`; - default: - return `${slave.race.charAt(0).toUpperCase() + slave.race.charAt(1) + slave.race.charAt(2)}`; - } - } - helpers.makeSpan(c, descStr(slave), "tan"); + const s = data.short.race[slave.race]; + helpers.makeSpan(c, s ? s : helpers.firstThreeUc(slave.race), "tan"); }, /** @@ -649,459 +477,15 @@ App.UI.SlaveSummaryRenderers = function() { * @returns {void} */ nationality: function(slave, c) { - function descStr(slave) { - switch (slave.nationality) { - case "Afghan": - return "Afg"; - case "Albanian": - return "Alb"; - case "Algerian": - return "Alg"; - case "American": - return "USA"; - case "Andorran": - return "And"; - case "Angolan": - return "Ang"; - case "Antiguan": - return "AB"; - case "Argentinian": - return "Arg"; - case "Armenian": - return "Arm"; - case "Aruban": - return "Aru"; - case "Australian": - return "Aus"; - case "Austrian": - return "Aut"; - case "Azerbaijani": - return "Aze"; - case "Bahamian": - return "Bah"; - case "Bahraini": - return "Bah"; - case "Bangladeshi": - return "Bgd"; - case "Barbadian": - return "Bar"; - case "Belarusian": - return "Ber"; - case "Belgian": - return "Bel"; - case "Belizean": - return "Blz"; - case "Beninese": - return "Ben"; - case "Bermudian": - return "Bmd"; - case "Bhutanese": - return "Bhu"; - case "Bissau-Guinean": - return "GB"; - case "Bolivian": - return "Bol"; - case "Bosnian": - return "Bos"; - case "Brazilian": - return "Bra"; - case "British": - return "UK"; - case "Bruneian": - return "Bru"; - case "Bulgarian": - return "Bul"; - case "Burkinabé": - return "BF"; - case "Burmese": - return "Bur"; - case "Burundian": - return "Bnd"; - case "Cambodian": - return "Kam"; - case "Cameroonian": - return "Cam"; - case "Canadian": - return "Can"; - case "Cape Verdean": - return "CV"; - case "Catalan": - return "Cat"; - case "Central African": - return "CAR"; - case "Chadian": - return "Cha"; - case "Chilean": - return "Chl"; - case "Chinese": - return "Chi"; - case "Colombian": - return "Col"; - case "Comorian": - return "Com"; - case "Congolese": - return "RC"; - case "a Cook Islander": - return "CI"; - case "Costa Rican": - return "CR"; - case "Croatian": - return "Cro"; - case "Cuban": - return "Cub"; - case "Curaçaoan": - return "Cur"; - case "Cypriot": - return "Cyp"; - case "Czech": - return "Cze"; - case "Danish": - return "Den"; - case "Djiboutian": - return "Dji"; - case "Dominican": - return "DR"; - case "Dominiquais": - return "Dom"; - case "Dutch": - return "Nld"; - case "East Timorese": - return "ET"; - case "Ecuadorian": - return "Ecu"; - case "Egyptian": - return "Egy"; - case "Emirati": - return "UAE"; - case "Equatoguinean": - return "EG"; - case "Eritrean": - return "Eri"; - case "Estonian": - return "Est"; - case "Ethiopian": - return "Eth"; - case "Fijian": - return "Fij"; - case "Filipina": - return "Phl"; - case "Finnish": - return "Fin"; - case "French": - return "Fra"; - case "French Guianan": - return "FG"; - case "French Polynesian": - return "FP"; - case "Gabonese": - return "Gab"; - case "Gambian": - return "Gam"; - case "Georgian": - return "Geo"; - case "German": - return "Ger"; - case "Ghanan": - return "Gha"; - case "Greek": - return "Gre"; - case "Greenlandic": - return "Grn"; - case "Grenadian": - return "Gda"; - case "Guamanian": - return "Gua"; - case "Guatemalan": - return "Gtm"; - case "Guinean": - return "Gui"; - case "Guyanese": - return "Guy"; - case "Haitian": - return "Hai"; - case "Honduran": - return "Hon"; - case "Hungarian": - return "Hun"; - case "I-Kiribati": - return "Kir"; - case "Icelandic": - return "Ice"; - case "Indian": - return "Ind"; - case "Indonesian": - return "Idn"; - case "Iranian": - return "Irn"; - case "Iraqi": - return "Irq"; - case "Irish": - return "Irl"; - case "Israeli": - return "Isr"; - case "Italian": - return "Ita"; - case "Ivorian": - return "IC"; - case "Jamaican": - return "Jam"; - case "Japanese": - return "Jpn"; - case "Jordanian": - return "Jor"; - case "Kazakh": - return "Kaz"; - case "Kenyan": - return "Ken"; - case "Kittitian": - return "SKN"; - case "Korean": - return "Kor"; - case "Kosovan": - return "Kos"; - case "Kurdish": - return "Kur"; - case "Kuwaiti": - return "Kuw"; - case "Kyrgyz": - return "Kyr"; - case "Laotian": - return "Lao"; - case "Latvian": - return "Lat"; - case "Lebanese": - return "Lbn"; - case "Liberian": - return "Lib"; - case "Libyan": - return "Lby"; - case "a Liechtensteiner": - return "Lie"; - case "Lithuanian": - return "Lit"; - case "Luxembourgian": - return "Lux"; - case "Macedonian": - return "Mac"; - case "Malagasy": - return "Mad"; - case "Malawian": - return "Mwi"; - case "Malaysian": - return "Mys"; - case "Maldivian": - return "Mdv"; - case "Malian": - return "Mal"; - case "Maltese": - return "Mlt"; - case "Marshallese": - return "MI"; - case "Mauritanian": - return "Mta"; - case "Mauritian": - return "Mts"; - case "Mexican": - return "Mex"; - case "Micronesian": - return "FSM"; - case "Moldovan": - return "Mol"; - case "Monégasque": - return "Mnc"; - case "Mongolian": - return "Mon"; - case "Montenegrin": - return "Mng"; - case "Moroccan": - return "Mor"; - case "Mosotho": - return "Les"; - case "Motswana": - return "Bot"; - case "Mozambican": - return "Moz"; - case "Namibian": - return "Nam"; - case "Nauruan": - return "Nau"; - case "Nepalese": - return "Npl"; - case "New Caledonian": - return "NC"; - case "a New Zealander": - return "NZ"; - case "Ni-Vanuatu": - return "Van"; - case "Nicaraguan": - return "Nic"; - case "Nigerian": - return "Nga"; - case "Nigerien": - return "Ngr"; - case "Niuean": - return "Niu"; - case "Norwegian": - return "Nor"; - case "Omani": - return "Omn"; - case "Pakistani": - return "Pak"; - case "Palauan": - return "Plu"; - case "Palestinian": - return "Pal"; - case "Panamanian": - return "Pan"; - case "Papua New Guinean": - return "PNG"; - case "Paraguayan": - return "Par"; - case "Peruvian": - return "Per"; - case "Polish": - return "Pol"; - case "Portuguese": - return "Por"; - case "Puerto Rican": - return "PR"; - case "Qatari": - return "Qat"; - case "Romanian": - return "Rom"; - case "Russian": - return "Rus"; - case "Rwandan": - return "Rwa"; - case "Sahrawi": - return "Sah"; - case "Saint Lucian": - return "SL"; - case "Salvadoran": - return "ES"; - case "Sammarinese": - return "SM"; - case "Samoan": - return "Sam"; - case "São Toméan": - return "STP"; - case "Saudi": - return "Sau"; - case "Scottish": - return "Sco"; - case "Senegalese": - return "Sen"; - case "Serbian": - return "Srb"; - case "Seychellois": - return "Sey"; - case "Sierra Leonean": - return "Sie"; - case "Singaporean": - return "Sng"; - case "Slovak": - return "Svk"; - case "Slovene": - return "Svn"; - case "a Solomon Islander": - return "SI"; - case "Somali": - return "Som"; - case "South African": - return "RSA"; - case "South Sudanese": - return "SS"; - case "Spanish": - return "Spa"; - case "Sri Lankan": - return "Sri"; - case "Sudanese": - return "Sud"; - case "Surinamese": - return "Sur"; - case "Swazi": - return "Swa"; - case "Swedish": - return "Swe"; - case "Swiss": - return "Swi"; - case "Syrian": - return "Syr"; - case "Taiwanese": - return "Tai"; - case "Tajik": - return "Taj"; - case "Tanzanian": - return "Tza"; - case "Thai": - return "Tha"; - case "Tibetan": - return "Tib"; - case "Togolese": - return "Tog"; - case "Tongan": - return "Ton"; - case "Trinidadian": - return "TT"; - case "Tunisian": - return "Tun"; - case "Turkish": - return "Tur"; - case "Turkmen": - return "Tkm"; - case "Tuvaluan": - return "Tuv"; - case "Ugandan": - return "Uga"; - case "Ukrainian": - return "Ukr"; - case "Uruguayan": - return "Uru"; - case "Uzbek": - return "Uzb"; - case "Vatican": - return "VC"; - case "Venezuelan": - return "Ven"; - case "Vietnamese": - return "Vnm"; - case "Vincentian": - return "SVG"; - case "Yemeni": - return "Yem"; - case "Zairian": - return "DRC"; - case "Zambian": - return "Zam"; - case "Zimbabwean": - if (slave.race === "white") { - return `Rho`; - } else { - return `Zwe`; - } - case "Ancient Chinese Revivalist": - return `Chi Rev`; - case "Ancient Egyptian Revivalist": - return `Egy Rev`; - case "Arabian Revivalist": - return `Ara Rev`; - case "Aztec Revivalist": - return `Azt Rev`; - case "Edo Revivalist": - return `Edo Rev`; - case "Roman Revivalist": - return `Rom Rev`; - case "": - case "none": - case "slave": - case "Stateless": - return "None"; - default: - return `${slave.nationality.charAt(0) + slave.nationality.charAt(1) + slave.nationality.charAt(2)}`; + let tmp = data.short.nationality[slave.nationality]; + if (!tmp && slave.nationality === "Zimbabwean") { + if (slave.race === "white") { + tmp = 'Rhodesian.'; + } else { + tmp = `${slave.nationality}.`; } } - - helpers.makeSpan(c, descStr(slave), "tan"); + helpers.makeSpan(c, tmp ? tmp : slave.nationality.substr(0, 3), "tan"); }, /** @@ -1110,47 +494,8 @@ App.UI.SlaveSummaryRenderers = function() { * @returns {void} */ skin: function(slave, c) { - function descStr(slave) { - switch (slave.skin) { - case "pure white": - return `P. Whi`; - case "extremely fair": - return `E. Fai`; - case "very fair": - return `V. Fai`; - case "extremely pale": - return `E. Pal`; - case "very pale": - return `V. Pal`; - case "light brown": - return `L. Br`; - case "dark brown": - return `D. Br`; - case "light olive": - return `L. Oli`; - case "dark olive": - return `D. Oli`; - case "light beige": - return `L. Bei`; - case "dark beige": - return `D. Bei`; - case "tan": - return `Tan`; - case "bronze": - return `Bron`; - case "ebony": - return `Ebon`; - case "pure black": - return `P. Bla`; - case "dark": - case "fair": - case "pale": - return `${slave.skin.charAt(0).toUpperCase() + slave.skin.slice(1)}`; - default: - return `${slave.skin.charAt(0).toUpperCase() + slave.skin.charAt(1) + slave.skin.charAt(2)}`; - } - } - helpers.makeSpan(c, descStr(slave)); + const s = data.short.skin[slave.skin]; + helpers.makeSpan(c, s ? s : helpers.firstThreeUc(slave.skin)); }, clothes: function() { }, @@ -1393,43 +738,7 @@ App.UI.SlaveSummaryRenderers = function() { * @returns {void} */ diet: function(slave, c) { - let dietDesc = ""; - switch (slave.diet) { - case "restricted": - dietDesc = `Dieting.`; - break; - case "fattening": - dietDesc = `Gaining weight.`; - break; - case "corrective": - dietDesc = `Corrective.`; - break; - case "XX": - dietDesc = `Estrogen rich.`; - break; - case "XY": - dietDesc = `Testosterone rich.`; - break; - case "XXY": - dietDesc = `Futanari mix.`; - break; - case "muscle building": - dietDesc = `Pumping iron.`; - break; - case "slimming": - dietDesc = `Slimming down.`; - break; - case "cum production": - dietDesc = `Cum production.`; - break; - case "cleansing": - dietDesc = `Cleansing.`; - break; - case "fertility": - dietDesc = `Fertility.`; - break; - } - + const dietDesc = data.long.diet[slave.diet]; if (dietDesc) { helpers.makeSpan(c, dietDesc, "teal"); } @@ -1598,30 +907,7 @@ App.UI.SlaveSummaryRenderers = function() { */ hormoneBalance: function(slave, c) { const colorClass = slave.hormoneBalance <= -21 ? "deepskyblue" : "pink"; - let desc = ""; - if (slave.hormoneBalance < -400) { - desc = `Overwhelmingly masculine`; - } else if (slave.hormoneBalance <= -300) { - desc = `Extremely masculine`; - } else if (slave.hormoneBalance <= -200) { - desc = `Heavily masculine`; - } else if (slave.hormoneBalance <= -100) { - desc = `Very masculine`; - } else if (slave.hormoneBalance <= -21) { - desc = `Masculine`; - } else if (slave.hormoneBalance <= 20) { - desc = `Neutral`; - } else if (slave.hormoneBalance <= 99) { - desc = `Feminine`; - } else if (slave.hormoneBalance <= 199) { - desc = `Very feminine`; - } else if (slave.hormoneBalance <= 299) { - desc = `Heavily feminine`; - } else if (slave.hormoneBalance <= 399) { - desc = `Extremely feminine`; - } else if (slave.hormoneBalance <= 500) { - desc = `Overwhelmingly feminine`; - } + const desc = helpers.getNumericRating(data.long.hormoneBalance, slave.hormoneBalance + 400); helpers.makeSpan(c, desc + " hormone balance.", colorClass); }, @@ -1696,37 +982,11 @@ App.UI.SlaveSummaryRenderers = function() { * @returns {void} */ race: function(slave, c) { - function descStr(slave) { - switch (slave.race) { - case "white": - return `Caucasian.`; - case "asian": - return `Asian.`; - case "indo-aryan": - return `Indo-aryan.`; - case "latina": - return `Latina.`; - case "middle eastern": - return `Middle Eastern.`; - case "black": - return `Black.`; - case "pacific islander": - return `Pacific Islander.`; - case "malay": - return `Malay.`; - case "amerindian": - return `Amerindian.`; - case "semitic": - return `Semitic.`; - case "southern european": - return `Southern European.`; - case "mixed race": - return `Mixed race.`; - default: - return `${slave.race.charAt(0).toUpperCase() + slave.race.slice(1)}.`; - } + let raceStr = App.Data.SlaveSummary.long.race[slave.race]; + if (!raceStr) { + raceStr = capFirstChar(slave.race); } - helpers.makeSpan(c, descStr(slave), "tan"); + helpers.makeSpan(c, raceStr + '.', "tan"); }, /** -- GitLab