void Animation::setupAttack(){ Point p1 = this->startp;//startp; Point p3 = this->nextp; //nextp; Point p2 = Point((p1.getX()+p3.getX())/2,(p1.getY()+p3.getY())/2); Rectangle1 defense1(5.0, 5.0, p1, "data/character/defensivestance",UserManager::getProfile().getColor()); Rectangle1 attack1(5.0, 5.0, p1, "data/character/attack1",UserManager::getProfile().getColor()); Rectangle1 attack2(5.0, 5.0, p1, "data/character/attack2",UserManager::getProfile().getColor()); Rectangle1 attack3(5.0, 5.0, p1, "data/character/attack3",UserManager::getProfile().getColor()); Rectangle1 attack4(5.0, 5.0, p2, "data/character/attack4",UserManager::getProfile().getColor()); Rectangle1 attack5(5.0, 5.0, p2, "data/character/attack5",UserManager::getProfile().getColor()); Rectangle1 defense2(5.0, 5.0, p3, "data/character/defensivestance",UserManager::getProfile().getColor()); attack.push_back(defense1); attack.push_back(attack1); attack.push_back(attack2); attack.push_back(attack3); attack.push_back(attack4); attack.push_back(attack5); attack.push_back(defense2); Point point1 = Point(p1.getX() + 3.75, p1.getY() - 1); Point point2 = Point(p2.getX() + 3.75, p2.getY() - 1); Point point3 = Point(p3.getX() + 3.75, p3.getY() - 1); Rectangle1 mon1(5.0, 5.0, point1, "data/monster/" + mon); Rectangle1 mon2(5.0, 5.0, point2, "data/monster/" + mon); Rectangle1 mon3(5.0, 5.0, point3, "data/monster/" + mon); enemyAttack.push_back(mon1); enemyAttack.push_back(mon1); enemyAttack.push_back(mon1); enemyAttack.push_back(mon1); enemyAttack.push_back(mon2); enemyAttack.push_back(mon2); enemyAttack.push_back(mon3); }
void monster::attack(monstclass *attackee){ attack1(attackee); attack2(attackee); attack3(attackee); attack4(attackee); attack5(attackee); attack6(attackee); }