添加救援时间
This commit is contained in:
parent
b666fee0ee
commit
f3e54250fd
@ -64,6 +64,7 @@ enum ActionType_e
|
|||||||
AT_Reload = 1,
|
AT_Reload = 1,
|
||||||
AT_UseItem = 2,
|
AT_UseItem = 2,
|
||||||
AT_Relive = 3,
|
AT_Relive = 3,
|
||||||
|
AT_Rescue = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
enum InventorySlot_e
|
enum InventorySlot_e
|
||||||
|
@ -425,8 +425,9 @@ void Human::CancelAction()
|
|||||||
Entity* entity = room->GetEntityByUniId(action_target_id);
|
Entity* entity = room->GetEntityByUniId(action_target_id);
|
||||||
if (entity->entity_type != ET_Player) {
|
if (entity->entity_type != ET_Player) {
|
||||||
Human* hum = (Human*)entity;
|
Human* hum = (Human*)entity;
|
||||||
a8::UnSetBitFlag(hum->status, HS_Rescue);
|
if (hum->action_type == AT_Rescue) {
|
||||||
hum->SyncAroundPlayers();
|
hum->CancelAction();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ResetAction();
|
ResetAction();
|
||||||
@ -1286,12 +1287,6 @@ void Human::FillBodyState(::google::protobuf::RepeatedPtrField<::cs::MFBodyState
|
|||||||
state->set_left_time(std::max(0, skill_meta->i->last_time() * 1000 - passed_time));
|
state->set_left_time(std::max(0, skill_meta->i->last_time() * 1000 - passed_time));
|
||||||
state->set_lasting_time(skill_meta->i->last_time() * 1000);
|
state->set_lasting_time(skill_meta->i->last_time() * 1000);
|
||||||
}
|
}
|
||||||
if (a8::HasBitFlag(status, HS_Rescue)) {
|
|
||||||
cs::MFBodyState* state = states->Add();
|
|
||||||
state->set_state_type(HS_Rescue);
|
|
||||||
state->set_left_time(0);
|
|
||||||
state->set_lasting_time(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::SummonHero()
|
void Human::SummonHero()
|
||||||
|
@ -24,7 +24,6 @@ enum HumanStatus
|
|||||||
HS_RecoverHP = 8,
|
HS_RecoverHP = 8,
|
||||||
HS_ReflectDamage = 9,
|
HS_ReflectDamage = 9,
|
||||||
HS_SummonHero = 10,
|
HS_SummonHero = 10,
|
||||||
HS_Rescue = 20,
|
|
||||||
HS_End
|
HS_End
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -75,7 +74,6 @@ class Human : public Entity
|
|||||||
long long dead_frameno = 0;
|
long long dead_frameno = 0;
|
||||||
long long join_frameno = 0;
|
long long join_frameno = 0;
|
||||||
int status = 0;
|
int status = 0;
|
||||||
long long rescue_frameno = 0;
|
|
||||||
|
|
||||||
Weapon default_weapon;
|
Weapon default_weapon;
|
||||||
std::vector<Weapon> weapons;
|
std::vector<Weapon> weapons;
|
||||||
|
@ -301,7 +301,10 @@ void Player::UpdateAction()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Human* hum = (Human*)entity;
|
Human* hum = (Human*)entity;
|
||||||
a8::UnSetBitFlag(hum->status, HS_Rescue);
|
if (hum->action_type == AT_Rescue) {
|
||||||
|
hum->CancelAction();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!hum->dead && hum->downed) {
|
if (!hum->dead && hum->downed) {
|
||||||
hum->health = MetaMgr::Instance()->GetSysParamAsInt("downed_relive_recover_hp");
|
hum->health = MetaMgr::Instance()->GetSysParamAsInt("downed_relive_recover_hp");
|
||||||
hum->downed = false;
|
hum->downed = false;
|
||||||
@ -783,8 +786,15 @@ void Player::HumanInteraction(Human* hum)
|
|||||||
if (!hum->downed) {
|
if (!hum->downed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
a8::SetBitFlag(hum->status, HS_Rescue);
|
if (hum->action_type == AT_Rescue) {
|
||||||
hum->rescue_frameno = room->frame_no;
|
return;
|
||||||
|
}
|
||||||
|
hum->StartAction(
|
||||||
|
AT_Rescue,
|
||||||
|
MetaMgr::Instance()->GetSysParamAsInt("rescue_time") * 1000,
|
||||||
|
room->frame_no,
|
||||||
|
entity_uniid
|
||||||
|
);
|
||||||
StartAction(
|
StartAction(
|
||||||
AT_Relive,
|
AT_Relive,
|
||||||
MetaMgr::Instance()->GetSysParamAsInt("downed_relive_time") * 1000,
|
MetaMgr::Instance()->GetSysParamAsInt("downed_relive_time") * 1000,
|
||||||
|
@ -147,7 +147,7 @@ message MFPlayerFull
|
|||||||
optional bool disconnected = 9; //是否断网
|
optional bool disconnected = 9; //是否断网
|
||||||
optional int32 anim_type = 10; //
|
optional int32 anim_type = 10; //
|
||||||
optional int32 anim_seq = 11; //
|
optional int32 anim_seq = 11; //
|
||||||
//optional int32 action_type = 12; //0: none 1:reload 2:useitem 3:relive
|
//optional int32 action_type = 12; //0: none 1:reload 2:useitem 3:relive 4: rescue
|
||||||
//optional int32 action_duration = 22; //持续时间毫秒
|
//optional int32 action_duration = 22; //持续时间毫秒
|
||||||
optional int32 skin = 13; //皮肤id
|
optional int32 skin = 13; //皮肤id
|
||||||
optional int32 backpack = 14; //背包
|
optional int32 backpack = 14; //背包
|
||||||
@ -374,7 +374,7 @@ message MFObjectFull
|
|||||||
//活跃玩家数据(当前)
|
//活跃玩家数据(当前)
|
||||||
message MFActivePlayerData
|
message MFActivePlayerData
|
||||||
{
|
{
|
||||||
optional int32 action_type = 3; //0: none 1:reload 2:useitem 3:relive
|
optional int32 action_type = 3; //0: none 1:reload 2:useitem 3:relive 4: rescue
|
||||||
optional int32 action_duration = 5; //持续时间毫秒
|
optional int32 action_duration = 5; //持续时间毫秒
|
||||||
optional int32 action_item_id = 6;
|
optional int32 action_item_id = 6;
|
||||||
optional int32 action_target_id = 7;
|
optional int32 action_target_id = 7;
|
||||||
@ -554,8 +554,6 @@ message MFBodyState
|
|||||||
8: 回血
|
8: 回血
|
||||||
9: 反伤
|
9: 反伤
|
||||||
10: 分身
|
10: 分身
|
||||||
|
|
||||||
20: 救援中
|
|
||||||
*/
|
*/
|
||||||
optional int32 state_type = 1;
|
optional int32 state_type = 1;
|
||||||
optional float left_time = 2; //剩余时间(单位毫秒)
|
optional float left_time = 2; //剩余时间(单位毫秒)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user