This commit is contained in:
aozhiwei 2023-04-02 17:24:40 +08:00
parent 6d4aa34c9e
commit b89a7ac80e
2 changed files with 47 additions and 13 deletions

View File

@ -703,30 +703,44 @@ void CallFuncBuff::ClearSummonHero()
void CallFuncBuff::SummonObstacleSpecPoint()
{
#if 0
int hero_id = meta->_int_buff_param2;
int id = meta->_int_buff_param2;
float x = meta->GetBuffParam3(this);
float y = meta->GetBuffParam4(this);
float z = meta->GetBuffParam5(this);
if (!owner->dead || meta->dead_valid() != 0) {
Hero* hero = owner->SummonHero(this,
glm::vec3(x, y, z),
owner->GetAttackDir());
Obstacle* ob = owner->SummonObstacle(this,
glm::vec3(x, y, z),
owner->GetAttackDir());
}
#endif
}
void CallFuncBuff::SummonObstacleSpecDistance()
{
#if 0
int hero_id = meta->_int_buff_param2;
float distance = meta->GetBuffParam3(this);
if (!owner->dead || meta->dead_valid() != 0) {
glm::vec3 born_pos = owner->GetPos().ToGlmVec3();
Hero* hero = owner->SummonHero(this,
born_pos,
owner->GetAttackDir());
if (hero) {
bool hit_result;
glm::vec3 hit_point;
glm::vec3 start = owner->GetPos().ToGlmVec3();
glm::vec3 end = owner->GetPos().ToGlmVec3() + owner->GetAttackDir() * distance;
glm::vec3 born_pos = owner->GetPos().ToGlmVec3() + owner->GetAttackDir() * distance;
owner->room->map_instance->Scale(start);
owner->room->map_instance->Scale(end);
if (owner->room->map_instance->Raycast
(
start,
end,
hit_point,
hit_result
)) {
owner->room->map_instance->UnScale(hit_point);
born_pos = hit_point;
}
Obstacle* ob = owner->SummonObstacle(this,
born_pos,
owner->GetAttackDir());
if (ob) {
#if 0
std::shared_ptr<std::vector<float>> vars = std::make_shared<std::vector<float>>();
vars->push_back(hero->GetUniId());
for (int buff_id : meta->_buff_param6_int_list) {
@ -738,9 +752,9 @@ void CallFuncBuff::SummonObstacleSpecDistance()
vars
);
}
#endif
}
}
#endif
}
void CallFuncBuff::ClearSummonObstacle()

View File

@ -3075,6 +3075,26 @@ std::shared_ptr<std::set<int>> Creature::CalcReporterList(const mt::Equip* weapo
return p;
}
Obstacle* Creature::SummonObstacle(Buff* buff,
const glm::vec3& pos,
const glm::vec3& dir
)
{
#if 0
Obstacle* hero = nullptr;
const mt::Hero* hero_meta = mt::Hero::GetById(buff->meta->_int_buff_param2);
if (hero_meta) {
hero = InternalSummonHero(buff,
hero_meta,
GetAttackDir(),
pos
);
hero->hero_level = GetBattleContext()->GetHeroLevel();
}
return hero;
#endif
}
void Creature::RemoveSurplusObstacle(int id, int num)
{
#if 0