
export interface AnimalDefinition {
  name: string
  animal: CreatureDefinition
  monster: CreatureDefinition
}

export interface CreatureDefinition {
  sight: number
  scent: number
  acceleration: number
  maxSpeed: number
  turnRate: number
  laziness: number // Laziness determines how often the creature wanders each time it decides if it should wander. 1 means it'll never act, 0 means it'll always act. laziness can also prevent immediate attacking when a monster is in range.
  noisiness: number // Noisness determines how likely the creature randomly will make noise.
  erratic: number // Erratic determines how likely the creature will randomly change direction while running.
  health: number
  damage: number
  cdr: number
}

export const animalGroups: Record<string, number> = {
  deer: 0,
  nutria: 1,
  turkey: 2,
  salamander: 3,
  rabbit: 4,
}

export const animals: Record<string, AnimalDefinition> = {
  deer: {
    name: 'deer',
    animal: {
      sight: 100,
      scent: 50,
      acceleration: 0.75,
      maxSpeed: 3,
      turnRate: 10,
      laziness: 0.75,
      noisiness: 0.1,
      erratic: 0.1,
      health: 3,
      damage: 2,
      cdr: 0.1,
    },
    monster: {
      sight: 125,
      scent: 75,
      acceleration: 0.75,
      maxSpeed: 3,
      turnRate: 10,
      laziness: 0.75,
      noisiness: 0.1,
      erratic: 0.1,
      health: 3,
      damage: 2,
      cdr: 0.1,
    }
  },
  nutria: {
    name: 'nutria',
    animal: {
      sight: 50,
      scent: 50,
      acceleration: 0.5,
      maxSpeed: 2,
      turnRate: 20,
      laziness: 0.95,
      noisiness: 0.05,
      erratic: 0.1,
      health: 3,
      damage: 0,
      cdr: 0.1,
    },
    monster: {
      sight: 50,
      scent: 50,
      acceleration: 0.5,
      maxSpeed: 2,
      turnRate: 20,
      laziness: 0.95,
      noisiness: 0.05,
      erratic: 0.1,
      health: 3,
      damage: 3,
      cdr: 0.2,
    },
  },
  turkey: {
    name: 'turkey',
    animal: {
      sight: 50,
      scent: 75,
      acceleration: 0.75,
      maxSpeed: 2,
      turnRate: 20,
      laziness: 0.85,
      noisiness: 0.2,
      erratic: 0.2,
      health: 2,
      damage: 0,
      cdr: 0.2,
    },
    monster: {
      sight: 75,
      scent: 75,
      acceleration: 0.75,
      maxSpeed: 2,
      turnRate: 20,
      laziness: 0.85,
      noisiness: 0.2,
      erratic: 0.2,
      health: 2,
      damage: 4,
      cdr: 0.2,
    }
  },
  salamander: {
    name: 'salamander',
    animal: {
      sight: 35,
      scent: 50,
      acceleration: 0.45,
      maxSpeed: 1.5,
      turnRate: 10,
      laziness: 0.9,
      noisiness: 0.05,
      erratic: 0.05,
      health: 3,
      damage: 0,
      cdr: 0.2,
    },
    monster: {
      sight: 35,
      scent: 50,
      acceleration: 0.45,
      maxSpeed: 1.5,
      turnRate: 10,
      laziness: 0.9,
      noisiness: 0.05,
      erratic: 0.05,
      health: 4,
      damage: 2,
      cdr: 0.2,
    }
  },
  rabbit: {
    name: 'rabbit',
    animal: {
      sight: 50,
      scent: 100,
      acceleration: 1,
      maxSpeed: 2,
      turnRate: 15,
      laziness: 0.65,
      noisiness: 0.2,
      erratic: 0.7,
      health: 2,
      damage: 0,
      cdr: 0.2,
    },
    monster: {
      sight: 50,
      scent: 100,
      acceleration: 1,
      maxSpeed: 2,
      turnRate: 15,
      laziness: 0.65,
      noisiness: 0.2,
      erratic: 0.7,
      health: 2,
      damage: 1,
      cdr: 0.4,
    }
  },
}