This commit is contained in:
aozhiwei 2023-06-24 09:23:56 +08:00
parent d3fd4a2d00
commit 08db6403f6
6 changed files with 15 additions and 11 deletions

View File

@ -24,6 +24,7 @@ void SummonLootBuff::Activate()
(
equip_id,
glm::vec3(x, y, z),
glm::vec3(x, y, z),
1,
1
);

View File

@ -618,7 +618,7 @@ void Bullet::ProcShieldWallBomb(int delay_time)
void Bullet::ProcOilBucketBomb(int delay_time)
{
if (sender.Get()) {
room->CreateLoot(gun_meta->id(), GetPos().ToGlmVec3(), 1, 1);
room->CreateLoot(gun_meta->id(), GetPos().ToGlmVec3(), GetPos().ToGlmVec3(), 1, 1);
}
}

View File

@ -134,6 +134,7 @@ void Guide::ProcPickup()
(
equip_id,
pos,
pos,
1,
1
);

View File

@ -1173,7 +1173,7 @@ void Human::DeadDrop()
GlmHelper::RotateY(dir, a8::RandAngle());
Position drop_pos = GetPos();
drop_pos.AddGlmVec3(dir * (40.0f + rand() % 50));
room->CreateLoot(helmet, drop_pos.ToGlmVec3(), 1, 1);
room->CreateLoot(helmet, GetPos().ToGlmVec3(), drop_pos.ToGlmVec3(), 1, 1);
helmet = 0;
}
//衣服
@ -1182,7 +1182,7 @@ void Human::DeadDrop()
GlmHelper::RotateY(dir, a8::RandAngle());
Position drop_pos = GetPos();
drop_pos.AddGlmVec3(dir * (40.0f + rand() % 50));
room->CreateLoot(chest, drop_pos.ToGlmVec3(), 1, 1);
room->CreateLoot(chest, GetPos().ToGlmVec3(), drop_pos.ToGlmVec3(), 1, 1);
chest = 0;
}
//背包
@ -1191,7 +1191,7 @@ void Human::DeadDrop()
GlmHelper::RotateY(dir, a8::RandAngle());
Position drop_pos = GetPos();
drop_pos.AddGlmVec3(dir * (40.0f + rand() % 50));
room->CreateLoot(backpack, drop_pos.ToGlmVec3(), 1, 1);
room->CreateLoot(backpack, GetPos().ToGlmVec3(), drop_pos.ToGlmVec3(), 1, 1);
backpack = 0;
}
}
@ -1282,7 +1282,7 @@ void Human::DeadDrop()
GetCurrWeapon()->weapon_idx == GUN_SLOT1) {
int num = 1 + rand() % 2;
for (int i = 0; i < num; ++i) {
room->CreateLoot(GetCurrWeapon()->meta->id(), GetPos().ToGlmVec3(), 1, 1);
room->CreateLoot(GetCurrWeapon()->meta->id(), GetPos().ToGlmVec3(), GetPos().ToGlmVec3(), 1, 1);
}
}
}
@ -1423,7 +1423,7 @@ void Human::ProcLootSkin(AddItemDTO& dto)
GlmHelper::RotateY(dir, a8::RandAngle());
Position drop_pos = GetPos();
drop_pos.AddGlmVec3(dir * (40.0f + rand() % 50));
room->CreateLoot(old_skin->skin_id, drop_pos.ToGlmVec3(), 1, 1);
room->CreateLoot(old_skin->skin_id, GetPos().ToGlmVec3(), drop_pos.ToGlmVec3(), 1, 1);
}
*old_skin = Skin();
@ -1443,7 +1443,7 @@ void Human::ProcLootSkin(AddItemDTO& dto)
GlmHelper::RotateY(dir, a8::RandAngle());
Position drop_pos = GetPos();
drop_pos.AddGlmVec3(dir * (40.0f + rand() % 50));
room->CreateLoot(old_skin->skin_id, drop_pos.ToGlmVec3(), 1, 1);
room->CreateLoot(old_skin->skin_id, GetPos().ToGlmVec3(), drop_pos.ToGlmVec3(), 1, 1);
}
*old_skin = Skin();
@ -3097,7 +3097,7 @@ void Human::DropWeapon(int weapon_idx, int num)
GlmHelper::RotateY(dir, a8::RandAngle());
Position pos = GetPos();
pos.FromGlmVec3(GetPos().ToGlmVec3() + dir * (40.0f + rand() % 50));
room->CreateLoot(weapon_id, pos.ToGlmVec3(), 1, 1);
room->CreateLoot(weapon_id, GetPos().ToGlmVec3(), pos.ToGlmVec3(), 1, 1);
}
}
MarkSyncActivePlayer(__FILE__, __LINE__, __func__);

View File

@ -587,9 +587,9 @@ RoomObstacle* Room::CreateObstacle(int id, float x, float y, float z,
return entity;
}
int Room::CreateLoot(int equip_id, const glm::vec3& pos, int count, int equip_lv)
int Room::CreateLoot(int equip_id, const glm::vec3& born_pos, const glm::vec3& pos, int count, int equip_lv)
{
return CreateLootEx(equip_id, pos, pos, count, equip_lv, false);
return CreateLootEx(equip_id, born_pos, pos, count, equip_lv, false);
}
int Room::CreateLootEx(int equip_id, const glm::vec3& born_pos, const glm::vec3& pos, int count, int equip_lv, bool show_anim)
@ -3010,6 +3010,7 @@ void Room::CreateWorldObjects()
(
obj->object_id,
obj->pos,
obj->pos,
1,
1
);
@ -3080,6 +3081,7 @@ void Room::CreateWorldObjects()
(
std::get<1>(tuple),
objects[i]->pos,
objects[i]->pos,
1,
1
);

View File

@ -152,7 +152,7 @@ public:
void DropItem(const glm::vec3& pos, int item_id, int item_count, int item_lv);
void DropItemEx(const glm::vec3& born_pos, const glm::vec3& pos, int item_id, int item_count, int item_lv, bool show_anim);
int CreateLoot(int equip_id, const glm::vec3& pos, int count, int equip_lv);
int CreateLoot(int equip_id, const glm::vec3& born_pos, const glm::vec3& pos, int count, int equip_lv);
int CreateLootEx(int equip_id, const glm::vec3& born_pos, const glm::vec3& pos, int count, int equip_lv, bool show_anim);
int CreateBullet(Creature* sender,
Creature* passenger,