完善载具逻辑
This commit is contained in:
parent
97b641f3d3
commit
3ee93e59ca
@ -397,3 +397,6 @@ const int TERMINATOR_BUFF_ID = 1033;
|
|||||||
const int TURN_OVER_SKILL_ID = 41001;
|
const int TURN_OVER_SKILL_ID = 41001;
|
||||||
|
|
||||||
const int HUNLUAN_BUFFID = 6001;
|
const int HUNLUAN_BUFFID = 6001;
|
||||||
|
|
||||||
|
const int DRIVER_BUFFID = 6003;
|
||||||
|
const int PASSENGER_BUFFID = 6004;
|
||||||
|
@ -4330,10 +4330,21 @@ void Human::DoGetOnWithLoot(Loot* entity)
|
|||||||
car_.car_id = item_meta->i->id();
|
car_.car_id = item_meta->i->id();
|
||||||
car_.meta = item_meta;
|
car_.meta = item_meta;
|
||||||
SetPos(entity->GetPos());
|
SetPos(entity->GetPos());
|
||||||
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(car_.meta->i->buffid());
|
{
|
||||||
if (buff_meta) {
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(DRIVER_BUFFID);
|
||||||
AddBuff(this, buff_meta, 1);
|
if (buff_meta) {
|
||||||
|
AddBuff(this, buff_meta, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(car_.meta->i->buffid());
|
||||||
|
if (buff_meta) {
|
||||||
|
AddBuff(this, buff_meta, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
car_.driver = this;
|
||||||
|
car_.passengers.clear();
|
||||||
|
car_.passengers.insert(this);
|
||||||
CancelAction();
|
CancelAction();
|
||||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||||
room->TakeOnCarObject(car_.car_uniid);
|
room->TakeOnCarObject(car_.car_uniid);
|
||||||
@ -4342,5 +4353,33 @@ void Human::DoGetOnWithLoot(Loot* entity)
|
|||||||
|
|
||||||
void Human::DoGetOnWithTeammate(Human* teammate)
|
void Human::DoGetOnWithTeammate(Human* teammate)
|
||||||
{
|
{
|
||||||
|
if (teammate->team_id != team_id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (teammate->GetEntityUniId() == GetEntityUniId()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (teammate->IsDead(room)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!teammate->HasBuffEffect(kBET_Driver)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (HasBuffEffect(kBET_Driver)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (HasBuffEffect(kBET_Passenger)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
teammate->GetCar().passengers.insert(this);
|
||||||
|
SetPos(teammate->GetPos());
|
||||||
|
{
|
||||||
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(PASSENGER_BUFFID);
|
||||||
|
if (buff_meta) {
|
||||||
|
AddBuff(this, buff_meta, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CancelAction();
|
||||||
|
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||||
}
|
}
|
||||||
|
@ -883,7 +883,7 @@ void Room::FillSMUiUpdate(cs::SMUiUpdate& msg)
|
|||||||
{
|
{
|
||||||
for (auto& pair : car_hash_) {
|
for (auto& pair : car_hash_) {
|
||||||
if (!pair.second.taken) {
|
if (!pair.second.taken) {
|
||||||
cs::MFCar* car = msg.add_car_list();
|
auto car = msg.add_car_list();
|
||||||
car->set_car_id(pair.second.car_id);
|
car->set_car_id(pair.second.car_id);
|
||||||
TypeConvert::ToPb(pair.second.pos, car->mutable_pos());
|
TypeConvert::ToPb(pair.second.pos, car->mutable_pos());
|
||||||
}
|
}
|
||||||
|
@ -103,6 +103,8 @@ struct HumanCar
|
|||||||
{
|
{
|
||||||
int car_id = 0;
|
int car_id = 0;
|
||||||
int car_uniid = 0;
|
int car_uniid = 0;
|
||||||
|
class Human* driver = nullptr;
|
||||||
|
std::set<class Human*> passengers;
|
||||||
|
|
||||||
MetaData::Equip* meta = nullptr;
|
MetaData::Equip* meta = nullptr;
|
||||||
};
|
};
|
||||||
|
@ -118,9 +118,11 @@ message MFVec2
|
|||||||
property_type: 10 更新武器子弹数
|
property_type: 10 更新武器子弹数
|
||||||
property_subtype: 武器索引
|
property_subtype: 武器索引
|
||||||
valule: 当前数量
|
valule: 当前数量
|
||||||
|
property_type: 11 载具唯一id
|
||||||
|
valule: car_uniid
|
||||||
property_type: 23 charid
|
property_type: 23 charid
|
||||||
valule: charid
|
valule: charid
|
||||||
*/
|
*/
|
||||||
message MFPropertyChg
|
message MFPropertyChg
|
||||||
{
|
{
|
||||||
optional int32 obj_id = 1; //对象id
|
optional int32 obj_id = 1; //对象id
|
||||||
@ -213,6 +215,7 @@ message MFPlayerFull
|
|||||||
optional int32 emoji2 = 26; //表情2
|
optional int32 emoji2 = 26; //表情2
|
||||||
optional int32 parachute = 27; //降落伞
|
optional int32 parachute = 27; //降落伞
|
||||||
repeated MFBuff buff_list = 28; //buff列表
|
repeated MFBuff buff_list = 28; //buff列表
|
||||||
|
optional int32 car_uniid = 29; //载具id
|
||||||
|
|
||||||
optional bool can_revive = 30; //是否可复活
|
optional bool can_revive = 30; //是否可复活
|
||||||
optional int32 revive_countdown = 31; //复活倒计时
|
optional int32 revive_countdown = 31; //复活倒计时
|
||||||
@ -405,10 +408,33 @@ message MFSmokeFull
|
|||||||
optional float rad = 3; //半径
|
optional float rad = 3; //半径
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//载具-部分
|
||||||
|
message MFCarPart
|
||||||
|
{
|
||||||
|
optional int32 obj_uniid = 1; //唯一id
|
||||||
|
optional MFVec2 pos = 2; //位置
|
||||||
|
optional MFVec2 dir = 3; //朝向
|
||||||
|
}
|
||||||
|
|
||||||
|
//载具-全量
|
||||||
|
message MFCarFull
|
||||||
|
{
|
||||||
|
optional int32 obj_uniid = 1; //唯一id
|
||||||
|
optional MFVec2 pos = 2; //位置
|
||||||
|
optional MFVec2 dir = 3; //朝向
|
||||||
|
optional int32 car_id = 4; //载具id
|
||||||
|
optional int32 driver = 5; //驾驶员id
|
||||||
|
/*
|
||||||
|
乘客列表(包含驾驶员)
|
||||||
|
!!!注意这里只返回客户端必要的用于显示玩家外观的信息而不是全量信息
|
||||||
|
*/
|
||||||
|
repeated MFPlayerFull passengers = 6;
|
||||||
|
}
|
||||||
|
|
||||||
//对象信息-部分
|
//对象信息-部分
|
||||||
message MFObjectPart
|
message MFObjectPart
|
||||||
{
|
{
|
||||||
//1:player 2:obstacle 3:building 4:lootspawner 5:loot 6:deadbody 7:decal 8:projectile 9:smoke 10:hero
|
//1:player 2:obstacle 3:building 4:lootspawner 5:loot 6:deadbody 7:decal 8:projectile 9:smoke 10:hero 11:car
|
||||||
optional int32 object_type = 1;
|
optional int32 object_type = 1;
|
||||||
|
|
||||||
optional MFPlayerPart union_obj_1 = 2;
|
optional MFPlayerPart union_obj_1 = 2;
|
||||||
@ -421,12 +447,13 @@ message MFObjectPart
|
|||||||
optional MFProjectilePart union_obj_8 = 9;
|
optional MFProjectilePart union_obj_8 = 9;
|
||||||
optional MFSmokePart union_obj_9 = 10;
|
optional MFSmokePart union_obj_9 = 10;
|
||||||
optional MFHeroPart union_obj_10 = 11;
|
optional MFHeroPart union_obj_10 = 11;
|
||||||
|
optional MFCarPart union_obj_11 = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
//对象信息-全量
|
//对象信息-全量
|
||||||
message MFObjectFull
|
message MFObjectFull
|
||||||
{
|
{
|
||||||
//1:player 2:obstacle 3:building 4:lootspawner 5:loot 6:deadbody 7:decal 8:projectile 9:smoke 10:hero
|
//1:player 2:obstacle 3:building 4:lootspawner 5:loot 6:deadbody 7:decal 8:projectile 9:smoke 10:hero 11:car
|
||||||
optional int32 object_type = 1;
|
optional int32 object_type = 1;
|
||||||
|
|
||||||
optional MFPlayerFull union_obj_1 = 2;
|
optional MFPlayerFull union_obj_1 = 2;
|
||||||
@ -439,6 +466,7 @@ message MFObjectFull
|
|||||||
optional MFProjectileFull union_obj_8 = 9;
|
optional MFProjectileFull union_obj_8 = 9;
|
||||||
optional MFSmokeFull union_obj_9 = 10;
|
optional MFSmokeFull union_obj_9 = 10;
|
||||||
optional MFHeroFull union_obj_10 = 11;
|
optional MFHeroFull union_obj_10 = 11;
|
||||||
|
optional MFCarFull union_obj_11 = 12;
|
||||||
|
|
||||||
optional int32 obj_uniid = 14; //唯一id
|
optional int32 obj_uniid = 14; //唯一id
|
||||||
optional int32 object_flags = 15; //对象标志位 1<<0: 存缓存 1<<1:读缓存
|
optional int32 object_flags = 15; //对象标志位 1<<0: 存缓存 1<<1:读缓存
|
||||||
@ -686,8 +714,8 @@ message MFPlane
|
|||||||
optional MFVec2 end_point = 2; //飞机终点
|
optional MFVec2 end_point = 2; //飞机终点
|
||||||
}
|
}
|
||||||
|
|
||||||
//载具
|
//载具信息(用于小地图显示)
|
||||||
message MFCar
|
message MFMapCarInfo
|
||||||
{
|
{
|
||||||
optional int32 car_id = 1; //载具id(读equip表)
|
optional int32 car_id = 1; //载具id(读equip表)
|
||||||
optional MFVec2 pos = 2; //载具坐标
|
optional MFVec2 pos = 2; //载具坐标
|
||||||
@ -1051,7 +1079,7 @@ message SMUiUpdate
|
|||||||
{
|
{
|
||||||
optional int32 alive_count = 1; //存活数量
|
optional int32 alive_count = 1; //存活数量
|
||||||
optional int32 kill_count = 2; //击杀数
|
optional int32 kill_count = 2; //击杀数
|
||||||
repeated MFCar car_list = 3; //载具列表
|
repeated MFMapCarInfo car_list = 3; //载具列表
|
||||||
|
|
||||||
//一下字段只有在僵尸模式有效
|
//一下字段只有在僵尸模式有效
|
||||||
optional int32 zombie_num = 10; //僵尸数
|
optional int32 zombie_num = 10; //僵尸数
|
||||||
|
Loading…
x
Reference in New Issue
Block a user