Example #1
0
 private void CreateFoe(BattleCharacter foe)
 {
     Entity e = _entityWorld.CreateEntity();
     e.AddComponent(new Group(false, foe.Name));
     e.AddComponent(new Image(_content.Load<Texture2D>(@"BattleSprite\" + foe.Name), 0));
     e.AddComponent(new BattleStats(foe));
     e.AddComponent(new Acting());
     e.AddComponent(new Transform());
     e.AddComponent(new AIControlled());
     e.Group = FighterManager.GroupName;
     e.Refresh();
 }
Example #2
0
 public void SetFoeGroup(string groupName)
 {
     IEnumerable<string> foeNames = ((FoeGroupData)_dataService.Get(DataType.FoeGroup, groupName)).Foes;
     _foes.Clear();
     foreach (string name in foeNames)
     {
         FoeData data = (FoeData)_dataService.Get(DataType.Foe, name);
         BattleCharacter foe = new BattleCharacter();
         foe.Name = name;
         foe.Attributes = Stats.Convert(data);
         foe.Skills = new List<SkillData>();
         foreach (string skillName in data.SkillNames)
         {
             foe.Skills.Add((SkillData)_dataService.Get(DataType.Skill, skillName));
         }
         _foes.Add(foe);
     }
 }