message: Extract getReligiosity function
diff: @@ -7,14 +7,24 @@ setup.createReligiosity = (town, npc) => {
  console.log(npc)
  // TODO: transfer religiosity to the religion object; for some reason the defineRollDataGetter isn't playing nicely with it.
  // lib.defineRollDataGetter(npc, setup.npcData.religion, 'religiosity', 'religiosity')
  - if (!npc.religion.strength) {
  - npc.religion.strength = getReligionStrength(npc.roll.religiosity)
  + if (npc.religion.strength) {
  + npc.roll.religiosity = getReligiosity(npc.religion.strength)
  } else {
  - const temp = setup.npcData.religion.strength.find(desc => {
  - return desc[1] === npc.religion.strength
  - })
  - npc.roll.religiosity = temp[0] + random(1, 5)
  + npc.religion.strength = getReligionStrength(npc.roll.religiosity)
  + }
  +}
  +
  +/**
  + * @param {string} religionStrength
  + * @returns {number}
  + */
  +function getReligiosity (religionStrength) {
  + for (const [threshold, strength] of setup.npcData.religion.strength) {
  + if (strength === religionStrength) {
  + return threshold + random(1, 5)
  + }
  }
  + return 0
  }
  /**
  