コード例 #1
0
ファイル: Monster.cs プロジェクト: Edpacca/ProjectManticore
 public void AddInstance()
 {
     CurrentHPCount.Add(HitPoints);
     Number = CurrentHPCount.Count();
     PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Number)));
     PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(CurrentHPCount)));
 }
コード例 #2
0
ファイル: Monster.cs プロジェクト: Edpacca/ProjectManticore
        public Monster(dynamic jsonObject)
        {
            Name      = jsonObject.name;
            Meta      = jsonObject.meta;
            Languages = jsonObject.Languages == "--" ? null : jsonObject.Languages;
            Senses    = jsonObject.Senses;

            HitPoints       = StatBlockParser.ParseHP(jsonObject.HitPoints);
            ChallengeRating = StatBlockParser.ParseChallengeRating(jsonObject.Challenge);
            ArmourClass     = StatBlockParser.ParseAC(jsonObject.ArmorClass);

            CurrentHitPoints = HitPoints;
            CurrentHPCount.Add(HitPoints);

            Speed               = jsonObject.Speed;
            DamageResistances   = jsonObject.Damage_Resistances;
            DamageImmunities    = jsonObject.Damage_Immunities;
            ConditionImmunities = jsonObject.Condition_Immunities;
            SavingThrows        = jsonObject.SavingThrows;
            Skills              = jsonObject.Skills;

            ParseActions(jsonObject);

            Strength     = (byte)jsonObject.STR;
            Dexterity    = (byte)jsonObject.DEX;
            Constitution = (byte)jsonObject.CON;
            Intelligence = (byte)jsonObject.INT;
            Wisdom       = (byte)jsonObject.WIS;
            Charisma     = (byte)jsonObject.CHA;

            ImgURL = jsonObject.img_url;
            SetModifiers();
        }
コード例 #3
0
ファイル: Monster.cs プロジェクト: Edpacca/ProjectManticore
 public void RemoveInstance()
 {
     if (Number == 1)
     {
         return;
     }
     else
     {
         CurrentHPCount.RemoveAt(Number - 1);
         Number = CurrentHPCount.Count();
         PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Number)));
         PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(CurrentHPCount)));
     }
 }