message: Extract getOppositeGender utility
diff: @@ -25,14 +25,14 @@ setup.createSexuality = function (npc) {
  0: {
  sexuality: 'heterosexual',
  partnerGenderProbability (npc) {
  - return lib.genderData[npc.gender].oppositeGender
  + return getOppositeGender(npc.gender)
  }
  },
  1: {
  sexuality: 'heterosexual with passing interest in other $currentNPC.menwomen',
  partnerGenderProbability (npc) {
  if (random(100) < 90) {
  - return lib.genderData[npc.gender].oppositeGender
  + return getOppositeGender(npc.gender)
  } else {
  return npc.gender
  }
  @@ -42,7 +42,7 @@ setup.createSexuality = function (npc) {
  sexuality: 'predominantly heterosexual, but with more than a passing interest in $currentNPC.menwomen',
  partnerGenderProbability (npc) {
  if (random(100) < 70) {
  - return lib.genderData[npc.gender].oppositeGender
  + return getOppositeGender(npc.gender)
  } else {
  return npc.gender
  }
  @@ -52,7 +52,7 @@ setup.createSexuality = function (npc) {
  sexuality: 'bisexual',
  partnerGenderProbability (npc) {
  if (random(100) < 50) {
  - return lib.genderData[npc.gender].oppositeGender
  + return getOppositeGender(npc.gender)
  } else {
  return npc.gender
  }
  @@ -64,7 +64,7 @@ setup.createSexuality = function (npc) {
  if (random(100) < 70) {
  return npc.gender
  } else {
  - return lib.genderData[npc.gender].oppositeGender
  + return getOppositeGender(npc.gender)
  }
  }
  },
  @@ -74,7 +74,7 @@ setup.createSexuality = function (npc) {
  if (random(100) < 90) {
  return npc.gender
  } else {
  - return lib.genderData[npc.gender].oppositeGender
  + return getOppositeGender(npc.gender)
  }
  }
  },
  @@ -92,6 +92,14 @@ setup.createSexuality = function (npc) {
  return npc
  }
  +/**
  + * @param {'man' | 'woman'} gender
  + * @returns {'man' | 'woman'}
  + */
  +function getOppositeGender (gender) {
  + return lib.genderData[gender].oppositeGender
  +}
  +
  /**
  * @param {number} sexualityRoll
  * @returns {number}
  