1
This commit is contained in:
parent
bf2a4f01b8
commit
5684536a8e
@ -29,6 +29,7 @@
|
|||||||
#include "mt/MapThing.h"
|
#include "mt/MapThing.h"
|
||||||
#include "mt/BattleBasicAttribute.h"
|
#include "mt/BattleBasicAttribute.h"
|
||||||
#include "mt/Map.h"
|
#include "mt/Map.h"
|
||||||
|
#include "mt/MobaRoom.h"
|
||||||
|
|
||||||
Hero::Hero():Creature()
|
Hero::Hero():Creature()
|
||||||
{
|
{
|
||||||
@ -368,6 +369,27 @@ void Hero::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
|||||||
}
|
}
|
||||||
AllocDeadExp(killer_id);
|
AllocDeadExp(killer_id);
|
||||||
GetTrigger()->Die(killer_id, weapon_id);
|
GetTrigger()->Die(killer_id, weapon_id);
|
||||||
|
if (room->IsMobaModeRoom() && !room->IsGameOver()) {
|
||||||
|
int revive_time = room->GetMapMeta()->GetMobaRoomMeta()->GetMonsterReviveTime(GetHeroMeta()->id());
|
||||||
|
if (revive_time >= 0) {
|
||||||
|
room->xtimer.SetTimeoutEx
|
||||||
|
(revive_time * SERVER_FRAME_RATE,
|
||||||
|
[room = room, hero_meta = GetHeroMeta(), pos = src_pos] (int event, const a8::Args* args)
|
||||||
|
{
|
||||||
|
glm::vec3 pos;
|
||||||
|
if (a8::TIMER_EXEC_EVENT == event) {
|
||||||
|
Hero* hero = room->CreateHero
|
||||||
|
(nullptr,
|
||||||
|
hero_meta,
|
||||||
|
pos,
|
||||||
|
GlmHelper::UP,
|
||||||
|
666,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
&room->xtimer_attacher_);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hero::OnAddToTargetPartObject(Entity* target)
|
void Hero::OnAddToTargetPartObject(Entity* target)
|
||||||
|
@ -15,6 +15,7 @@ public:
|
|||||||
const mt::Hero* meta = nullptr;
|
const mt::Hero* meta = nullptr;
|
||||||
bool is_pve_boss = false;
|
bool is_pve_boss = false;
|
||||||
list_head entry;
|
list_head entry;
|
||||||
|
glm::vec3 src_pos = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
Hero();
|
Hero();
|
||||||
virtual ~Hero() override;
|
virtual ~Hero() override;
|
||||||
|
@ -868,6 +868,7 @@ Hero* Room::CreateHero(Creature* master,
|
|||||||
hero->master.Attach(master);
|
hero->master.Attach(master);
|
||||||
}
|
}
|
||||||
hero->room = this;
|
hero->room = this;
|
||||||
|
hero->src_pos = pos;
|
||||||
hero->GetMutablePos().FromGlmVec3(pos);
|
hero->GetMutablePos().FromGlmVec3(pos);
|
||||||
hero->SetMoveDir(dir);
|
hero->SetMoveDir(dir);
|
||||||
hero->SetAttackDir(dir);
|
hero->SetAttackDir(dir);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user