完成骏马逻辑
This commit is contained in:
parent
ebf4b2452e
commit
f558221358
@ -722,7 +722,7 @@ void Player::ProcPrepareItems(const ::google::protobuf::RepeatedField< ::google:
|
|||||||
MetaData::Equip* item_meta = MetaMgr::Instance()->GetEquip(equip_id);
|
MetaData::Equip* item_meta = MetaMgr::Instance()->GetEquip(equip_id);
|
||||||
if (item_meta) {
|
if (item_meta) {
|
||||||
switch (item_meta->i->equip_type()) {
|
switch (item_meta->i->equip_type()) {
|
||||||
case 1:
|
case EQUIP_TYPE_WEAPON:
|
||||||
{
|
{
|
||||||
//装备
|
//装备
|
||||||
if (item_meta->i->equip_subtype() == 1) {
|
if (item_meta->i->equip_subtype() == 1) {
|
||||||
@ -760,6 +760,20 @@ void Player::ProcPrepareItems(const ::google::protobuf::RepeatedField< ::google:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case EQUIP_TYPE_CAR:
|
||||||
|
{
|
||||||
|
int car_uniid = room->CreateAndTakeonCar(item_meta->i->id(), GetPos());
|
||||||
|
if (car_uniid != -1) {
|
||||||
|
car_.car_uniid = car_uniid;
|
||||||
|
car_.car_id = item_meta->i->id();
|
||||||
|
car_.meta = item_meta;
|
||||||
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(car_.meta->i->buffid());
|
||||||
|
if (buff_meta) {
|
||||||
|
AddBuff(buff_meta, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
if (item_meta->i->_inventory_slot() >= 0 &&
|
if (item_meta->i->_inventory_slot() >= 0 &&
|
||||||
|
@ -1495,6 +1495,21 @@ void Room::TakeOffCarObject(int car_uniid, a8::Vec2 pos)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Room::CreateAndTakeonCar(int car_id, a8::Vec2 pos)
|
||||||
|
{
|
||||||
|
MetaData::Equip* item_meta = MetaMgr::Instance()->GetEquip(car_id);
|
||||||
|
if (!item_meta) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
int car_uniid = AllocUniid();
|
||||||
|
CarObject car;
|
||||||
|
car.car_id = car_id;
|
||||||
|
car.pos = pos;
|
||||||
|
car.taken = true;
|
||||||
|
car_hash_[car_uniid] = car;
|
||||||
|
return car_uniid;
|
||||||
|
}
|
||||||
|
|
||||||
void Room::NotifyWxVoip()
|
void Room::NotifyWxVoip()
|
||||||
{
|
{
|
||||||
xtimer.AddDeadLineTimerAndAttach(0,
|
xtimer.AddDeadLineTimerAndAttach(0,
|
||||||
|
@ -100,6 +100,7 @@ public:
|
|||||||
void UpdateCarObject(int old_uniid, int new_uniid, a8::Vec2 pos);
|
void UpdateCarObject(int old_uniid, int new_uniid, a8::Vec2 pos);
|
||||||
void TakeOnCarObject(int car_uniid);
|
void TakeOnCarObject(int car_uniid);
|
||||||
void TakeOffCarObject(int car_uniid, a8::Vec2 pos);
|
void TakeOffCarObject(int car_uniid, a8::Vec2 pos);
|
||||||
|
int CreateAndTakeonCar(int car_id, a8::Vec2 pos);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int AllocUniid();
|
int AllocUniid();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user