添加reload速度

This commit is contained in:
aozhiwei 2020-03-17 16:46:11 +08:00
parent 188aa06e5f
commit b779b32f20
2 changed files with 24 additions and 19 deletions

View File

@ -93,6 +93,8 @@ float Human::GetSpeed()
}
} else if (aiming) {
return std::max(1, meta->i->aiming_speed());
} else if (action_type != AT_None) {
return std::max(1, meta->i->reload_speed());
}
float speed = meta->i->move_speed();
speed = (speed + buff_attr_abs_[kHAT_Speed]) * (1 + buff_attr_rate_[kHAT_Speed]);
@ -2119,6 +2121,24 @@ void Human::DeadDrop()
room->DropItem(drop_pos, weapon.weapon_id, 1, weapon.weapon_lv);
}
}
{
Skin* old_skin = GetSkinByIdx(kSkinSlot_HAT);
if (old_skin && old_skin->skin_id != 0) {
a8::Vec2 dir = a8::Vec2::UP;
dir.Rotate(a8::RandAngle());
room->CreateLoot(old_skin->skin_id, GetPos() + dir * (40 + rand() % 50), 1, 1);
*old_skin = Skin();
}
}
{
Skin* old_skin = GetSkinByIdx(kSkinSlot_CLOTH);
if (old_skin && old_skin->skin_id != 0) {
a8::Vec2 dir = a8::Vec2::UP;
dir.Rotate(a8::RandAngle());
room->CreateLoot(old_skin->skin_id, GetPos() + dir * (40 + rand() % 50), 1, 1);
*old_skin = Skin();
}
}
for (size_t slot = 0; slot < inventory_.size(); ++slot) {
if (inventory_[slot] > 0) {
MetaData::Equip* equip_meta = MetaMgr::Instance()->GetEquipBySlotId(slot);
@ -2132,22 +2152,6 @@ void Human::DeadDrop()
}
}
}
{
Skin* old_skin = GetSkinByIdx(kSkinSlot_HAT);
if (old_skin && old_skin->skin_id != 0) {
a8::Vec2 dir = a8::Vec2::UP;
dir.Rotate(a8::RandAngle());
room->CreateLoot(old_skin->skin_id, GetPos() + dir * (40 + rand() % 50), 1, 1);
}
}
{
Skin* old_skin = GetSkinByIdx(kSkinSlot_CLOTH);
if (old_skin && old_skin->skin_id != 0) {
a8::Vec2 dir = a8::Vec2::UP;
dir.Rotate(a8::RandAngle());
room->CreateLoot(old_skin->skin_id, GetPos() + dir * (40 + rand() % 50), 1, 1);
}
}
}
void Human::SendBattleReport()
@ -2480,13 +2484,13 @@ void Human::RandSkin()
for (int i = 0; i < kSkinNum; ++i) {
int rand_idx = rand() % ids.size();
int skin_id = ids[rand_idx];
if (skin_id == 2) {
if (i == 1) {
skin_id = 13001 + (rand() % 6);
} else if (skin_id == 3) {
} else if (i == 2) {
skin_id = 15001 + (rand() % 6);
}
Skin& skin = skins[i];
skin.skin_id = ids[rand_idx];
skin.skin_id = skin_id;
skin.skin_lv = 1;
ids.erase(ids.begin() + rand_idx);
}

View File

@ -112,6 +112,7 @@ message Player
optional int32 shot_speed = 7;
optional int32 aiming_speed = 8;
optional int32 move_speed4 = 10; //4
optional int32 reload_speed = 9;
optional float def = 11; //
optional string volume = 12; //
}