1
This commit is contained in:
parent
583111790e
commit
fe4ee20929
@ -2146,6 +2146,8 @@ void Creature::SummonObstacle(Buff* buff, int id, const a8::Vec2& target_pos)
|
|||||||
if (buff->meta->int_param2 > 0) {
|
if (buff->meta->int_param2 > 0) {
|
||||||
RemoveSurplusObstacle(buff->meta->i->buff_id(), id, buff->meta->int_param2);
|
RemoveSurplusObstacle(buff->meta->i->buff_id(), id, buff->meta->int_param2);
|
||||||
}
|
}
|
||||||
|
float *p_rotate = nullptr;
|
||||||
|
float rotate = 0.0f;
|
||||||
a8::Vec2 pos = target_pos;
|
a8::Vec2 pos = target_pos;
|
||||||
if (buff->skill_meta) {
|
if (buff->skill_meta) {
|
||||||
switch (buff->skill_meta->GetMagicId()) {
|
switch (buff->skill_meta->GetMagicId()) {
|
||||||
@ -2153,6 +2155,11 @@ void Creature::SummonObstacle(Buff* buff, int id, const a8::Vec2& target_pos)
|
|||||||
{
|
{
|
||||||
if (!GetAttackDir().IsZero()) {
|
if (!GetAttackDir().IsZero()) {
|
||||||
pos = target_pos + GetAttackDir() * 100;
|
pos = target_pos + GetAttackDir() * 100;
|
||||||
|
rotate = GetAttackDir().CalcAngleEx(a8::Vec2::UP);
|
||||||
|
if (GetAttackDir().x > 0.00001f) {
|
||||||
|
rotate = -rotate;
|
||||||
|
}
|
||||||
|
p_rotate = &rotate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2169,6 +2176,9 @@ void Creature::SummonObstacle(Buff* buff, int id, const a8::Vec2& target_pos)
|
|||||||
obstacle->SetTeamId(room, team_id);
|
obstacle->SetTeamId(room, team_id);
|
||||||
obstacle->SetMasterId(room, GetUniId());
|
obstacle->SetMasterId(room, GetUniId());
|
||||||
obstacle->Active();
|
obstacle->Active();
|
||||||
|
if (p_rotate) {
|
||||||
|
obstacle->SetRotate(*p_rotate);
|
||||||
|
}
|
||||||
obstacle->context_ability = context_ability;
|
obstacle->context_ability = context_ability;
|
||||||
slave_things_.push_back(std::make_tuple(buff->meta->i->buff_id(), obstacle));
|
slave_things_.push_back(std::make_tuple(buff->meta->i->buff_id(), obstacle));
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -227,7 +227,7 @@ void Obstacle::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_d
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (std::abs(rotate_) > 0.000001) {
|
if (std::abs(rotate_) > 0.000001) {
|
||||||
p->set_rotate(rotate_);
|
p->set_rotate(rotate_ * 180);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ void SkillHelper::Init()
|
|||||||
for (int i = MAGIC_NONE; i < MAGIC_END; ++i) {
|
for (int i = MAGIC_NONE; i < MAGIC_END; ++i) {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
int skill_id = GetMagicSkillId(i);
|
int skill_id = GetMagicSkillId(i);
|
||||||
if (skill_id != 0) {
|
if (skill_id == 0) {
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
magic_skill_hash_[i] = skill_id;
|
magic_skill_hash_[i] = skill_id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user