添加死亡掉落
This commit is contained in:
parent
ce9408f6f9
commit
db3dcb8dfa
@ -605,6 +605,7 @@ void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
||||
}
|
||||
}
|
||||
}
|
||||
DeadDrop();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1852,3 +1853,26 @@ void Human::InternalSendGameOver()
|
||||
delete params;
|
||||
sending_gameover_ = true;
|
||||
}
|
||||
|
||||
void Human::DeadDrop()
|
||||
{
|
||||
for (auto& weapon : weapons) {
|
||||
if (weapon.weapon_id != 0 && weapon.weapon_id != default_weapon.weapon_id) {
|
||||
Vector2D drop_pos = pos;
|
||||
room->DropItem(drop_pos, weapon.weapon_id, 1);
|
||||
}
|
||||
}
|
||||
for (size_t slot = 0; slot < inventory_.size(); ++slot) {
|
||||
if (inventory_[slot] > 0) {
|
||||
MetaData::Equip* equip_meta = MetaMgr::Instance()->GetEquipBySlotId(slot);
|
||||
if (equip_meta) {
|
||||
if (equip_meta->i->equip_type() == 2 &&
|
||||
MetaMgr::Instance()->fighting_mode) {
|
||||
return;
|
||||
}
|
||||
Vector2D drop_pos = pos;
|
||||
room->DropItem(drop_pos, equip_meta->i->id(), inventory_[slot]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -179,6 +179,7 @@ private:
|
||||
void ClearFrameData();
|
||||
void GenBattleReportData(a8::MutableXObject* params);
|
||||
void InternalSendGameOver();
|
||||
void DeadDrop();
|
||||
|
||||
protected:
|
||||
long long last_shot_frameno_ = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user