message: Refactor setFactionStability
diff: @@ -2,32 +2,21 @@ import { Faction } from './_common'
  export function setFactionStability (faction: Faction) {
  console.log('determining stability...')
  -
  - if (faction.roll.stability > 95) {
  - faction.stability = 'rock solid'
  - } else if (faction.roll.stability > 90) {
  - faction.stability = 'very stable'
  - } else if (faction.roll.stability > 80) {
  - faction.stability = 'quite stable'
  - } else if (faction.roll.stability > 70) {
  - faction.stability = 'stable'
  - } else if (faction.roll.stability > 60) {
  - faction.stability = 'mostly stable'
  - } else if (faction.roll.stability > 55) {
  - faction.stability = 'relatively stable'
  - } else if (faction.roll.stability > 50) {
  - faction.stability = 'stable'
  - } else if (faction.roll.stability > 45) {
  - faction.stability = 'relatively unstable'
  - } else if (faction.roll.stability > 40) {
  - faction.stability = 'somewhat unstable'
  - } else if (faction.roll.stability > 30) {
  - faction.stability = 'quite unstable'
  - } else if (faction.roll.stability > 20) {
  - faction.stability = 'very unstable'
  - } else if (faction.roll.stability > 10) {
  - faction.stability = 'rapidly disintegrating'
  - } else {
  - faction.stability = 'falling to pieces'
  + faction.stability = getFactionStability(faction.roll.stability)
  }
  +
  +function getFactionStability (roll: number) {
  + if (roll > 95) return 'rock solid'
  + if (roll > 90) return 'very stable'
  + if (roll > 80) return 'quite stable'
  + if (roll > 70) return 'stable'
  + if (roll > 60) return 'mostly stable'
  + if (roll > 55) return 'relatively stable'
  + if (roll > 50) return 'stable'
  + if (roll > 45) return 'relatively unstable'
  + if (roll > 40) return 'somewhat unstable'
  + if (roll > 30) return 'quite unstable'
  + if (roll > 20) return 'very unstable'
  + if (roll > 10) return 'rapidly disintegrating'
  + return 'falling to pieces'
  }
  