import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root',
})
export class SpeciesService {
  constructor() {}

  public getSpeciesDetails(name: string): any {
    switch (name) {
      case 'Eladrin':
        return this.eladrin;
      case 'HalfElfDetection':
        return this.halfElfDetection;
      default:
        return this.notImplementedYet;
    }
  }

  private eladrin: any = {
    title: 'Eladrin',
    description: `
    Eladrin are elves of the Feywild, a realm of perilous beauty and boundless magic. Using that magic, eladrin can step from one place to another in the blink of an eye, and each eladrin resonates with emotions captured in the Feywild in the form of seasons — affinities that affect the eladrin’s mood and appearance. An eladrin’s season can change, though some remain in one season forever. Like other elves, eladrin can live to be over 750 years old.

    #### Eladrin Seasons

    1. **Autumn:** peace and goodwill, when summer's harvest is shared with all.
    2. **Winter:** contemplation and dolor, when the vibrant energy of the world slumbers.
    3. **Spring:** cheerfulness and celebration, marked by merriment and hope as winter's sorrow passes.
    4. **Summer:** boldness and aggression, a time of unfettered energy and calls to action.

    **Ability Score Increase:** When determining your character’s ability scores, increase one score by 2 and increase a different score by 1, or increase three different scores by 1. You can't raise any of your scores above 20.
    
    **Creature Type:** You are a Humanoid. You are also considered an elf for any prerequisite or effect that requires you to be an elf.
    
    **Size:** You are Medium.
    
    **Speed:** Your walking speed is 30 feet.
    
    **Darkvision:** You can see in dim light within 60 feet of you as if it were bright light and in darkness as if it were dim light. You discern colors in that darkness only as shades of gray.
    
    **Fey Ancestry:** You have advantage on saving throws you make to avoid or end the charmed condition on yourself.
    
    **Fey Step:** As a bonus action, you can magically teleport up to 30 feet to an unoccupied space you can see. You can use this trait a number of times equal to your proficiency bonus, and you regain all expended uses when you finish a long rest.
    When you reach 3rd level, your Fey Step gains an additional effect based on your season; if the effect requires a saving throw, the DC equals 8 + your proficiency bonus + your Intelligence, Wisdom, or Charisma modifier (choose when you select this race):
    - **Autumn** Immediately after you use your Fey Step, up to two creatures of your choice that you can see within 10 feet of you must succeed on a Wisdom saving throw or be charmed by you for 1 minute, or until you or your companions deal any damage to the creatures.
    - **Winter** When you use your Fey Step, one creature of your choice that you can see within 5 feet of you before you teleport must succeed on a Wisdom saving throw or be frightened of you until the end of your next turn.
    - **Spring** When you use your Fey Step, you can touch one willing creature within 5 feet of you. That creature then teleports instead of you, appearing in an unoccupied space of your choice that you can see within 30 feet of you.
    - **Summer** Immediately after you use your Fey Step, each creature of your choice that you can see within 5 feet of you takes fire damage equal to your proficiency bonus.
   
    **Keen Senses** You have proficiency in the Perception skill.
   
    **Trance** You don’t need to sleep, and magic can’t put you to sleep. You can finish a long rest in 4 hours if you spend those hours in a trancelike meditation, during which you retain consciousness.
    - Whenever you finish this trance, you can change your season, and you can gain two proficiencies that you don’t have, each one with a weapon or a tool of your choice selected from the Player’s Handbook. You mystically acquire these proficiencies by drawing them from shared elven memory, and you retain them until you finish your next long rest.
   
    **Languages** Your character can speak, read, and write Common and one other language that you and your DM agree is appropriate for the character. The Player’s Handbook offers a list of languages to choose from. The DM is free to modify that list for a campaign.
    
    `,
    abilities: [
      {
        name: 'Fey Step',
        level: 0,
        description: `
        **Fey Step:** As a bonus action, you can magically teleport up to 30 feet to an unoccupied space you can see. You can use this trait a number of times equal to your proficiency bonus, and you regain all expended uses when you finish a long rest.
        When you reach 3rd level, your Fey Step gains an additional effect based on your season; if the effect requires a saving throw, the DC equals 8 + your proficiency bonus + your Intelligence, Wisdom, or Charisma modifier (choose when you select this race):
        - **Autumn** Immediately after you use your Fey Step, up to two creatures of your choice that you can see within 10 feet of you must succeed on a Wisdom saving throw or be charmed by you for 1 minute, or until you or your companions deal any damage to the creatures.
        - **Winter** When you use your Fey Step, one creature of your choice that you can see within 5 feet of you before you teleport must succeed on a Wisdom saving throw or be frightened of you until the end of your next turn.
        - **Spring** When you use your Fey Step, you can touch one willing creature within 5 feet of you. That creature then teleports instead of you, appearing in an unoccupied space of your choice that you can see within 30 feet of you.
        - **Summer** Immediately after you use your Fey Step, each creature of your choice that you can see within 5 feet of you takes fire damage equal to your proficiency bonus.
   
        `,
      },
    ],
  };

  private halfElfDetection: any = {
    title: 'Half-Elf (Mark of Detection)',
    description: `
    Walking in two worlds but truly belonging to neither, half-elves combine what some say are the best qualities of their elf and human parents: human curiosity, inventiveness, and ambition tempered by the refined senses, love of nature, and artistic tastes of the elves.

    **Ability Score Increase:** Your Wisdom score increases by 2, and one other Ability Score of your choice increases by 1.
    
    **Creature Type:** You are a Humanoid. You are also considered an elf for any prerequisite or effect that requires you to be an elf.
    
    **Size:** You are Medium.
    
    **Speed:** Your walking speed is 35 feet.
    
    **Darkvision:** You can see in dim light within 60 feet of you as if it were bright light and in darkness as if it were dim light. You discern colors in that darkness only as shades of gray.
    
    **Fey Ancestry:** You have advantage on saving throws you make to avoid or end the charmed condition on yourself.
    
    **Skill Versatility:** You gain proficiency in two skills of your choice.
    
    **Languages:** Your character can speak, read, and write Common, Elvish, and one extra language of your choice.
    
    **Deductive Intuition:** Whenever you make a Intelligence (Investigation) or a Wisdom (Insight) check, you can roll a d4 and add the number rolled to the total ability check.

    **Magical Detection:** You can cast the Detect Magic and the Detect Poison and Disease spells with this trait. Starting at 3rd level, you can also cast the See Invisibility spell with it. Once you cast either spell with this trait, you can't cast that spell again until you finish a Long Rest. Intelligence is your Spellcasting Ability for these spells, and you don't require material components for them.

    **Spells of the Mark:** If you have the Spellcasting or Pact Magic class feature, the spells on the Mark of Detection Spells table are added to the spell list of your Spellcasting class.

    **Mark of Detection Spells**

    | Spell Level | Spells |
    | ----------- | ------ |
    | 1st | Detect Magic, Detect Poison and Disease |
    | 2nd | See Invisibility |
    | 3rd | Clairvoyance, Tongues |
    | 4th | Arcane Eye, Locate Creature |
    | 5th | Legend Lore, Rary's Telepathic Bond |
    
    `,
    abilities: [],
  };

  private notImplementedYet: any = {
    title: 'Not Implemented Yet',
    description: `
    `,
    abilities: [],
  };
}
