コード例 #1
0
 public static void getStats(CharacterModel cm)
 {
     for (int i = 1; i < cm.lvl && i < levelIncreases.Count; i++)
     {
         levelIncreases[i](cm);
     }
 }
コード例 #2
0
        public static string getNewAbilityText(CharacterModel cm)
        {
            if (classCalculators.ContainsKey(cm.currentClass))
            {
                return classCalculators[cm.currentClass].getNewAbilityMessage(cm);
            }

            return string.Empty;
        }
コード例 #3
0
 public void getStats(CharacterModel cm)
 {
     foreach (CharacterClassModel ccm in cm.characterClasses)
     {
         if (ccm.className == className)
         {
             for (int i = 0; i < ccm.lvl && i < levelIncreases.Count; i++)
             {
                 levelIncreases[i](cm);
             }
         }
     }
 }
コード例 #4
0
 public static void addCharacter(PlayerModel pm)
 {
     Models.CharacterModel cm = new Models.CharacterModel();
     cm.name = "Alexander";
     cm.currentClass = "Adventurer";
     cm.lvl = 1;
     cm.activeAbilities = new List<Models.CharacterAbilityModel>();
     cm.characterClasses = new List<Models.CharacterClassModel>();
     cm.characterClasses.Add(new Models.CharacterClassModel() { className = "Adventurer", cp = 0, lvl = 1 });
     cm.currentQuest = new Models.CharacterQuestModel();
     cm.equipment = new Models.EquipmentModel() { accessory = "", armor = "", weapon = "" };
     cm.stats = new Models.StatsModel() { maxHP = 25, maxMP = 1, strength = 5, vitality = 5, intellect = 5, wisdom = 5, agility = 5 };
     StatCalculations.StatCalculator.updateCharacterStats(cm);
     pm.characters.Add(cm);
 }
コード例 #5
0
        public IEnumerable<AbilityDescription> getAbilities(CharacterModel cm)
        {
            List<AbilityDescription> returnValue = new List<AbilityDescription>();

            foreach (CharacterClassModel ccm in cm.characterClasses)
            {
                if (ccm.className == className)
                {
                    for (int i = 0; i < ccm.lvl && i / 2 < abilities.Count; i += 2)
                    {
                        returnValue.Add(this.abilities[i / 2]);
                    }
                }
            }

            return returnValue;
        }
コード例 #6
0
        public string getNewAbilityMessage(CharacterModel cm)
        {
            foreach (CharacterClassModel ccm in cm.characterClasses)
            {
                if (ccm.className == className)
                {
                    if (ccm.lvl % 2 == 1 && abilities.Count < ((ccm.lvl - 1) / 2))
                    {
                        return cm.name + " has learned " + abilities[(ccm.lvl - 1) / 2].name + ".  " + abilities[(ccm.lvl - 1) / 2].description;
                    }
                    else
                    {
                        return statIncreases[(ccm.lvl / 2) - 1]; //Return new message for stat increases
                    }
                }
            }

            return string.Empty;
        }
コード例 #7
0
        public static void updateCharacterStats(CharacterModel cm)
        {
            cm.stats.maxHP = 25;
            cm.stats.maxMP = 1;
            cm.stats.strength = 5;
            cm.stats.vitality = 5;
            cm.stats.intellect = 5;
            cm.stats.wisdom = 5;
            cm.stats.agility = 5;

            GeneralStatCalculator.getStats(cm);

            if (classCalculators.ContainsKey(cm.currentClass))
            {
                classCalculators[cm.currentClass].getStats(cm);
            }

            if (classCalculators.ContainsKey(cm.currentClass))
            {
                cm.abilities = classCalculators[cm.currentClass].getAbilities(cm).ToList();
            }
        }
コード例 #8
0
 public static void addCharacter(PlayerModel pm)
 {
     Models.CharacterModel cm = new Models.CharacterModel();
     cm.name             = "Alexander";
     cm.currentClass     = "Adventurer";
     cm.lvl              = 1;
     cm.activeAbilities  = new List <Models.CharacterAbilityModel>();
     cm.characterClasses = new List <Models.CharacterClassModel>();
     cm.characterClasses.Add(new Models.CharacterClassModel()
     {
         className = "Adventurer", cp = 0, lvl = 1
     });
     cm.currentQuest = new Models.CharacterQuestModel();
     cm.equipment    = new Models.EquipmentModel()
     {
         accessory = "", armor = "", weapon = ""
     };
     cm.stats = new Models.StatsModel()
     {
         maxHP = 25, maxMP = 1, strength = 5, vitality = 5, intellect = 5, wisdom = 5, agility = 5
     };
     StatCalculations.StatCalculator.updateCharacterStats(cm);
     pm.characters.Add(cm);
 }
コード例 #9
0
        public static PlayerModel initPlayerModel()
        {
            PlayerModel returnValue = new PlayerModel();

            returnValue.characters = new List <Models.CharacterModel>();
            Models.CharacterModel cm = new Models.CharacterModel();
            cm.name             = "Alex";
            cm.currentClass     = "Adventurer";
            cm.lvl              = 1;
            cm.activeAbilities  = new List <Models.CharacterAbilityModel>();
            cm.characterClasses = new List <Models.CharacterClassModel>();
            cm.characterClasses.Add(new Models.CharacterClassModel()
            {
                className = "Adventurer", cp = 0, lvl = 1
            });
            cm.characterClasses.Add(new Models.CharacterClassModel()
            {
                className = "Brawler", cp = 0, lvl = 1
            });
            cm.currentQuest = new Models.CharacterQuestModel();
            cm.equipment    = new Models.EquipmentModel()
            {
                accessory = "", armor = "", weapon = ""
            };
            cm.stats = new Models.StatsModel()
            {
                maxHP = 25, maxMP = 1, strength = 5, vitality = 5, intellect = 5, wisdom = 5, agility = 5
            };
            returnValue.characters.Add(cm);
            cm                  = new Models.CharacterModel();
            cm.name             = "Noright";
            cm.currentClass     = "Brawler";
            cm.lvl              = 1;
            cm.activeAbilities  = new List <Models.CharacterAbilityModel>();
            cm.characterClasses = new List <Models.CharacterClassModel>();
            cm.characterClasses.Add(new Models.CharacterClassModel()
            {
                className = "Adventurer", cp = 0, lvl = 1
            });
            cm.characterClasses.Add(new Models.CharacterClassModel()
            {
                className = "Brawler", cp = 0, lvl = 1
            });
            cm.currentQuest = new Models.CharacterQuestModel();
            cm.equipment    = new Models.EquipmentModel()
            {
                accessory = "", armor = "", weapon = ""
            };
            cm.stats = new Models.StatsModel()
            {
                maxHP = 25, maxMP = 1, strength = 5, vitality = 5, intellect = 5, wisdom = 5, agility = 5
            };
            returnValue.characters.Add(cm);
            cm                  = new CharacterModel();
            cm.name             = "Centers";
            cm.currentClass     = "Mage";
            cm.lvl              = 1;
            cm.activeAbilities  = new List <Models.CharacterAbilityModel>();
            cm.characterClasses = new List <Models.CharacterClassModel>();
            cm.characterClasses.Add(new Models.CharacterClassModel()
            {
                className = "Adventurer", cp = 0, lvl = 1
            });
            cm.characterClasses.Add(new Models.CharacterClassModel()
            {
                className = "Brawler", cp = 0, lvl = 1
            });
            cm.characterClasses.Add(new Models.CharacterClassModel()
            {
                className = "Mage", cp = 0, lvl = 1
            });
            cm.currentQuest = new Models.CharacterQuestModel();
            cm.equipment    = new Models.EquipmentModel()
            {
                accessory = "", armor = "", weapon = ""
            };
            cm.stats = new Models.StatsModel()
            {
                maxHP = 25, maxMP = 1, strength = 5, vitality = 5, intellect = 5, wisdom = 5, agility = 5
            };
            returnValue.characters.Add(cm);
            returnValue.configuration = new List <Models.ConfigurationModel>();
            returnValue.gp            = 0;
            returnValue.items         = new List <Models.PlayerItemModel>();
            returnValue.parties       = new List <Models.PartyModel>();
            returnValue.rootMap       = "Ensemble Village";
            returnValue.rootX         = 5;
            returnValue.rootY         = 5;
            return(returnValue);
        }
コード例 #10
0
 public static PlayerModel initPlayerModel()
 {
     PlayerModel returnValue = new PlayerModel();
     returnValue.characters = new List<Models.CharacterModel>();
     Models.CharacterModel cm = new Models.CharacterModel();
     cm.name = "Alex";
     cm.currentClass = "Adventurer";
     cm.lvl = 1;
     cm.activeAbilities = new List<Models.CharacterAbilityModel>();
     cm.characterClasses = new List<Models.CharacterClassModel>();
     cm.characterClasses.Add(new Models.CharacterClassModel() { className = "Adventurer", cp = 0, lvl = 1 });
     cm.characterClasses.Add(new Models.CharacterClassModel() { className = "Brawler", cp = 0, lvl = 1 });
     cm.currentQuest = new Models.CharacterQuestModel();
     cm.equipment = new Models.EquipmentModel() { accessory = "", armor = "", weapon = "" };
     cm.stats = new Models.StatsModel() { maxHP = 25, maxMP = 1, strength = 5, vitality = 5, intellect = 5, wisdom = 5, agility = 5 };
     returnValue.characters.Add(cm);
     cm = new Models.CharacterModel();
     cm.name = "Noright";
     cm.currentClass = "Brawler";
     cm.lvl = 1;
     cm.activeAbilities = new List<Models.CharacterAbilityModel>();
     cm.characterClasses = new List<Models.CharacterClassModel>();
     cm.characterClasses.Add(new Models.CharacterClassModel() { className = "Adventurer", cp = 0, lvl = 1 });
     cm.characterClasses.Add(new Models.CharacterClassModel() { className = "Brawler", cp = 0, lvl = 1 });
     cm.currentQuest = new Models.CharacterQuestModel();
     cm.equipment = new Models.EquipmentModel() { accessory = "", armor = "", weapon = "" };
     cm.stats = new Models.StatsModel() { maxHP = 25, maxMP = 1, strength = 5, vitality = 5, intellect = 5, wisdom = 5, agility = 5 };
     returnValue.characters.Add(cm);
     cm = new CharacterModel();
     cm.name = "Centers";
     cm.currentClass = "Mage";
     cm.lvl = 1;
     cm.activeAbilities = new List<Models.CharacterAbilityModel>();
     cm.characterClasses = new List<Models.CharacterClassModel>();
     cm.characterClasses.Add(new Models.CharacterClassModel() { className = "Adventurer", cp = 0, lvl = 1 });
     cm.characterClasses.Add(new Models.CharacterClassModel() { className = "Brawler", cp = 0, lvl = 1 });
     cm.characterClasses.Add(new Models.CharacterClassModel() { className = "Mage", cp = 0, lvl = 1 });
     cm.currentQuest = new Models.CharacterQuestModel();
     cm.equipment = new Models.EquipmentModel() { accessory = "", armor = "", weapon = "" };
     cm.stats = new Models.StatsModel() { maxHP = 25, maxMP = 1, strength = 5, vitality = 5, intellect = 5, wisdom = 5, agility = 5 };
     returnValue.characters.Add(cm);
     returnValue.configuration = new List<Models.ConfigurationModel>();
     returnValue.gp = 0;
     returnValue.items = new List<Models.PlayerItemModel>();
     returnValue.parties = new List<Models.PartyModel>();
     returnValue.rootMap = "Ensemble Village";
     returnValue.rootX = 5;
     returnValue.rootY = 5;
     return returnValue;
 }