This commit is contained in:
aozhiwei 2023-05-25 20:15:00 +08:00
parent 0f31e94d48
commit 5895149c83
4 changed files with 29 additions and 0 deletions

View File

@ -282,6 +282,11 @@ void Hero::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
if (meta->HasDrop() && !room->IsPveRoom()) {
room->ScatterDrop(GetPos().ToGlmVec3(), meta->RandDrop());
}
if (!room->IsPveRoom() && !room->IsNewBieRoom()) {
for (int id : meta->_drop_list) {
room->ScatterDrop(GetPos().ToGlmVec3(), id);
}
}
room->frame_event.AddDead(GetWeakPtrRef(), 0);
room->xtimer.SetTimeoutEx
(

View File

@ -1260,6 +1260,22 @@ void Human::DeadDrop()
{
on_dead_remove_objects_.clear();
}
{
if (!room->IsGameOver() && IsAndroid()) {
if (!room->IsPveRoom() && !room->IsNewBieRoom()) {
for (int id : meta->_drop_list) {
room->ScatterDrop(GetPos().ToGlmVec3(), id);
}
}
if (GetCurrWeapon() &&
GetCurrWeapon()->weapon_idx == GUN_SLOT1) {
int num = 1 + rand() % 2;
for (int i = 0; i < num; ++i) {
room->ScatterDrop(GetPos().ToGlmVec3(), GetCurrWeapon()->meta->id());
}
}
}
}
{
if (GetInventory(IS_YELLOW_STONE) > 0 && gemstone > 0) {
room->frame_event.AddPropChg

View File

@ -31,6 +31,13 @@ namespace mt
);
}
}
{
std::vector<std::string> strings;
a8::Split(drop(), strings, '|');
for (const std::string& str : strings) {
_drop_list.push_back(a8::XValue(str).GetInt());
}
}
{
std::vector<std::string> strings;
a8::Split(volume(), strings, '|');

View File

@ -45,6 +45,7 @@ namespace mt
bool HasDrop() const { return !_dead_drop.empty();};
std::tuple<int, int> _pve_score;
std::map<int, HeroShotAnimation> shot_animations;
std::vector<int> _drop_list;
void Init1();
static void StaticPostInit();