/**
 * @param {App.Entity.SlaveState} slave
 * @returns {string}
 */
App.Desc.skin = function(slave) {
	let r = [];
	const {
		he, him, his, hers, himself, boy, He, His
	} = getPronouns(slave);

	if (slave.fuckdoll > 0) {
		r.push(`The small areas of visible skin are`);
		r = r.concat(freckles());
		r = r.concat(tanned());
	} else if (V.seeNationality === 1) {
		if (slave.nationality === 0) {
			r.push(`Ethnically, ${he}'s`);
		} else if (slave.nationality === "slave") {
			r.push(`${He}'s been chattel long enough that slavery is effectively ${his} nationality; ethnically, ${he}'s`);
		} else if (slave.nationality === "Stateless") {
			r.push(`${He} has spent so much time in the Free Cities that their statelessness is effectively ${his} nationality; ethnically, ${he}'s`);
		} else if (slave.nationality === "Zimbabwean" && slave.race === "white") {
			r.push(`${He}'s originally <span class="tan">Rhodesian;</span> ethnically, ${he}'s`);
		} else if (slave.nationality === "Vatican") {
			r.push(`${He}'s originally <span class="tan">from Vatican City;</span> ethnically, ${he}'s`);
		} else {
			r.push(`${He}'s originally <span class="tan">${slave.nationality};</span> ethnically, ${he}'s`);
		}
		r.push(`<span class="tan">${slave.race},</span> and ${his} skin is`);
		r = r.concat(freckles());
		r = r.concat(tanned());
		if (slave.race !== slave.origRace && V.saleDescription !== 1) {
			r.push(`${He} has received plastic surgery to appear ${slave.race}; ${he} is originally ${slave.origRace}.`);
		} else if (slave.race !== slave.origRace && V.saleDescription === 1) {
			if (V.PC.skill.medicine >= 100) {
				r.push(`Thanks to your medical experience, you can easily tell that ${he} was originally ${slave.origRace}, but surgically modified.`);
			} else if (V.PC.skill.medicine >= 50) {
				r.push(`Oddly enough, ${he} appears to have a number of ${slave.origRace} features.`);
			} else if (V.PC.skill.slaving >= 50) {
				r.push(`Thanks to your experience in buying and selling slaves, you can easily tell that ${he} is not naturally ${slave.race}.`);
			} else if (jsRandom(0, 100) < V.PC.skill.medicine) {
				r.push(`${His} features seem slightly off.`);
			}
		}
	} else if ((V.seeRace === 1)) {
		r.push(`Ethnically, ${he}'s <span class="tan">${slave.race},</span> and ${his} skin is`);
		r = r.concat(freckles());
		r = r.concat(tanned());
		if (slave.race !== slave.origRace && V.saleDescription !== 1) {
			r.push(`${He} has received plastic surgery to appear ${slave.race}; ${he} is originally ${slave.origRace}`);
		} else if (slave.race !== slave.origRace && V.saleDescription === 1) {
			if (V.PC.skill.medicine >= 100) {
				r.push(`Thanks to your medical experience, you can easily tell that ${he} was originally ${slave.origRace}, but surgically modified.`);
			} else if (V.PC.skill.medicine >= 50) {
				r.push(`Oddly enough, ${he} appears to have a number of ${slave.origRace} features.`);
			} else if (V.PC.skill.slaving >= 50) {
				r.push(`Thanks to your experience in buying and selling slaves, you can easily tell that ${he} is not naturally ${slave.race}.`);
			} else if (jsRandom(0, 100) < V.PC.skill.medicine) {
				r.push(`${His} features seem slightly off.`);
			}
		}
	} else {
		r.push(`${His} skin is`);
		r = r.concat(freckles());
		r = r.concat(tanned());
	}

	return r.join(" ");

	function freckles() {
		const r = [];
		if (slave.markings === "freckles") {
			r.push(`${slave.skin} and lightly `);
			if ((skinToneLevel(slave.skin) > 5) && (skinToneLevel(slave.skin) < 10) && (slave.hColor === "red")) {
				r.push(`freckled, an attractive combination.`);
			} else {
				r.push(`freckled.`);
			}
		} else if (slave.markings === "heavily freckled") {
			r.push(`${slave.skin} and heavily`);
			if ((skinToneLevel(slave.skin) > 5) && (skinToneLevel(slave.skin) < 10) && (slave.hColor === "red")) {
				r.push(`freckled, an attractive combination.`);
			} else {
				r.push(`freckled.`);
			}
		} else {
			r.push(`${slave.skin}.`);
		}
		return r;
	}

	function tanned() {
		const r = [];
		if (slave.skin === "sun tanned" || slave.skin === "spray tanned") {
			r.push(`${His} skin has been`);
			if (slave.skin === "sun tanned") {
				r.push(`tanned to a natural, healthy-looking tone.`);
			} else if (slave.skin === "spray tanned") {
				r.push(`tanned with obvious, garish-looking makeup.`);
			} else {
				r.push(`tanned.`);
			}
		}
		return r;
	}
};

src/npc/descriptions/skin.js