1
This commit is contained in:
parent
f669b63892
commit
fc0ae8f6c5
@ -290,47 +290,51 @@ void FrameEvent::AddZombieIdChg(Human* sender)
|
||||
|
||||
}
|
||||
|
||||
void FrameEvent::AddDead(Human* sender, int revive_time)
|
||||
void FrameEvent::AddDead(CreatureWeakPtr& sender, int revive_time)
|
||||
{
|
||||
{
|
||||
dead_alive_objs_.push_back(
|
||||
std::make_tuple(
|
||||
sender->GetEntityUniId(),
|
||||
revive_time,
|
||||
0
|
||||
)
|
||||
);
|
||||
}
|
||||
{
|
||||
int dead_idx = dead_alive_objs_.size() - 1;
|
||||
sender->TouchAllLayerHumanList
|
||||
(
|
||||
[dead_idx] (Human* hum, bool& stop)
|
||||
{
|
||||
hum->dead_alive_objs_.push_back(dead_idx);
|
||||
});
|
||||
if (sender.Get()) {
|
||||
{
|
||||
dead_alive_objs_.push_back(
|
||||
std::make_tuple(
|
||||
sender.Get()->GetEntityUniId(),
|
||||
revive_time,
|
||||
0
|
||||
)
|
||||
);
|
||||
}
|
||||
{
|
||||
int dead_idx = dead_alive_objs_.size() - 1;
|
||||
sender.Get()->TouchAllLayerHumanList
|
||||
(
|
||||
[dead_idx] (Human* hum, bool& stop)
|
||||
{
|
||||
hum->dead_alive_objs_.push_back(dead_idx);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FrameEvent::AddRevive(Human* sender)
|
||||
void FrameEvent::AddRevive(CreatureWeakPtr& sender)
|
||||
{
|
||||
{
|
||||
dead_alive_objs_.push_back(
|
||||
std::make_tuple(
|
||||
sender->GetEntityUniId(),
|
||||
0,
|
||||
1
|
||||
)
|
||||
);
|
||||
}
|
||||
{
|
||||
int revive_idx = dead_alive_objs_.size() - 1;
|
||||
sender->TouchAllLayerHumanList
|
||||
(
|
||||
[revive_idx] (Human* hum, bool& stop)
|
||||
{
|
||||
hum->dead_alive_objs_.push_back(revive_idx);
|
||||
});
|
||||
if (sender.Get()) {
|
||||
{
|
||||
dead_alive_objs_.push_back(
|
||||
std::make_tuple(
|
||||
sender.Get()->GetEntityUniId(),
|
||||
0,
|
||||
1
|
||||
)
|
||||
);
|
||||
}
|
||||
{
|
||||
int revive_idx = dead_alive_objs_.size() - 1;
|
||||
sender.Get()->TouchAllLayerHumanList
|
||||
(
|
||||
[revive_idx] (Human* hum, bool& stop)
|
||||
{
|
||||
hum->dead_alive_objs_.push_back(revive_idx);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,8 +33,8 @@ public:
|
||||
void AddSkillCurrTimesChg(CreatureWeakPtr sender, int skill_id, int curr_times);
|
||||
void AddItemChg(Human* hum, int item_id, int item_num);
|
||||
void AddZombieIdChg(Human* hum);
|
||||
void AddDead(Human* sender, int revive_time);
|
||||
void AddRevive(Human* sender);
|
||||
void AddDead(CreatureWeakPtr& sender, int revive_time);
|
||||
void AddRevive(CreatureWeakPtr& sender);
|
||||
void AddCarChg(Human* sender);
|
||||
|
||||
void Clear();
|
||||
|
@ -290,8 +290,19 @@ void Hero::DecHP(float dec_hp, int killer_id, const std::string& killer_name, in
|
||||
void Hero::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
||||
{
|
||||
dead = true;
|
||||
BroadcastDeleteState(room);
|
||||
RemoveFromAroundPlayers(room);
|
||||
room->grid_service->RemoveCreature(this);
|
||||
room->RemoveObjectLater(this);
|
||||
room->frame_event.AddDead(GetWeakPtrRef(), 0);
|
||||
room->xtimer.AddDeadLineTimerAndAttach
|
||||
(
|
||||
meta->i->delay_delete() / FRAME_RATE_MS,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
Hero* hero = (Hero*)param.sender.GetUserData();
|
||||
hero->BroadcastDeleteState(hero->room);
|
||||
hero->RemoveFromAroundPlayers(hero->room);
|
||||
hero->room->grid_service->RemoveCreature(hero);
|
||||
hero->room->RemoveObjectLater(hero);
|
||||
},
|
||||
&xtimer_attacher.timer_list_);
|
||||
}
|
||||
|
@ -815,7 +815,7 @@ void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
||||
}
|
||||
ClearLordMode();
|
||||
ClearBuffList();
|
||||
room->frame_event.AddDead(this,
|
||||
room->frame_event.AddDead(GetWeakPtrRef(),
|
||||
meta->i->revive_time() * 1000);
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
room->xtimer.AddDeadLineTimerAndAttach
|
||||
@ -840,7 +840,7 @@ void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
||||
RemoveBuffByEffectId(kBET_Camouflage);
|
||||
}
|
||||
ClearLordMode();
|
||||
room->frame_event.AddDead(this,
|
||||
room->frame_event.AddDead(GetWeakPtrRef(),
|
||||
0);
|
||||
#ifdef DEBUG
|
||||
room->CheckPartObjects();
|
||||
@ -2703,7 +2703,7 @@ void Human::Revive()
|
||||
AddBuff(this, buff_meta, 1);
|
||||
}
|
||||
}
|
||||
room->frame_event.AddRevive(this);
|
||||
room->frame_event.AddRevive(GetWeakPtrRef());
|
||||
room->OnHumanRevive(this);
|
||||
|
||||
ResetSkill();
|
||||
|
@ -162,6 +162,8 @@ message Player
|
||||
optional string ai_script = 26;
|
||||
optional string init_buffs = 27;
|
||||
optional int32 default_weapon = 28;
|
||||
optional int32 dead_drop = 29;
|
||||
optional int32 delay_delete = 39;
|
||||
}
|
||||
|
||||
message Robot
|
||||
|
Loading…
x
Reference in New Issue
Block a user