Add skill management system: implement Skill and PetSkill models, create SkillController, and update ApplicationDbContext for skills

This commit is contained in:
2025-02-02 15:30:48 -03:00
parent 06455db598
commit f234b5d84d
17 changed files with 543 additions and 749 deletions

View File

@@ -1,5 +1,6 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace PetCompanion.Models
{
@@ -7,10 +8,20 @@ namespace PetCompanion.Models
{
[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; }
@@ -67,6 +78,10 @@ namespace PetCompanion.Models
stats.MaxStrength = stats.Strength;
stats.MaxCharisma = stats.Charisma;
stats.Luck = 1;
stats.Agility = 1;
stats.Perception = 1;
return stats;
}
}