89 lines
2.8 KiB
C#
89 lines
2.8 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace PetCompanion.Models
|
|
{
|
|
public class PetStats
|
|
{
|
|
[Key, ForeignKey("Pet")]
|
|
public string PetId { get; set; }
|
|
|
|
// Display stats
|
|
public int Intelligence { get; set; }
|
|
public int Strength { get; set; }
|
|
public int Charisma { get; set; }
|
|
|
|
// Hidden stats (not displayed to the API)
|
|
[JsonIgnore]
|
|
public int Luck { get; set; } // used for rarity of item finds
|
|
[JsonIgnore]
|
|
public int Agility { get; set; } // used for combat
|
|
[JsonIgnore]
|
|
public int Perception { get; set; } // used for number of itens found
|
|
|
|
public int MaxIntelligence { get; set; }
|
|
public int MaxStrength { get; set; }
|
|
public int MaxCharisma { get; set; }
|
|
|
|
public static PetStats BuildFromClass(PetClass petClass)
|
|
{
|
|
var stats = new PetStats();
|
|
|
|
switch (petClass)
|
|
{
|
|
case PetClass.FOREST_SPIRIT:
|
|
stats.Intelligence = 10;
|
|
stats.Strength = 5;
|
|
stats.Charisma = 5;
|
|
break;
|
|
case PetClass.OCEAN_GUARDIAN:
|
|
stats.Intelligence = 5;
|
|
stats.Strength = 10;
|
|
stats.Charisma = 5;
|
|
break;
|
|
case PetClass.FIRE_ELEMENTAL:
|
|
stats.Intelligence = 5;
|
|
stats.Strength = 5;
|
|
stats.Charisma = 10;
|
|
break;
|
|
case PetClass.MYTHICAL_BEAST:
|
|
stats.Intelligence = 7;
|
|
stats.Strength = 7;
|
|
stats.Charisma = 7;
|
|
break;
|
|
case PetClass.SHADOW_WALKER:
|
|
stats.Intelligence = 8;
|
|
stats.Strength = 6;
|
|
stats.Charisma = 6;
|
|
break;
|
|
case PetClass.CYBER_PET:
|
|
stats.Intelligence = 8;
|
|
stats.Strength = 8;
|
|
stats.Charisma = 6;
|
|
break;
|
|
case PetClass.BIO_MECHANICAL:
|
|
stats.Intelligence = 8;
|
|
stats.Strength = 6;
|
|
stats.Charisma = 8;
|
|
break;
|
|
default:
|
|
stats.Intelligence = 5;
|
|
stats.Strength = 5;
|
|
stats.Charisma = 5;
|
|
break;
|
|
}
|
|
|
|
stats.MaxIntelligence = stats.Intelligence;
|
|
stats.MaxStrength = stats.Strength;
|
|
stats.MaxCharisma = stats.Charisma;
|
|
|
|
stats.Luck = 1;
|
|
stats.Agility = 1;
|
|
stats.Perception = 1;
|
|
|
|
return stats;
|
|
}
|
|
}
|
|
}
|