forked from project-redbud/FunGame-Core
fix: 金钱分配问题
This commit is contained in:
parent
4f77f5bf7d
commit
f10aa2c948
@ -1644,13 +1644,20 @@ namespace Milimoe.FunGame.Core.Model
|
||||
// 现在 20 时间内的非伤害类型辅助也能参与助攻了
|
||||
Character[] assists = [.. _assistDetail.Keys.Where(c => c != death && (_assistDetail[c].GetPercentage(death) > 0.10 &&
|
||||
(_assistDetail[c].GetLastTime(death) - TotalTime <= 30) || (_assistDetail[c].GetNotDamageAssistLastTime(killer) - TotalTime <= 20)))];
|
||||
double totalDamagePercentage = _assistDetail.Keys.Where(assists.Contains).Select(c => _assistDetail[c].GetPercentage(death)).Sum();
|
||||
double totalDamagePercentage = _assistDetail.Keys.Where(assists.Contains).Select(c => _assistDetail[c].GetPercentage(death) < 0.10 &&
|
||||
_assistDetail[c].GetNotDamageAssistLastTime(killer) - TotalTime <= 20 ? 0.1 : _assistDetail[c].GetPercentage(death)).Sum();
|
||||
int totalMoney = Math.Min(Convert.ToInt32(money * totalDamagePercentage), 425); // 防止刷伤害设置金钱上限
|
||||
|
||||
// 分配金钱和累计助攻
|
||||
foreach (Character assist in assists)
|
||||
{
|
||||
int cmoney = Convert.ToInt32(_assistDetail[assist].GetPercentage(death) / totalDamagePercentage * totalMoney);
|
||||
bool hasNotDamageAssist = _assistDetail[assist].GetNotDamageAssistLastTime(killer) - TotalTime <= 20;
|
||||
double damagePercentage = _assistDetail[assist].GetPercentage(death);
|
||||
if (hasNotDamageAssist && damagePercentage < 0.1)
|
||||
{
|
||||
damagePercentage = 0.1;
|
||||
}
|
||||
int cmoney = Convert.ToInt32(damagePercentage / totalDamagePercentage * totalMoney);
|
||||
if (assist != killer)
|
||||
{
|
||||
if (!_earnedMoney.TryAdd(assist, cmoney)) _earnedMoney[assist] += cmoney;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user