完善新手逻辑
This commit is contained in:
parent
a41b9a2e13
commit
60cb263e4d
@ -162,7 +162,7 @@ void AndroidAI::UpdateNewBieNpc()
|
||||
hum->move_dir.Normalize();
|
||||
hum->attack_dir = hum->move_dir;
|
||||
if (hum->curr_weapon->weapon_idx != 0) {
|
||||
hum->curr_weapon->ammo = 10;
|
||||
hum->curr_weapon->ammo = MetaMgr::Instance()->newbie_first_robot_ammo;
|
||||
}
|
||||
} else if (hum->room->frame_no - hum->enable_frameno < SERVER_FRAME_RATE * 1.5) {
|
||||
int speed = std::max(1, (int)hum->GetSpeed());
|
||||
|
@ -2959,18 +2959,6 @@ void Human::DropItems(Obstacle* obstacle)
|
||||
} else {
|
||||
if (normal_drop_times_ < MetaMgr::Instance()->newbie_drop.size()) {
|
||||
if (normal_drop_times_ == 0) {
|
||||
//刷一个机器人
|
||||
room->xtimer.AddDeadLineTimerAndAttach
|
||||
(0,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
Human* hum = (Human*)param.sender.GetUserData();
|
||||
hum->room->ShuaNewBieAndroid(hum);
|
||||
},
|
||||
&xtimer_attacher.timer_list_
|
||||
);
|
||||
}
|
||||
drop_id = MetaMgr::Instance()->newbie_drop[normal_drop_times_];
|
||||
}
|
||||
@ -3229,7 +3217,7 @@ void Human::AdjustDecHp(float old_health, float& new_health)
|
||||
Buff* buff = GetBuffByEffectId(kBET_NewProtect);
|
||||
if (buff) {
|
||||
if (GetHP() < GetMaxHP() * buff->meta->param1) {
|
||||
new_health = std::max(GetMaxHP() * buff->meta->param1, GetMaxHP());
|
||||
new_health = std::max(GetMaxHP() * buff->meta->param1, (float)0);
|
||||
#ifdef DEBUG
|
||||
a8::UdpLog::Instance()->Debug("触发新手保护buff %d %s %s %f %f",
|
||||
{
|
||||
|
@ -19,6 +19,8 @@ enum HumanStatus
|
||||
HS_AlreadyLordMode = 1,
|
||||
HS_Disable = 2,
|
||||
HS_NewBieNpc = 3,
|
||||
HS_AlreadyShow = 4,
|
||||
HS_AlreadyEquip = 5,
|
||||
HS_End
|
||||
};
|
||||
|
||||
|
@ -184,6 +184,10 @@ public:
|
||||
MetaMgr::Instance()->other_fill_interval = MetaMgr::Instance()->GetSysParamAsInt("other_fill_interval", 2000);
|
||||
MetaMgr::Instance()->map_cell_width = MetaMgr::Instance()->GetSysParamAsInt("map_cell_width", 64 * 8);
|
||||
{
|
||||
METAMGR_READ(newbie_first_robot_ammo, 3);
|
||||
METAMGR_READ(newbie_first_robot_appeartime, 8);
|
||||
METAMGR_READ(newbie_airdrop_appeartime, 6);
|
||||
|
||||
METAMGR_READ(level0room_shua_robot_min_time, 5);
|
||||
METAMGR_READ(level0room_shua_robot_max_time, 7);
|
||||
METAMGR_READ(level0room_shua_robot_min_num, 1);
|
||||
|
@ -71,6 +71,9 @@ class MetaMgr : public a8::Singleton<MetaMgr>
|
||||
std::vector<int> newbie_drop;
|
||||
std::vector<int> newbie_airdrop;
|
||||
int newbie_first_robot_distance = 0;
|
||||
int newbie_first_robot_appeartime = 0;
|
||||
int newbie_first_robot_ammo = 0;
|
||||
int newbie_airdrop_appeartime = 0;
|
||||
std::vector<int> newbie_buff_list;
|
||||
|
||||
int level0room_shua_robot_min_time = 0;
|
||||
|
@ -572,6 +572,34 @@ void Player::LootInteraction(Loot* entity)
|
||||
need_sync_active_player = true;
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
if (room->room_type == RT_NewBrid &&
|
||||
!a8::HasBitFlag(status, HS_AlreadyEquip)) {
|
||||
a8::SetBitFlag(status, HS_AlreadyEquip);
|
||||
//刷一个机器人
|
||||
room->xtimer.AddDeadLineTimerAndAttach
|
||||
(SERVER_FRAME_RATE * MetaMgr::Instance()->newbie_first_robot_appeartime,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
Human* hum = (Human*)param.sender.GetUserData();
|
||||
hum->room->ShuaNewBieAndroid(hum);
|
||||
},
|
||||
&xtimer_attacher.timer_list_
|
||||
);
|
||||
//6秒后出现空投
|
||||
room->xtimer.AddDeadLineTimerAndAttach
|
||||
(SERVER_FRAME_RATE * MetaMgr::Instance()->newbie_airdrop_appeartime,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
Human* hum = (Human*)param.sender.GetUserData();
|
||||
hum->room->InitAirDrop();
|
||||
},
|
||||
&xtimer_attacher.timer_list_
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EQUIP_TYPE_OLDSKIN:
|
||||
|
@ -265,6 +265,7 @@ void Room::ShowAndroid(Human* target, int num)
|
||||
hum->born_point = target->born_point;
|
||||
IncBornPointHumanNum(hum->born_point, hum);
|
||||
hum->SetPos(hum->born_point->RandPoint());
|
||||
a8::SetBitFlag(hum->status, HS_AlreadyShow);
|
||||
EnableHuman(hum);
|
||||
++i;
|
||||
if (i >= num) {
|
||||
@ -903,7 +904,9 @@ void Room::UpdateGasInactive()
|
||||
CombineTeam();
|
||||
NotifyGameStart();
|
||||
NotifyWxVoip();
|
||||
InitAirDrop();
|
||||
if (room_type != RT_NewBrid) {
|
||||
InitAirDrop();
|
||||
}
|
||||
RoomMgr::Instance()->ActiveRoom(room_uuid);
|
||||
}
|
||||
}
|
||||
@ -1761,7 +1764,9 @@ void Room::ShuaNewBieAndroid(Human* target)
|
||||
#endif
|
||||
for (auto& pair : human_hash_) {
|
||||
if (pair.second->entity_subtype == EST_Android &&
|
||||
a8::HasBitFlag(pair.second->status, HS_Disable)) {
|
||||
a8::HasBitFlag(pair.second->status, HS_Disable) &&
|
||||
!a8::HasBitFlag(pair.second->status, HS_AlreadyShow)
|
||||
) {
|
||||
Android* hum = (Android*)pair.second;
|
||||
a8::Vec2 pos = target->GetPos();
|
||||
pos.x -= MetaMgr::Instance()->newbie_first_robot_distance;
|
||||
|
@ -121,6 +121,7 @@ public:
|
||||
ObstacleData* GetPermanentObstacleData(int entity_uniid);
|
||||
long long GetGasInactiveTime();
|
||||
void ShuaNewBieAndroid(Human* target);
|
||||
void InitAirDrop();
|
||||
|
||||
private:
|
||||
int AllocUniid();
|
||||
@ -135,7 +136,6 @@ private:
|
||||
a8::Vec2& out_pos);
|
||||
void MatchTeam(Human* hum);
|
||||
void CombineTeam();
|
||||
void InitAirDrop();
|
||||
void AirDrop(int appear_time, int box_id);
|
||||
void AdjustAirDropPos(MetaData::MapThing* thing_meta, a8::Vec2& box_pos);
|
||||
void ShuaPlane();
|
||||
|
Loading…
x
Reference in New Issue
Block a user