We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change on https://github.com/TwistedScorpio/OTHire/blob/master/source/player.cpp both int32_t Player::getDefense() const and float Player::getDefenseFactor() const
int32_t Player::getDefense() const
float Player::getDefenseFactor() const
float Player::getDefenseFactor() const { switch(fightMode){ case FIGHTMODE_ATTACK: { return 0.6f; break; } case FIGHTMODE_BALANCED: { return 1.0f; break; } case FIGHTMODE_DEFENSE: { return 1.8f; break; } default: return 1.0f; break; } } int32_t Player::getDefense() const { int32_t defenseSkill = getSkill(SKILL_FIST, SKILL_LEVEL); int32_t defenseValue = 5; float defenseFactor = getDefenseFactor(); const Item* weapon = NULL; const Item* shield = NULL; getShieldAndWeapon(shield, weapon); if(weapon){ defenseValue = weapon->getDefense() + 1; defenseSkill = getWeaponSkill(weapon); } if(shield){ defenseValue = shield->getDefense() + 1; defenseSkill = getSkill(SKILL_SHIELD, SKILL_LEVEL); } if(defenseSkill == 0) return 0; if(vocation && vocation->getBaseDefense() != 1.0){ defenseValue = int32_t(defenseValue * vocation->getBaseDefense()); } // Nostalrius use this to default to full def when you are not attacking anything, we don't have access to this variables, so it's not implemented /* if ((followCreature || !attackedCreature) && earliestAttackTime <= OTSYS_TIME()) { defenseFactor = 1.8; } */ int32_t randresult1 = (uint32_t)random_range(0, 99); int32_t randresult2 = (uint32_t)random_range(0, 99); return ((int32_t)std::floor((float)((5 * defenseSkill + 50)* defenseValue * defenseFactor * (randresult1+randresult2) / 2 / 10000.))); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
change on https://github.com/TwistedScorpio/OTHire/blob/master/source/player.cpp
both
int32_t Player::getDefense() const
andfloat Player::getDefenseFactor() const
The text was updated successfully, but these errors were encountered: