add follow
This commit is contained in:
parent
9d14513bd1
commit
8ab2306565
@ -278,6 +278,7 @@ enum PropertyType_e
|
|||||||
kPropSkillCurrTimes = 25,
|
kPropSkillCurrTimes = 25,
|
||||||
kPropSkillMaxTimes = 26,
|
kPropSkillMaxTimes = 26,
|
||||||
kPropCarOil = 27,
|
kPropCarOil = 27,
|
||||||
|
kPropFollowTarget = 30,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum MapObjectType_e
|
enum MapObjectType_e
|
||||||
|
@ -96,6 +96,7 @@ class Creature : public MoveableEntity
|
|||||||
|
|
||||||
bool need_sync_active_player = false;
|
bool need_sync_active_player = false;
|
||||||
std::function<void ()> on_loading_bullet;
|
std::function<void ()> on_loading_bullet;
|
||||||
|
CreatureWeakPtr follow_target;
|
||||||
|
|
||||||
Creature();
|
Creature();
|
||||||
virtual ~Creature() override;
|
virtual ~Creature() override;
|
||||||
|
@ -238,6 +238,9 @@ void Human::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_data
|
|||||||
if (parachute != 0) {
|
if (parachute != 0) {
|
||||||
p->set_parachute(parachute);
|
p->set_parachute(parachute);
|
||||||
}
|
}
|
||||||
|
if (follow_target.Get()) {
|
||||||
|
p->set_follow_target(follow_target.Get()->GetUniId());
|
||||||
|
}
|
||||||
FillBodyState(p->mutable_states());
|
FillBodyState(p->mutable_states());
|
||||||
FillBuffList(hum, p->mutable_buff_list());
|
FillBuffList(hum, p->mutable_buff_list());
|
||||||
FillSkillList(p->mutable_skill_list());
|
FillSkillList(p->mutable_skill_list());
|
||||||
|
@ -116,6 +116,9 @@ void Player::InternalUpdate(int delta_time)
|
|||||||
if (jump) {
|
if (jump) {
|
||||||
UpdateJump();
|
UpdateJump();
|
||||||
}
|
}
|
||||||
|
if (follow != -1) {
|
||||||
|
UpdateFollow();
|
||||||
|
}
|
||||||
if (shot_start || shot_hold) {
|
if (shot_start || shot_hold) {
|
||||||
UpdateShot();
|
UpdateShot();
|
||||||
}
|
}
|
||||||
@ -1153,6 +1156,9 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg)
|
|||||||
if (msg.has_jump()) {
|
if (msg.has_jump()) {
|
||||||
jump = true;
|
jump = true;
|
||||||
}
|
}
|
||||||
|
if (msg.has_follow()) {
|
||||||
|
follow = msg.follow();
|
||||||
|
}
|
||||||
if (msg.has_use_skill()) {
|
if (msg.has_use_skill()) {
|
||||||
use_skill = msg.use_skill();
|
use_skill = msg.use_skill();
|
||||||
use_skill_id = msg.skill_id();
|
use_skill_id = msg.skill_id();
|
||||||
@ -1718,6 +1724,11 @@ void Player::UpdateAiming()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::UpdateFollow()
|
||||||
|
{
|
||||||
|
follow = -1;
|
||||||
|
}
|
||||||
|
|
||||||
void Player::CheckShotHoldState(Weapon* weapon)
|
void Player::CheckShotHoldState(Weapon* weapon)
|
||||||
{
|
{
|
||||||
if (weapon->meta->buff_meta && weapon->meta->buff_meta->i->trigger_type() == kBTT_SeriesShot) {
|
if (weapon->meta->buff_meta && weapon->meta->buff_meta->i->trigger_type() == kBTT_SeriesShot) {
|
||||||
|
@ -68,6 +68,8 @@ class Player : public Human
|
|||||||
int get_on = 0;
|
int get_on = 0;
|
||||||
int switch_seat = 0;
|
int switch_seat = 0;
|
||||||
|
|
||||||
|
int follow = -1;
|
||||||
|
|
||||||
::google::protobuf::RepeatedField< ::google::protobuf::int32 > interaction_objids;
|
::google::protobuf::RepeatedField< ::google::protobuf::int32 > interaction_objids;
|
||||||
|
|
||||||
virtual ~Player() override;
|
virtual ~Player() override;
|
||||||
@ -90,6 +92,7 @@ class Player : public Human
|
|||||||
void UpdateSwitchSeat();
|
void UpdateSwitchSeat();
|
||||||
void UpdateUseSkill();
|
void UpdateUseSkill();
|
||||||
void UpdateAiming();
|
void UpdateAiming();
|
||||||
|
void UpdateFollow();
|
||||||
void Shot();
|
void Shot();
|
||||||
void ProcInteraction();
|
void ProcInteraction();
|
||||||
void ObstacleInteraction(Obstacle* entity);
|
void ObstacleInteraction(Obstacle* entity);
|
||||||
|
@ -141,6 +141,8 @@ message MFVec2
|
|||||||
property_type: 29 百分比属性加成
|
property_type: 29 百分比属性加成
|
||||||
property_subtype: 属性id
|
property_subtype: 属性id
|
||||||
valule: 百分比绝对值
|
valule: 百分比绝对值
|
||||||
|
property_type: 30 跟随目标id
|
||||||
|
valule: 目标id
|
||||||
*/
|
*/
|
||||||
message MFPropertyChg
|
message MFPropertyChg
|
||||||
{
|
{
|
||||||
@ -150,7 +152,6 @@ message MFPropertyChg
|
|||||||
optional float value = 4; //属性值
|
optional float value = 4; //属性值
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//碰撞体
|
//碰撞体
|
||||||
message MFCollider
|
message MFCollider
|
||||||
{
|
{
|
||||||
@ -267,6 +268,7 @@ message MFPlayerFull
|
|||||||
repeated MFSkill skill_list = 38; //技能列表
|
repeated MFSkill skill_list = 38; //技能列表
|
||||||
|
|
||||||
repeated MFAttrAddition attr_addition= 61; //属性加成
|
repeated MFAttrAddition attr_addition= 61; //属性加成
|
||||||
|
optional int32 follow_target = 62 [default = 0]; //跟随的目标id 0: 未跟随
|
||||||
|
|
||||||
optional int32 charid = 44; //人物id
|
optional int32 charid = 44; //人物id
|
||||||
optional float speed = 45; //速度
|
optional float speed = 45; //速度
|
||||||
@ -624,6 +626,7 @@ message MFTeamData
|
|||||||
optional float max_health = 9; //最大血量
|
optional float max_health = 9; //最大血量
|
||||||
optional bool riding = 40 [default = false]; //是否倒 下
|
optional bool riding = 40 [default = false]; //是否倒 下
|
||||||
optional string user_data = 60 [default = ""]; //用户自定义数据(只同步一次)
|
optional string user_data = 60 [default = ""]; //用户自定义数据(只同步一次)
|
||||||
|
optional int32 can_follow = 62 [default = 0]; //是否可跟随
|
||||||
|
|
||||||
//一下字段只在结算的时候该字段才有内容
|
//一下字段只在结算的时候该字段才有内容
|
||||||
optional string account_id = 10; //账号id
|
optional string account_id = 10; //账号id
|
||||||
@ -974,6 +977,8 @@ message CMMove
|
|||||||
*/
|
*/
|
||||||
optional int32 get_on = 36;
|
optional int32 get_on = 36;
|
||||||
optional int32 switch_seat = 37; //切换座位
|
optional int32 switch_seat = 37; //切换座位
|
||||||
|
|
||||||
|
optional int32 follow = 38; //跟随0:取消跟随 其他:玩家uniid
|
||||||
}
|
}
|
||||||
|
|
||||||
//执行GM指令
|
//执行GM指令
|
||||||
|
Loading…
x
Reference in New Issue
Block a user