1
This commit is contained in:
parent
5209acac55
commit
14c9b86832
@ -260,11 +260,19 @@ void FrameEvent::AddItemChg(Human* hum, int item_id, int item_num)
|
|||||||
hum->chged_items_.push_back(idx);
|
hum->chged_items_.push_back(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FrameEvent::AddZombieIdChg(Human* hum)
|
void FrameEvent::AddZombieIdChg(Human* sender)
|
||||||
{
|
{
|
||||||
chged_zombieids_.push_back(hum);
|
chged_zombieids_.push_back(sender);
|
||||||
int idx = chged_zombieids_.size() - 1;
|
int idx = chged_zombieids_.size() - 1;
|
||||||
hum->chged_zombieid_.push_back(idx);
|
{
|
||||||
|
sender->TouchAllLayerHumanList
|
||||||
|
(
|
||||||
|
[idx] (Human* hum, bool& stop)
|
||||||
|
{
|
||||||
|
hum->chged_zombieid_.push_back(idx);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FrameEvent::AddDead(Human* sender, int revive_time)
|
void FrameEvent::AddDead(Human* sender, int revive_time)
|
||||||
|
@ -199,11 +199,12 @@ cs::SMUpdate* FrameMaker::MakeUpdateMsg(const Human* hum)
|
|||||||
}
|
}
|
||||||
for (size_t idx : hum->chged_zombieid_) {
|
for (size_t idx : hum->chged_zombieid_) {
|
||||||
if (idx < room->frame_event.chged_zombieids_.size()) {
|
if (idx < room->frame_event.chged_zombieids_.size()) {
|
||||||
|
auto& chg_hum = room->frame_event.chged_zombieids_[idx];
|
||||||
{
|
{
|
||||||
auto p = msg->add_chged_property_list();
|
auto p = msg->add_chged_property_list();
|
||||||
p->set_obj_id(hum->GetEntityUniId());
|
p->set_obj_id(chg_hum->GetEntityUniId());
|
||||||
p->set_property_type(kPropZombieId);
|
p->set_property_type(kPropZombieId);
|
||||||
p->set_value(hum->meta->i->id());
|
p->set_value(chg_hum->meta->i->id());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ class Human : public MoveableEntity
|
|||||||
Buff* GetBuffByEffectId(int effect_id);
|
Buff* GetBuffByEffectId(int effect_id);
|
||||||
void RecalcBuffAttr();
|
void RecalcBuffAttr();
|
||||||
void ProcBuffEffect(Human* caster, Buff* buff);
|
void ProcBuffEffect(Human* caster, Buff* buff);
|
||||||
int GetLevel() {return 1;};
|
int GetLevel() {return level_;};
|
||||||
void OnAttack() {};
|
void OnAttack() {};
|
||||||
void OnHit() {};
|
void OnHit() {};
|
||||||
int GetItemNum(int item_id);
|
int GetItemNum(int item_id);
|
||||||
|
@ -1118,7 +1118,7 @@ bool Room::GenSmallCircle(a8::Vec2 big_circle_pos, float big_circle_rad, float s
|
|||||||
|
|
||||||
void Room::MatchTeam(Human* hum)
|
void Room::MatchTeam(Human* hum)
|
||||||
{
|
{
|
||||||
if (!hum->team_uuid.empty() && GetRoomMode() != kZombieMode) {
|
if (!hum->team_uuid.empty()) {
|
||||||
for (auto& pair : human_hash_) {
|
for (auto& pair : human_hash_) {
|
||||||
if (pair.second != hum) {
|
if (pair.second != hum) {
|
||||||
if (!hum->team_uuid.empty() && pair.second->team_uuid == hum->team_uuid) {
|
if (!hum->team_uuid.empty() && pair.second->team_uuid == hum->team_uuid) {
|
||||||
@ -1146,9 +1146,6 @@ void Room::MatchTeam(Human* hum)
|
|||||||
|
|
||||||
void Room::CombineTeam()
|
void Room::CombineTeam()
|
||||||
{
|
{
|
||||||
if (GetRoomMode() != kChiJiMode) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
std::map<int, size_t> need_combine_teams;
|
std::map<int, size_t> need_combine_teams;
|
||||||
std::map<int, size_t> need_combine_teams_copy;
|
std::map<int, size_t> need_combine_teams_copy;
|
||||||
|
|
||||||
@ -1458,24 +1455,6 @@ void Room::AirDrop(int appear_time, int box_id, int airdrop_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Room::OnZombieAppear(Human* hum)
|
|
||||||
{
|
|
||||||
if (hum->GetRace() == kZombieRace && hum->meta->i->level() == 3 && !sent_zombie_boss_notify) {
|
|
||||||
sent_zombie_boss_notify = true;
|
|
||||||
TouchPlayerList
|
|
||||||
(
|
|
||||||
a8::XParams()
|
|
||||||
.SetParam1(hum->meta->i->name()),
|
|
||||||
[] (Player* hum, a8::XParams& param)
|
|
||||||
{
|
|
||||||
hum->SendSysPiaoMsg(a8::Format("%s出现了", {param.param1.GetString()}),
|
|
||||||
a8::MkRgb(255, 0, 0),
|
|
||||||
3);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Room::AdjustAirDropPos(MetaData::MapThing* thing_meta, a8::Vec2& box_pos)
|
void Room::AdjustAirDropPos(MetaData::MapThing* thing_meta, a8::Vec2& box_pos)
|
||||||
{
|
{
|
||||||
if (room_type_ == RT_NewBrid) {
|
if (room_type_ == RT_NewBrid) {
|
||||||
@ -2682,13 +2661,11 @@ void Room::AddPlayerPostProc(Player* hum)
|
|||||||
RandRemoveAndroid();
|
RandRemoveAndroid();
|
||||||
}
|
}
|
||||||
if (GetRoomMode() == kZombieMode) {
|
if (GetRoomMode() == kZombieMode) {
|
||||||
#ifdef DEBUG
|
|
||||||
#if 0
|
#if 0
|
||||||
hum->ChangeToRace(kZombieRace, 3);
|
hum->ChangeToRace(kZombieRace, 3);
|
||||||
#else
|
#else
|
||||||
hum->ChangeToRace(kHumanRace, 1);
|
hum->ChangeToRace(kHumanRace, 1);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
xtimer.AddRepeatTimerAndAttach
|
xtimer.AddRepeatTimerAndAttach
|
||||||
@ -2901,13 +2878,7 @@ void Room::ZombieModeStart()
|
|||||||
human_list.push_back(pair.second);
|
human_list.push_back(pair.second);
|
||||||
}
|
}
|
||||||
std::random_shuffle(human_list.begin(), human_list.end());
|
std::random_shuffle(human_list.begin(), human_list.end());
|
||||||
#ifdef DEBUG
|
for (size_t i = 0; i < 2; ++i) {
|
||||||
#else
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
for (int i = 0; i < MetaMgr::Instance()->zbmode_init_zombie_num; ++i) {
|
|
||||||
Human* hum = human_list[i];
|
Human* hum = human_list[i];
|
||||||
hum->ChangeToRace(kZombieRace, 1);
|
hum->ChangeToRace(kZombieRace, 1);
|
||||||
}
|
}
|
||||||
@ -3231,6 +3202,24 @@ void Room::NotifySysPiao(const std::string& msg, int color, int duration)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Room::OnZombieAppear(Human* hum)
|
||||||
|
{
|
||||||
|
if (hum->GetRace() == kZombieRace && hum->meta->i->level() == 3 && !sent_zombie_boss_notify) {
|
||||||
|
sent_zombie_boss_notify = true;
|
||||||
|
TouchPlayerList
|
||||||
|
(
|
||||||
|
a8::XParams()
|
||||||
|
.SetParam1(hum->meta->i->name()),
|
||||||
|
[] (Player* hum, a8::XParams& param)
|
||||||
|
{
|
||||||
|
hum->SendSysPiaoMsg(a8::Format("%s出现了", {param.param1.GetString()}),
|
||||||
|
a8::MkRgb(255, 0, 0),
|
||||||
|
3);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
size_t Room::GetRoomMaxPlayerNum()
|
size_t Room::GetRoomMaxPlayerNum()
|
||||||
{
|
{
|
||||||
if (room_mode_ == kZombieMode) {
|
if (room_mode_ == kZombieMode) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user