rename frame_no->GetFrameNo()
This commit is contained in:
parent
ccdbbe98fa
commit
3b1a8bc94d
@ -110,7 +110,7 @@ void AndroidAI::DoMove()
|
|||||||
Human* hum = (Human*)owner;
|
Human* hum = (Human*)owner;
|
||||||
int speed = std::max(1, (int)hum->GetSpeed());
|
int speed = std::max(1, (int)hum->GetSpeed());
|
||||||
if (a8::HasBitFlag(hum->status, HS_NewBieNpc) &&
|
if (a8::HasBitFlag(hum->status, HS_NewBieNpc) &&
|
||||||
hum->room->frame_no - hum->enable_frameno < SERVER_FRAME_RATE * 8) {
|
hum->room->GetFrameNo() - hum->enable_frameno < SERVER_FRAME_RATE * 8) {
|
||||||
hum->move_dir = hum->room->first_newbie->GetPos() - hum->GetPos();
|
hum->move_dir = hum->room->first_newbie->GetPos() - hum->GetPos();
|
||||||
hum->move_dir.Normalize();
|
hum->move_dir.Normalize();
|
||||||
}
|
}
|
||||||
@ -157,14 +157,14 @@ void AndroidAI::DoAttack()
|
|||||||
void AndroidAI::UpdateNewBieNpc()
|
void AndroidAI::UpdateNewBieNpc()
|
||||||
{
|
{
|
||||||
Human* hum = (Human*)owner;
|
Human* hum = (Human*)owner;
|
||||||
if (hum->room->frame_no - hum->enable_frameno < 2) {
|
if (hum->room->GetFrameNo() - hum->enable_frameno < 2) {
|
||||||
hum->move_dir = hum->room->first_newbie->GetPos() - hum->GetPos();
|
hum->move_dir = hum->room->first_newbie->GetPos() - hum->GetPos();
|
||||||
hum->move_dir.Normalize();
|
hum->move_dir.Normalize();
|
||||||
hum->attack_dir = hum->move_dir;
|
hum->attack_dir = hum->move_dir;
|
||||||
if (hum->curr_weapon->weapon_idx != 0) {
|
if (hum->curr_weapon->weapon_idx != 0) {
|
||||||
hum->curr_weapon->ammo = MetaMgr::Instance()->newbie_first_robot_ammo;
|
hum->curr_weapon->ammo = MetaMgr::Instance()->newbie_first_robot_ammo;
|
||||||
}
|
}
|
||||||
} else if (hum->room->frame_no - hum->enable_frameno < SERVER_FRAME_RATE * 1.5) {
|
} else if (hum->room->GetFrameNo() - hum->enable_frameno < SERVER_FRAME_RATE * 1.5) {
|
||||||
int speed = std::max(1, (int)hum->GetSpeed());
|
int speed = std::max(1, (int)hum->GetSpeed());
|
||||||
for (int i = 0; i < speed; ++i) {
|
for (int i = 0; i < speed; ++i) {
|
||||||
a8::Vec2 old_pos = hum->GetPos();
|
a8::Vec2 old_pos = hum->GetPos();
|
||||||
@ -178,7 +178,7 @@ void AndroidAI::UpdateNewBieNpc()
|
|||||||
}
|
}
|
||||||
hum->room->grid_service->MoveHuman(hum);
|
hum->room->grid_service->MoveHuman(hum);
|
||||||
}
|
}
|
||||||
} else if (hum->room->frame_no - hum->enable_frameno < SERVER_FRAME_RATE * 3) {
|
} else if (hum->room->GetFrameNo() - hum->enable_frameno < SERVER_FRAME_RATE * 3) {
|
||||||
Human* enemy = hum->room->first_newbie;
|
Human* enemy = hum->room->first_newbie;
|
||||||
Human* sender = hum;
|
Human* sender = hum;
|
||||||
a8::Vec2 shot_dir = enemy->GetPos() - sender->GetPos();
|
a8::Vec2 shot_dir = enemy->GetPos() - sender->GetPos();
|
||||||
|
@ -37,12 +37,12 @@ void Android::Initialize()
|
|||||||
void Android::Update(int delta_time)
|
void Android::Update(int delta_time)
|
||||||
{
|
{
|
||||||
if (UpdatedTimes() <= 0) {
|
if (UpdatedTimes() <= 0) {
|
||||||
if (room->frame_no % 2 != 0) {
|
if (room->GetFrameNo() % 2 != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InternalUpdate(delta_time);
|
InternalUpdate(delta_time);
|
||||||
if (room->frame_no % 2 == 0) {
|
if (room->GetFrameNo() % 2 == 0) {
|
||||||
SendUpdateMsg();
|
SendUpdateMsg();
|
||||||
}
|
}
|
||||||
++updated_times_;
|
++updated_times_;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
int Buff::GetLeftTime()
|
int Buff::GetLeftTime()
|
||||||
{
|
{
|
||||||
int passed_ms = (owner->room->frame_no - add_frameno) * FRAME_RATE_MS;
|
int passed_ms = (owner->room->GetFrameNo() - add_frameno) * FRAME_RATE_MS;
|
||||||
return std::max(GetLastingTime() - passed_ms, 0);
|
return std::max(GetLastingTime() - passed_ms, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class Entity
|
|||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
if (room && entity_subtype == EST_Player) {
|
if (room && entity_subtype == EST_Player) {
|
||||||
if (room->frame_no > SERVER_FRAME_RATE * 35) {
|
if (room->GetFrameNo() > SERVER_FRAME_RATE * 35) {
|
||||||
if (pos.Distance(pos_) > 500) {
|
if (pos.Distance(pos_) > 500) {
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ cs::SMUpdate* FrameMaker::MakeUpdateMsg(const Human* hum)
|
|||||||
}
|
}
|
||||||
for (auto& itr : hum->part_objects) {
|
for (auto& itr : hum->part_objects) {
|
||||||
Entity* entity = itr;
|
Entity* entity = itr;
|
||||||
if (entity->IsDead(room) && hum->room->frame_no - entity->GetDeadFrameNo(room) > 10) {
|
if (entity->IsDead(room) && hum->room->GetFrameNo() - entity->GetDeadFrameNo(room) > 10) {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -76,7 +76,7 @@ void GameLog::GameEnd(Player* hum)
|
|||||||
prop->SetVal("map_name", hum->room->map_meta->i->map_name());
|
prop->SetVal("map_name", hum->room->map_meta->i->map_name());
|
||||||
prop->SetVal("map_tpl_name", hum->room->map_tpl_name);
|
prop->SetVal("map_tpl_name", hum->room->map_tpl_name);
|
||||||
if (!hum->dead) {
|
if (!hum->dead) {
|
||||||
prop->SetVal("alive_time", hum->room->frame_no * 1000.0f / SERVER_FRAME_RATE);
|
prop->SetVal("alive_time", hum->room->GetFrameNo() * 1000.0f / SERVER_FRAME_RATE);
|
||||||
} else {
|
} else {
|
||||||
prop->SetVal("alive_time", hum->dead_frameno * 1000.0f / SERVER_FRAME_RATE);
|
prop->SetVal("alive_time", hum->dead_frameno * 1000.0f / SERVER_FRAME_RATE);
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ void Human::FillMFObjectFull(Room* room, cs::MFObjectFull* full_data)
|
|||||||
dead_frameno,
|
dead_frameno,
|
||||||
dead_times,
|
dead_times,
|
||||||
room->AliveCount(),
|
room->AliveCount(),
|
||||||
room->frame_no
|
room->GetFrameNo()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
countdown = std::max(0, countdown - kReviveTimeAdd);
|
countdown = std::max(0, countdown - kReviveTimeAdd);
|
||||||
@ -202,7 +202,7 @@ void Human::FillMFPlayerStats(cs::MFPlayerStats* stats_pb)
|
|||||||
stats_pb->set_player_avatar_url(avatar_url);
|
stats_pb->set_player_avatar_url(avatar_url);
|
||||||
|
|
||||||
if (!dead) {
|
if (!dead) {
|
||||||
stats_pb->set_time_alive(room->frame_no * 1000.0f / SERVER_FRAME_RATE);
|
stats_pb->set_time_alive(room->GetFrameNo() * 1000.0f / SERVER_FRAME_RATE);
|
||||||
} else {
|
} else {
|
||||||
stats_pb->set_time_alive(dead_frameno * 1000.0f / SERVER_FRAME_RATE);
|
stats_pb->set_time_alive(dead_frameno * 1000.0f / SERVER_FRAME_RATE);
|
||||||
}
|
}
|
||||||
@ -278,9 +278,9 @@ void Human::FillMFTeamData(cs::MFTeamData* team_data)
|
|||||||
{
|
{
|
||||||
#else
|
#else
|
||||||
if (room->gas_data.gas_mode == GasJump ||
|
if (room->gas_data.gas_mode == GasJump ||
|
||||||
room->frame_no - last_sync_teamdata_frameno_ > SERVER_FRAME_RATE * 2) {
|
room->GetFrameNo() - last_sync_teamdata_frameno_ > SERVER_FRAME_RATE * 2) {
|
||||||
#endif
|
#endif
|
||||||
last_sync_teamdata_frameno_ = room->frame_no;
|
last_sync_teamdata_frameno_ = room->GetFrameNo();
|
||||||
team_data->set_player_id(entity_uniid);
|
team_data->set_player_id(entity_uniid);
|
||||||
team_data->set_name(name);
|
team_data->set_name(name);
|
||||||
TypeConvert::ToPb(GetPos(), team_data->mutable_pos());
|
TypeConvert::ToPb(GetPos(), team_data->mutable_pos());
|
||||||
@ -382,7 +382,7 @@ void Human::Shot(a8::Vec2& target_dir)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
last_shot_frameno_ = room->frame_no;
|
last_shot_frameno_ = room->GetFrameNo();
|
||||||
if (!need_sync_active_player) {
|
if (!need_sync_active_player) {
|
||||||
room->frame_event.AddBulletNumChg(this);
|
room->frame_event.AddBulletNumChg(this);
|
||||||
}
|
}
|
||||||
@ -427,7 +427,7 @@ void Human::TankShot(a8::Vec2& target_dir)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
--tank_weapon.ammo;
|
--tank_weapon.ammo;
|
||||||
last_shot_frameno_ = room->frame_no;
|
last_shot_frameno_ = room->GetFrameNo();
|
||||||
room->frame_event.AddTankBulletNumChg(this);
|
room->frame_event.AddTankBulletNumChg(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -627,7 +627,7 @@ void Human::UpdateSkill()
|
|||||||
if (skill_meta_) {
|
if (skill_meta_) {
|
||||||
if (curr_skill_phase < skill_meta_->phases.size()) {
|
if (curr_skill_phase < skill_meta_->phases.size()) {
|
||||||
MetaData::SkillPhase* phase = &skill_meta_->phases[curr_skill_phase];
|
MetaData::SkillPhase* phase = &skill_meta_->phases[curr_skill_phase];
|
||||||
if (phase->time_offset >= (int)((room->frame_no - last_use_skill_frameno_) * FRAME_RATE_MS)) {
|
if (phase->time_offset >= (int)((room->GetFrameNo() - last_use_skill_frameno_) * FRAME_RATE_MS)) {
|
||||||
ProcSkillPhase(phase);
|
ProcSkillPhase(phase);
|
||||||
++curr_skill_phase;
|
++curr_skill_phase;
|
||||||
}
|
}
|
||||||
@ -753,7 +753,7 @@ void Human::StartAction(ActionType_e action_type,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->action_type = action_type;
|
this->action_type = action_type;
|
||||||
this->action_frameno = room->frame_no;
|
this->action_frameno = room->GetFrameNo();
|
||||||
this->action_duration = action_duration;
|
this->action_duration = action_duration;
|
||||||
this->action_item_id = item_id;
|
this->action_item_id = item_id;
|
||||||
this->action_target_id = target_id;
|
this->action_target_id = target_id;
|
||||||
@ -933,7 +933,7 @@ void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
|||||||
dead = true;
|
dead = true;
|
||||||
downed = false;
|
downed = false;
|
||||||
ability.hp = 0.0f;
|
ability.hp = 0.0f;
|
||||||
dead_frameno = room->frame_no;
|
dead_frameno = room->GetFrameNo();
|
||||||
++dead_times;
|
++dead_times;
|
||||||
if (HasBuffEffect(kBET_Camouflage)) {
|
if (HasBuffEffect(kBET_Camouflage)) {
|
||||||
RemoveBuffByEffectId(kBET_Camouflage);
|
RemoveBuffByEffectId(kBET_Camouflage);
|
||||||
@ -1123,7 +1123,7 @@ void Human::DoSkill()
|
|||||||
skill_target_pos = a8::Vec2();
|
skill_target_pos = a8::Vec2();
|
||||||
skill_param1 = 0.0f;
|
skill_param1 = 0.0f;
|
||||||
playing_skill = true;
|
playing_skill = true;
|
||||||
last_use_skill_frameno_ = room->frame_no;
|
last_use_skill_frameno_ = room->GetFrameNo();
|
||||||
#if 1
|
#if 1
|
||||||
skill_target_id = entity_uniid;
|
skill_target_id = entity_uniid;
|
||||||
#endif
|
#endif
|
||||||
@ -1394,7 +1394,7 @@ void Human::FillMFActivePlayerData(cs::MFActivePlayerData* player_data)
|
|||||||
if (action_type != AT_None) {
|
if (action_type != AT_None) {
|
||||||
int duration = std::max(0,
|
int duration = std::max(0,
|
||||||
action_duration -
|
action_duration -
|
||||||
(int)((room->frame_no - action_frameno) * 1.0f / SERVER_FRAME_RATE) * 1000
|
(int)((room->GetFrameNo() - action_frameno) * 1.0f / SERVER_FRAME_RATE) * 1000
|
||||||
);
|
);
|
||||||
player_data->set_action_item_id(action_item_id);
|
player_data->set_action_item_id(action_item_id);
|
||||||
player_data->set_action_duration(duration);
|
player_data->set_action_duration(duration);
|
||||||
@ -1435,7 +1435,7 @@ void Human::FillMFActivePlayerData(cs::MFActivePlayerData* player_data)
|
|||||||
player_data->set_skill_left_time(0);
|
player_data->set_skill_left_time(0);
|
||||||
player_data->set_skill_cd_time(skill_meta->i->cd_time() * 1000);
|
player_data->set_skill_cd_time(skill_meta->i->cd_time() * 1000);
|
||||||
} else {
|
} else {
|
||||||
int passed_time = (room->frame_no - last_use_skill_frameno_) * FRAME_RATE_MS;
|
int passed_time = (room->GetFrameNo() - last_use_skill_frameno_) * FRAME_RATE_MS;
|
||||||
int skill_left_time = std::max(0, skill_meta->i->cd_time() * 1000 - passed_time);
|
int skill_left_time = std::max(0, skill_meta->i->cd_time() * 1000 - passed_time);
|
||||||
player_data->set_skill_left_time(skill_left_time);
|
player_data->set_skill_left_time(skill_left_time);
|
||||||
player_data->set_skill_cd_time(skill_meta->i->cd_time() * 1000);
|
player_data->set_skill_cd_time(skill_meta->i->cd_time() * 1000);
|
||||||
@ -1451,7 +1451,7 @@ void Human::FillMFGasData(cs::MFGasData* gas_data)
|
|||||||
gas_data->set_mode(room->gas_data.gas_mode);
|
gas_data->set_mode(room->gas_data.gas_mode);
|
||||||
if (room->gas_data.gas_mode == GasInactive) {
|
if (room->gas_data.gas_mode == GasInactive) {
|
||||||
long long duration = room->GetGasInactiveTime() * SERVER_FRAME_RATE -
|
long long duration = room->GetGasInactiveTime() * SERVER_FRAME_RATE -
|
||||||
(room->frame_no - room->gas_data.gas_start_frameno);
|
(room->GetFrameNo() - room->gas_data.gas_start_frameno);
|
||||||
gas_data->set_duration(std::max(duration * 50, (long long)1000) / 1000);
|
gas_data->set_duration(std::max(duration * 50, (long long)1000) / 1000);
|
||||||
} else if (room->gas_data.gas_mode == GasJump) {
|
} else if (room->gas_data.gas_mode == GasJump) {
|
||||||
gas_data->set_duration(0);
|
gas_data->set_duration(0);
|
||||||
@ -1469,7 +1469,7 @@ void Human::FillMFGasData(cs::MFGasData* gas_data)
|
|||||||
gas_data->set_duration(0);
|
gas_data->set_duration(0);
|
||||||
} else {
|
} else {
|
||||||
long long duration = room->gas_data.old_area_meta->i->wait_time() * 20 -
|
long long duration = room->gas_data.old_area_meta->i->wait_time() * 20 -
|
||||||
(room->frame_no - room->gas_data.gas_start_frameno);
|
(room->GetFrameNo() - room->gas_data.gas_start_frameno);
|
||||||
gas_data->set_duration(std::max(duration * 50, (long long)1000) / 1000);
|
gas_data->set_duration(std::max(duration * 50, (long long)1000) / 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1553,7 +1553,7 @@ void Human::RecoverHp(int inc_hp)
|
|||||||
void Human::FillBodyState(::google::protobuf::RepeatedPtrField<::cs::MFBodyState>* states)
|
void Human::FillBodyState(::google::protobuf::RepeatedPtrField<::cs::MFBodyState>* states)
|
||||||
{
|
{
|
||||||
if (pain_killer_timer) {
|
if (pain_killer_timer) {
|
||||||
int passed_time = (room->frame_no - pain_killer_frameno) * FRAME_RATE_MS;
|
int passed_time = (room->GetFrameNo() - pain_killer_frameno) * FRAME_RATE_MS;
|
||||||
int left_time = std::max(0, pain_killer_lastingtime * 1000 - passed_time);
|
int left_time = std::max(0, pain_killer_lastingtime * 1000 - passed_time);
|
||||||
int anodyne_max_time = MetaMgr::Instance()->GetSysParamAsInt("anodyne_max_time");
|
int anodyne_max_time = MetaMgr::Instance()->GetSysParamAsInt("anodyne_max_time");
|
||||||
left_time = std::min(left_time, anodyne_max_time * 1000);
|
left_time = std::min(left_time, anodyne_max_time * 1000);
|
||||||
@ -1753,7 +1753,7 @@ void Human::UpdateAction()
|
|||||||
{
|
{
|
||||||
int duration = std::max(0,
|
int duration = std::max(0,
|
||||||
action_duration -
|
action_duration -
|
||||||
(int)((room->frame_no - action_frameno) * 1.0f / SERVER_FRAME_RATE) * 1000
|
(int)((room->GetFrameNo() - action_frameno) * 1.0f / SERVER_FRAME_RATE) * 1000
|
||||||
);
|
);
|
||||||
if (duration <= 0) {
|
if (duration <= 0) {
|
||||||
switch (action_type) {
|
switch (action_type) {
|
||||||
@ -1812,14 +1812,14 @@ void Human::UpdateAction()
|
|||||||
if (item_meta){
|
if (item_meta){
|
||||||
if (GetInventory(item_meta->i->_inventory_slot()) > 0) {
|
if (GetInventory(item_meta->i->_inventory_slot()) > 0) {
|
||||||
if (pain_killer_timer) {
|
if (pain_killer_timer) {
|
||||||
int passed_time = (room->frame_no - pain_killer_frameno) * FRAME_RATE_MS;
|
int passed_time = (room->GetFrameNo() - pain_killer_frameno) * FRAME_RATE_MS;
|
||||||
int left_time = std::max(0, pain_killer_lastingtime * 1000 - passed_time);
|
int left_time = std::max(0, pain_killer_lastingtime * 1000 - passed_time);
|
||||||
int anodyne_max_time = MetaMgr::Instance()->GetSysParamAsInt("anodyne_max_time");
|
int anodyne_max_time = MetaMgr::Instance()->GetSysParamAsInt("anodyne_max_time");
|
||||||
left_time = std::min(left_time, anodyne_max_time * 1000);
|
left_time = std::min(left_time, anodyne_max_time * 1000);
|
||||||
pain_killer_lastingtime += std::min(item_meta->i->time() * 1000, anodyne_max_time * 1000 - left_time) / 1000;
|
pain_killer_lastingtime += std::min(item_meta->i->time() * 1000, anodyne_max_time * 1000 - left_time) / 1000;
|
||||||
need_sync_active_player = true;
|
need_sync_active_player = true;
|
||||||
} else {
|
} else {
|
||||||
pain_killer_frameno = room->frame_no;
|
pain_killer_frameno = room->GetFrameNo();
|
||||||
pain_killer_lastingtime = item_meta->i->time();
|
pain_killer_lastingtime = item_meta->i->time();
|
||||||
pain_killer_timer = room->xtimer.AddRepeatTimerAndAttach(
|
pain_killer_timer = room->xtimer.AddRepeatTimerAndAttach(
|
||||||
SERVER_FRAME_RATE,
|
SERVER_FRAME_RATE,
|
||||||
@ -1834,7 +1834,7 @@ void Human::UpdateAction()
|
|||||||
hum->ability.hp = std::min(hum->GetHP(), hum->GetMaxHP());
|
hum->ability.hp = std::min(hum->GetHP(), hum->GetMaxHP());
|
||||||
hum->stats.heal_amount += hum->GetHP() - old_health;
|
hum->stats.heal_amount += hum->GetHP() - old_health;
|
||||||
hum->SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
hum->SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||||
if (hum->room->frame_no - hum->pain_killer_frameno > hum->pain_killer_lastingtime * SERVER_FRAME_RATE) {
|
if (hum->room->GetFrameNo() - hum->pain_killer_frameno > hum->pain_killer_lastingtime * SERVER_FRAME_RATE) {
|
||||||
hum->room->xtimer.DeleteTimer(hum->pain_killer_timer);
|
hum->room->xtimer.DeleteTimer(hum->pain_killer_timer);
|
||||||
hum->pain_killer_timer = nullptr;
|
hum->pain_killer_timer = nullptr;
|
||||||
}
|
}
|
||||||
@ -2205,7 +2205,7 @@ void Human::GenBattleReportData(a8::MutableXObject* params)
|
|||||||
params->SetVal("harm", stats.damage_amount_out);
|
params->SetVal("harm", stats.damage_amount_out);
|
||||||
params->SetVal("add_HP", stats.heal_amount);
|
params->SetVal("add_HP", stats.heal_amount);
|
||||||
if (!dead) {
|
if (!dead) {
|
||||||
params->SetVal("alive_time", room->frame_no * 1000.0f / SERVER_FRAME_RATE);
|
params->SetVal("alive_time", room->GetFrameNo() * 1000.0f / SERVER_FRAME_RATE);
|
||||||
} else {
|
} else {
|
||||||
params->SetVal("alive_time", dead_frameno * 1000.0f / SERVER_FRAME_RATE);
|
params->SetVal("alive_time", dead_frameno * 1000.0f / SERVER_FRAME_RATE);
|
||||||
}
|
}
|
||||||
@ -2751,7 +2751,7 @@ int Human::GetSkillLeftTime()
|
|||||||
if (last_use_skill_frameno_ == 0) {
|
if (last_use_skill_frameno_ == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
int passed_time = (room->frame_no - last_use_skill_frameno_) * FRAME_RATE_MS;
|
int passed_time = (room->GetFrameNo() - last_use_skill_frameno_) * FRAME_RATE_MS;
|
||||||
int skill_left_time = std::max(0, GetSkillCd() - passed_time);
|
int skill_left_time = std::max(0, GetSkillCd() - passed_time);
|
||||||
return skill_left_time;
|
return skill_left_time;
|
||||||
}
|
}
|
||||||
@ -2869,7 +2869,7 @@ void Human::AddBuff(MetaData::Buff* buff_meta, int skill_lv)
|
|||||||
buff->owner = this;
|
buff->owner = this;
|
||||||
buff->meta = buff_meta;
|
buff->meta = buff_meta;
|
||||||
//buff->skill_meta
|
//buff->skill_meta
|
||||||
buff->add_frameno = room->frame_no;
|
buff->add_frameno = room->GetFrameNo();
|
||||||
buff->xtimer_attacher.xtimer = &room->xtimer;
|
buff->xtimer_attacher.xtimer = &room->xtimer;
|
||||||
buff_effect_[buff->meta->i->buff_effect()] = buff;
|
buff_effect_[buff->meta->i->buff_effect()] = buff;
|
||||||
room->frame_event.AddBuff(this, buff);
|
room->frame_event.AddBuff(this, buff);
|
||||||
@ -2952,7 +2952,7 @@ void Human::ProcBuffEffect(Buff* buff)
|
|||||||
{
|
{
|
||||||
if (curr_skill_phase < skill_meta_->phases.size()) {
|
if (curr_skill_phase < skill_meta_->phases.size()) {
|
||||||
MetaData::SkillPhase* phase = &skill_meta_->phases[curr_skill_phase];
|
MetaData::SkillPhase* phase = &skill_meta_->phases[curr_skill_phase];
|
||||||
if (phase->time_offset >= (int)((room->frame_no - last_use_skill_frameno_) * FRAME_RATE_MS)) {
|
if (phase->time_offset >= (int)((room->GetFrameNo() - last_use_skill_frameno_) * FRAME_RATE_MS)) {
|
||||||
if (HasBuffEffect(kBET_Car)) {
|
if (HasBuffEffect(kBET_Car)) {
|
||||||
_UpdateMove(phase->param1.GetDouble() * 1.5);
|
_UpdateMove(phase->param1.GetDouble() * 1.5);
|
||||||
} else {
|
} else {
|
||||||
@ -2992,7 +2992,7 @@ void Human::AddItem(int item_id, int item_num)
|
|||||||
items_[item_id] = item_num;
|
items_[item_id] = item_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (room && room->frame_no > join_frameno) {
|
if (room && room->GetFrameNo() > join_frameno) {
|
||||||
room->frame_event.AddItemChg(this, item_id, items_[item_id]);
|
room->frame_event.AddItemChg(this, item_id, items_[item_id]);
|
||||||
} else {
|
} else {
|
||||||
if (item_num <= 0) {
|
if (item_num <= 0) {
|
||||||
|
@ -113,7 +113,7 @@ void Obstacle::FillMFObjectFull(Room* room, cs::MFObjectFull* full_data)
|
|||||||
p->set_obstacle_id(meta->i->thing_id());
|
p->set_obstacle_id(meta->i->thing_id());
|
||||||
p->set_health(GetHealth(room));
|
p->set_health(GetHealth(room));
|
||||||
p->set_dead(IsDead(room));
|
p->set_dead(IsDead(room));
|
||||||
p->set_dead_at_thisframe(IsDead(room) ? GetDeadFrameNo(room) <= room->frame_no : false);
|
p->set_dead_at_thisframe(IsDead(room) ? GetDeadFrameNo(room) <= room->GetFrameNo() : false);
|
||||||
|
|
||||||
p->set_is_door(is_door_);
|
p->set_is_door(is_door_);
|
||||||
if (is_door_ && IsPermanent()) {
|
if (is_door_ && IsPermanent()) {
|
||||||
@ -406,10 +406,10 @@ void Obstacle::Die(Room* room)
|
|||||||
}
|
}
|
||||||
p->health = 0;
|
p->health = 0;
|
||||||
p->dead = true;
|
p->dead = true;
|
||||||
p->dead_frameno = room->frame_no;
|
p->dead_frameno = room->GetFrameNo();
|
||||||
} else {
|
} else {
|
||||||
health_ = 0;
|
health_ = 0;
|
||||||
dead_ = true;
|
dead_ = true;
|
||||||
dead_frameno_ = room->frame_no;
|
dead_frameno_ = room->GetFrameNo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,12 +40,12 @@ void Player::Initialize()
|
|||||||
void Player::Update(int delta_time)
|
void Player::Update(int delta_time)
|
||||||
{
|
{
|
||||||
if (UpdatedTimes() <= 0) {
|
if (UpdatedTimes() <= 0) {
|
||||||
if (room->frame_no % 2 != 0) {
|
if (room->GetFrameNo() % 2 != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InternalUpdate(delta_time);
|
InternalUpdate(delta_time);
|
||||||
if (room->frame_no % 2 == 0) {
|
if (room->GetFrameNo() % 2 == 0) {
|
||||||
SendUpdateMsg();
|
SendUpdateMsg();
|
||||||
}
|
}
|
||||||
++updated_times_;
|
++updated_times_;
|
||||||
@ -59,7 +59,7 @@ void Player::InternalUpdate(int delta_time)
|
|||||||
if (moving) {
|
if (moving) {
|
||||||
UpdateMove();
|
UpdateMove();
|
||||||
}
|
}
|
||||||
if (room->frame_no % 2 == 0) {
|
if (room->GetFrameNo() % 2 == 0) {
|
||||||
if (drop_weapon) {
|
if (drop_weapon) {
|
||||||
UpdateDropWeapon();
|
UpdateDropWeapon();
|
||||||
}
|
}
|
||||||
@ -175,7 +175,7 @@ void Player::UpdateShot()
|
|||||||
++series_shot_frames;
|
++series_shot_frames;
|
||||||
if (last_shot_frameno_ == 0 ||
|
if (last_shot_frameno_ == 0 ||
|
||||||
(
|
(
|
||||||
(room->frame_no - last_shot_frameno_) * (1000 / SERVER_FRAME_RATE)) >=
|
(room->GetFrameNo() - last_shot_frameno_) * (1000 / SERVER_FRAME_RATE)) >=
|
||||||
p_weapon->GetAttrValue(kHAT_FireRate)
|
p_weapon->GetAttrValue(kHAT_FireRate)
|
||||||
) {
|
) {
|
||||||
Shot();
|
Shot();
|
||||||
@ -447,7 +447,7 @@ void Player::Shot()
|
|||||||
curr_weapon->ammo <= 0) {
|
curr_weapon->ammo <= 0) {
|
||||||
AutoLoadingBullet();
|
AutoLoadingBullet();
|
||||||
}
|
}
|
||||||
last_shot_frameno_ = room->frame_no;
|
last_shot_frameno_ = room->GetFrameNo();
|
||||||
need_sync_active_player = true;
|
need_sync_active_player = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -725,13 +725,13 @@ void Player::HumanInteraction(Human* hum)
|
|||||||
hum->StartAction(
|
hum->StartAction(
|
||||||
AT_Rescue,
|
AT_Rescue,
|
||||||
MetaMgr::Instance()->GetSysParamAsInt("downed_relive_time") * 1000,
|
MetaMgr::Instance()->GetSysParamAsInt("downed_relive_time") * 1000,
|
||||||
room->frame_no,
|
room->GetFrameNo(),
|
||||||
entity_uniid
|
entity_uniid
|
||||||
);
|
);
|
||||||
StartAction(
|
StartAction(
|
||||||
AT_Relive,
|
AT_Relive,
|
||||||
MetaMgr::Instance()->GetSysParamAsInt("downed_relive_time") * 1000,
|
MetaMgr::Instance()->GetSysParamAsInt("downed_relive_time") * 1000,
|
||||||
room->frame_no,
|
room->GetFrameNo(),
|
||||||
hum->entity_uniid
|
hum->entity_uniid
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1177,7 +1177,7 @@ void Player::_CMLeave(f8::MsgHdr& hdr, const cs::CMLeave& msg)
|
|||||||
BeKill(entity_uniid, name, VW_Spectate);
|
BeKill(entity_uniid, name, VW_Spectate);
|
||||||
}
|
}
|
||||||
leave_ = true;
|
leave_ = true;
|
||||||
leave_frameno_ = room->frame_no;
|
leave_frameno_ = room->GetFrameNo();
|
||||||
}
|
}
|
||||||
cs::SMLeave respmsg;
|
cs::SMLeave respmsg;
|
||||||
SendNotifyMsg(respmsg);
|
SendNotifyMsg(respmsg);
|
||||||
|
@ -29,7 +29,7 @@ const int ROOM_MAX_PLAYER_NUM = 40;
|
|||||||
static long long RoomXGetTickCount(void* context)
|
static long long RoomXGetTickCount(void* context)
|
||||||
{
|
{
|
||||||
Room* room = (Room*)context;
|
Room* room = (Room*)context;
|
||||||
return room->frame_no;
|
return room->GetFrameNo();
|
||||||
}
|
}
|
||||||
|
|
||||||
Room::~Room()
|
Room::~Room()
|
||||||
@ -94,7 +94,7 @@ void Room::Update(int delta_time)
|
|||||||
run_in_timer_ = true;
|
run_in_timer_ = true;
|
||||||
#endif
|
#endif
|
||||||
xtimer.Update();
|
xtimer.Update();
|
||||||
if (game_over && frame_no - game_over_frameno > SERVER_FRAME_RATE * 20) {
|
if (game_over && GetFrameNo() - game_over_frameno > SERVER_FRAME_RATE * 20) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,16 +103,16 @@ void Room::Update(int delta_time)
|
|||||||
#endif
|
#endif
|
||||||
elapsed_time_ += delta_time;
|
elapsed_time_ += delta_time;
|
||||||
while (elapsed_time_ >= 50) {
|
while (elapsed_time_ >= 50) {
|
||||||
if (frame_no % 2 == 0) {
|
if (GetFrameNo() % 2 == 0) {
|
||||||
UpdateGas();
|
UpdateGas();
|
||||||
}
|
}
|
||||||
for (auto& pair : moveable_hash_) {
|
for (auto& pair : moveable_hash_) {
|
||||||
pair.second->Update(50);
|
pair.second->Update(50);
|
||||||
}
|
}
|
||||||
if (frame_no % 2 == 0) {
|
if (GetFrameNo() % 2 == 0) {
|
||||||
frame_event.Clear();
|
frame_event.Clear();
|
||||||
}
|
}
|
||||||
++frame_no;
|
++frameno_;
|
||||||
elapsed_time_ -= 50;
|
elapsed_time_ -= 50;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -164,7 +164,7 @@ void Room::AddPlayer(Player* hum)
|
|||||||
|
|
||||||
hum->entity_uniid = AllocUniid();
|
hum->entity_uniid = AllocUniid();
|
||||||
hum->room = this;
|
hum->room = this;
|
||||||
hum->join_frameno = frame_no;
|
hum->join_frameno = GetFrameNo();
|
||||||
hum->Initialize();
|
hum->Initialize();
|
||||||
{
|
{
|
||||||
cs::SMJoinedNotify notifymsg;
|
cs::SMJoinedNotify notifymsg;
|
||||||
@ -184,7 +184,6 @@ void Room::AddPlayer(Player* hum)
|
|||||||
accountid_hash_[hum->account_id] = hum;
|
accountid_hash_[hum->account_id] = hum;
|
||||||
human_hash_[hum->entity_uniid] = hum;
|
human_hash_[hum->entity_uniid] = hum;
|
||||||
alive_human_hash_[hum->entity_uniid] = hum;
|
alive_human_hash_[hum->entity_uniid] = hum;
|
||||||
last_add_player_tick = a8::XGetTickCount();
|
|
||||||
++alive_count_;
|
++alive_count_;
|
||||||
++App::Instance()->perf.alive_count;
|
++App::Instance()->perf.alive_count;
|
||||||
grid_service->AddHuman(hum);
|
grid_service->AddHuman(hum);
|
||||||
@ -396,7 +395,7 @@ DEFAULT_BORN_POINT_Y + rand() % 1500)
|
|||||||
Human* Room::FindEnemy(Human* hum)
|
Human* Room::FindEnemy(Human* hum)
|
||||||
{
|
{
|
||||||
if (a8::HasBitFlag(hum->status, HS_NewBieNpc) &&
|
if (a8::HasBitFlag(hum->status, HS_NewBieNpc) &&
|
||||||
frame_no - hum->enable_frameno < SERVER_FRAME_RATE * 8) {
|
GetFrameNo() - hum->enable_frameno < SERVER_FRAME_RATE * 8) {
|
||||||
return first_newbie;
|
return first_newbie;
|
||||||
}
|
}
|
||||||
std::vector<Human*> enemys;
|
std::vector<Human*> enemys;
|
||||||
@ -885,7 +884,7 @@ void Room::UpdateGas()
|
|||||||
if (gas_data.gas_mode != GasInactive && gas_data.gas_mode != GasJump) {
|
if (gas_data.gas_mode != GasInactive && gas_data.gas_mode != GasJump) {
|
||||||
if (!game_over && alive_count_ <= MAX_TEAM_NUM && GetAliveTeamNum() <= 1) {
|
if (!game_over && alive_count_ <= MAX_TEAM_NUM && GetAliveTeamNum() <= 1) {
|
||||||
game_over = true;
|
game_over = true;
|
||||||
game_over_frameno = frame_no;
|
game_over_frameno = GetFrameNo();
|
||||||
OnGameOver();
|
OnGameOver();
|
||||||
}
|
}
|
||||||
for (auto& pair : human_hash_) {
|
for (auto& pair : human_hash_) {
|
||||||
@ -915,12 +914,12 @@ void Room::UpdateGas()
|
|||||||
|
|
||||||
void Room::UpdateGasInactive()
|
void Room::UpdateGasInactive()
|
||||||
{
|
{
|
||||||
if (frame_no - gas_data.gas_start_frameno >= GetGasInactiveTime() * SERVER_FRAME_RATE) {
|
if (GetFrameNo() - gas_data.gas_start_frameno >= GetGasInactiveTime() * SERVER_FRAME_RATE) {
|
||||||
gas_data.gas_mode = GasWaiting;
|
gas_data.gas_mode = GasWaiting;
|
||||||
gas_data.old_area_meta = MetaMgr::Instance()->GetSafeArea(30001);
|
gas_data.old_area_meta = MetaMgr::Instance()->GetSafeArea(30001);
|
||||||
gas_data.new_area_meta = MetaMgr::Instance()->GetSafeArea(30002);
|
gas_data.new_area_meta = MetaMgr::Instance()->GetSafeArea(30002);
|
||||||
gas_data.gas_progress = gas_data.old_area_meta->i->rad();
|
gas_data.gas_progress = gas_data.old_area_meta->i->rad();
|
||||||
gas_data.gas_start_frameno = frame_no;
|
gas_data.gas_start_frameno = GetFrameNo();
|
||||||
gas_data.pos_old = a8::Vec2(map_meta->i->map_width() / 2.0f,
|
gas_data.pos_old = a8::Vec2(map_meta->i->map_width() / 2.0f,
|
||||||
map_meta->i->map_height() / 2.0f);
|
map_meta->i->map_height() / 2.0f);
|
||||||
gas_data.pos_old_bk = gas_data.pos_old;
|
gas_data.pos_old_bk = gas_data.pos_old;
|
||||||
@ -933,7 +932,7 @@ void Room::UpdateGasInactive()
|
|||||||
}
|
}
|
||||||
gas_data.rad_old = gas_data.old_area_meta->i->rad();
|
gas_data.rad_old = gas_data.old_area_meta->i->rad();
|
||||||
gas_data.rad_new = gas_data.new_area_meta->i->rad();
|
gas_data.rad_new = gas_data.new_area_meta->i->rad();
|
||||||
battle_start_frameno_ = frame_no;
|
battle_start_frameno_ = GetFrameNo();
|
||||||
if (human_hash_.size() < ROOM_MAX_PLAYER_NUM) {
|
if (human_hash_.size() < ROOM_MAX_PLAYER_NUM) {
|
||||||
CreateAndroid(ROOM_MAX_PLAYER_NUM - human_hash_.size());
|
CreateAndroid(ROOM_MAX_PLAYER_NUM - human_hash_.size());
|
||||||
NotifyUiUpdate();
|
NotifyUiUpdate();
|
||||||
@ -950,18 +949,18 @@ void Room::UpdateGasInactive()
|
|||||||
|
|
||||||
void Room::UpdateGasWaiting()
|
void Room::UpdateGasWaiting()
|
||||||
{
|
{
|
||||||
if (frame_no - gas_data.gas_start_frameno >=
|
if (GetFrameNo() - gas_data.gas_start_frameno >=
|
||||||
gas_data.old_area_meta->i->wait_time() * SERVER_FRAME_RATE) {
|
gas_data.old_area_meta->i->wait_time() * SERVER_FRAME_RATE) {
|
||||||
gas_data.gas_mode = GasMoving;
|
gas_data.gas_mode = GasMoving;
|
||||||
gas_data.gas_start_frameno = frame_no;;
|
gas_data.gas_start_frameno = GetFrameNo();;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Room::UpdateGasMoving()
|
void Room::UpdateGasMoving()
|
||||||
{
|
{
|
||||||
if (frame_no - gas_data.gas_start_frameno > 0 && !gas_data.is_last_gas) {
|
if (GetFrameNo() - gas_data.gas_start_frameno > 0 && !gas_data.is_last_gas) {
|
||||||
float distance = gas_data.old_area_meta->i->shrink_speed() *
|
float distance = gas_data.old_area_meta->i->shrink_speed() *
|
||||||
((frame_no - gas_data.gas_start_frameno) * (1.0 / SERVER_FRAME_RATE));
|
((GetFrameNo() - gas_data.gas_start_frameno) * (1.0 / SERVER_FRAME_RATE));
|
||||||
gas_data.gas_progress = std::max(gas_data.rad_old - distance, gas_data.rad_new);
|
gas_data.gas_progress = std::max(gas_data.rad_old - distance, gas_data.rad_new);
|
||||||
if (!(gas_data.pos_new == gas_data.pos_old)) {
|
if (!(gas_data.pos_new == gas_data.pos_old)) {
|
||||||
a8::Vec2 p1 = gas_data.pos_new - gas_data.pos_old_bk;
|
a8::Vec2 p1 = gas_data.pos_new - gas_data.pos_old_bk;
|
||||||
@ -988,7 +987,7 @@ void Room::UpdateGasMoving()
|
|||||||
gas_data.old_area_meta = MetaMgr::Instance()->GetSafeArea(pre_area_id);
|
gas_data.old_area_meta = MetaMgr::Instance()->GetSafeArea(pre_area_id);
|
||||||
gas_data.new_area_meta = MetaMgr::Instance()->GetSafeArea(pre_area_id + 1);
|
gas_data.new_area_meta = MetaMgr::Instance()->GetSafeArea(pre_area_id + 1);
|
||||||
gas_data.gas_progress = gas_data.old_area_meta->i->rad();
|
gas_data.gas_progress = gas_data.old_area_meta->i->rad();
|
||||||
gas_data.gas_start_frameno = frame_no;
|
gas_data.gas_start_frameno = GetFrameNo();
|
||||||
gas_data.pos_old = pre_pos;
|
gas_data.pos_old = pre_pos;
|
||||||
gas_data.pos_old_bk = gas_data.pos_old;
|
gas_data.pos_old_bk = gas_data.pos_old;
|
||||||
{
|
{
|
||||||
@ -1363,7 +1362,7 @@ void Room::AddObjectLater(RoomEntity* entity)
|
|||||||
void Room::OnGameOver()
|
void Room::OnGameOver()
|
||||||
{
|
{
|
||||||
for (auto& pair : human_hash_) {
|
for (auto& pair : human_hash_) {
|
||||||
if (game_over && game_over_frameno == frame_no) {
|
if (game_over && game_over_frameno == GetFrameNo()) {
|
||||||
pair.second->SendGameOver();
|
pair.second->SendGameOver();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1821,7 +1820,7 @@ void Room::EnableHuman(Human* target)
|
|||||||
if (a8::HasBitFlag(target->status, HS_Disable)) {
|
if (a8::HasBitFlag(target->status, HS_Disable)) {
|
||||||
a8::UnSetBitFlag(target->status, HS_Disable);
|
a8::UnSetBitFlag(target->status, HS_Disable);
|
||||||
target->OnEnable();
|
target->OnEnable();
|
||||||
target->enable_frameno = frame_no;
|
target->enable_frameno = GetFrameNo();
|
||||||
moveable_hash_[target->entity_uniid] = target;
|
moveable_hash_[target->entity_uniid] = target;
|
||||||
grid_service->AddHuman(target);
|
grid_service->AddHuman(target);
|
||||||
target->FindLocation();
|
target->FindLocation();
|
||||||
@ -1961,7 +1960,7 @@ void Room::ShuaAndroidTimerFunc()
|
|||||||
MetaMgr::Instance()->level1room_shua_robot_max_num
|
MetaMgr::Instance()->level1room_shua_robot_max_num
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
shua_android_timer = xtimer.AddDeadLineTimerAndAttach
|
xtimer.AddDeadLineTimerAndAttach
|
||||||
(SERVER_FRAME_RATE * shua_time,
|
(SERVER_FRAME_RATE * shua_time,
|
||||||
a8::XParams()
|
a8::XParams()
|
||||||
.SetSender(this),
|
.SetSender(this),
|
||||||
@ -1974,7 +1973,6 @@ void Room::ShuaAndroidTimerFunc()
|
|||||||
[] (const a8::XParams& param)
|
[] (const a8::XParams& param)
|
||||||
{
|
{
|
||||||
Room* room = (Room*)param.sender.GetUserData();
|
Room* room = (Room*)param.sender.GetUserData();
|
||||||
room->shua_android_timer = nullptr;
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (shua_time > 0 && shua_num > 0) {
|
if (shua_time > 0 && shua_num > 0) {
|
||||||
@ -2004,7 +2002,7 @@ void Room::DieAndroidTimerFunc()
|
|||||||
MetaMgr::Instance()->level1room_die_robot_max_num
|
MetaMgr::Instance()->level1room_die_robot_max_num
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
die_android_timer = xtimer.AddDeadLineTimerAndAttach
|
xtimer.AddDeadLineTimerAndAttach
|
||||||
(SERVER_FRAME_RATE * die_time,
|
(SERVER_FRAME_RATE * die_time,
|
||||||
a8::XParams()
|
a8::XParams()
|
||||||
.SetSender(this),
|
.SetSender(this),
|
||||||
@ -2017,7 +2015,6 @@ void Room::DieAndroidTimerFunc()
|
|||||||
[] (const a8::XParams& param)
|
[] (const a8::XParams& param)
|
||||||
{
|
{
|
||||||
Room* room = (Room*)param.sender.GetUserData();
|
Room* room = (Room*)param.sender.GetUserData();
|
||||||
room->die_android_timer = nullptr;
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (die_time > 0 && die_num > 0) {
|
if (die_time > 0 && die_num > 0) {
|
||||||
@ -2126,7 +2123,7 @@ void Room::ProcDieAndroid(int die_time, int die_num)
|
|||||||
std::vector<Human*> alive_humans;
|
std::vector<Human*> alive_humans;
|
||||||
alive_humans.reserve(human_hash_.size());
|
alive_humans.reserve(human_hash_.size());
|
||||||
{
|
{
|
||||||
if (frame_no % 8 < 5) {
|
if (GetFrameNo() % 8 < 5) {
|
||||||
for (auto itr = human_hash_.begin(); itr != human_hash_.end(); ++itr) {
|
for (auto itr = human_hash_.begin(); itr != human_hash_.end(); ++itr) {
|
||||||
CheckAliveHuman(itr->second, alive_humans);
|
CheckAliveHuman(itr->second, alive_humans);
|
||||||
if (alive_humans.size() > 16) {
|
if (alive_humans.size() > 16) {
|
||||||
|
@ -46,7 +46,6 @@ public:
|
|||||||
std::string map_tpl_name;
|
std::string map_tpl_name;
|
||||||
FrameEvent frame_event;
|
FrameEvent frame_event;
|
||||||
FrameMaker frame_maker;
|
FrameMaker frame_maker;
|
||||||
long long frame_no = 0;
|
|
||||||
GasData gas_data;
|
GasData gas_data;
|
||||||
bool game_over = false;
|
bool game_over = false;
|
||||||
long long game_over_frameno = 0;
|
long long game_over_frameno = 0;
|
||||||
@ -60,19 +59,17 @@ public:
|
|||||||
long long last_debugout_tick = 0;
|
long long last_debugout_tick = 0;
|
||||||
bool waiting_start = false;
|
bool waiting_start = false;
|
||||||
RoomType_e room_type = RT_NewBrid;
|
RoomType_e room_type = RT_NewBrid;
|
||||||
long long last_add_player_tick = 0;
|
|
||||||
std::vector<MetaData::MapTplThing*>* spawn_points = nullptr;
|
std::vector<MetaData::MapTplThing*>* spawn_points = nullptr;
|
||||||
MetaData::MapTplThing* newbie_born_point_meta = nullptr;
|
MetaData::MapTplThing* newbie_born_point_meta = nullptr;
|
||||||
std::vector<MetaData::MapTplThing*>* loots = nullptr;
|
std::vector<MetaData::MapTplThing*>* loots = nullptr;
|
||||||
std::vector<Building*>* buildings = nullptr;
|
std::vector<Building*>* buildings = nullptr;
|
||||||
xtimer_list* shua_android_timer = nullptr;
|
|
||||||
xtimer_list* die_android_timer = nullptr;
|
|
||||||
Human* first_newbie = nullptr;
|
Human* first_newbie = nullptr;
|
||||||
|
|
||||||
~Room();
|
~Room();
|
||||||
void Init();
|
void Init();
|
||||||
void UnInit();
|
void UnInit();
|
||||||
void Update(int delta_time);
|
void Update(int delta_time);
|
||||||
|
inline long long GetFrameNo() { return frameno_; }
|
||||||
int GetPlayerNum();
|
int GetPlayerNum();
|
||||||
int AliveCount();
|
int AliveCount();
|
||||||
inline int RealAliveCount() { return alive_human_hash_.size(); }
|
inline int RealAliveCount() { return alive_human_hash_.size(); }
|
||||||
@ -173,6 +170,7 @@ private:
|
|||||||
void CheckAliveHuman(Human* hum, std::vector<Human*>& alive_humans);
|
void CheckAliveHuman(Human* hum, std::vector<Human*>& alive_humans);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
long long frameno_ = 0;
|
||||||
int elapsed_time_ = 0;
|
int elapsed_time_ = 0;
|
||||||
int alive_count_ = 0;
|
int alive_count_ = 0;
|
||||||
int force_shua_android_times_ = 0;
|
int force_shua_android_times_ = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user