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