v1.2.6.0 (Winter Update)

This commit is contained in:
Regalis11
2023-12-14 16:11:27 +02:00
parent af8cc89fce
commit b91e85559d
375 changed files with 7771 additions and 2874 deletions
@@ -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());