1
This commit is contained in:
parent
e22ede9fce
commit
e594484a5e
@ -2072,20 +2072,22 @@ void Creature::SummonHero(Buff* buff,
|
|||||||
int num = std::get<4>(info);
|
int num = std::get<4>(info);
|
||||||
MetaData::Player* hero_meta = MetaMgr::Instance()->GetPlayer(hero_id);
|
MetaData::Player* hero_meta = MetaMgr::Instance()->GetPlayer(hero_id);
|
||||||
if (hero_meta) {
|
if (hero_meta) {
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int j = 0; j < num; ++j) {
|
||||||
a8::Vec2 born_dir = dir;
|
for (int i = 0; i < 4; ++i) {
|
||||||
a8::Vec2 born_offset(x, y);
|
a8::Vec2 born_dir = dir;
|
||||||
born_offset.Rotate(born_dir.CalcAngle(a8::Vec2::UP));
|
a8::Vec2 born_offset(x, y);
|
||||||
born_offset.Rotate(i * 0.5);
|
born_offset.Rotate(born_dir.CalcAngle(a8::Vec2::UP));
|
||||||
a8::Vec2 hero_pos = pos + born_offset;
|
born_offset.Rotate(i * 0.5);
|
||||||
Hero* hero = InternalSummonHero(hero_meta,
|
a8::Vec2 hero_pos = pos + born_offset;
|
||||||
dir,
|
Hero* hero = InternalSummonHero(hero_meta,
|
||||||
hero_pos,
|
dir,
|
||||||
through_wall);
|
hero_pos,
|
||||||
if (hero) {
|
through_wall);
|
||||||
RemoveSurplusHero(buff->meta->i->buff_id(), hero_id, num);
|
if (hero) {
|
||||||
slave_heros_.push_back(std::make_tuple(buff->meta->i->buff_id(), hero));
|
RemoveSurplusHero(buff->meta->i->buff_id(), hero_id, num);
|
||||||
break;
|
slave_heros_.push_back(std::make_tuple(buff->meta->i->buff_id(), hero));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user