public virtual void InitialStatus() { this.Level = 1; this.SoulPoint = 100 + Random.Range(0, 50); talentPoint = this.SoulPoint; MonsterName = this.name; this.expPoint = new CharacterAttri(100, 99999); this.expPoint.AddValue(-this.expPoint.MaxValue); int rnd = Random.Range(0, Mathf.Min(20, talentPoint)); this.healPoint = new CharacterAttri(2000 + rnd * 50, 99999); talentPoint -= rnd; rnd = Random.Range(0, Mathf.Min(20, talentPoint)); this.manaPoint = new CharacterAttri(500 + rnd * 20, 99999); talentPoint -= rnd; rnd = Random.Range(0, Mathf.Min(20, talentPoint)); this.attack = new CharacterAttri(200 + rnd, 9999); talentPoint -= rnd; rnd = Random.Range(0, Mathf.Min(20, talentPoint)); this.deffence = new CharacterAttri(150 + rnd, 9999); talentPoint -= rnd; rnd = Random.Range(0, Mathf.Min(20, talentPoint)); this.speed = new CharacterAttri(100 + rnd, 500, 50); talentPoint -= rnd; rnd = Random.Range(0, Mathf.Min(20, talentPoint)); this.luck = new CharacterAttri(10 + (int)Mathf.Ceil(rnd * 0.1f), 50); talentPoint -= rnd; rnd = Random.Range(0, Mathf.Min(20, talentPoint)); this.mind = new CharacterAttri(75 + (int)Mathf.Ceil(rnd * 0.1f), 100); talentPoint -= rnd; }
public void SetAttr(CharacterAttri attr) { this.attr = attr; UpdateValue(); }
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(); } }
public IconControl(Transform trans, CharacterAttri attr) { this.trans = trans; this.attr = attr; }