1
This commit is contained in:
parent
a838ac6408
commit
7ed5aa8fa7
@ -332,13 +332,14 @@ void Hero::DecHP(float dec_hp, int killer_id, const std::string killer_name, int
|
|||||||
|
|
||||||
void Hero::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
void Hero::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
||||||
{
|
{
|
||||||
|
std::vector<int> items;
|
||||||
dead = true;
|
dead = true;
|
||||||
if (meta->HasDrop() && !room->IsPveRoom()) {
|
if (meta->HasDrop() && !room->IsPveRoom()) {
|
||||||
room->ScatterDrop(GetPos().ToGlmVec3(), meta->RandDrop());
|
room->ScatterDrop(GetPos().ToGlmVec3(), meta->RandDrop(), false, &items);
|
||||||
}
|
}
|
||||||
if (!room->IsPveRoom()) {
|
if (!room->IsPveRoom()) {
|
||||||
for (int id : meta->_drop_list) {
|
for (int id : meta->_drop_list) {
|
||||||
room->ScatterDrop(GetPos().ToGlmVec3(), id);
|
room->ScatterDrop(GetPos().ToGlmVec3(), id, false, &items);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
room->frame_event.AddDead(GetWeakPtrRef(), 0);
|
room->frame_event.AddDead(GetWeakPtrRef(), 0);
|
||||||
@ -370,6 +371,7 @@ 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()) {
|
if (room->IsMobaModeRoom() && !room->IsGameOver()) {
|
||||||
|
{
|
||||||
int revive_time = room->GetMapMeta()->GetMobaRoomMeta()->GetMonsterReviveTime(GetHeroMeta()->id());
|
int revive_time = room->GetMapMeta()->GetMobaRoomMeta()->GetMonsterReviveTime(GetHeroMeta()->id());
|
||||||
if (revive_time >= 0) {
|
if (revive_time >= 0) {
|
||||||
room->xtimer.SetTimeoutEx
|
room->xtimer.SetTimeoutEx
|
||||||
@ -389,6 +391,20 @@ void Hero::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
|||||||
&room->xtimer_attacher_);
|
&room->xtimer_attacher_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
int life_time = room->GetMapMeta()->GetMobaRoomMeta()->GetMonsterLootLifeTime(GetHeroMeta()->id());
|
||||||
|
if (life_time >= 0) {
|
||||||
|
room->xtimer.SetTimeoutEx
|
||||||
|
(life_time * SERVER_FRAME_RATE,
|
||||||
|
[room = room, items] (int event, const a8::Args* args)
|
||||||
|
{
|
||||||
|
if (a8::TIMER_EXEC_EVENT == event) {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
&room->xtimer_attacher_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hero::OnAddToTargetPartObject(Entity* target)
|
void Hero::OnAddToTargetPartObject(Entity* target)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user