bool isIdChainInTeam(int id, const std::vector<Hero*>& team) { for(int id2 = id; id2 != -1; id2 = HPT(id2).transformTargetHeroId) { for(Hero* h : team) if(h && h->heroId == id2) return true; } return false; }
//--------------- // Hero //--------------- Hero::Hero(std::string uid, int hid, int lvl, int ex) :id(uid), heroId(hid), level(lvl), exp(ex) { profile = &HPT(hid); eliteLevel = 0; health = profile->health.eval(level); attack = profile->attack.eval(level); regen = profile->regen.eval(level); expCap = level > profile->maxLevel ? -1 : profile->exp.eval(level); maxEnergy = profile->activeSkillId != -1 ? AST(profile->activeSkillId).energy : 0; skillBonus = 0; trainPrice = lvl * 100; }
// Hero Profile int HeroProfile::getMaxStar() const { int maxStar = star; int transNum = transformTargetHeroId; for (;;) { if(transNum == -1) break; const HeroProfile& next = HPT(transNum); transNum = next.transformTargetHeroId; maxStar++; } return maxStar; }
#define HPT(x) x struct monster monsters[NUMMONST+1] = { /* {"Name", CARRY, NORMAL, WANDER, APPEAR, INTEL, {ATTRIBUTES}, "SUMMONED_CREATURE", NUMBER_SUMMONED, ADDED_EXPERIENCE/HIT_POINT, {str exp, level, "armor", hit_points, "damage"}}, */ {"unknown", 0, FALSE, FALSE, '\0', "", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0, {10, 0, 0, 0, HPT(""), ""}}, {"bat", 0, TRUE, FALSE, 'b', "2-4", {ISMEAN, ISHUH, CANDISEASE, ISFLY, ISHASTE}, 0, 0, 0, {10, 5, 2, 1, HPT("1d4"), "1d2"}}, {"giant rat", 0, TRUE, TRUE, 'R', "2-4", {ISMEAN, CANDISEASE}, 0, 0, 1, {10, 7, 1, 7, HPT("1d4"), "1d3"}},