Merge remote-tracking branch 'upstream/master' into develop

This commit is contained in:
EvilFactory
2024-04-24 12:20:11 -03:00
397 changed files with 15250 additions and 6473 deletions
@@ -740,6 +740,35 @@ namespace Barotrauma
};
}, isCheat: true));
commands.Add(new Command("listsuitabletreatments", "listsuitabletreatments [character name]: List which items are the most suitable for treating the specified character. Useful for debugging medic AI.", (string[] args) =>
{
Character character = (args.Length == 0) ? Character.Controlled : FindMatchingCharacter(args);
if (character != null)
{
Dictionary<Identifier, float> treatments = new Dictionary<Identifier, float>();
character.CharacterHealth.GetSuitableTreatments(treatments, user: null);
foreach (var treatment in treatments.OrderByDescending(t => t.Value))
{
Color color = Color.White;
#if CLIENT
color = ToolBox.GradientLerp(
MathUtils.InverseLerp(-1000, 1000, treatment.Value),
Color.Red, Color.Yellow, Color.White, Color.LightGreen);
#endif
NewMessage((int)treatment.Value + ": " + treatment.Key, color);
}
}
},
() =>
{
return new string[][]
{
Character.CharacterList.Select(c => c.Name).Distinct().OrderBy(n => n).ToArray()
};
}, isCheat: true));
commands.Add(new Command("revive", "revive [character name]: Bring the specified character back from the dead. If the name parameter is omitted, the controlled character will be revived.", (string[] args) =>
{
Character revivedCharacter = (args.Length == 0) ? Character.Controlled : FindMatchingCharacter(args);
@@ -828,7 +857,7 @@ namespace Barotrauma
}
else if (eventPrefab != null)
{
var newEvent = eventPrefab.CreateInstance();
var newEvent = eventPrefab.CreateInstance(GameMain.GameSession.EventManager.RandomSeed);
if (newEvent == null)
{
NewMessage($"Could not initialize event {args[0]} because level did not meet requirements");
@@ -2297,6 +2326,7 @@ namespace Barotrauma
#endif
}
spawnedCharacter.GiveJobItems(spawnPoint);
spawnedCharacter.GiveIdCardTags(spawnPoint);
spawnedCharacter.Info.StartItemsGiven = true;
}
else