Unstable 1.2.4.0
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
@@ -20,6 +21,23 @@ namespace Barotrauma
|
||||
AvailableCharacters.Remove(character);
|
||||
}
|
||||
|
||||
public static int GetSalaryFor(IReadOnlyCollection<CharacterInfo> hires)
|
||||
{
|
||||
return hires.Sum(hire => GetSalaryFor(hire));
|
||||
}
|
||||
|
||||
public static int GetSalaryFor(CharacterInfo hire)
|
||||
{
|
||||
IEnumerable<Character> crew = GameSession.GetSessionCrewCharacters(CharacterType.Both);
|
||||
float multiplier = 0;
|
||||
foreach (var character in crew)
|
||||
{
|
||||
multiplier += character?.Info?.GetSavedStatValueWithAll(StatTypes.HireCostMultiplier, hire.Job.Prefab.Identifier) ?? 0;
|
||||
}
|
||||
float finalMultiplier = 1f + MathF.Max(multiplier, -1f);
|
||||
return (int)(hire.Salary * finalMultiplier);
|
||||
}
|
||||
|
||||
public void GenerateCharacters(Location location, int amount)
|
||||
{
|
||||
AvailableCharacters.ForEach(c => c.Remove());
|
||||
|
||||
Reference in New Issue
Block a user