void Opcode813CHandler::_run() { int amount = _vm->dataStack()->popInteger(); int skill = _vm->dataStack()->popInteger(); auto critter = static_cast<Game::GameCritterObject*>(_vm->dataStack()->popObject()); critter->setSkillGainedValue((SKILL)skill, critter->skillGainedValue((SKILL)skill) + amount); Logger::debug("SCRIPT") << "[813C] void critter_mod_skill(GameCritterObject* who, int skill, int amount)" << std::endl << " skill = " << skill << std::endl << " amount = " << amount << std::endl; }
int GameCritterObject::skillValue(unsigned int skill) { if (skill >= _skillsTagged.size()) throw Exception("GameCritterObject::skillValue(skill) - skill out of range:" + std::to_string(skill)); return skillBaseValue(skill) + skillGainedValue(skill); }
int CritterObject::skillValue(SKILL skill) const { if (skill > SKILL::OUTDOORSMAN) throw Exception("CritterObject::skillValue(skill) - skill out of range:" + std::to_string((unsigned)skill)); return skillBaseValue(skill) + skillGainedValue(skill); }