merge dev
This commit is contained in:
commit
04becd0cd6
@ -373,6 +373,18 @@ void Bullet::ProcFragBomb(int delay_time)
|
|||||||
void Bullet::ProcPosionGasBomb(int delay_time)
|
void Bullet::ProcPosionGasBomb(int delay_time)
|
||||||
{
|
{
|
||||||
if (sender.Get()) {
|
if (sender.Get()) {
|
||||||
|
#if 1
|
||||||
|
a8::Vec2 old_buff_vec2_param1 = sender.Get()->buff_vec2_param1;
|
||||||
|
sender.Get()->buff_vec2_param1 = GetPos();
|
||||||
|
MetaData::Buff * buff_meta = MetaMgr::Instance()->GetBuff(gun_meta->i->buffid());
|
||||||
|
if (buff_meta) {
|
||||||
|
sender.Get()->AddBuff(sender.Get(),
|
||||||
|
buff_meta,
|
||||||
|
1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
sender.Get()->buff_vec2_param1 = old_buff_vec2_param1;
|
||||||
|
#else
|
||||||
PosionGasMiTask* task = new PosionGasMiTask();
|
PosionGasMiTask* task = new PosionGasMiTask();
|
||||||
task->room = room;
|
task->room = room;
|
||||||
task->sender.Attach(sender.Get());
|
task->sender.Attach(sender.Get());
|
||||||
@ -398,6 +410,7 @@ void Bullet::ProcPosionGasBomb(int delay_time)
|
|||||||
},
|
},
|
||||||
&room->timer_attacher.timer_list_
|
&room->timer_attacher.timer_list_
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,6 +383,7 @@ enum ObstacleType_e
|
|||||||
kObstacleSelfExplosion = 1,
|
kObstacleSelfExplosion = 1,
|
||||||
kObstacleMine = 2,
|
kObstacleMine = 2,
|
||||||
kObstacleTrap = 3,
|
kObstacleTrap = 3,
|
||||||
|
kObstaclePosionGas = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* const PROJ_NAME_FMT = "game%d_gameserver";
|
const char* const PROJ_NAME_FMT = "game%d_gameserver";
|
||||||
|
@ -21,6 +21,8 @@ void InternalShot(Creature* c,
|
|||||||
{
|
{
|
||||||
if (weapon_meta->i->_inventory_slot() == IS_TRAP ||
|
if (weapon_meta->i->_inventory_slot() == IS_TRAP ||
|
||||||
weapon_meta->i->_inventory_slot() == IS_MINE) {
|
weapon_meta->i->_inventory_slot() == IS_MINE) {
|
||||||
|
a8::Vec2 old_buff_vec2_param1 = c->buff_vec2_param1;
|
||||||
|
c->buff_vec2_param1 = c->GetPos();
|
||||||
MetaData::Buff * buff_meta = MetaMgr::Instance()->GetBuff(bullet_meta->i->buffid());
|
MetaData::Buff * buff_meta = MetaMgr::Instance()->GetBuff(bullet_meta->i->buffid());
|
||||||
if (buff_meta) {
|
if (buff_meta) {
|
||||||
c->AddBuff(c,
|
c->AddBuff(c,
|
||||||
@ -28,6 +30,7 @@ void InternalShot(Creature* c,
|
|||||||
1
|
1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
c->buff_vec2_param1 = old_buff_vec2_param1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (auto& tuple : weapon_meta->bullet_born_offset) {
|
for (auto& tuple : weapon_meta->bullet_born_offset) {
|
||||||
@ -500,6 +503,7 @@ void Creature::DoSkill(int skill_id,
|
|||||||
skill_distance_ = skill_distance;
|
skill_distance_ = skill_distance;
|
||||||
curr_skill_ = skill;
|
curr_skill_ = skill;
|
||||||
playing_skill = true;
|
playing_skill = true;
|
||||||
|
buff_vec2_param1 = GetPos() + skill_dir_ * skill_distance_;
|
||||||
CurrentSkill()->last_use_frameno = room->GetFrameNo();
|
CurrentSkill()->last_use_frameno = room->GetFrameNo();
|
||||||
if (CurrentSkill()->meta->i->skill_target() == kST_Self
|
if (CurrentSkill()->meta->i->skill_target() == kST_Self
|
||||||
) {
|
) {
|
||||||
@ -845,6 +849,7 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
|
|||||||
case kBET_SummonObstacle:
|
case kBET_SummonObstacle:
|
||||||
{
|
{
|
||||||
a8::Vec2 target_pos = caster->GetPos() + caster->skill_dir_ * caster->skill_distance_;
|
a8::Vec2 target_pos = caster->GetPos() + caster->skill_dir_ * caster->skill_distance_;
|
||||||
|
target_pos = buff_vec2_param1;
|
||||||
SummonObstacle(buff->meta->param1, target_pos);
|
SummonObstacle(buff->meta->param1, target_pos);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -47,6 +47,7 @@ class Creature : public MoveableEntity
|
|||||||
long long poisoning_time = 0;
|
long long poisoning_time = 0;
|
||||||
|
|
||||||
Weapon car_weapon;
|
Weapon car_weapon;
|
||||||
|
a8::Vec2 buff_vec2_param1;
|
||||||
|
|
||||||
bool need_sync_active_player = false;
|
bool need_sync_active_player = false;
|
||||||
std::function<void ()> on_loading_bullet;
|
std::function<void ()> on_loading_bullet;
|
||||||
|
@ -246,6 +246,8 @@ void Human::FillMFPlayerStats(cs::MFPlayerStats* stats_pb)
|
|||||||
{
|
{
|
||||||
stats_pb->set_player_id(GetEntityUniId());
|
stats_pb->set_player_id(GetEntityUniId());
|
||||||
stats_pb->set_player_avatar_url(avatar_url);
|
stats_pb->set_player_avatar_url(avatar_url);
|
||||||
|
stats_pb->set_charid(meta->i->id());
|
||||||
|
stats_pb->set_team_id(team_id);
|
||||||
|
|
||||||
if (!dead) {
|
if (!dead) {
|
||||||
stats_pb->set_time_alive(room->GetFrameNo() * 1000.0f / SERVER_FRAME_RATE);
|
stats_pb->set_time_alive(room->GetFrameNo() * 1000.0f / SERVER_FRAME_RATE);
|
||||||
@ -694,6 +696,8 @@ void Human::FillSMGameOver(cs::SMGameOver& msg)
|
|||||||
msg.set_game_over(room->IsGameOver());
|
msg.set_game_over(room->IsGameOver());
|
||||||
msg.set_victory(!dead);
|
msg.set_victory(!dead);
|
||||||
msg.set_room_uuid(a8::XValue(room->GetRoomUuid()));
|
msg.set_room_uuid(a8::XValue(room->GetRoomUuid()));
|
||||||
|
msg.set_total_human_num(room->GetHumanNum());
|
||||||
|
msg.set_alive_human_num(room->AliveCount());
|
||||||
|
|
||||||
{
|
{
|
||||||
for (auto& itr : *team_members) {
|
for (auto& itr : *team_members) {
|
||||||
@ -836,6 +840,8 @@ 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,
|
||||||
|
0);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
room->CheckPartObjects();
|
room->CheckPartObjects();
|
||||||
#endif
|
#endif
|
||||||
|
@ -64,11 +64,14 @@ void MolotorCocktailMiTask::Check()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
a8::Vec2 old_buff_vec2_param1 = sender.Get()->buff_vec2_param1;
|
||||||
|
sender.Get()->buff_vec2_param1 = sender.Get()->GetPos();
|
||||||
for (Creature* target : objects) {
|
for (Creature* target : objects) {
|
||||||
if (!target->GetBuffById(meta->i->buffid())) {
|
if (!target->GetBuffById(meta->i->buffid())) {
|
||||||
target->MustBeAddBuff(sender.Get(), meta->i->buffid());
|
target->MustBeAddBuff(sender.Get(), meta->i->buffid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sender.Get()->buff_vec2_param1 = old_buff_vec2_param1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,11 +64,14 @@ void PosionGasMiTask::Check()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
a8::Vec2 old_buff_vec2_param1 = sender.Get()->buff_vec2_param1;
|
||||||
|
sender.Get()->buff_vec2_param1 = sender.Get()->GetPos();
|
||||||
for (Creature* target : objects) {
|
for (Creature* target : objects) {
|
||||||
if (!target->GetBuffById(meta->i->buffid())) {
|
if (!target->GetBuffById(meta->i->buffid())) {
|
||||||
target->MustBeAddBuff(sender.Get(), meta->i->buffid());
|
target->MustBeAddBuff(sender.Get(), meta->i->buffid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sender.Get()->buff_vec2_param1 = old_buff_vec2_param1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,6 +171,11 @@ int Room::GetPlayerNum()
|
|||||||
return accountid_hash_.size();
|
return accountid_hash_.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Room::GetHumanNum()
|
||||||
|
{
|
||||||
|
return human_hash_.size();
|
||||||
|
}
|
||||||
|
|
||||||
Player* Room::GetPlayerByAccountId(const std::string& accountid)
|
Player* Room::GetPlayerByAccountId(const std::string& accountid)
|
||||||
{
|
{
|
||||||
auto itr = accountid_hash_.find(accountid);
|
auto itr = accountid_hash_.find(accountid);
|
||||||
@ -2246,7 +2251,7 @@ ObstacleData* Room::GetPermanentObstacleData(int obstacle_uniid)
|
|||||||
|
|
||||||
long long Room::GetGasInactiveTime()
|
long long Room::GetGasInactiveTime()
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#ifdef DEBUG
|
||||||
return 5;
|
return 5;
|
||||||
#endif
|
#endif
|
||||||
if (room_mode_ == kZombieMode) {
|
if (room_mode_ == kZombieMode) {
|
||||||
|
@ -74,6 +74,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int GetPlayerNum();
|
int GetPlayerNum();
|
||||||
|
int GetHumanNum();
|
||||||
int AliveCount();
|
int AliveCount();
|
||||||
long long AliveCountChgFrameNo() { return alive_count_chged_frameno_; };
|
long long AliveCountChgFrameNo() { return alive_count_chged_frameno_; };
|
||||||
inline int RealAliveCount() { return alive_human_hash_.size(); }
|
inline int RealAliveCount() { return alive_human_hash_.size(); }
|
||||||
|
@ -330,6 +330,11 @@ void RoomObstacle::Active()
|
|||||||
ActiveTrap();
|
ActiveTrap();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case kObstaclePosionGas:
|
||||||
|
{
|
||||||
|
ActivePosionGas();
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -393,3 +398,30 @@ void RoomObstacle::ActiveTrap()
|
|||||||
&xtimer_attacher.timer_list_
|
&xtimer_attacher.timer_list_
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RoomObstacle::ActivePosionGas()
|
||||||
|
{
|
||||||
|
room->xtimer.AddDeadLineTimerAndAttach
|
||||||
|
(
|
||||||
|
meta->i->time() / FRAME_RATE_MS,
|
||||||
|
a8::XParams()
|
||||||
|
.SetSender(this),
|
||||||
|
[] (const a8::XParams& param)
|
||||||
|
{
|
||||||
|
RoomObstacle* obstacle = (RoomObstacle*)param.sender.GetUserData();
|
||||||
|
obstacle->room->xtimer.AddRepeatTimerAndAttach
|
||||||
|
(
|
||||||
|
obstacle->meta->i->explosion_interval() / FRAME_RATE_MS,
|
||||||
|
a8::XParams()
|
||||||
|
.SetSender(obstacle),
|
||||||
|
[] (const a8::XParams& param)
|
||||||
|
{
|
||||||
|
RoomObstacle* obstacle = (RoomObstacle*)param.sender.GetUserData();
|
||||||
|
obstacle->SpecExplosion();
|
||||||
|
},
|
||||||
|
&obstacle->xtimer_attacher.timer_list_
|
||||||
|
);
|
||||||
|
},
|
||||||
|
&xtimer_attacher.timer_list_
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@ -28,6 +28,7 @@ private:
|
|||||||
void ActiveSelfExplosion();
|
void ActiveSelfExplosion();
|
||||||
void ActiveMine();
|
void ActiveMine();
|
||||||
void ActiveTrap();
|
void ActiveTrap();
|
||||||
|
void ActivePosionGas();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool temp_through_ = false;
|
bool temp_through_ = false;
|
||||||
|
@ -667,6 +667,8 @@ message MFPlayerStats
|
|||||||
optional int32 vip_lv = 35 [default = 0]; //等级
|
optional int32 vip_lv = 35 [default = 0]; //等级
|
||||||
optional int32 head = 36 [default = 0]; //头像框
|
optional int32 head = 36 [default = 0]; //头像框
|
||||||
optional int32 sex = 37 [default = 0]; //性别
|
optional int32 sex = 37 [default = 0]; //性别
|
||||||
|
optional int32 charid = 38; //人物id
|
||||||
|
optional int32 team_id = 39; //tamid
|
||||||
}
|
}
|
||||||
|
|
||||||
//空投
|
//空投
|
||||||
@ -1038,8 +1040,8 @@ message SMUpdate
|
|||||||
repeated MFPropertyChg chged_property_list = 31; //property变更列表
|
repeated MFPropertyChg chged_property_list = 31; //property变更列表
|
||||||
repeated MFPlaySkill play_skill_list = 32; //播放技能
|
repeated MFPlaySkill play_skill_list = 32; //播放技能
|
||||||
|
|
||||||
//一下字段只有僵尸模式才有效
|
|
||||||
repeated MFTuple dead_alive_objs = 42; //玩家values[0]:objid values[1]:多少毫秒后复活 values[2]: 0:死亡 1:复活
|
repeated MFTuple dead_alive_objs = 42; //玩家values[0]:objid values[1]:多少毫秒后复活 values[2]: 0:死亡 1:复活
|
||||||
|
//一下字段只有僵尸模式才有效
|
||||||
repeated MFPosition object_positions = 43; //对象坐标信息,如果对象已经在part_objects则可能不发,这时客户端可以读取part_objects里的左边更新小地图
|
repeated MFPosition object_positions = 43; //对象坐标信息,如果对象已经在part_objects则可能不发,这时客户端可以读取part_objects里的左边更新小地图
|
||||||
optional int32 game_left_time = 45; //游戏剩余时间(毫秒, 战斗开始后字段才有意义)
|
optional int32 game_left_time = 45; //游戏剩余时间(毫秒, 战斗开始后字段才有意义)
|
||||||
}
|
}
|
||||||
@ -1064,6 +1066,8 @@ message SMGameOver
|
|||||||
optional int32 team_allcnt = 3;
|
optional int32 team_allcnt = 3;
|
||||||
optional bool game_over = 4; //是否结束
|
optional bool game_over = 4; //是否结束
|
||||||
optional bool victory = 5; //是否胜利
|
optional bool victory = 5; //是否胜利
|
||||||
|
optional int32 total_human_num = 12; //房间总人数
|
||||||
|
optional int32 alive_human_num = 13; //房间剩余存活人数
|
||||||
|
|
||||||
repeated MFPlayerStats player_stats = 6; //玩家信息统计
|
repeated MFPlayerStats player_stats = 6; //玩家信息统计
|
||||||
optional string room_uuid = 7; //房间唯一id
|
optional string room_uuid = 7; //房间唯一id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user