void CreatureManager::CalculateResult(int src,int tar)
{
	Character* cast = GetCreature(src);
	Character* target = GetCreature(tar);
	//首先计算命中与否
	bool bhit = false;
	if(g_RandomInt(0,9) >= (int)(target->GetDodge()*10))
		bhit = true;


	target->GetCounter() = true;
	if(bhit)
	{
		target->GetHP() -= cast->GetPreHurt();
		cast->GetPreHurt() = 0;

		target->Attacked();
	}
	else
		target->Defend();
}
예제 #2
0
void CreatureManager::CalculateResult(int src,int tar)
{
	//测试,让target 受伤害
	Character* target = GetCreature(tar);
	target->Attacked();
}