Exemplo n.º 1
0
 public ItemData(string identifier, string name, string imageName, int healthGain, WeaponStats weaponStats, int acModifier, string type, bool stackable, int stackLimit, bool singleUse, int value)
 {
     Identifier = identifier;
     Name = name;
     ImageName = imageName;
     HealthGain = healthGain;
     WeaponStats = weaponStats;
     AcModifier = acModifier;
     Type = type;
     Stackable = stackable;
     StackLimit = stackLimit;
     SingleUse = singleUse;
     Value = value;
 }
Exemplo n.º 2
0
 private MonsterData ReadMonster(XmlReader reader, Counter<string> badTags)
 {
     string identifier = null;
     string name = null;
     string imageName = null;
     DiceRoll hitDice = DiceRoll.ZERO_ROLL;
     List<AreaType> areaTypes = new List<AreaType>();
     List<string> loot = new List<string>();
     int initiative = 0;
     int armorClass = 0;
     int attackBonus = 0;
     float challengeRating = 0;
     WeaponStats weaponStats = new WeaponStats("blahh", DiceRoll.ZERO_ROLL, 1,30, null);
     while (reader.Read())
     {
         if (reader.NodeType == XmlNodeType.Element && reader.Name == "id")
         {
             identifier = reader.ReadElementContentAsString();
         }
         else if (reader.NodeType == XmlNodeType.Element && reader.Name == "name")
         {
             name = reader.ReadElementContentAsString();
         }
         else if (reader.NodeType == XmlNodeType.Element && reader.Name == "image_name")
         {
             imageName = reader.ReadElementContentAsString();
         }
         else if (reader.NodeType == XmlNodeType.Element && reader.Name == "hit_dice")
         {
             hitDice = XmlHelper.ReadDiceRoll(reader.ReadElementContentAsString());
         }
         else if (reader.NodeType == XmlNodeType.Element && reader.Name == "initiative")
         {
             initiative = reader.ReadElementContentAsInt();
         }
         else if (reader.NodeType == XmlNodeType.Element && reader.Name == "armor_class")
         {
             armorClass = reader.ReadElementContentAsInt();
         }
         else if (reader.NodeType == XmlNodeType.Element && reader.Name == "attack")
         {
             attackBonus = reader.ReadElementContentAsInt();
         }
         else if (reader.NodeType == XmlNodeType.Element && reader.Name == "areas")
         {
             areaTypes = XmlHelper.ReadAreaTypes(reader, badTags);
         }
         else if (reader.NodeType == XmlNodeType.Element && reader.Name == "weapon")
         {
             weaponStats = XmlHelper.ReadWeaponStats(reader, badTags, null);
         }
         else if (reader.NodeType == XmlNodeType.Element && reader.Name == "drops")
         {
             loot = XmlHelper.ReadDrops(reader, badTags);
         }
         else if (reader.NodeType == XmlNodeType.Element && reader.Name == "challenge_rating")
         {
             challengeRating = reader.ReadElementContentAsFloat();
         }
         else if (reader.NodeType == XmlNodeType.Element)
         {
             badTags.Increment(reader.Name);
         }
         else if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "monster")
         {
             break;
         }
     }
     return new MonsterData(identifier, name, imageName, hitDice, initiative, armorClass, challengeRating, attackBonus, weaponStats, areaTypes, loot);
 }
Exemplo n.º 3
0
 public MonsterData(string identifier, string name, string imageName, DiceRoll hitDice, int initiative, int armorClass, float challengeRating, int attackBonus, WeaponStats weaponStats, List<AreaType> areaTypes, List<string> loot)
     : this()
 {
     Identifier = identifier;
     Name = name;
     BaseImageName = imageName;
     HitDice = hitDice;
     Initiative = initiative;
     ArmorClass = armorClass;
     ChallengeRating = challengeRating;
     AttackModifier = attackBonus;
     WeaponStats = weaponStats;
     AreaTypes = areaTypes;
     Loot = loot;
 }
Exemplo n.º 4
0
 public WeaponAttack(WeaponStats stats, Weapon weapon)
 {
     this.stats = stats;
     this.weapon = weapon;
 }