/**
 *
 * @param name Name of the humanoid
 * @param race Race of the humanoid
 * @param age Age of the humanoid
 * @param clas Class of the humanoid
 * @param level Current level of the humanoid
 */
Humanoid::Humanoid(string name, Race race, Clas clas, uint16 age, uint8 level)
	: 	Being(name, GetRaceSize(race), GetRaceSpeed(race), GetBaseRefBonus(clas, level),
			GetBaseWillBonus(clas, level), GetBaseFortBonus(clas, level)),
		race(race),
		clas(clas),
		age(age),
		level(level)
{
	SetAgeBonuses();
	SetRaceBonuses();
	CalculateBaseAttackBonus();
	GetRaceSize();
}
Ejemplo n.º 2
0
void CUnit::SetRace(RaceType Type) 
{ 
	Race = Type;
	Size = GetRaceSize(Race);
	Speed = GetRaceSpeed(Race);
	Vision = GetRaceVision(Race);

	LangList.clear();
	LearnLanguage(LangCommon);
	LearnLanguage(GetRaceLang(Race));

	//BUG:: Staty dodaja sie kilka razy podczas powrotu
	if(Race != RACE_HUMAN)
	{
		Ability[GetRaceAbility(Race)] +=2;
		Ability[GetRaceAbility(Race,1)] +=2;
	}

	if(Race == RACE_DRAGONBORN)
		TrainPower(10082);

	if(Race == RACE_ELADRIN)
		TrainPower(10083);

	if(Race == RACE_ELF)
		TrainPower(10084);

	if(Race == RACE_HALFLING)
		TrainPower(10085);
}
/**
 * Get the size of this humanoid.
 *
 * @return The size of the humanoid, as defined by SizeEnum
 */
Size Humanoid::GetRaceSize()
{
	return GetRaceSize(race);
}