void consumeAttr(Skillset& mine, const Skillset& his, vector<string>& adjectives) { bool was = false; for (SkillId id : ENUM_ALL(SkillId)) { if (mine.getValue(id) < his.getValue(id)) { mine.setValue(id, his.getValue(id)); was = true; } } if (was) adjectives.push_back("more skillfull"); }
void consumeAttr(Skillset& mine, const Skillset& his, vector<string>& adjectives) { bool was = false; for (SkillId id : his.getAllDiscrete()) if (!mine.hasDiscrete(id) && Skill::get(id)->transferOnConsumption() && consumeProb()) { mine.insert(id); was = true; } for (SkillId id : ENUM_ALL(SkillId)) { if (!Skill::get(id)->isDiscrete() && mine.getValue(id) < his.getValue(id)) { mine.setValue(id, his.getValue(id)); was = true; } } if (was) adjectives.push_back("more skillfull"); }