Add skill management system: implement Skill and PetSkill models, create SkillController, and update ApplicationDbContext for skills
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user