public HumanSkills(HumanSkills fatherSkills, HumanSkills motherSkills, GameObject g) { _go = g; _manualSkill = CreateSkill(fatherSkills._manualSkill, motherSkills._manualSkill); _farmingSkill = CreateSkill(fatherSkills._farmingSkill, motherSkills._farmingSkill); _teachingSkill = CreateSkill(fatherSkills._teachingSkill, motherSkills._teachingSkill); }
public Human(GameObject go) { _go = go; _age = new TimeManager(_go, new TimeManager.YearMonth(Random.Range(0, 30), 0)); _father = null; _mother = null; _humanSkills = new HumanSkills(Random.Range(0, 8), go); _humanTraits = new HumanTraits(_go, this); _humanGenetics = new HumanGenetics(_go, this); RandomizeNameAndGender(); }
public Human(GameObject go, Human father, Human mother) { _go = go; _age = new TimeManager(_go); _father = father; _mother = mother; RandomizeNameAndGender(father, mother); _humanSkills = new HumanSkills(Random.Range(0, 8), go); _humanTraits = new HumanTraits(_go, this); _humanGenetics = new HumanGenetics(_go, this, _father, _mother); }
public void LearnSkills(HumanSkills teacher, float deltaTime, float childTime) { float teachingAbility = teacher._teachingSkill.currentAmount * skillVariation; _manualSkill.currentAmount = Mathf.Clamp(Mathf.Clamp(_manualSkill.currentAmount + (teachingAbility * teacher._manualSkill.currentAmount * deltaTime / childTime) * _manualSkill.baseAmount / 3.5f, _manualSkill.baseAmount, _manualSkill.baseAmount + (teachingAbility * _manualSkill.baseAmount)), 0, 7); _farmingSkill.currentAmount = Mathf.Clamp(Mathf.Clamp(_farmingSkill.currentAmount + (teachingAbility * teacher._farmingSkill.currentAmount * deltaTime / childTime) * _farmingSkill.baseAmount / 3.5f, _farmingSkill.baseAmount, _farmingSkill.baseAmount + (teachingAbility * _farmingSkill.baseAmount)), 0, 7); _teachingSkill.currentAmount = Mathf.Clamp(Mathf.Clamp(_teachingSkill.currentAmount + (teachingAbility * teacher._teachingSkill.currentAmount * deltaTime / childTime) * _teachingSkill.baseAmount / 3.5f, _teachingSkill.baseAmount, _teachingSkill.baseAmount + (teachingAbility * _teachingSkill.baseAmount)), 0, 7); if (_manualSkill.currentAmount == 7 || _farmingSkill.currentAmount == 7 || _teachingSkill.currentAmount == 7) { EventHandler.instance.AddAchievement(Achievement.prodigy); } }
protected override void Initialize() { BaseHealth = 100; BaseDamage = 10; BaseArmor = 0; BaseMoveSpeed = 8f; BaseAttackSpeed = 5f; Stamina = 100; Hunger = 100; Thirst = 100; _skills = new HumanSkills(this); }
public Human(GameObject go, int template) { _go = go; _father = null; _mother = null; switch (template) { case 0: { _age = new TimeManager(_go, new TimeManager.YearMonth(6, 0)); //_ageZone = AgeZone.Child; _gender = Gender.female; _name = "Ava"; _surname = "Shimmer"; break; } case 1: { _age = new TimeManager(_go, new TimeManager.YearMonth(60, 0)); //_ageZone = AgeZone.Elder; _gender = Gender.female; _name = "Nonna"; _surname = "Shimmer"; _isVirgin = false; break; } case 2: { _age = new TimeManager(_go, new TimeManager.YearMonth(28, 0)); //_ageZone = AgeZone.Adult; _gender = Gender.male; _humanSkills = new HumanSkills(0, go); _name = "Frase"; _surname = "Shimmer"; _isVirgin = false; break; } case 3: { _age = new TimeManager(_go, new TimeManager.YearMonth(21, 0)); //_ageZone = AgeZone.Adult; _gender = Gender.female; _humanSkills = new HumanSkills(2, go); _name = "Dena"; _surname = "Flint"; _isVirgin = false; break; } case 4: { _age = new TimeManager(_go, new TimeManager.YearMonth(21, 0)); //_ageZone = AgeZone.Adult; _gender = Gender.male; _name = "Heno"; _surname = "Pine"; _humanSkills = new HumanSkills(Random.Range(0, 8), go); _isVirgin = false; break; } } if (_humanSkills == null) { _humanSkills = new HumanSkills(template, go); } if (_humanGenetics == null) { _humanGenetics = new HumanGenetics(_go, this, template); } _humanTraits = new HumanTraits(_go, this); }