private IEnumerator SkillUnlockRun(int skill_id) { App.Model.Master.MCharacterSkill[] skills = CharacterCacher.Instance.Get(character.CharacterId).skills; App.Model.Master.MCharacterSkill skill = System.Array.Find(skills, s => s.skill_id == skill_id); if (Global.SUser.self.items == null) { SItem sItem = new SItem(); yield return(StartCoroutine(sItem.RequestList())); Global.SUser.self.items = sItem.items; } App.Model.MItem mItem = System.Array.Find(Global.SUser.self.items, i => i.Master.item_type == App.Model.Master.MItem.ItemType.skillPoint); if (mItem == null || skill.skill_point > mItem.Cnt) { CConfirmDialog.Show("确认", "没有足够的技能书,无法解锁新技能!要购买技能书吗?", () => { }); yield break; } SSkill sSkill = new SSkill(); yield return(StartCoroutine(sSkill.RequestUnlock(character.CharacterId, skill_id))); character.Skills = sSkill.skills; Global.SUser.self.items = sSkill.items; }
private IEnumerator SkillLevelUpRun(int id, App.Model.MSkill mSkill) { SSkill sSkill = new SSkill(); yield return(StartCoroutine(sSkill.RequestLevelUp(id))); mSkill.Update(sSkill.skill); }
} // This must be initialized in child public CPet(string name, EntityType type, EntityType?secondaryType = null) { Name = name; Type = type; SecondaryType = secondaryType; Skills = new SSkill[4] { null, null, null, null }; }
private IEnumerator SkillLearnRun(int id) { SSkill sSkill = new SSkill(); yield return(StartCoroutine(sSkill.RequestLeran(character.CharacterId, id))); character.Skills = sSkill.skills; Global.SUser.self.items = sSkill.items; CDialog cDialog = Global.SceneManager.FindDialog(SceneManager.Prefabs.ItemListDialog); cDialog.Close(); }
public List <Skill> GetSkillsEdit(int categoryid, string iduser) { SSkill soffer = new SSkill(); //SUser suser = new SUser(); List <Skill> skillsm = new List <Skill>(); var skills = soffer.FindSkillByCategoryEdit(categoryid, iduser); if (skills.Count > 0) { skillsm = skills.Select(e => new Skill().InjectFrom(e)).Cast <Skill>().ToList(); } return(skillsm); }
public void AddSkill(SSkill skill) { var count = 0; for (var i = 0; i < 4; i++) { if (Skills[i] != null) { count++; } } if (count != 4) { Skills[count] = skill; ConsoleUtil.WriteColor("기술을 배웠습니다."); } else { var q = new List <SelectableQuestion>(); q.Add(new SelectableQuestion("잊지 않는다")); foreach (var s in Skills) { q.Add(new SelectableQuestion(s.Name)); } var index = ConsoleUtil.AskSelectableQuestion("어떤 기술을 잊으시겠습니까?", q); if (index == 0) { ConsoleUtil.WriteColor("기술을 잊지 않았습니다."); } else { Skills[index - 2] = skill; ConsoleUtil.WriteColor("기술을 잊었습니다."); } } }