1
This commit is contained in:
parent
17166c21d3
commit
c02c4542c4
@ -67,23 +67,27 @@ void BoxDrop::OnHumanDeadDrop(Human* hum)
|
|||||||
if (room_->GetVictoryTeam()) {
|
if (room_->GetVictoryTeam()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
int drop_num = 0;
|
||||||
|
for (int i = 0; i < hum->box_num; ++i) {
|
||||||
int rnd = a8::RandEx(0, 100);
|
int rnd = a8::RandEx(0, 100);
|
||||||
if (hum->stats->abandon_battle) {
|
if (hum->stats->abandon_battle) {
|
||||||
if (rnd <= mt::Param::s().battle_event_end_loss_rate_quit * 100) {
|
if (rnd <= mt::Param::s().battle_event_end_loss_rate_quit * 100) {
|
||||||
Drop(hum->box_num, hum->GetPos().ToGlmVec3());
|
++drop_num;
|
||||||
hum->box_num = 0;
|
|
||||||
room_->frame_event.AddPropChgEx(hum->GetWeakPtrRef(), kPropBoxNum, 0, hum->box_num,
|
|
||||||
0, 0, false);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (rnd <= mt::Param::s().battle_event_end_loss_rate_dead * 100) {
|
if (rnd <= mt::Param::s().battle_event_end_loss_rate_dead * 100) {
|
||||||
Drop(hum->box_num, hum->GetPos().ToGlmVec3());
|
++drop_num;
|
||||||
hum->box_num = 0;
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
drop_num = std::max(drop_num, hum->box_num);
|
||||||
|
if (drop_num > 0) {
|
||||||
|
Drop(drop_num, hum->GetPos().ToGlmVec3());
|
||||||
|
hum->box_num -= drop_num;
|
||||||
room_->frame_event.AddPropChgEx(hum->GetWeakPtrRef(), kPropBoxNum, 0, hum->box_num,
|
room_->frame_event.AddPropChgEx(hum->GetWeakPtrRef(), kPropBoxNum, 0, hum->box_num,
|
||||||
0, 0, false);
|
0, 0, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void BoxDrop::Drop(int num, const glm::vec3& center)
|
void BoxDrop::Drop(int num, const glm::vec3& center)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user