protected override void InitialSkill() { base.InitialSkill(); if (skills.Find((sk) => { return sk.SkillId == Skill.IceImpact; }) == null) { this.skills.Add(Skillbase.CreateSKill(Skill.IceImpact,this)); } this.passiveSkill.Add(Skillbase.CreateSKill(Skill.HeroPower,this)); this.chara.ShowHUDText("I Learn " + Skill.HeroPower.ToString(), Color.blue, 1f); }
protected virtual void InitialSkill() { int skillCount = (int)Skill.Count; int newSkillCount = Mathf.Min(talentPoint / 20, 4); for (int i = 0; i < newSkillCount; i++) { int sk = Random.Range(0, skillCount); Skillbase skB = skills.Find((s) => { return((int)s.SkillId == sk); }); if (skB != null) { skB.AddExp(20); continue; } else { this.skills.Add(Skillbase.CreateSKill((Skill)sk, this)); } talentPoint -= 20; this.chara.ShowHUDText("I Learn " + ((Skill)sk).ToString(), Color.white, 1f); //Debug.Log(this.MonsterName + " learned skill : " + ((Skill)sk).ToString()); } }
private void LevelUp() { int soulBonus = Random.Range(30, 50); this.SoulPoint += soulBonus; this.talentPoint += soulBonus; this.expPoint.AddValue(-this.expPoint.MaxValue); this.Level += 1; this.transform.localScale = initialSCale * (1 + 0.03f * Level); //this.chara.AttackRange += 0.5f; this.expPoint.AddMaxValue((int)(this.expPoint.MaxValue * Random.Range(5, 20) / 100f)); Dictionary <CharacterAttri, float> attrs = new Dictionary <CharacterAttri, float>(); attrs.Add(this.healPoint, 10); attrs.Add(this.manaPoint, 10); attrs.Add(this.attack, 0.3f); attrs.Add(this.deffence, 0.3f); if (speed.MaxValue <= 300) { attrs.Add(this.speed, 0.2f); } if (luck.MaxValue <= 50) { attrs.Add(this.luck, 0.05f); } if (mind.MaxValue <= 100) { attrs.Add(this.mind, 0.05f); } int attrCount = attrs.Count; for (int i = 0; i < attrCount; i++) { CharacterAttri attr = attrs.Keys.ToArray()[Random.Range(0, attrs.Count)]; int upgradeValue = Random.Range(0, talentPoint / 5); attr.AddMaxValue((int)Mathf.Ceil(upgradeValue * attrs[attr])); talentPoint -= upgradeValue; attrs.Remove(attr); } this.healPoint.AddValue(this.healPoint.MaxValue / 2); this.manaPoint.AddValue(this.healPoint.MaxValue / 2); int skillCount = this.skills.Count; for (int j = 0; j < skillCount; j++) { Skillbase sk = skills[Random.Range(0, this.skills.Count)]; int skillExp = Random.Range(0, talentPoint); sk.AddExp(skillExp); talentPoint -= skillExp; } int newSkillCount = talentPoint / 25; for (int i = 0; i < newSkillCount; i++) { int sk = Random.Range(0, skillCount); if (skills.Exists((s) => { return((int)s.SkillId == sk); })) { skills[sk].AddExp(50); talentPoint -= 25; continue; } this.skills.Add(Skillbase.CreateSKill((Skill)sk, this)); talentPoint -= 25; this.chara.ShowHUDText("I Learn " + ((Skill)sk).ToString(), Color.white, 1f); //Debug.Log(this.MonsterName + " learned skill : " + ((Skill)sk).ToString()); } if (Level >= 30) { Revolation(); } }