示例#1
0
文件: CWeapon.cpp 项目: phabh/warbugs
//Outros métodos
void CWeapon::useScroll(CScroll *&scroll)
{
	if(scroll != NULL)
	{
		_modificador = _modificador + scroll->getMod();
		_danoMin = _danoMin + scroll->getMinDamage();
		_danoMax = _danoMax + scroll->getMaxDamage();
		_velocidade = _velocidade + scroll->getSpeed();
		_alcance = _alcance + scroll->getRange();
		setDurability(getDurability() + scroll->getDurability());
		if((scroll->getMod())||
			(scroll->getMinDamage())||
			(scroll->getMaxDamage())||
			(scroll->getSpeed())||
			(scroll->getRange()))
		{
			_nivelMagico = _nivelMagico + 1;
		}
		//scroll->setOwner(null);
		delete scroll;
		scroll = NULL;
	}
}
示例#2
0
void Item::setMinQuality(const Item &item) {
    quality_type minQuality = (quality < item.quality) ? quality : item.quality;
    minQuality /= 100;
    quality_type minDurability = (getDurability() < item.getDurability()) ? getDurability() : item.getDurability();
    quality = minQuality * 100 + minDurability;
}