添加弹药
This commit is contained in:
parent
a72692b860
commit
3f80cd943f
@ -13,7 +13,7 @@ Human::Human()
|
|||||||
movement = new MovementComponent();
|
movement = new MovementComponent();
|
||||||
movement->owner = this;
|
movement->owner = this;
|
||||||
default_weapon.weapon_idx = 0;
|
default_weapon.weapon_idx = 0;
|
||||||
default_weapon.weapon_id = 12102;
|
default_weapon.weapon_id = 12101;
|
||||||
default_weapon.weapon_lv = 1;
|
default_weapon.weapon_lv = 1;
|
||||||
default_weapon.meta = MetaMgr::Instance()->GetEquip(default_weapon.weapon_id);
|
default_weapon.meta = MetaMgr::Instance()->GetEquip(default_weapon.weapon_id);
|
||||||
weapons.reserve(MAX_WEAPON_NUM);
|
weapons.reserve(MAX_WEAPON_NUM);
|
||||||
|
@ -404,7 +404,7 @@ void Player::UpdateDropWeapon()
|
|||||||
{
|
{
|
||||||
Vector2D dir = Vector2D::UP;
|
Vector2D dir = Vector2D::UP;
|
||||||
dir.Rotate(a8::RandAngle());
|
dir.Rotate(a8::RandAngle());
|
||||||
entity->pos = pos + dir * (5 + rand() % 50);
|
entity->pos = pos + dir * (25 + rand() % 50);
|
||||||
}
|
}
|
||||||
entity->item_id = weapon_id;
|
entity->item_id = weapon_id;
|
||||||
entity->count = 1;
|
entity->count = 1;
|
||||||
|
@ -124,4 +124,5 @@ void Weapon::ToPB(cs::MFWeapon* pb_obj)
|
|||||||
pb_obj->set_weapon_id(weapon_id);
|
pb_obj->set_weapon_id(weapon_id);
|
||||||
pb_obj->set_weapon_lv(weapon_lv);
|
pb_obj->set_weapon_lv(weapon_lv);
|
||||||
pb_obj->set_num(num);
|
pb_obj->set_num(num);
|
||||||
|
pb_obj->set_ammo(ammo);
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,7 @@ struct Weapon
|
|||||||
int weapon_id = 0;
|
int weapon_id = 0;
|
||||||
int weapon_lv = 0;
|
int weapon_lv = 0;
|
||||||
int num = 0;
|
int num = 0;
|
||||||
|
int ammo = 0;
|
||||||
MetaData::Equip* meta = nullptr;
|
MetaData::Equip* meta = nullptr;
|
||||||
|
|
||||||
void ToPB(cs::MFWeapon* pb_obj);
|
void ToPB(cs::MFWeapon* pb_obj);
|
||||||
|
@ -125,6 +125,7 @@ message MFWeapon
|
|||||||
optional int32 weapon_id = 1; //武器id 当weapon_id == 0时表示无装备(装备位置显示空)
|
optional int32 weapon_id = 1; //武器id 当weapon_id == 0时表示无装备(装备位置显示空)
|
||||||
optional int32 weapon_lv = 2; //武器等级
|
optional int32 weapon_lv = 2; //武器等级
|
||||||
optional int32 num = 3; //数量 手雷和烟雾弹时该字段有意义
|
optional int32 num = 3; //数量 手雷和烟雾弹时该字段有意义
|
||||||
|
optional int32 ammo = 4; //弹药数
|
||||||
}
|
}
|
||||||
|
|
||||||
//玩家信息-部分
|
//玩家信息-部分
|
||||||
@ -357,21 +358,23 @@ message MFActivePlayerData
|
|||||||
optional int32 cur_scope = 10; //当前视野倍数 1 2 4 8 15
|
optional int32 cur_scope = 10; //当前视野倍数 1 2 4 8 15
|
||||||
/*
|
/*
|
||||||
0: 9mm
|
0: 9mm
|
||||||
1: 762mm
|
1: 556mm
|
||||||
2: 556mm
|
2: 762mm
|
||||||
3: 12gauge
|
3: 12gauge
|
||||||
4: frag 手雷
|
4: rpg火药(榴弹炮)
|
||||||
5: smoke 烟雾弹
|
5: frag 手雷
|
||||||
6: bandage 绷带
|
6: smoke 烟雾弹
|
||||||
7: healthkit 医疗包
|
7: healthkit 医疗包
|
||||||
8: soda 苏打
|
8: 止痛药
|
||||||
9: painkiller 止痛药
|
9:
|
||||||
|
10:
|
||||||
|
11:
|
||||||
|
|
||||||
10: 1xscope
|
12: 1xscope
|
||||||
11: 2xscope
|
13: 2xscope
|
||||||
12: 4xscope
|
14: 4xscope
|
||||||
13: 8xscope
|
15: 8xscope
|
||||||
14: 15xscope
|
16: 15xscope
|
||||||
*/
|
*/
|
||||||
repeated int32 inventory = 11; //库存
|
repeated int32 inventory = 11; //库存
|
||||||
|
|
||||||
|
@ -64,6 +64,9 @@ message Equip
|
|||||||
optional int32 number = 18; //视野参数
|
optional int32 number = 18; //视野参数
|
||||||
optional int32 volume = 19; //装备容量
|
optional int32 volume = 19; //装备容量
|
||||||
optional int32 bullet_rad = 20; //子弹半径
|
optional int32 bullet_rad = 20; //子弹半径
|
||||||
|
|
||||||
|
optional string inventory_slot = 21; //库存槽位
|
||||||
|
optional int32 _inventory_slot = 22; //库存槽位
|
||||||
}
|
}
|
||||||
|
|
||||||
message Player
|
message Player
|
||||||
|
Loading…
x
Reference in New Issue
Block a user