1
This commit is contained in:
parent
808c2f998a
commit
354274c262
@ -27,7 +27,6 @@
|
||||
#include "buff/in_water.h"
|
||||
#include "buff/internal_add.h"
|
||||
#include "buff/jump.h"
|
||||
#include "buff/jumpto.h"
|
||||
#include "buff/machine_gun.h"
|
||||
#include "buff/once_chg_attr.h"
|
||||
#include "buff/passenger.h"
|
||||
@ -99,8 +98,6 @@ std::shared_ptr<Buff> BuffFactory::MakeBuff(const mt::Buff* buff_meta)
|
||||
return std::make_shared<InternalAddBuff>();
|
||||
case kBET_Jump:
|
||||
return std::make_shared<JumpBuff>();
|
||||
case kBET_JumpTo:
|
||||
return std::make_shared<JumpToBuff>();
|
||||
case kBET_MachineGun:
|
||||
return std::make_shared<MachineGunBuff>();
|
||||
case kBET_OnceChgAttr:
|
||||
|
@ -1,37 +0,0 @@
|
||||
#include "precompile.h"
|
||||
|
||||
#include "buff/jumpto.h"
|
||||
|
||||
#include "creature.h"
|
||||
#include "room.h"
|
||||
|
||||
#include "mt/Buff.h"
|
||||
|
||||
void JumpToBuff::Activate()
|
||||
{
|
||||
Entity* entity = owner->room->GetEntityByUniId(owner->skill_target_id_);
|
||||
if (entity) {
|
||||
float target_distance = entity->GetPos().Distance2D2(owner->GetPos());
|
||||
if (target_distance <= 0.000001f) {
|
||||
owner->SetPos(entity->GetPos());
|
||||
owner->target_pos = entity->GetPos();
|
||||
} else {
|
||||
if (target_distance <= meta->_buff_param3) {
|
||||
owner->SetPos(entity->GetPos());
|
||||
owner->target_pos = entity->GetPos();
|
||||
} else {
|
||||
glm::vec3 move_dir = owner->GetPos().CalcDir(entity->GetPos());
|
||||
GlmHelper::Normalize(move_dir);
|
||||
owner->SetMoveDir(move_dir);
|
||||
owner->skill_dir_ = owner->GetMoveDir();
|
||||
owner->target_pos = owner->GetPos();
|
||||
owner->target_pos.AddGlmVec3(owner->GetMoveDir() * (target_distance - meta->_buff_param3));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JumpToBuff::Deactivate()
|
||||
{
|
||||
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "buff.h"
|
||||
|
||||
class JumpToBuff : public Buff
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void Activate() override;
|
||||
virtual void Deactivate() override;
|
||||
|
||||
};
|
@ -2482,7 +2482,7 @@ void Creature::SpecDirMove(glm::vec3 dir, float distance)
|
||||
|
||||
bool Creature::HasSpecMove()
|
||||
{
|
||||
return GetBuffByEffectId(kBET_JumpTo) ||
|
||||
return
|
||||
GetBuffByEffectId(kBET_BePull);
|
||||
}
|
||||
|
||||
@ -2509,22 +2509,7 @@ void Creature::_UpdateSpecMove()
|
||||
}
|
||||
}
|
||||
if (move_end) {
|
||||
Buff* buff = GetBuffByEffectId(kBET_JumpTo);
|
||||
if (buff) {
|
||||
if (CurrentSkill() &&
|
||||
buff->skill_meta == CurrentSkill()->meta &&
|
||||
!CurrentSkill()->meta->_phases.empty()) {
|
||||
std::set<Creature*> target_list;
|
||||
float old_skill_distance = CurrentSkill()->meta->skill_distance();
|
||||
CurrentSkill()->meta->SetSkillDistance(CurrentSkill()->meta->_phases[0].phase_param1.GetDouble());
|
||||
SelectSkillTargets(CurrentSkill(), GetPos(), target_list);
|
||||
CurrentSkill()->meta->SetSkillDistance(old_skill_distance);
|
||||
|
||||
TriggerBuff(CurrentSkill(), target_list, kBTT_SkillHit);
|
||||
}
|
||||
RemoveBuffByEffectId(kBET_JumpTo);
|
||||
}
|
||||
buff = GetBuffByEffectId(kBET_BePull);
|
||||
Buff* buff = GetBuffByEffectId(kBET_BePull);
|
||||
if (buff) {
|
||||
const mt::Buff* new_buff = mt::Buff::GetById(1039);
|
||||
if (new_buff) {
|
||||
|
@ -468,12 +468,6 @@ void Human::Initialize()
|
||||
|
||||
float Human::GetSpeed()
|
||||
{
|
||||
{
|
||||
Buff* buff = GetBuffByEffectId(kBET_JumpTo);
|
||||
if (buff) {
|
||||
return buff->meta->_buff_param2;
|
||||
}
|
||||
}
|
||||
{
|
||||
Buff* buff = GetBuffByEffectId(kBET_HoldShield);
|
||||
if (buff) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user