1
This commit is contained in:
parent
8f954597b5
commit
cce815fd18
@ -2,6 +2,7 @@
|
||||
#include "hero.h"
|
||||
#include "room.h"
|
||||
#include "human.h"
|
||||
#include "metadata.h"
|
||||
|
||||
#include "pvedata.h"
|
||||
|
||||
@ -24,12 +25,20 @@ void PveData::OnBeKill(Hero* hero)
|
||||
total_dmg += pair.second;
|
||||
}
|
||||
if (total_dmg > 0) {
|
||||
float base_score = 0;
|
||||
if (room->IsDestoryRoom()) {
|
||||
base_score = std::get<0>(hero->meta->pve_score);
|
||||
} else {
|
||||
base_score = std::get<1>(hero->meta->pve_score);
|
||||
}
|
||||
for (auto& pair : itr->second) {
|
||||
Human* hum = room->GetHumanByUniId(pair.first);
|
||||
if (hum) {
|
||||
|
||||
int win_score = pair.second / total_dmg * base_score;
|
||||
hum->WinPveScore(win_score);
|
||||
}
|
||||
}
|
||||
}
|
||||
room->NotifyUiUpdate();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user